Euler and Verlet Integration for Particle Physics

www.gorillasun.de
7 min read
standard
In this post we revisit our particle system, and have a first look at the Verlet Integration method, which is an alternate method for simulating particle physics. It is in many ways more robust that the regular Euler Integration method that we have employed so far.
I never thought that this series would grow to this length - but the more I learn about this topic, the more I find things to write about. Starting from what seemed like a very trivial sketch - some circles bouncing around on the canvas - I actually ended up learning so much about simulating physics, about collision detection, optimizations for computing collisions faster, how springs work, how to connect particles with springs and create meshes, and even taking a dip into soft body physics.

And now, what if I told you that there was a completely different approach to doing all of these things? That the way we implemented our particle system in it's current state, was just one of the different approaches in which things can be done? And that the system we created is actually flawed in many ways? Yes, there's actually many issues that still remain and that we're going to tackle throughout this article.

First we'll go over what we've done so far, again, but this time around examine it from a mathematical point of view. And while we're at it, we'll also identify some problems that exist in this system. In the second part of this article we'll then talk about Verlet Integration, a different numerical method to compute the movement of particles on the canvas.

It might seem like a scary term at first, but it's actually not that complicated, it just requires us to do a little bit of setup to get there. Overall, it isn't even very difficult to implement. One important aspect of Verlet Integration is it's numerical stability - we'll see what that means towards the end of the article - making it excellent for scenarios where we have a number of interconnected particles: for instance when we're trying to model soft body physics! That's why it's worth looking into, to help us and make our future soft body simulations more accurate, more robust and overall much smoother!

Another thing, before we start - I want to give a gigantic shoutout to this amazing video from Gustavo,…
Ahmad Moussa
Read full article