carlosardura/lagrangian-noether-simulator
Dynamic system simulator via Euler-Lagrange. EOM resolution and visualization of symmetries/conservation laws (Noether’s theorem).
Lagrangian Mechanics Simulator
This repository provides a modular and scalable simulator for classical mechanics, designed to bridge the gap between analytical mechanics and numerical computation. By utilizing SymPy, the system derives the Euler-Lagrange equations from the automatically defined Lagrangian, solving the equations of motion symbolically before mapping them into the numerical domain. This approach prevents potential algebraic errors in manual derivation.
The project features a rigorous comparison between different integration schemes. While Runge-Kutta 4 (RK4) provides high local precision with a global error of
To prevent numerical overflow and minimize round-off errors, the simulator operates in a dimensionless environment. Mass is scaled relative to the minimum mass in the particle set, while position and velocity are normalized. This scaling is integrated with a comprehensive testing suite in Pytest, validating the results against strict error bounds: a linear drift proportional to the time interval for RK4, and bounded deviations for symplectic methods.
The main goal of the project is to provide an interactive tool for illustrating the connection between a physical system’s symmetries and the corresponding conservation laws, as described by Noether’s theorem. By analyzing Lagrangian invariances under potentials with temporal, translational or rotational invariances, the simulator provides visual and numerical evidence of the conservation of energy, linear momentum or angular momentum in classical dynamics.