Sign in to follow this  
coderchris

Question about velocity verlet integration

Recommended Posts

Im Trying to move to velocity verlet integration from Euler, but im somewhat confused on something.. The equations for velocity verlet (I hope): velocity verlet In the last equation for calculation velocity, it wants the force at the next time step; How am I supposed to plug in a force there if the next time step hasnt happened yet?

Share this post


Link to post
Share on other sites
If acceleration is a function of only time and position then it's easy. Otherwise I have no idea; maybe you'd need to use a different approach.

Share this post


Link to post
Share on other sites
I think that's Leap-frog, not velocity verlet.

f(n+1) is the force for this frame (since you are calculating v(n+1)), and f(n) is the previous frame's force. Just calculate the force first.

Share this post


Link to post
Share on other sites
Ah I see, so that would mean f(n) is my force from the previous frame; makes sense

If that is leapfrog, how would I do velocity verlet? Which is actually more accurate: standard verlet, velocity verlet, or leapfrog?

Share this post


Link to post
Share on other sites
The different verlets are all pretty good, they just have differnt pros/cons. Velocity verlet better balances the precision between velocity and position. Presonally I like velocity verlet because it gives you an explicit velocity term, which is useful in a number of situations, like collisions (don't let the propoganda for vanilla verlet fool you. You need to explicitly set the velocity after a collision to get correct results, even though the formula uses an implicit velocity term!)

The Theory of Molecular Dynamics Simulations is an excellent article. In general, molecular dynamics simulations seem to be a step ahead of game physics, even though they're doing basically the same thing.

And to save you a step, you'll eventually want to know how to respond to collisions correctly. The coefficient of restitution is an article I wrote to address that (see the "use" section in particular).

Share this post


Link to post
Share on other sites

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