Question: Root - Finding: fzero ( The MATLAB Built - in Function ) A simple formula to estimate the upward velocity of a rocket ( neglecting

Root-Finding: fzero (The MATLAB Built-in Function)
A simple formula to estimate the upward velocity of a rocket (neglecting the aerodynamic drag) is:
v=uln(m0m0-qt)-gt
where t= time, v= upward velocity, u= the velocity at which fuel is expelled relative to the rocket, m0= the initial mass of the rocket at time t=0,q=t fuel
consumption rate, and g= the downward acceleration of gravity.
Develop a MATLAB function which, for given parameters u,m0,q, and g, and a specified velocity v**, computes the time t** that the rocket reaches this velocity.
Hint:
(1) Formulate this problem into a root-finding problem, and solve it using the MATLAB built-in function "fzero".
(2) The initial bracketing interval (or initial guess) for "fzero" must be within the domain of the root-finding function. Note that the above function v(t) has a bounded
domain (due to "ln").
Function 8
function tstar = fzero_rocket_example(u, g, q, m0, vstar)
% Inputs (all scalars)
%, mo: initial mass of rocket at time t=0
% g: gravitational constant
%q : fuel consumption rate
%,u : velocity at which fuel expelled relative to rocket
% vstar: upward velocity value for which tstar is to be determined
% output
% tstar: the time that the rocket reaches the specified velocity, vstar (scalar)
$8 Write your code here.
tstar =0;
end
Code to call your function ?
m0=160e3;%kg
u=1800;%ms
vstar =750;,9ms
q=2600; %kgs
g=9.81;%ms???2
tstar = fzero_rocket_example(u, g, q, m0, vstar)
Assessment:
Test 1: m0=160e3,u=1800,vstar=750(Pretest)
Test Code:
clear; clc
m0=160e3;%kg
u=1800;%ms
vstar =750; %ms
q=2600;%kgs
g=9.81;%ms???2
tstar = fzero_rocket_example(u, g, q, m0, vstar)
tstarCorrect = reference.fzero_rocket_example , vstar
 Root-Finding: fzero (The MATLAB Built-in Function) A simple formula to estimate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!