How to solve a differential equation system with ode15s

8 次查看(过去 30 天)
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

采纳的回答

darova
darova 2020-2-18
I made some correcitons. Try now

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by