I need a help both mathmatical way and Matlab Code would be
I need a help (both mathmatical way and Matlab Code would be fine)
The speed of a rocket (v) moving vertically near the Earth\'s surface is approximated as: v(t) = uIn M_0\\M_0-mt-gt this equation Find the time at which the rocket reaches the speed of sound (340 m/s). Use any of the methods discussed in class (except MATLAB-provided functions). Solve until the relative approximation error is lessthanorequalto 0.00001. What would be the mass of the rocket at the time it reaches the speed of sound?Solution
Code:
u = 2510;
m0 = 2.8*10.^6;
m = 13.3*10.^3;
g = 9.81;
v = 0;
t = 1;
while(v<340)
v = u * log(m0/(m0-m*t))-g*t;
t = t + 1;
m0 = m0 -m;
end
fprintf(\'The time at which the rocket reaches speed of sound is %d seconds\ \',t);
fprintf(\'The mass of the rocket at the time it reaches speed ot sound is %d\ \',m0);
Output:
The time at which the rocket reaches speed of sound is 46 seconds
The mass of the rocket at the time it reaches speed ot sound is 2201500
