Constants
Provides centralised definitions of physical constants, simulation parameters, and application-wide settings.
This module provides a single source of truth for values that are used across the application, ensuring consistency and ease of maintenance.
- author:
Le Bars, Yoann
- src.constants.ANGULAR_DAMPING: Final[float] = 0.005
Damping factor for angular velocity.
- Type:
ivar float
- src.constants.COEFF_FRICTION: Final[float] = 0.6
Coefficient of kinetic (sliding) friction.
- Type:
ivar float
- src.constants.COEFF_RESTITUTION: Final[float] = 0.1
Coefficient of restitution (bounciness) for collisions.
- Type:
ivar float
- src.constants.COEFF_STATIC_FRICTION: Final[float] = 0.8
Coefficient of static friction.
- Type:
ivar float
- src.constants.DEFAULT_DENS: Final[float] = 0.1
Default density for bodies.
- Type:
ivar float
- src.constants.DEFAULT_DT: Final[float] = 0.5
Default initial time step for the simulation.
- Type:
ivar float
- src.constants.DEFAULT_LOG_FREQ: Final[int] = 100
Default frequency for logging system energy.
- Type:
ivar int
- src.constants.DEFAULT_N_BODIES: Final[int] = 20
Default number of bodies in the simulation.
- Type:
ivar int
- src.constants.DEFAULT_N_ITER: Final[int] = 500
Default number of simulation iterations.
- Type:
ivar int
- src.constants.DEFAULT_SEED: Final[int] = 0
Default seed for random number generation.
- Type:
ivar int
- src.constants.DT_DAMPING_FACTOR: Final[float] = 0.1
Damping factor for smoothing adaptive time step changes.
- Type:
ivar float
- src.constants.EPSILON: Final[float] = 1e-06
Default computing precision value.
- Type:
ivar float
- src.constants.G: Final[float] = 6.6743e-11
Default universal gravity constant (in m³/kg/s²).
- Type:
ivar float
- src.constants.LINEAR_DAMPING: Final[float] = 0.005
Damping factor for linear velocity.
- Type:
ivar float
- src.constants.MAX_DT: Final[float] = 0.01
Maximum time step allowed for the simulation to ensure stability.
- Type:
ivar float
- src.constants.POSITIONAL_CORRECTION_FACTOR: Final[float] = 0.2
The percentage of overlap to correct in each frame (Baumgarte stabilization).
- Type:
ivar float
- src.constants.SHOW_ALPHA_ARROW_ARG: Final[str] = 'show_alpha_arrow'
Command-line argument for showing angular acceleration arrows.
- Type:
ivar str
- src.constants.SHOW_TORQUE_ARROW_ARG: Final[str] = 'show_torque_arrow'
Command-line argument for showing torque arrows.
- Type:
ivar str
- src.constants.TARGET_DX: Final[float] = 0.01
Heuristic for the maximum distance a body should be allowed to travel in a single step during adaptive time-stepping.
- Type:
ivar float