Simulation of a double pendulum

By |

This animation simulates the chaotic behavior of a double pendulum – one of the most famous examples of deterministic chaos systems. Two coupled pendulum arms with adjustable lengths and masses swing under the influence of gravity. The masses can be dragged to any starting position. An angle-time diagram records the evolution of both angles.

Links

Description of the Animation

The double pendulum consists of two rigidly connected pendulum arms: The first arm (blue) is attached to the pivot point, while the second arm (red) hangs from the end of the first. The motion is described by the Lagrange equations of the second kind and solved numerically using the 4th-order Runge-Kutta method.

The angles \( \theta_1 \) and \( \theta_2 \) are each measured from the vertical. The equations of motion are derived from the Lagrangian \( L = T – V \) with kinetic energy \( T \) and potential energy \( V \):

\[ T = \frac{1}{2}(m_1 + m_2)L_1^2\dot{\theta}_1^2 + \frac{1}{2}m_2 L_2^2\dot{\theta}_2^2 + m_2 L_1 L_2 \dot{\theta}_1\dot{\theta}_2\cos(\theta_1 – \theta_2) \]

\[ V = -(m_1 + m_2)gL_1\cos\theta_1 – m_2 g L_2\cos\theta_2 \]

The left area of the animation shows the double pendulum with angle markers. A gray trail traces the path of the second mass, visualizing the chaotic behavior. The right area displays a coordinate system showing the temporal evolution of both angles \( \theta_1(t) \) and \( \theta_2(t) \) in the range from −180° to +180°.

Interactive Controls

The following parameters are adjustable:

  • Pendulum lengths L₁ and L₂: Adjustable from 50 to 200 pixels. Different length ratios lead to various motion patterns.
  • Masses m₁ and m₂: Adjustable from 0.5 to 5.0 kg. The mass ratio affects the energy distribution between the arms.
  • Gravity g: Adjustable from 100 to 1000 px/s². Higher values accelerate the motion.
  • Damping: Adjustable from 0 to 2. At values greater than zero, the oscillation gradually decays.
  • Direct dragging: In pause mode, both masses can be dragged with the mouse to any position to explore different initial conditions.
  • Start/Pause: Starts or pauses the simulation.
  • Reset: Resets the pendulum to the V-shaped initial position (\( \theta_1 = 45° \), \( \theta_2 = 135° \)).

The lower area displays the current values: time \( t \), the instantaneous angles \( \theta_1 \) and \( \theta_2 \), as well as the corresponding angular velocities \( \omega_1 \) and \( \omega_2 \).

Chaotic Behavior

The double pendulum is a classic example of a chaotic system: Although the equations of motion are deterministic, the slightest changes in initial conditions lead to completely different trajectories. This sensitivity – the “butterfly effect” – makes long-term predictions practically impossible.

Overview

TitleDouble Pendulum – Chaotic Oscillations
Target AudienceTeachers and Lecturers
FeaturesFull-screen mode
Lossless scaling
Large screens and projectors supported
LicenseOpen Source – CC BY 4.0
Attribution NoticeCreated with AI assistance