A simple one-particle system

notion image

Introduction

This project is the first assignment for a physics-based animation. Its main implementation is to simulate an elementary particle with explicit and implicit Eulerian.

Implementation

In order to simulate this particle, we need three variables distributed to represent the velocity acceleration of the point as well as the displacement. The explicit Euler method is very straightforward, and we use only the current acceleration to calculate the velocity and displacement in the next step.
vn+1=vn+anΔtrn+1=rn+vn+1Δt\textbf{v}_{n+1} = \textbf{v}_n+\textbf{a}_n\Delta t\\\textbf{r}_{n+1} = \textbf{r}_n+\textbf{v}_{n+1}\Delta t
The implicit Euler method is a bit more complicated. In this operation we need to solve for the position of the next step and then get the acceleration of that point and bring it into the current acceleration.

Final Result

We can see the particles moving in a circular stance, and we can turn on gravity manually with g The stance is turned on manually by f and the explicit and implicit computations are switched on by i. It is worth mentioning that using the linear method leads to particle divergence, while the implicit method leads to particle convergence.