|
I'm using matlab 7.4.0 (R2007a)
i want to solve a system of differential equations
i read in Help and do like it
i only copy from Help.
it consist of:
"function dy = rigid(t,y)
dy = zeros(3,1); % a column vector
dy(1) = y(2) * y(3);
dy(2) = -y(1) * y(3);
dy(3) = -0.51 * y(1) * y(2);"
to make m-file
after that, i type
"options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
[T,Y] = ode45(@rigid,[0 12],[0 1 1],options);"
in command window
but it doesn't run
and appear a warning
"??? Error using ==> feval
Undefined function or method 'rigid' for input arguments of type 'double'.
Error in ==> funfun\private\odearguments at 110
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ..."
I don't know why these codes come from Help. i think it must be run easily.
can you explain this problem?????
i hope to receive your reply as soon as possible
thank you so much.
|