Welcome to the Space Time and the Universe.
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Nov 2010
    Location
    Milwaukee, WI
    Posts
    72

    Default RK4, Euler, and computer simulations

    Just the other day I bought a computer game called "Universe Sandbox". It basically a $10 physics engine. I enjoy it very much. Theres this one thing in the Options menu where I can switch between "Normal" and "Accurate" modes. The difference being that in "Normal" mode it uses Euler math, and in "Accurate" mode ituses RK4. I know nothing about either. So here's my question.

    What is the difference between the Euler and RK4? The game just says Euler is quicker. I assume that means Euler uses a shorter formula. Is that all
    there is to it?

    I tried looking on wikipedia but the articles they have on Euler and RK4 get intense pretty fast. I was hoping someone could give me a layman's breakdown.
    Last edited by Joe McCarron; 02-08-2012 at 08:14 PM.

  2. #2
    Senior Member
    Join Date
    Nov 2010
    Location
    NC USA
    Posts
    843

    Default Re: RK4, Euler, and computer simulations

    Most physical processes are described by differential equations. To solve the differential equation, you can solve it explicitly. In the case gravity and two masses, the solution is a conic section. For planets, the solution is approximated by an ellipse in a lot of models. Euler and RK4 are both Runge-Kutta methods that "jump" from one time to the next in small steps. The error in doing this is usually small, but it can build up over time. RK4 does a better job of controlling those errors than Euler, but it's more complicated, and takes longer, as you suspected.
    Last edited by grapes; 02-09-2012 at 10:57 AM.

  3. #3
    Moderator
    Join Date
    Sep 2008
    Location
    Colorado Springs, CO
    Posts
    369

    Default Re: RK4, Euler, and computer simulations

    Linky.

    Wikipedia can be your friend...

    It can also be confusing.
    As for those whose curiosities fall along more fanciful lines, I suggest it's because they have more money than they know what to do with while not having had enough science and engineering to know what they're dealing with.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •