Write a matlab function called rocket_euler


Question 1: Having eliminated unacceptable launch times, our rocket is ready to launch. Let us assume the following launch dynamics: m(t) dv/ dt = -m(t)g - c dm /dt , where m(t) is the mass of the rocket, g = 9.81 m/s2 is gravitational acceleration, and c is some constant. Let us assume the rocket uses fuel at a constant rate of dm/dt = -400 kg/s, the initial mass is m(0) = 42, 000 kg, and c = 2, 500 m/s. Write a MATLAB function called rocket_euler to solve this o.d.e. from t = 0 seconds to t = 90 seconds using Euler's method. Make the step size the input for the function, and make the time, mass, and velocity vectors the outputs

Question 2: Write a MATLAB script called hw2_p3.m that uses your function from Problem 2 to plot the velocity of the rocket for a step size of 45 seconds, 15 seconds, 5 seconds, and 1 seconds. Also plot the velocity from the analytical solution-be sure that the analytical curve "looks smooth." The analytical solution to the o.d.e. is v(t) = -gt - c* ln*  (m(t) /msub0) , where msub 0  is the initial mass. Plot all of these velocities in the same plot, and use different colors, line styles, and markers for the simulated velocities. That is, make sure your different curves are easily distinguishable. Remember to add axis labels and a legend! Discuss your results: What similarities and differences do you see among your Euler solutions and analytical solution?

Request for Solution File

Ask an Expert for Answer!!
MATLAB Programming: Write a matlab function called rocket_euler
Reference No:- TGS03211304

Expected delivery within 24 Hours