Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

just need help with B. i have so far: function dz = prob3(t,z) z = zeros(4,1); d

ID: 2970923 • Letter: J

Question

just need help with B. i have so far:


function dz = prob3(t,z)

z = zeros(4,1);

dz(1) = z(2);

dz(2) = -0.0673*z(2)*sqrt(z(2)^2+z(4)^2);

dz(3) = z(4);

dz(4) = -9.81-0.0673*z(2)*sqrt(z(2)^2+z(4)^2);


when i tried running the ode45 i got an error:


>> [t,z] = ode45(@prob3,[0 5],[0 134 0 0]);

Error using odearguments (line 91)

PROB3 must return a column vector.


Error in ode45 (line 114)

[neq, tspan, ntspan, next, t0, tfinal,

tdir, y0, f0, odeArgs, odeFcn, ...


i don't know what i'm doing wrong.


A paratrooper jumps from an aircraft in straight and level flight. The motion of the paratrooper is approximately described by the following system of equations: d2x/dt2 = - gamma / m (dx/dt) d2y/dt2 = - g - gamma / m (dx/dt) where x and y are the paratrooper's position according to the coordinate system shown in the figure. The system parameters m = 80kg, g = 9.81 m/s2, gamma = 5.38 N-s2/m2. The initial conditions are x(0) = 0, y(0) = 0, dx/dt|t = 0 = 134 m/s, dy/dt|t = 0 = 0 By hand: Reduce the system to a system of 1st-order ODEs; MATLAB: Write a script to solve the motion x(t) and y(t) of the paratrooper for the first 5 seconds using the Matlab built-in function 0de45, and plot the trajectory (y vs. x).|

Explanation / Answer

you did it correctly, but there is one mistake.

In the second line of the prob3 script you wrote z=zeros(4,1)

it should be dz=zeros(4,1).

This is because your returning vector is dz but not z. So you should initialize dz but not z.

Everything else is correct.

the command for plotting y vs x is

plot(z(:,1),z(:,3));