Rotating Torus using Euler’s Equations

This is a project for which I used Matlab to create a rotating torus using Euler’s equations to demonstrate rigid body mechanics. I made the below animation which simulates the rigid body mechanics and I created a couple of graphs that show the rotational velocity of the object.

https://github.com/FinlayMcGrath/RotatingTorus

animation

2D Plot3D Plot