Skip to main content

Module physics

Module physics 

Source
Expand description

Physics domain engine.

Implements numerical integration for physical simulations:

  • Verlet (symplectic, 2nd order)
  • Euler (1st order)
  • RK4 (4th order)

§Energy Conservation

Symplectic integrators (Verlet) preserve phase space volume, leading to bounded energy error over long simulations.

Structs§

CentralForceField
Central force field (e.g., gravity toward origin).
EulerIntegrator
Euler integrator (1st order, non-symplectic).
GravityField
Simple gravity force field.
PhysicsEngine
Physics engine wrapper.
RK4Integrator
Runge-Kutta 4th order integrator.
VerletIntegrator
Störmer-Verlet symplectic integrator.

Traits§

ForceField
Force field trait for computing accelerations.
Integrator
Numerical integrator trait.