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.

src.constants.ARROW_INITIAL_LENGTH: Final[float] = 10.0

The initial length of the debug vector arrows.

src.constants.ARROW_RADIUS: Final[float] = 0.5

The radius of the shaft for debug vector arrows.

src.constants.COEFF_FRICTION: Final[float] = 0.6

Coefficient of kinetic (sliding) friction.

src.constants.COEFF_RESTITUTION: Final[float] = 0.1

Coefficient of restitution (bounciness) for collisions.

src.constants.COEFF_STATIC_FRICTION: Final[float] = 0.8

Coefficient of static friction.

src.constants.DEFAULT_DENS: Final[float] = 0.1

Default density for bodies.

src.constants.DEFAULT_DT: Final[float] = 0.5

Default initial time step for the simulation.

src.constants.DEFAULT_LOG_FREQ: Final[int] = 100

Default frequency for logging system energy.

src.constants.DEFAULT_N_BODIES: Final[int] = 20

Default number of bodies in the simulation.

src.constants.DEFAULT_N_ITER: Final[int] = 500

Default number of simulation iterations.

src.constants.DEFAULT_SEED: Final[int] = 0

Default seed for random number generation.

src.constants.DT_DAMPING_FACTOR: Final[float] = 0.1

Damping factor for smoothing adaptive time step changes.

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

Default computing precision value.

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

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

src.constants.INITIAL_DOMAIN_SIZE: Final[float] = 200.0

The size of the cubic domain for initial body placement (deprecated, now using scaled volume).

src.constants.LINEAR_DAMPING: Final[float] = 0.005

Damping factor for linear velocity.

src.constants.MAX_DT: Final[float] = 0.01

Maximum time step allowed for the simulation to ensure stability.

src.constants.MAX_INITIAL_ANGULAR_VELOCITY: Final[float] = 0.5

Maximum initial angular velocity component for bodies.

src.constants.MAX_MASS: Final[float] = 75.0

Maximum mass for randomly generated bodies.

src.constants.MAX_VELOCITY: Final[float] = 5.0

Maximum initial velocity component for bodies.

src.constants.MIN_MASS: Final[float] = 25.0

Minimum mass for randomly generated bodies.

src.constants.MIN_VELOCITY: Final[float] = -5.0

Minimum initial velocity component for bodies.

src.constants.PLACEMENT_SCALE_FACTOR: Final[float] = 4.0

Heuristic scaling factor for the initial placement volume of bodies.

src.constants.POSITIONAL_CORRECTION_FACTOR: Final[float] = 0.2

The percentage of overlap to correct in each frame, used for Baumgarte stabilisation.

src.constants.SHOW_ALPHA_ARROW_ARG: Final[str] = 'show_alpha_arrow'

Command-line argument for showing angular acceleration arrows.

src.constants.SHOW_TORQUE_ARROW_ARG: Final[str] = 'show_torque_arrow'

Command-line argument for showing torque arrows.

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.