Animation of the motion a double-pendulum. Both Julia and Python versions of the code are given.

# zaman13/Double-Pendulum-Motion-Animation

Switch branches/tags
Nothing to show

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

## Files

Failed to load latest commit information.
Type
Name
Commit time

# Double-Pendulum-Motion-Animation Animation of the chaotic motion a double-pendulum using Julia and Python. The julia version is implemented in a Jupyter notebook environment whereas the python version is a conventional script. Double pendulums of arbitrary lengths, masses, initial positions, and the initial velocities can be simulated using this code. Both versions of the code allow the animation to be saved in either mp4 or gif format.

## Julia version The code can save the animation as a gif file. It can also playback the video in Jupyter notebook environment. The animation is recorded at equal time steps to preserve relative velocity of the pendulums in the video.

## Python version The animation is done using FuncAnimation() of matplotlib. The code can save the animation as a mp4 file. The python script was tested in spyder environment. Plotting in external window should be enabled to view the animation.

## Package requirements for Julia version

1. Plots
2. Differential Equations
3. Direckx

## Package requirements for Python version

1. numpy
2. scipy.integrate (odeint)
3. pylab, matplotlib (animation)
4. imagemagick (to save animation as a gif file)

## Use

The mass and length of the pendulums, gravitational acceleration constant, the initial conditions and the simulaiton duration are defined at the beginning of the code. Different cases can be simulated by changing these parameters.

## Sample output

Double pendulum system animation. The left animation is from the julia code with m1 = m2 = 1kg, L1 = L2 = 1m, initial conditions: θ1 = 5π/8, θ2 = 5π/9, ω1 = 0, ω2 = 0. The right animation is from the python code with m1 = 2kg, m2 = 1kg, L1 =1.4m, L2 = 1m, initial conditions: θ1 = 5π/11, θ2 = 5π/9, ω1 = 0, ω2 = 0.

Here, θ1 and θ2 are the initial angular positions, and, ω1 and ω2 are initial angular velocities in SI units.

## References

Animation of the motion a double-pendulum. Both Julia and Python versions of the code are given.

## Releases

No releases published

## Packages 0

No packages published