system of two non linear second order equations

1 view (last 30 days)
Hi im having a problem for solving this set of equation and
i'm not that familiar with the ODE45 function in Matlab.
i would be glad if someone can help me with the following set of equations.
Thanks ,
Chen
  4 Comments
chen
chen on 4 Jan 2015
Edited: chen on 4 Jan 2015
i have implemented the following for solving this system:
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)
the program seems in infinite loop (Matlab stays"Busy"). where did i wrong?
Torsten
Torsten on 5 Jan 2015
I get
xprime=[x(2); k*(1-x(2)^2)/(1+k*x(1)); x(4) ; -(k*x(2)*x(4))/(1+k*x(1))];
for your system where x(1)=y, x(2)=y', x(3)=z, x(4)=z'.
Best wishes
Torsten.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!