Physics Simulations

This page lists a couple of MATLAB codes I have written to simulate certain physical situations. You may use and edit them freely.

  • Double Pendulum in a liquid - This is an interactive GUI where the user can set the initial conditions, the density of the liquid, the value of g, and several other constants. The code has the option of simulating two pendulums at once so that one can compare the motion of the two. (For ex - with and without the presence of the liquid). Note how the chaotic motion of the pendulum depends on the initial conditions.


  • 3 body spring system - This is an interactive GUI where the user can set the initial conditions for the 3 bodies attached to the spring system. Additionally, one can set the spring constants.