Sign in to follow this  

Modifying Runge-Kutta using second derivatives

This topic is 3485 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a physics engine, and I'm working on the core integrator. Position relates to force as a second order ODE. Generally the approach is to break that down in to two first order ODEs (ie: integrate velocity using acceleration, and integrate position using velocity). This is mentioned in Numerical Recipes in C, Chapter 16, section 1. In my ignorance, I'm playing with the idea of integrating position using both velocity and acceleration terms. If you take Runge-Kutta, and break it down, it's basically a three step algorithm (the first step involves the initial values, so I'm not counting that) that uses Euler's Method to approximate the slope at different points in the time step, and then uses a weighted average of the slopes it calculates to again use Euler's Method to integrate. I'm assuming there's a very good reason, but why not replace Euler's Method inside Runge Kutta with something like the SUVAT equations (sometimes called a parabolic integrator)? ie: position = old position + old velocity * timestep + acceleration / 2 * timestep * timestep So for position, instead of finding the slope at different points in the timestep, you're finding the acceleration (second derivative) at different points in the timestep, and then using the SUVAT equations to approximate a new point to evaluate, just like with normal Runge-Kutta. Velocity would be calculated just like regular Runge-Kutta, other than using the new positions. I haven't run any comparison tests for the accuracy of this modified Runge-Kutta, but is there some principal reason why Runge-Kutta needs to take steps using Euler? I'm thinking it has something to do with Euler being a first order method. But would the algorithm still work for a second order method? Would it give better results? [Edited by - Numsgil on May 27, 2008 5:55:20 PM]

Share this post


Link to post
Share on other sites
Found some more links:



All say the same thing: break the second order ODE (ie: acceleration) in to two separate first order ODEs (ie: delta velocity and delta position). But why is this a better idea than trying to solve the second order ODE directly? It would seem to me that errors would cascade with each half step in Runge Kutta.

Share this post


Link to post
Share on other sites
I'm presently building a test app to try different methods and experiment. In the mean time, I've done some more reading. this numerical methods lecture (bottom of page) presents the Runge Kutta method as "improved Euler", a "predictor-corrector" with a fixed number of corrector steps using Euler's method as the predictor.

I've heard the term predictor corrector before, but I don't know anything about it. I think the core of my question is really whether or not you can take Runge-Kutta, split its prediction algorithm (Euler) and its corrector algorithm (all those k terms), and replace the prediction algorithm with a second order method (like Verlet or semi-explicit Euler or something along those lines). And if you did, what would the new error terms be for position and velocity?

Share this post


Link to post
Share on other sites

This topic is 3485 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this