Matlab:使用ode求解器的参数出错

时间:2019-02-21 12:38:43

标签: matlab syntax-error ode

没有特定的错误,它只是简单地说“错误”,并在ode45中显示一行与我所写内容不符的行。如果有人能给我解决这个问题的方法,我将不胜感激。代码和错误消息如下:

代码:

tstart = 0;
tfinal = 10;
y0 = [0.18; 0.10; 0; 0];
[t,y] = ode45(@secondODE,[tstart tfinal], y0);

function dy = secondODE(t,y)
dy = zeros(4,1);
dy(1) = y(2);
dy(2) = -c/A2*y(1);
dy(3) = y(4);
dy(4) = D2/B2 + c*C2/(A2*B2)*y(1);
end

错误消息:

Error in ode45 (line 115)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);

Error in bJAa (line 4)
[t,y] = ode45(@secondODE,[tstart tfinal], y0);

0 个答案:

没有答案