Explore this project on GitHub
Euler-Lagrange equations are used to simulate the motion of a dice in a box. The dice is placed in a box, and the box is rotated. The dice moves inside the box due to the rotation of the box. The equations of motion are derived using the Euler-Lagrange equations. The simulation is done using SymPy and Matplotlib.
The equations of Euler-Lagrange are given by:
where:
-
$L$ is the Lagrangian -
$q_{i}$ is the configuration variable -
$\dot{q_{i}}$ are the generalized velocities of the configuration variables
For this simulation, the configuration variables are the angles,
The forces acting on the system are defined as follows:
Restoring Force: A restoring force,
where:
Gravitational Force: The downward force,
The simulation of the equations of motion gives the following configurations of the dice and the box: