Numerical methods for system of ODES

  • C/++/#
  • Thread starter Themis
  • Start date
  • #1
7
0

Main Question or Discussion Point

Hi there. I want to evolve a system of non linear coupled ODEs

[tex] \frac{dx}{dt} = \frac{-k}{x^5(56-y^8)^{9/2}}(85+y^{5} + y^{6}) [/tex]

[tex] \frac{dy}{dt} = \frac{-k}{x^4(56-y^5)^{7/2}}(44+y^2) [/tex]

Let's say I have the initial conditions. What numerical method someone could use to solve this? adaptive step size like RK dormand prince method? I am a bit confused cause i tried some with no good results (maybe cause I am not good programmer, not of the method's fault)
 

Answers and Replies

  • #2
SteamKing
Staff Emeritus
Science Advisor
Homework Helper
12,798
1,666
Hi there. I want to evolve a system of non linear coupled ODEs

[tex] \frac{dx}{dt} = \frac{-k}{x^5(56-y^8)^{9/2}}(85+y^{5} + y^{6}) [/tex]

[tex] \frac{dy}{dt} = \frac{-k}{x^4(56-y^5)^{7/2}}(44+y^2) [/tex]

Let's say I have the initial conditions. What numerical method someone could use to solve this? adaptive step size like RK dormand prince method? I am a bit confused cause i tried some with no good results (maybe cause I am not good programmer, not of the method's fault)
What do you mean by the term "evolve"?
 
  • #3
7
0
What do you mean by the term "evolve"?
Solve them numerically,Any suggestion due to the non linearity and the denominator?
 
  • #4
SteamKing
Staff Emeritus
Science Advisor
Homework Helper
12,798
1,666
Solve them numerically,Any suggestion due to the non linearity and the denominator?
Well, obviously you are going to have a problem if y5 = 58 or y8 = 58 or x = 0.

But the comment, "I tried some with no good result" doesn't really specify what has happened in your case.
 
  • #5
7
0
Yes I noticed that problem with the anomalies. What I don't understand is what method someone could use to numerical integrate this kind of equations. I understand that an adaptive step size method is best for this problem but there are a few and someone with experience could advise a method to approach the problem. I tried to use boost libraries (odeint) but the results are not good. When I run the program the output values seem not to change at all when they should be and the lack of experience doesn't help to find the problem. If you know how to use boost I cant show what I did.
 
  • #6
155
24
As first approach try to use Matlab ode45 function to integrate ODE and see what happens.
If you already have implemented a numerical method for solving ODE try to use it on known results to check that you code has no error.
 
  • #7
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
683
As first approach try to use Matlab ode45 function to integrate ODE and see what happens.
That's equivalent to what the OP already did. Matlab's ode45 uses Dormand Prince by default.

If you already have implemented a numerical method for solving ODE try to use it on known results to check that you code has no error.
I would advise stepping back even further and checking where did those derivatives came from. The singularities in the derivatives are a bit suspect.

To the OP: What are the initial values for x and y, and what is k? If x>1 and 0<y<1, you're not going to see much movement. The derivatives are small because of the factors of 1/x^5 and 1/x^4. Moreover, those singularities at x=0, y=56^(1/8), and y=56^(1/5) make this a very stiff system.
 

Related Threads on Numerical methods for system of ODES

Replies
4
Views
1K
Replies
1
Views
2K
  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
6
Views
908
Replies
3
Views
864
  • Last Post
Replies
7
Views
5K
  • Last Post
Replies
14
Views
3K
  • Last Post
Replies
1
Views
15K
Replies
2
Views
604
Top