Dice Cup Simulation

overview

I used pyhon code to simulate the motion and impacts of a dice in a cup using 2D multi-body dynamics. First, the systems spacial frames and configuration variables were defined. The Lagrangian was calculated the Euler Lagrangian equations. Impact equations were incorporated to update the configuration of both bodies when their frames would come into contact. The configurations of the simulation were recorded and used to produce an animation that depicted the dynamics of the simulation, helping understand and troubleshoot what was simulated.