Please turn in this assignment (and all future assignments for
this course) by emailing them to me .
Please use the subject of "Physics 222 HW9" for these assignments
(if you use the link above, the subject will be added automatically).
Please *attach * the source code to any programs that
you write for this assignment. If you write more than one program,
attach *each separately*. When answering the questions themselves
feel free to answer directly in the body of your message (or attach your
answers). I may take off points for assignments that are not
sent to me in the correct form.

#### Rocket Motion

In this problem, you will write a progam to find the maximum height reached by a model rocket. In this problem use floating point variables that are at least 8 bytes in size (double). The relevant force equation is :

F = m(t)a = -m(t)g -k v|v| +T(t)

where*T(t)=b t(1-t)*is the time-dependant thrust for times from 0 to 1 second, with the thrust being 0 at all other times and*b*is a constant in N/s^{2}.*k*is the drag coefficient,*k= 1/2 C*, where_{w}ρ A*C*is a constant,_{w}=1.0*A*is the area in m^{2}, and*ρ = 1.225 kg/m*is the density of air. The "-k v|v|" takes care of the direction on the air resistance force - the sign of that term will always point against the direction of current motion. Since the loss of mass of the rocket engine is responsible for the thrust,^{3}*dm/dt*is proportional to*-T(t)*. Following through some of the math (available from the Rocket lab), we find that:m(t) = m

_{initial}+ (m_{final}- m_{initial})*(3t^{2}- 2t^{3}).Or

m

_{i}= m_{initial}+ (m_{final}- m_{initial})* (3t_{i}^{2}- 2t_{i}^{3}).To solve for the velocity numerically, we solve the force equation above for acceleration, and then find its difference equation equivalent:

v

After finding the speed, you will be able to find the height from:_{i}= v_{i-1}+ Δt *(-g - k*v_{i-1}*abs(v_{i-1})/m_{i}+ T_{i}/m_{i})x

Of course to solve either of the above, you will already have to have forms for T_{i}= x_{i-1}+ Δt v_{i}_{i}and m_{i}. You will also need to save an array of times.Think carefully about what condition must be met in order to find the maximum height.

Your program should read in the following input data from the supplied files below: Δt, b, surface area, initial mass, and final mass. The files are: rocket_1a, rocket_1b, rocket_1c, rocket_1d, rocket_2, rocket_3, and rocket_4.

Your program should write to an output file the input data it read from the input file, followed by the maximum height and the time at which it happened, and three columns of data: the time, position, and velocity for each time that the program calculated. Your program should also plot the position versus time and velocity versus time using PLPlot.

- Consider the rocket_1 files, which only differ from each other in their time step sizes. Do these results seem to be approaching any limiting value? Do you trust these results? Why or why not?
- For each of the other files - rocket_2, rocket_3, and rocket_4 - discuss how the input file differs from the others. Compare the results for the maximum height. Do they make sense?

For this program send output files from running your program with each input file, plots from the rocket_3 case, and answers to the questions above.

#### Review questions from the book:

7.5, 7.6