How to solve a differential equation system with ode15s

6 views (last 30 days)
Hello I need to solve this differential equation system with ODE15s but when I try to define the anonymous fuction and solve the problem shows this error:
ecu=@(t,x,y)[9*x(1)+24*y(1)+5*cos(t)-(1/3)*sin(t);-24*x(1)-51*y(1)-9*cos(t)+(1/3)*sin(t)]
ci=[1/3 2/3]
rvt=0:0.01:5
[t,x,y]=ode15s(ecu,rvt,ci)
fplot(x,y)
% Not enough input arguments.
%
% Error in Untitled3>@(t,x,y)[9*x(1)+24*y(1)+5*cos(t)-(1/3)*sin(t);-24*x(1)-51*y(1)-9*cos(t)+(1/3)*sin(t)]
%
% Error in odearguments (line 90)
% f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
%
% Error in ode15s (line 150)
% odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Thanks for your help

Accepted Answer

darova
darova on 18 Feb 2020
I made some correcitons. Try now

More Answers (0)

Tags

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!