Question about velocity verlet integration

Started by
3 comments, last by Numsgil 17 years, 1 month ago
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?
Advertisement
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.
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.
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?
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).
[size=2]Darwinbots - [size=2]Artificial life simulation

This topic is closed to new replies.

Advertisement