MATLAB Answers

ode45 second order

27 views (last 30 days)
pattara tangjareansuk
pattara tangjareansuk on 18 Apr 2021 at 3:28
Commented: pattara tangjareansuk on 18 Apr 2021 at 14:27
please, I want to plot second order and use function ode45. So just now I can't write function.
y" = 3.6sin(t) - 60y - 5y'
and this is my question 👆👆
function dy=model(t,y)
dy = [y(2); 3.6*sin(t) - 60*y(0) - 5*y(1)]
end
and this 👆👆 is my error function

Answers (1)

Alan Stevens
Alan Stevens on 18 Apr 2021 at 7:41
Matlab indices start at 1, so you want
dy = [y(2); 3.6*sin(t) - 60*y(1) - 5*y(2)];
  3 Comments
pattara tangjareansuk
pattara tangjareansuk on 18 Apr 2021 at 14:27
i want to create system identification . my professor he said "you should create analytical solution and compare between lsim

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!