Question: Matlab Question A rocket is launched vertically and at t = 0, the rocket's engine shuts down. At that time, the rocket has reached an

Matlab
Question A rocket is launched vertically and at t = 0, the rocket's engine shuts down. At that time, the rocket has reached an altitude of ho = 500 m and is rising at a velocity of up = 125 m/s. Gravity then takes over. The height of the rocket as a function of time is: h(t) = ho + vot t> 0 where g = 9.81 m/s. The time t = 0 marks the time the engine shuts off. After this time, the rocket continues to rise and reaches a maximum height of hmax meters at time t = tmax. Then, it begins to drop and reaches the ground at time t = tg. a. Create a vector for times from 0 to 30 seconds using an increment of 2 s. b. Use a for loop to compute h(t) for the time vector created in Part (a). c. Create a plot of the height versus time for the vectors defined in Part (a) and (b). Mark the r and y axes of the plot using appropriate labels. d. Noting that the rocket reaches a maximum height, Hmax, when the height function , h(t), attains a maxima, compute the time at which this occurs, tmax, and the maximum height, hmax. Also, display the results to the command window. Note that this is obtained by setting dh 0. dt Hint: Use analytical expressions for this simple equation. No need to use Newton-Raphson or bisection e. Compute and output to the command window the time at which the rocket hits the ground, tg, by noting that this occurs when h(t) = 0. Note that for a quadratic equation of the form ar+ bc +e= 0, the solution is given by T= -b + b2 - 4ac 2a f. On the plot obtained in Part (c), mark tg using a red circle and (tmax, Hmax) using a blue square. Comment on what you observe
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
