% [y_laser,y_encoder]=run_ball_on_beam(voltage,init_pos,init_angle);
% 
% The default initial ball positoin and initial beam angle are zero, such that:
% if you only send 1 argument, the ball and beam are initialized to zero
% if you only send 2 arguments, the beam angle is initialized to zero
%
% Note you must run "clear all" before each new time you run this
% simulation in order to "reset" the initial conditions.
%
% Simulation update rate is 50 Hz.
%
% Simulation takes a voltage input and optionally intial ball position and
% initial ball angle and returns the motor encorder angle reading and laser
% ball position 0.02 seconds later.
%
% angle is in radians clockwise from horizontal
% position is in meters positive to the right (zero is center of the beam)
% If the beam angle exceeds +/- pi/2 radians (90 degrees) then the ball is
% removed from the beam (y measurement=NaN)
%
% If you want to run the beam without the ball initialze the beam angle to
% greater than pi/2:
% [y_laser,y_encoder]=run_ball_on_beam(voltage,0,pi)
%

function [y_laser,y_encoder]=run_ball_on_beam(voltage,init_pos,init_angle);

