Results 1 to 7 of 7

Math Help - Runge-Kutta method with different step length on different variables?

  1. #1
    Senior Member TriKri's Avatar
    Joined
    Nov 2006
    Posts
    357
    Thanks
    1

    Runge-Kutta method with different step length on different variables?

    Hi, is it possible to use a Runge-Kutta method (for example Euler's method to take one), and calculate more carefully depending on the behavior of a variable? For example, if one is to simulate a system of planets which attract each other according to the laws of physics, the calculations will have to be more carefully if there are two planets that are very close to each other, since every derivative will change more rapidly.

    Now, I know that this can be solved using variable step length. However, calculating planets' orbits around each other in a computer program charges the processor heavily - calculating every planet's orbit more carefully by reducing the step length will slow down the whole process and make the program lag. In contrary, running the simulation with the same step length as before will really decrease the accuracy of the orbits of the two planets that are close to each other.

    Ideally, only the orbits of the two planets that are close to each other would have to be calculated more carefully, maybe by reducing the step length for only those planets in, if it in some way is possible. Do you know of any way to do this, or if it the method is used in applications? Is there some other way to increase the accuracy when calculating the orbits for only those two planets? It's easy when all variables in a differential equation have the same step length. But when They get different step length, it gets more complicated...
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Aug 2007
    From
    USA
    Posts
    3,110
    Thanks
    2
    Just off the top of my head...

    The problem is precision. As soon as you make a large error, such as too big a step size, all your fine adjustments after that are meaningless.

    In this case, too big a step size on where the planet is will have your planets close to each other when they should not be. Who cares about their joint close behavior when they should not even be there?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Senior Member TriKri's Avatar
    Joined
    Nov 2006
    Posts
    357
    Thanks
    1
    Maybe they actually should be there? Anyway, the system with planets was just an example. Consider gas molecules if you want. Or whatever else that consists of a number of elements where each one of the elements usually behaves quite peaceful but then once in a while behaves chaotically for a short period of time due to external conditions.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Aug 2007
    From
    USA
    Posts
    3,110
    Thanks
    2
    Fair enough. Why does it have to be one model? Why not drop into "close" behavior when you observe the chaos?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Senior Member TriKri's Avatar
    Joined
    Nov 2006
    Posts
    357
    Thanks
    1
    How would this "close" behaviour look? Would it make the simulation more accurate, or how would it improve the simulation?
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor
    Joined
    Aug 2007
    From
    USA
    Posts
    3,110
    Thanks
    2
    Not sure. Just thinking out loud. It depends on exactly what your model is. I suppose it could be:

    1) Gross behavior for basic movements when nothing is close to anything else and everything is behaving nicely.

    2) Hold just about everything when something interesting happens, draw a much smaller sphere of influence, and barely track those things that are not directly interesting.

    Really, without a much better description of what is going on, it's pretty tough to give any better direction.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Senior Member TriKri's Avatar
    Joined
    Nov 2006
    Posts
    357
    Thanks
    1
    I was just speaking in general terms; I have not planet to make a space simulator. Although I have actually made a particle simulator before, where every particle attracted every other particle, and where the force between two particles was inversely proportional to the distance in square.

    What I want is a method that is applicable to all models and to all kind of differential equations that can be numerically solved using an explicit (a regular) Runge-Kutta method. Now I'm not sure if there is any general solution to the problem I introduced, but it would have been very handy if there was.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Runge kutta matlab code (method)
    Posted in the Differential Equations Forum
    Replies: 2
    Last Post: November 25th 2010, 10:19 AM
  2. How to derive the Runge Kutta 2nd Order Method?
    Posted in the Differential Equations Forum
    Replies: 0
    Last Post: October 10th 2010, 02:33 PM
  3. Runge-Kutta method
    Posted in the Calculus Forum
    Replies: 0
    Last Post: April 23rd 2010, 02:38 AM
  4. Runge Kutta method
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: February 26th 2010, 01:54 PM
  5. Determine the order of a Runge-Kutta method
    Posted in the Differential Geometry Forum
    Replies: 0
    Last Post: October 19th 2009, 06:56 AM

Search Tags


/mathhelpforum @mathhelpforum