Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am quite puzzled to solve the coupled ode's numerically. Please tell me why it runs for a long time and not giving any output in mathematica. I am using NDsolve. please have a look

NDSolve[{ x'[t] == x[t]/y[t] + x[t]/z[t] - x[t]/z[t]^2, 
          y'[t] == 1 + y[t]/z[t] - (2 y[t])/z[t]^2, 
          z'[t] == -z[t] - z[t]/y[t] - (2 z[t])/y[t]^2,
          x[0] == 2,
          y[0] == 5, 
          z[0] == 7},
        {x, y, z},
        {t, -10, 10},
        MaxSteps -> Infinity]
share|improve this question
    
Just a suggestion : you can simplify the system with the change of variable x[t]->Exp[p[t]], z[t]->Exp[q[t]]. Also, the first equation is actually decoupled so you only need to solve the remaining two. –  b.gatessucks Jun 2 '13 at 19:01

1 Answer 1

It seems there is a singularity in t=-4.64095 and t=2.2479405927739124. You can try:

sol = NDSolve[{Derivative[1][x][t] == 
    x[t]/y[t] + x[t]/z[t] - x[t]/z[t]^2, 
       Derivative[1][y][t] == y[t]/z[t] - (2*y[t])/z[t]^2 + 1, 
   Derivative[1][z][t] == -(z[t]/y[t]) - (2*z[t])/y[t]^2 - z[t], 
       x[0] == 2, y[0] == 5, z[0] == 7}, {x, y, z}, {t, -4.62, 2.23}, 
  MaxSteps -> 1000000]

Plot[Evaluate[{x[t], y[t], z[t]} /. sol], {t, -4.62, 2.23}, 
 Frame -> True, Axes -> None]

enter image description here

share|improve this answer
    
thank you very much –  ricci1729 Jun 1 '13 at 9:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.