A rocket launches with an initial mass of 10,000 kg, an acceleration due to the
ID: 1769666 • Letter: A
Question
A rocket launches with an initial mass of 10,000 kg, an acceleration due to the rocket of 20 m/sec 2, and 4,000 kg of fuel. It burns 50 kg of fuel each second. Write a MATLAB program to calculate and plot its velocity versus time. Things to consider Use a "for loop" with a nested "if statement" or a "while" statement to loop through time Use the physics equations for velocity and acceleration Remember to include the force of gravity . Remember to stop firing the rocket when you run out of fuel Your program must output the final velocity to the screen (use the "fprintf" or "disp" commands.) and make a plotExplanation / Answer
The matlab script for this problem is
***************************************************************
%Declare variables
k = 5;
mv = 14000;
mv0 = 10000;
g = 9.8;
%Loop until time
for t= 1:10
%Define velocity
u = k*log(mv/mv0)+(g*t)
end
%Define final time
t = 10;
%Display final velocity
fprintf('The final velocity is %f',k*log(mv/mv0)+(g*t))
%Plot graph
plot(u,t)
***************************************************************************************
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.