Question

The upward velocity of a rocket can be computed from the following formula: mo v = u * In( ) – gt mo - qt87 where v = upward

The MATLAB code should have the outline of this:

m0 = 160e3; % [kg]

u = 1800; % [m/s]

v = 750; % [m/s]

q = 2600; % [kg/s]

g = 9.81; % [m/s^2]

tl = 10; % Lower guess [s]

tu = 50; % Upper guess [s]

es = 0.0001; %Stopping criterion

t_v750 = rocket(m0, g, q, u, v,tl,tu,es)

function t_root = rocket(m0,g,q,u,v,xl,xu,es);

% Inputs:

% m0: initial mass of rocket at time t=0 [kg] (scalar)

% g: gravitational constant [m/s^2] (scalar)

% q: fuel consumption rate [kg/s] (scalar)

% u: velocity at which fuel is expelled relative to rocket [m/s] (scalar)

% xl: Initial guess for the lower root (scalar)

% xu: Initial guess for the upper root (scalar)

%

% Outputs:

% t_root: time when the rocket reaches the specified velocity [s] (scalar)

%

%% Write your code here:

0 0
Add a comment Improve this question Transcribed image text
Answer #1

m0 = 160e3; % [kg]

u = 1800; % [m/s]

v = 750; % [m/s]

q = 2600; % [kg/s]

g = 9.81; % [m/s^2]

tl = 10; % Lower guess [s]

tu = 50; % Upper guess [s]

es = 0.0001; %Stopping criterion

t_v750 = rocket(m0, g, q, u, v,tl,tu,es)
function t_root = rocket(m0,g,q,u,v,xl,xu,es)

% Inputs:

% m0: initial mass of rocket at time t=0 [kg] (scalar)

% g: gravitational constant [m/s^2] (scalar)

% q: fuel consumption rate [kg/s] (scalar)

% u: velocity at which fuel is expelled relative to rocket [m/s] (scalar)

% xl: Initial guess for the lower root (scalar)

% xu: Initial guess for the upper root (scalar)

%

% Outputs:

% t_root: time when the rocket reaches the specified velocity [s] (scalar)

%

%% Write your code here:
f = @(x) u*log(m0/(m0-q*x))-g*x-v;
a=xl;
b=xu;
iter = 0;
  
if f(a)*f(b)>=0

disp('No Root')

else

prev = (a+b)/2;
p=a;
while (abs(f(p))>es)
prev=p;

iter =iter+ 1;

p = (a+b)/2;

if f(p) == 0
p
q=1
break;

end

if f(a)*f(p)<0

b = p;

else

a = p;

end
if(iter==100)
disp('the required accuracy is not reached in 50 iterations');
end
end

end
t_root=p;
end

MATLAB R2018a - O X Pradeep do E C . Search Documentation + New G Open PLOTS C Find Files 3 Compare - Print D Save Aduan APPS

Add a comment
Know the answer?
Add Answer to:
The MATLAB code should have the outline of this: m0 = 160e3; % [kg] u =...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MATLAB WORK PLEASE The upward velocity of a rocket can be computed from the following formula:...

    MATLAB WORK PLEASE The upward velocity of a rocket can be computed from the following formula: v=u* In mo -91 mo-91 where v = upward velocity, u = the velocity at which fuel is expelled relative to the rocket, me = the initial mass of the rocket at time t=0,9 = the fuel consumption rate, and g = the acceleration due to gravity. Compute the time tro at which v reaches an arbitrary value using the bisection method. Use the...

  • 2-1): The upward velocity of a rocket can be computed be the following formula: mo mo - qt where ...

    Please show all your steps and calculations. 2-1): The upward velocity of a rocket can be computed be the following formula: mo mo - qt where v upward velocity (m/s), u velocity at which fuel is expelled relative to the rocket (m/s), mo- initial mass of the rocket at time t 0s (kg), q -fuel consumption rate (kg/s), and g downward acceleration of gravity (assumed constant 9.81 m/s2). If u 1850 m/s, mo 160,000 kg, and q 2500 kg/s. a)...

  • PLEASE ALSO SOLVE USING THE SIMPSONS 1/3RULE.PLEASE DONT ATTEMPT THE QUESTION IF YOU CANT SOLVE BOTH GUASS AND SIMPSONS...

    PLEASE ALSO SOLVE USING THE SIMPSONS 1/3RULE.PLEASE DONT ATTEMPT THE QUESTION IF YOU CANT SOLVE BOTH GUASS AND SIMPSONS Q2. The upward velocity of a rocket can be computed by the following formula: mo v= uln gt gt mo where v= upward velocity, velocity at which fuel is expelled relative to the rocket, mg= initial mass of the rocket at time t= 0, fuel consumption rate, and downward acceleration of gravity (assumed constant 9.81m/s2). If u= 2500 kg/s, determine how...

  • Write a function named “NewtonRaphson” that implements the Newton-Raphson method. The inputs to this function are...

    Write a function named “NewtonRaphson” that implements the Newton-Raphson method. The inputs to this function are the name of the function, name of the function’s derivative function, initial guess, maximum number of iterations, and tolerance for the relative convergence error. The output is the root. Use the problem in Homework #3 to test your function.    Hw 3 that we are pulling from %Newton-Raphson method to find upward velocity of a rocket clear all; clc; u=2200; %m/s m0=160000; %kg q=2680;...

  • 39. Rocket Motion Suppose a small single-stage rocket of total mass m) is launched vertically, th...

    I'd question 40 please. 39. Rocket Motion Suppose a small single-stage rocket of total mass m) is launched vertically, the positive direction is upward, the air resistance is linear, and the rocket consumes its fuel at a constant rate. In Problem 22 of Exercises 1.3 you were asked to use Newton's second law of motion in the form given in (17) of that exercise set to show that a mathematical model for the velocity v(t) of the rocket is given...

  • A rocket in outer space has a payload of 5055.6 kg and 1.542 . 105 kg...

    A rocket in outer space has a payload of 5055.6 kg and 1.542 . 105 kg of fuel. The rocket can expel propellant at a speed of 5.580 km/s. Assume that the rocket starts from rest, accelerates to its final velocity, and then begins its trip. How long will it take the rocket to travel a distance of 3.82. 103 km (approximately the distance between Earth and Moon)? Question A fire hose 4.54 cm in diameter is capable of spraying...

  • 2. An object of 5 kg is released from rest 1000 meters above the ground level...

    2. An object of 5 kg is released from rest 1000 meters above the ground level and allowed to fall under the influence of gravity. Assuming that the force due to air resistance is proportional to the velocity of the object with proportionality constant k = 50 kg/sec determine the formula for the velocity of the object 3. A rocket having an initial mass mo kg is launched vertically from the surface of the Earth. The rocket expels gas at...

  • A rocket accelerates by burning its onboard fuel, so its mass decreases with time. Suppose the...

    A rocket accelerates by burning its onboard fuel, so its mass decreases with time. Suppose the initial mass of the rocket at liftoff (including its fuel) is m, the fuel is consumed at rate r, and the exhaust gases are ejected with constant velocity v_e (relative to the rocket). A model for the velocity of the rocket at time t is given by the equation v(t) = -gt - v_e ln m - rt/m where g is the acceleration due...

  • QB: The Rocket Equation The velocity of a rocket t seconds after liftoff from earth can be modeled by v(t) = -g*t - v_e...

    QB: The Rocket Equation The velocity of a rocket t seconds after liftoff from earth can be modeled by v(t) = -g*t - v_e * Ln( (m-r*t)/m ) where g = 9.8 m/s^2, the usual earth gravity value, v_e = exhaust velocity, 3000 m/s (the e here isn't related to 2.71828...) m = initial mass of the rocket+fuel: 30,000 kg r = rate of using fuel = 160 kg/s i) Find a formula for the acceleration function a(t) and graph...

  • Need help in solving this problem a 2220-kg test rocket is launched vertically from the launch...

    Need help in solving this problem a 2220-kg test rocket is launched vertically from the launch pad. Its fuel (of negligible mass) provides a thrust force so that its vertical velocity as a function of time is given by v(t)=At+Bt2, where A and B are constants and time is measured from the instant the fuel is ignited. At the instant of ignition, the rocket has an upward acceleration of 1.20 m/s2 and 1.80 s later an upward velocity of 1.64...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT