Try it out here

https://yaeldemers.com/multibody-pendulum-visualization

What it does

In the context of this year's Physics Hackathon, we decided to work on a visualization tool for pendulum motion. As we researched the topic, we realized most simulator focused on single and double pendulums, but we wondered what would happen as you increase the amount of bobs in the system? How chaotic could this get?

How we built it

As we wanted this tool to be interactive, we thought it would be a great idea to make this in JavaScript. This way, anyone could try it and have its own spin on it. We used the p5.js framework to draw the systems and hosted them on HTML5 pages. The tricky part was getting the equations of motion right. For a simple pendulum, classical mechanics equations are sufficient, however we had to turn to Lagrangian mechanics and many papers to figure out the motion of multibody pendulums. Note, to show the chaos induced by multibody pendulums, we plotted the position of the bottom bob over time.

Challenges we ran into

  • We were able to recreate the motion of a single & double pendulums but we could not successfully create the motion of a triple pendulum because the equations used for this motion is only applicable for small angles. The proper ones could be derived in a similar fashion as the ones for the double pendulum, but the work to do so is significantly longer and we had to compromise due to the time limit.
  • Another problem we ran into consisted of our use of the time step. As our simulation runs in-real time, at 60 frame per second (FPS), we had to make sure to adapt the time step so that the calculations were not done too many times. This led us to have a more realistic simulation while reducing the computational power needed for the whole project.

Accomplishments that we're proud of

We studied a new language( JavaScript) and one of its frameworks ( p5.js ) within the limited hours and were able to successfully create a simulation of single & double pendulums and its phase space. We were also able to derive the angular momentum of a pendulum with a limited knowledge in physics.

What we learned

During this project, we studied the motion of a pendulum, especially how the motion of the pendulums are heavily influenced by the length of the wires of each pendulums, mass (for double pendulums and onward), gravity, dampening and the number of bobs in a pendulum. It was great to see how increasing the number of bobs induces more chaos to the system. Also, we learned about phase-paces and how to graph them.

What's next for Multibody Pendulum Visualization Tool

As we approached an increasing amount of pendulum's bobs, we realized a generalization formula might be necessary to qualify the equations of motion (EOM) of said bobs. Each mass added to the system significantly complexifies the EOMs and hence make the code tedious to write, and read. Once a generalization formula is found, it will be easy to visualize how the system behaves as the number of bobs gets bigger. An other option could be to use an other language / framework to calculate said EOMs (for example Python and Sympy or Matlab). As we introduced in our double pendulum system, phase-space diagrams could also be an interesting approach to this topic as it touches some concepts of chaos theory.

Built With

+ 13 more
Share this project:

Updates