Question: Root - Finding: fzero ( The MATLAB Built - in Function ) A simple formula to estimate the upward velocity of a rocket ( neglecting
RootFinding: fzero The MATLAB Builtin Function
A simple formula to estimate the upward velocity of a rocket neglecting the aerodynamic drag is:
uln
where time, upward velocity, the velocity at which fuel is expelled relative to the rocket, the initial mass of the rocket at time fuel
consumption rate, and the downward acceleration of gravity.
Develop a MATLAB function which, for given parameters and and a specified velocity computes the time that the rocket reaches this velocity.
Hint:
Formulate this problem into a rootfinding problem, and solve it using the MATLAB builtin function "fzero".
The initial bracketing interval or initial guess for "fzero" must be within the domain of the rootfinding function. Note that the above function has a bounded
domain due to ln
Function
function tstar fzerorocketexampleu g q m vstar
Inputs all scalars
mo: initial mass of rocket at time
g: gravitational constant
: fuel consumption rate
: 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
$ Write your code here.
tstar ;
end
Code to call your function
;
;
vstar ;
;
;
tstar fzerorocketexampleu g q m vstar
Assessment:
Test : vstarPretest
Test Code:
clear; clc
;
;
vstar ;
;
;
tstar fzerorocketexampleu g q m vstar
tstarCorrect reference.fzerorocketexample vstar
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
