Question

Use MATLAB’s ode45 command to solve the following non linear 2nd order ODE: y'' = −y'...

Use MATLAB’s ode45 command to solve the following non linear 2nd order ODE:

y'' = −y' + sin(ty)

where the derivatives are with respect to time. The initial conditions are y(0) = 1 and y ' (0) = 0. Include your MATLAB code and correctly labelled plot (for 0 ≤ t ≤ 30). Describe the behaviour of the solution.

Under certain conditions the following system of ODEs models fluid turbulence over time:

dx / dt = σ(y − x)

dy / dt = rx − y − xz

dz / dt = xy − bz

where x, y and z model movement of fluid in three dimensions. Assume σ = 10, r = 28 and b = 8 3 and initial conditions of x(0) = 2, y(0) = 4 and z(0) = 6. Use MATLAB’s ode45 command to solve this system of nonlinear ODEs and plot your solution for 0 ≤ t ≤ 5 (include your MATLAB code and correctly labelled plot). Comment on the solution.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

%for 2nd order ode
ode = @(t,y)[y(2);-y(2)+sin(t*y(1))];
init=[1;0];
tspan=[0,30];
[t,y]=ode45(ode,tspan,init);
plot(t,y(:,1),t,y(:,2))
legend('y(t)','y''(t)')
xlabel('t')
ylabel('y and y''')


%for fluid turbulence system
sigma=10;
r=28;
b=83;
f = @(t,xyz)[sigma*(xyz(2)-xyz(1));r*xyz(1)-xyz(2)-xyz(1)*xyz(3);
    xyz(1)*xyz(2)-b*xyz(3)];
init=[2;4;6];
tspan=[0,5];
[t,XYZ]=ode45(f,tspan,init);
figure
plot(t,XYZ(:,1),t,XYZ(:,2),t,XYZ(:,3))
legend('x','y','z')
xlabel('t')
ylabel('movement in 3 dimensions')

Add a comment
Know the answer?
Add Answer to:
Use MATLAB’s ode45 command to solve the following non linear 2nd order ODE: y'' = −y'...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT