Constants

General constant definitions.

module:

constants

author:

Le Bars, Yoann

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. See file LICENSE or go to:

https://www.gnu.org/licenses/gpl-3.0.html

constants.COEFF_FRICTION: Final[float] = 0.6

Coefficient of kinetic (sliding) friction. Used in impulse calculations.

constants.COEFF_RESTITUTION: Final[float] = 0.1

Spring constant for penalty-based collision response.

constants.COEFF_STATIC_FRICTION: Final[float] = 0.8

Coefficient of static friction. Typically slightly higher than kinetic friction.

constants.DEFAULT_DENS: Final[float] = 0.1

Default bodies density.

constants.DEFAULT_DT: Final[float] = 0.5

Default time step (in s).

constants.DEFAULT_N_BODIES: Final[int] = 20

Default number of bodies.

constants.DEFAULT_N_ITER: Final[int] = 500

Default number of iterations.

constants.DEFAULT_SEED: Final[int] = 0

Default seed for random number generation.

constants.DENS_KEY: Final[str] = 'dens'

Key for body density.

constants.DT_KEY: Final[str] = 'dt'

Key for time step.

constants.EPSILON: Final[float] = 1e-06

Default computing precision value.

constants.EPSILON_KEY: Final[str] = 'epsilon'

Key for computing precision.

constants.G: Final[float] = 6.6743e-11

Default universal gravity constant (in m³ / kg / s²).

constants.MAX_DT: Final[float] = 0.01

Maximum time step allowed for the simulation to ensure stability. This value may need to be tuned down for simulations with high velocities or strong forces.

constants.N_BODIES_KEY: Final[str] = 'n_bodies'

Key for number of bodies.

constants.N_ITER_KEY: Final[str] = 'n_iter'

Key for number of iterations.

constants.SEED_KEY: Final[str] = 'seed'

Key for seed.

constants.TARGET_DX: Final[float] = 0.01

Heuristic for the maximum distance a body should travel in one step during adaptive time stepping.

constants.UNIVERSAL_G_KEY: Final[str] = 'universal_g'

Key for universal gravity constant.