Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started