INDIVIDUAL The height and upwardgoing velocity of a rocket

. INDIVIDUAL] The height and upward-going velocity of a rocket (in meters and m/sec) can be represented by the following equations f(t) = 2.13 tr_ 0.001314 + 0.000034 t4.751 u(t) = 4.26 t0.0052 t3 + 0.00016 1534 t3.751 a. Write two MATLAB functions (as two M-files) that compute the height and velocity of the rocket by the above equations, but they also give zero height and zero velocity for all t\'s for which f(t)

Solution

2 a) code for a) part

function [ h ] = hfun(t)
%HFUN Summary of this function goes here
% Detailed explanation goes here

f=2.13*t.^2-0.0013*t.^4+0.00034*t.^4.751;

if f>=0
  
h=f;
else
h=0;
  
end

end

-------------------------------------------------

now for vfun function

function [ v ] = vfun( t )
%VFUN Summary of this function goes here
% Detailed explanation goes here
u=4.26*t.^2-0.0052*t.^3+0.000161534*t.^3.751;

if u>=0
  
v=u;
else
v=0;
  
end

end

-------------------------------------------------------------------------

2b) code

t=0:0.01:70;

x=hfun(t);

m=vfun(t);

ind=find(x==0&v==0)

time=t(ind);

------------------------------------------

2c) code here

t=0:0.01:70;

x=hfun(t);

[v,ind]=max(x);

time=t(ind);

-----------------------------------------------------------

2d)

t=0:0.01:70;

time=fminbnd(@(t) hfun(t),0,70);

 . INDIVIDUAL] The height and upward-going velocity of a rocket (in meters and m/sec) can be represented by the following equations f(t) = 2.13 tr_ 0.001314 + 0
 . INDIVIDUAL] The height and upward-going velocity of a rocket (in meters and m/sec) can be represented by the following equations f(t) = 2.13 tr_ 0.001314 + 0

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site