Solve by matlab The upward velocity v ofa rocket is is given by: where v upward
ID: 662233 • Letter: S
Question
Solve by matlabThe upward velocity v ofa rocket is is given by: where v upward velocity of rocket (ms) u relative velocity at which fuel is expelled (m/s) fuel consumption rate (kgs) nitial mass of rocket (kg) t time in seconds g gravity (9.81 m/s Part marks): Write a function m-file (velocity, m) that, given u, g, mo. and t, computes and returns v. Have your function generate an error ifgtis greater than or equal to mo. Part II marks) The steps required to solve this part should be placed in a script file (script.m). Assume that 2000 m/s, me 50000 kg, and g 2700 kg/s. Note Your are expected to make use of the function you produced in part nstead of re- implementing the equation within your script file. If you find it necessary to re-implement the equation you may do so but students who do this will not earn full marks. Produce two plots (figures land 2) of v vs for from 0s to 50s. Produce one plot using function fplot and the other using function plot. i) At what time will the rocket attain a velocity of 750 m/s? Precisely determine the answer (graphical solutions are NOT acceptable) and output it using function fprintf
Explanation / Answer
bith a and b questions embedded.....please have a look
function Y=checkVelocity(t) %this function is to calculate upward velocity
u=input('Please enter relative velocity: ');
mo=input('Please enter mass of rocket in kg: ');
q=input('Please enter fuel consumption rate in kg: '); %these are reading parameters from users
g=9.81
v = u * log(mo/(mo-qt)) %formmula to calculate upward velocity
v =v-gt
if v == 750
fprintf('your required speed attained at %d',v) %this is your second function..printing when our required velocity attains
end
fh = @checkVelocity;
fplot(fh,[0 50]) //plotting graph
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.