1. The upward velocity of a rocket can be computed by the following formula: v=u
ID: 1718226 • Letter: 1
Question
1. The upward velocity of a rocket can be computed by the following formula:
v=u*ln(m0/(m0-q*t))-g*t
Where the velocity at which fuel is expelled relative to the rocket is u =2200 m/s, the initial mass of the rocket at time is m0 =160000 kg, the fuel consumption rate is q =2680 kg/s, and acceleration of gravity is g =9.8 m/s2 . You may use 30 s as the initial value for time t in the calculation. (i) Program in MATLAB using Newton-Raphson’s method to compute the time t at which the rocket upward velocity v =1000 m/s. Determine your result so that it is within 0.001% of the true value. (ii) Calculate by hand the first 3 iterations. (iii) Use MATLAB build-in function “fzero” to find the solution. Hint: In MATLAB programming, Newton-Raphson’s algorithm is very similar to Fixed-point
Explanation / Answer
(i) Matlab Code
% Change here for different functions
f=@(x) 2200*log(160000/(160000-2680*x)) - 9.8*x - 1000;
%this is the derivative of the above function
df= @(x) (2680*2200)/(160000-2680*x) - 9.8;
x=30;
x1 = 0;
while abs(x1-x)>10^-5
x1=x-(f(x)/df(x));
x=x1;
end
sol=x;
fprintf('Approximate Root is %.15f ',sol)
Output
Approximate Root is 26.235412089360917
(iii) Matlab Code & Output
x = fzero(@(x)2200*log(160000/(160000-2680*x)) - 9.8*x - 1000,30)
x =
25.9424
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.