|
MolSim
|
Strategy functions for calculating the velocity of one or more particles. More...
#include "objects/ParticleContainer.h"Go to the source code of this file.
Functions | |
| void | calculateV (ParticleContainer &particles, double delta_t) |
| Calculates the velocity \( v \) for all Particle objects in a given ParticleContainer. | |
Strategy functions for calculating the velocity of one or more particles.
| void calculateV | ( | ParticleContainer & | particles, |
| double | delta_t | ||
| ) |
Calculates the velocity \( v \) for all Particle objects in a given ParticleContainer.
The velocity \( v_i \) of a given particle \( i \) at the next unit of time \( t_{n+1} \) is calculated using the formula
\[ v_i(t_{n+1}) = v_i(t_n) + \Delta t \frac{F_i(t_n) + F_i(t_{n+1})}{2m_i}. \]
| particles | The ParticleContainer containing the Particle objects to iterate over. |
| delta_t | The timestep \( \Delta t \). |