PDA

View Full Version : ode (scilab) problem


rafal__
Nov9-07, 12:02 PM
1. The problem statement, all variables and given/known data
equations:
dx/dt=(x+a)(b-y)
dy/dt=(c-y)(x+yd)
a=7;
b=3;
c=5;
d=3;

2. Relevant equations



3. The attempt at a solution
Why is trajectory incorrect ?

clear
t0=0;
tk=5.5;
dt=0.1;
t=t0:dt:tk;
a=7;
b=3;
c=5;
d=3;

function w=f(t,Y)
w=zeros(2,1);
w(1)=(Y(1)+a)*(b-Y(2));
w(2)=(c-Y(2))*(Y(1)+d*Y(2));
endfunction

x=ode([-8.5;2],t0,t,f);
plot2d(x(1,: ),x(2,: ));