Mugged
- 103
- 0
Hello, I've started learning how to numerically integrate ODE's and I've run aground when i posed a 2nd order system for mathematica.
Here is my initial code:
NDSolve = [{x'[t] == -y[t] - x[t]^2, y'[t]==x[t], x[0]==1, y[0]==0.5},{x,y},{t,0,30}]
and i get an error message saying the equation becomes stiff at a certain time t. Now I have played around with different integrating methods, switching from stiff integrators to nonstiff ones...but i can't get this to work.
The code above you can probably just cut and paste into your mathematica and see for yourself.
If you know how to fix the problem, can you post the code of how you did it?
Thank you so much
Here is my initial code:
NDSolve = [{x'[t] == -y[t] - x[t]^2, y'[t]==x[t], x[0]==1, y[0]==0.5},{x,y},{t,0,30}]
and i get an error message saying the equation becomes stiff at a certain time t. Now I have played around with different integrating methods, switching from stiff integrators to nonstiff ones...but i can't get this to work.
The code above you can probably just cut and paste into your mathematica and see for yourself.
If you know how to fix the problem, can you post the code of how you did it?
Thank you so much