#include <random>
#include <array>
Go to the source code of this file.
◆ maxwellBoltzmannDistributedVelocity()
| std::array<double, 3> maxwellBoltzmannDistributedVelocity |
( |
double |
averageVelocity, |
|
|
size_t |
dimensions |
|
) |
| |
|
inline |
Generate a random velocity vector according to the Maxwell-Boltzmann distribution, with a given average velocity.
- Parameters
-
| averageVelocity | The average velocity of the brownian motion for the system. |
| dimensions | Number of dimensions for which the velocity vector shall be generated. Set this to 2 or 3. |
- Returns
- Array containing the generated velocity vector.