Particle System

Your browser does not support the HTML5 canvas tag.
0.00 s
0.00 ms
0

Particle system algorithm:

This example shows a simple particle system:
  1. remove particles with age > max. life time
  2. generate new particles by emitters
  3. compute forces for all particles
  4. time integration to get new particle positions and velocities

1. Remove particles with age > max. life time

The life time of each particle is set to 0 when a particle is generated. In each simulation step the life time is increased by the time step size $\Delta t$. When a particle's life time is greater than a predefined maximum life time, the particle is removed from the simulation.

Note that the life time can be used for rendering effects. In our case the transparency is increased depending on the life time to fade out the particles.

2. Generate new particles by emitters

In each simulation step new particles are generated at the position of the emitter. Typically they are initialized with some predefined values and sometimes some random values are added to obtain more natural results.

In our simulation the particles are generated with a velocity pointing upwards. Moreover, the velocity in x- and y-direction is modified by some random values.

3. Compute forces for all particles

In each step forces are determined for the particles, e.g. gravity, wind etc. In our simple example only gravity is applied.

4. Time integration

Finally, the particles are advected by numerical time integration. In our case we use a symplectic Euler method: $$\begin{align*} \mathbf v(t + \Delta t) &= \mathbf v(t) + \frac{\Delta t}{m} \mathbf f^{\text{ext}} \\ \mathbf x(t + \Delta t) &= \mathbf x(t) + \Delta t \mathbf v(t + \Delta t), \end{align*}$$ where $\mathbf f^{\text{ext}}$ are the external forces.