EXERCISE 1

Create a computational model of ball launched with some velocity in the horizontal direction. Create a visual representation of the motion (either 2D animation or a graph of the 2D trajectory.

Your model should include the mass and size of the ball, the initial horizontal speed, and the initial height of the ball above the floor. The model should stop when the ball hits the floor. The model should return the horizontal distance the ball travels before hitting the floor as well as the total time it is in the air.

The equations that model the motion of the ball are

(3)drdt=v

and

(4)dvdt=Fm.

These equations involve derivatives but computer models must use time steps that have a finite size (called discrete time steps). In terms of finite differences these two equations can be written as

(5)ΔrΔt=v

and

(6)ΔvΔt=Fm.

Remember that the Δ symbol means “change in …” so Δt is the “change in time”. Use these equations to find two equations that allow you to update the position and velocity of the particle at each time step.

Hint: Remember that you have motion along the x-axis and motion along the y-axis.