Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are Electrophoresis?

Answered: 1 week ago