System of two second order ODE's

chen

New member
Joined
Jan 9, 2015
Messages
1
Hi ,
I have tried solving the following system of ODE's (eq1 attached) using Matlab.
first i reduced it into a system of four 1st order ODE's (eq2 attached).
thani tried to solve it using ode45() in the following manner:

function xprime = Mirage(t,x);
k=2;
xprime=[x(1); k*(1-x(1).^2)./(1+k*x(2)); x(3) ; -(k*x(1)*x(3))./(1+k*x(2))];
end

x0=[1 1 1 1];
tspan=[0,20];
[t,x]=ode45(@Mirage,tspan,x0)


where did i wrong?
i will appreciate your help.
 

Attachments

  • eq1.JPG
    eq1.JPG
    11.9 KB · Views: 11
  • eq2.JPG
    eq2.JPG
    13.1 KB · Views: 10
Hi ,
I have tried solving the following system of ODE's (eq1 attached) using Matlab.
first i reduced it into a system of four 1st order ODE's (eq2 attached).
thani tried to solve it using ode45() in the following manner:

function xprime = Mirage(t,x);
k=2;
xprime=[x(1); k*(1-x(1).^2)./(1+k*x(2)); x(3) ; -(k*x(1)*x(3))./(1+k*x(2))];
end

x0=[1 1 1 1];
tspan=[0,20];
[t,x]=ode45(@Mirage,tspan,x0)


where did i wrong?
i will appreciate your help.
Just to make sure I understand what you mean, I'll repeat in my own words assuming y and z are functions of, say x, and thus y' is dy/dx and z' is dz/dx:
You have a coupled set of equations
(1) (1+ky)y'' + k y'2 = k
and
(2) (1+ky)z'' + k y' z' = 0
Letting
y' = t
and
z' = s
we can rewrite (1) and (2) as
(1') t' = \(\displaystyle \frac{k (1 - t^2)}{1+ky}\)
(2') s' =\(\displaystyle \frac{-k t s}{1+ky}\)

If that is what you mean, I don't see anything wrong with it although I wouldn't approach it that way initially. I would concentrate on (1) since, once you find the solution for y, z is obtained fairly easily as an integral involving y. That is, looking at (2), we have
\(\displaystyle \frac{z''}{z'} = - \frac{k y'}{1+ky}\)
Integrating, we have
ln(z') = ln(c (1+ky)-1 )
or
z(x) = c \(\displaystyle \int [1 + k\space y(x)]^{-1} dx\)
 
Top