clarkeno1
2009-02-07, 19:14
我用MATLAB7.4的ODE45解四元常微分方程组,程序如下:
function xdot = eqx(t,x);
m = 0.5;
alf = 0.15;
K=[0.0265,0.1,0.15];
Q=20;
a=0.8;
xdot = zeros(4,1);
xdot(1) = Q - alf * x(1) * x(2) + a*m*(x(1)+x(2)+x(3)+x(4));
xdot(2) = x(2) * (-m + K(2) * alf * x(1) - alf * x(3));
xdot(3) = x(3) * (-m + K(3) * alf * x(2) - alf * x(4));
xdot(4) = x(4) * (-m + K(4) * alf * x(3));
执行
>> [t,x] = ode45('eqx',[0 0.2] , [0 125] , [0 12.5e+3] , [0 0.2e+3]);
后得到如下出错信息,怎么办啊?
??? Error using ==> funfun\private\odearguments at 44
Correct syntax is ode45(EQX,tspan,y0,options).
Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
function xdot = eqx(t,x);
m = 0.5;
alf = 0.15;
K=[0.0265,0.1,0.15];
Q=20;
a=0.8;
xdot = zeros(4,1);
xdot(1) = Q - alf * x(1) * x(2) + a*m*(x(1)+x(2)+x(3)+x(4));
xdot(2) = x(2) * (-m + K(2) * alf * x(1) - alf * x(3));
xdot(3) = x(3) * (-m + K(3) * alf * x(2) - alf * x(4));
xdot(4) = x(4) * (-m + K(4) * alf * x(3));
执行
>> [t,x] = ode45('eqx',[0 0.2] , [0 125] , [0 12.5e+3] , [0 0.2e+3]);
后得到如下出错信息,怎么办啊?
??? Error using ==> funfun\private\odearguments at 44
Correct syntax is ode45(EQX,tspan,y0,options).
Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...