Physics Theory — Project 2: Simple and Double Pendulums

Objective

This project studies rotational oscillating systems using angular coordinates instead of direct Cartesian coordinates. It focuses on three areas:

  1. rotational dynamics;
  2. numerical integration of ordinary differential equations;
  3. the transition between regular and chaotic behavior.

Conventions

  • Length unit: meter (m)
  • Mass unit: kilogram (kg)
  • Time unit: second (s)
  • Angle unit in the interface: degree (deg)
  • Angle unit in the integrator: radian (rad)
  • Gravity: m/s²
  • Angular velocity: rad/s

The angle θ=0\theta = 0 represents the rod pointing downward in stable equilibrium. Positive values rotate counterclockwise when viewed in the conventional Cartesian plane.

Simple pendulum

Model

The simple pendulum is modeled as a point mass attached to a rigid, massless rod of length LL.

Its exact equation of motion is:

θ¨=gLsin(θ)\ddot{\theta} = -\frac{g}{L}\sin(\theta)

The project also uses a linear damping term proportional to angular velocity:

θ¨=gLsin(θ)cθ˙\ddot{\theta} = -\frac{g}{L}\sin(\theta) - c\dot{\theta}

where:

  • gg is gravity;
  • LL is the rod length;
  • cc is the angular damping coefficient.

Small-angle approximation

When θ1|\theta| \ll 1 rad, sin(θ)θ\sin(\theta) \approx \theta, and the equation becomes linear:

θ¨+gLθ=0\ddot{\theta} + \frac{g}{L}\theta = 0

In this regime, the theoretical period is:

T2πLgT \approx 2\pi\sqrt{\frac{L}{g}}

This expression is used as a numerical validation reference in the tests.

Mechanical energy

For mass mm, the simple pendulum’s total energy can be written as:

E=12mL2ω2+mgL(1cos(θ))E = \frac{1}{2}mL^2\omega^2 + mgL\left(1 - \cos(\theta)\right)

where ω=θ˙\omega = \dot{\theta}.

Without damping, the energy should remain approximately constant. With damping, it should decrease over time.

Double pendulum

Model

The double pendulum has two point masses, m1m_1 and m2m_2, coupled by two rigid rods of lengths L1L_1 and L2L_2. Its degrees of freedom are θ1\theta_1 and θ2\theta_2.

The exact equations are nonlinear and coupled, and they depend simultaneously on the angles and angular velocities. One standard form for the angular accelerations is:

θ¨1=g(2m1+m2)sinθ1m2gsin(θ12θ2)2sin(θ1θ2)m2(ω22L2+ω12L1cos(θ1θ2))L1(2m1+m2m2cos(2θ12θ2))\ddot{\theta}_1 = \frac{-g(2m_1+m_2)\sin\theta_1 - m_2g\sin(\theta_1 - 2\theta_2) - 2\sin(\theta_1-\theta_2)m_2\left(\omega_2^2L_2 + \omega_1^2L_1\cos(\theta_1-\theta_2)\right)}{L_1\left(2m_1+m_2-m_2\cos(2\theta_1-2\theta_2)\right)} θ¨2=2sin(θ1θ2)(ω12L1(m1+m2)+g(m1+m2)cosθ1+ω22L2m2cos(θ1θ2))L2(2m1+m2m2cos(2θ12θ2))\ddot{\theta}_2 = \frac{2\sin(\theta_1-\theta_2)\left(\omega_1^2L_1(m_1+m_2) + g(m_1+m_2)\cos\theta_1 + \omega_2^2L_2m_2\cos(\theta_1-\theta_2)\right)}{L_2\left(2m_1+m_2-m_2\cos(2\theta_1-2\theta_2)\right)}

The project also adds linear damping terms:

θ¨1θ¨1c1ω1\ddot{\theta}_1 \leftarrow \ddot{\theta}_1 - c_1\omega_1 θ¨2θ¨2c2ω2\ddot{\theta}_2 \leftarrow \ddot{\theta}_2 - c_2\omega_2

Mechanical energy

The mass positions are:

x1=L1sinθ1,y1=L1cosθ1x_1 = L_1\sin\theta_1, \qquad y_1 = -L_1\cos\theta_1 x2=x1+L2sinθ2,y2=y1L2cosθ2x_2 = x_1 + L_2\sin\theta_2, \qquad y_2 = y_1 - L_2\cos\theta_2

The velocities are obtained by differentiating these expressions. The total energy is:

E=12m1(vx12+vy12)+12m2(vx22+vy22)+UE = \frac{1}{2}m_1(v_{x1}^2 + v_{y1}^2) + \frac{1}{2}m_2(v_{x2}^2 + v_{y2}^2) + U

with gravitational potential measured relative to the lowest-energy configuration:

U=m1gL1(1cosθ1)+m2g(L1(1cosθ1)+L2(1cosθ2))U = m_1gL_1(1-\cos\theta_1) + m_2g\left(L_1(1-\cos\theta_1) + L_2(1-\cos\theta_2)\right)

Numerical integration

The project implements two integrators:

Symplectic Euler

  • Updates the angular velocities first;
  • Then updates the angles using the corrected velocities.

It is simple and inexpensive, and it often preserves the system’s qualitative structure better than standard explicit Euler.

Fourth-order Runge-Kutta (RK4)

It uses four intermediate evaluations per time step and produces much lower local error than first-order methods.

For the simple pendulum, RK4 should closely approximate the theoretical small-angle period. For the double pendulum, it helps reduce local error in a system that is highly sensitive to initial conditions.

Chaos and sensitivity to initial conditions

The double pendulum is a classic example of a deterministic system that can exhibit chaotic behavior. This means that:

  • the equations are fully deterministic;
  • small differences in the initial state can grow rapidly over time;
  • long-term predictions become highly sensitive to numerical error.

Therefore, double-pendulum tests should prioritize:

  • absence of NaN and Inf;
  • numerical stability for reasonable time steps;
  • basic invariants when the system has no damping;
  • simple special cases, such as exact rest at θ1=θ2=0\theta_1 = \theta_2 = 0.

Practical validation targets

Simple pendulum

  • small-angle period;
  • approximate energy conservation without damping;
  • energy decay with damping;
  • stability with different integration methods.

Double pendulum

  • stable rest in the downward vertical configuration;
  • finite evolution without numerical blow-up;
  • coherent trails for both bobs;
  • qualitatively distinct behavior between regular and chaotic regimes.

Model limitations

This project deliberately simplifies several aspects:

  • rods are rigid and massless;
  • there is no pivot friction beyond the model’s imposed linear damping;
  • masses and rods do not collide;
  • there is no distributed air resistance along the rods;
  • the problem is two-dimensional.

These simplifications are appropriate for studying numerical integration, energy, periodicity, and chaos without introducing unnecessary complexity too early.