The simple pendulum has an apparent simple motion, and yet, the union of two pendulums generate a system with a chaotic motion. Although there is no formal proof, there is no known solution for the double pendulum system motion, and thus, it must be solved numerically. This study aims to analyze such a system and compare the sensitivity to different numerical methods. Moreover, it is also a goal to goal to analyze how the chaotic motion takes place, and whether it is prevalent for the entire system or for some cases. To achieve that, equations of motion are obtained using the Euler-Lagrangian equation. The resulting differential equations are them solved numerically, using Runge-Kutta (4th order) and Euler’s Explicit Forward methods. The system is then computationally simulated using the programming language python. Detailed solutions are initially presented for different initial states of the system and the two different numerical methods, analyzing motion, behavior, and mechanical energy of the system. Then, solutions are presented for a very large number of initial positions, allowing for patterns to be discovered.
This repository contains the modelling of the equations of motion, and numerical solution (Implementaiton of the numerical methods). All models used and references can be found on the report and on the Acknowledgements and Bibliography sections. The repository is fully open-sourced under the MIT License. This study was originally submitted as a project for the class ENME631 (Numerical Methods) in the University of Calgary (Calgary, Alberta, Canada).
All necessary libraries are shown in the beginning of each notebook. The code was tested with Python 3.9.7 64-bit, but should work with version 3.x.
The recommended way to install the libraries is with Pypi, using pip:
> pip install <libraryname>
Before opening an issue, make sure your libraries are updated:
> pip install --upgrade <libraryname>
Either:
-
Clone the repository, which will give you all the data used in the original study. Please see Acknowledgements for licensing of each data source information.
-
Use the notebooks, which will download and process all the data, and is throughout commented to allow for some flexibility in the simulation.
-
It should be noted that the execution time rises exponentially for a large number of points. For example, simulating 1500 initial angular positions for each pendulum bob generates a total of 2,250,000 trajectories, which took approximately 16h of continuous running in the author's machine. A suggestion to improve that is to either parallelize the code or use an implementation such as Cython
- Double_Pendulum_Model.ipynb - The python notebook with all the models, simulation and numerical solution. Note: The notebook is highly recommended, but a python file is also included for compatibility purposes Double_Pendulum_Model.py.
- ENME631 - Numerical Solution to Chaos - Double Pendulum - The python notebook with all the models, simulation and numerical solution.
- Figures Folder - Contains all the images and animations used in the final report.
- Figures: Numerical Methods Verification/ - Verification of the numerical methods with ODEs with known analytical solutions.
- Figures: Cartesian Motion/ - Analysis of the cartesian motion for cases 1, 2, and methods RK4 and Euler.
- Figures: Conservation of Mechanical Energy/ - Analysis of the conservation of mechanical energy for the two different methods.
- Figures: Number of Flips/ - Analysis of the number of flips for different initial angular positions and mechanical energy.
- Figures: Final Angular Position - Full Circle Spectrum/ - Analysis of the final angular position for different initial angular positions (360 degrees).
- Figures: Final Angular Position - Region/ - Analysis of the final angular position for different initial angular positions and mechanical energy (Region).
- Figures: Animation - Cases 1 and 2 motion/ - Animation of the referenced cases 1 and 2 throughout the report text.
Number of pendulum flips (bob#2) x initial positions | Number of pendulum flips (bob#2) x initial positions |
---|---|
Final angular position (bob#2) x initial positions | Zoomed in section (previous chart) |
---|---|
Note: Click for much more detailed images.
-
NumPy.com, the library used for matrix and arrays operation in this project. This library is open-sourced under the BSD License.
-
Matplotlib, the library for data visualization. This library uses BSD compatible code. and operates in the LSF [License] (https://docs.python.org/3/license.html).
- Acheson, D. J. (1997). From calculus to chaos: An introduction to dynamics. Oxford University Press.
- Stachowiak, T., & Okada, T. (2006). A numerical analysis of chaos in the double pendulum. Chaos, Solitons & Fractals, 29(2), 417–422. https://doi.org/10.1016/j.chaos.2005.08.032
- Ohlhoff, A., & Richter, P. H. (2000). Forces in the Double Pendulum. ZAMM, 80(8), 517–534. https://doi.org/10.1002/1521-4001(200008)80:8<517::AID-ZAMM517>3.0.CO;2-1
- Marcelo Tusset, A., Piccirillo, V., Bueno, A. M., Manoel Balthazar, J., Sado, D., Felix, J. L. P., & Brasil, R. M. L. R. da F. (2016). Chaos control and sensitivity analysis of a double pendulum arm excited by an RLC circuit based nonlinear shaker. Journal of Vibration and Control, 22(17), 3621–3637. https://doi.org/10.1177/1077546314564782
- Sanjeewa, S. D., & Parnichkun, M. (2019). Control of rotary double inverted pendulum system using mixed sensitivity H∞ controller. International Journal of Advanced Robotic Systems, 16(2), 172988141983327. https://doi.org/10.1177/1729881419833273
- Kiyoumarsi, A., Ataei, M., Mirzaeian-Dehkordi, B., & Ashrafi, R. (2007). The Mathematical Modeling of a Double-Pendulum System as a Physical Model of Flexible Arm Robot. 2007 IEEE International Conference on Control and Automation, 1900–1904. https://doi.org/10.1109/ICCA.2007.4376692
- Sun, N., Wu, Y., Liang, X., & Fang, Y. (2019). Nonlinear Stable Transportation Control for Double-Pendulum Shipboard Cranes With Ship-Motion-Induced Disturbances. IEEE Transactions on Industrial Electronics, 66(12), 9467–9479. https://doi.org/10.1109/TIE.2019.2893855
- Bazargan-Lari, Y., Eghtesad, M., Khoogar, A., & Mohammad-Zadeh, A. (2014). Dynamics and regulation of locomotion of a human swing leg as a double-pendulum considering self-impact joint constraint. Journal of Biomedical Physics & Engineering, 4(3), 91–102.
- Inoue, Y., Shibata, K., Fukumoto, M., Wang, S., & Oka, K. (n.d.). Study on Dynamic Analysis and Wearable Sensor System for Golf Swing. 146.
- Neal, H. (n.d.). Using Mechanics of a Double Pendulum to Maximize Sport Performance. 6.
- Gonzalez, G. (2008). Single and Double plane pendulum. 8.
- Zingg, D. W., & Chisholm, T. T. (1999). Runge–Kutta methods for linear ordinary differential equations. Applied Numerical Mathematics, 31(2), 227–238. https://doi.org/10.1016/S0168-9274(98)00129-9
- J, R. (1983). Runge-kutta method. Numerical Methods.
- Levien, R. B., & Tan, S. M. (1998). Double pendulum: An experiment in chaos. American Journal of Physics, 61(11), 1038. https://doi.org/10.1119/1.17335
- Chen, Joe. (2008). Chaos from Simplicity: An Introduction to the Double Pendulum.