Skip to content

DoublePendulum

Systems / ODEs / Physical systems

Two coupled pendula — the iconic mechanically chaotic system, exquisitely sensitive to initial conditions.

continuous · ODE4 dimensionschaoticconservative

Start here

Python
import tsdynamics as ts

system = ts.systems.DoublePendulum()
traj = system.run(final_time=20.0, dt=0.01, seed=0)
ts.plot(traj)

traj.t contains the sample times and traj.y the state array; system.info shows the defaults. In a notebook the last line displays the plot. In a Python script, call .show() on it to open a window, or .save("trajectory.svg") to export it.

With an adaptive ODE solver, dt sets the output spacing; rtol and atol control local integration error. For a fixed-step solver, reduce dt to check numerical convergence.

projection (th1, th2, p1)
projection (th1, th2, p2)

Interactive: drag to rotate

This finite simulation illustrates one initial condition and view. The diagnostics below report their own inputs and observation windows.

Dynamics at the default parameters

Lyapunov exponents measure separation rates along an orbit. The Kaplan–Yorke dimension is derived from those rates, not a direct geometric measurement. Finite runs depend on the initial condition, transient and observation window; a value near zero needs a convergence check.

Lyapunov spectrum
Finite-time / numerical estimate
$+0.003768,\; -4.152e-05,\; -0.0003656,\; -0.003361$
per time unit
Method and evidence

Benettin QR tangent dynamics

Finite-time estimate, not a convergence certificate. All state-space directions were computed.

Settings

{
  "backend": "jit",
  "k": 4,
  "final_time": 400.0,
  "transient": 100.0,
  "dt": 0.1,
  "ic": [
    0.06927601503676149,
    0.025637571034085017,
    -0.05521680914597596,
    -0.07988698060008846
  ],
  "rtol": 1e-09,
  "atol": 1e-12,
  "solver": "rk45"
}

Preparation

{
  "seed": 1741695697,
  "ic_policy": "declared/in-basin start, else seeded small ball"
}

Estimator runtime in the recorded environment: 0.216 s.

Kaplan–Yorke dimension
Finite-time / numerical estimate
$D_{KY} = 4$
Method and evidence

Kaplan–Yorke interpolation of the recorded spectrum

Lyapunov dimension estimate; equality with a fractal or information dimension requires additional dynamical assumptions.

Settings

{
  "backend": "jit",
  "k": 4,
  "final_time": 400.0,
  "transient": 100.0,
  "dt": 0.1,
  "ic": [
    0.06927601503676149,
    0.025637571034085017,
    -0.05521680914597596,
    -0.07988698060008846
  ],
  "rtol": 1e-09,
  "atol": 1e-12,
  "solver": "rk45"
}
Divergence ∇·f
Not applicable: too large to display — pathological rational divergence
Equilibria / fixed points
Finite-time / numerical estimate
49 equilibria found
0 stable · 34 unstable · 15 marginal / undetermined
Method and evidence

A seeded numerical search, not a completeness proof. Stability means linear asymptotic stability. Marginal/nonhyperbolic roots have no nonlinear stability verdict from this linearisation.

max Re(eigenvalue) for flows; max |multiplier| - 1 for maps. Boundary band: 1e-7 * max(1, max |eigenvalue|).

Settings

{
  "method": "newton",
  "n_seeds": 80,
  "seed": 0
}

Estimator runtime in the recorded environment: 0.0605 s.

Recorded parameters and software
{
  "parameters": {
    "d": 1.0,
    "m": 1.0
  },
  "parameter_expressions": {},
  "state_dimension": 4,
  "explicit_time": false,
  "library_version": "6.0.3",
  "python": "3.14.8",
  "numpy": "2.4.4",
  "scipy": "1.17.1",
  "protocol_version": 1
}

Definition

\[ \begin{aligned} \dot{th1} &= \frac{6 \left(2 p_{1} - 3 p_{2} \cos{\left(th_{1} - th_{2} \right)}\right)}{d^{2} m \left(16 - 9 \cos^{2}{\left(th_{1} - th_{2} \right)}\right)} \\ \dot{th2} &= \frac{6 \left(- 3 p_{1} \cos{\left(th_{1} - th_{2} \right)} + 8 p_{2}\right)}{d^{2} m \left(16 - 9 \cos^{2}{\left(th_{1} - th_{2} \right)}\right)} \\ \dot{p1} &= - 0.5 d^{2} m \left(\frac{29.46 \sin{\left(th_{1} \right)}}{d} + \frac{36 \left(2 p_{1} - 3 p_{2} \cos{\left(th_{1} - th_{2} \right)}\right) \left(- 3 p_{1} \cos{\left(th_{1} - th_{2} \right)} + 8 p_{2}\right) \sin{\left(th_{1} - th_{2} \right)}}{d^{4} m^{2} \left(16 - 9 \cos^{2}{\left(th_{1} - th_{2} \right)}\right)^{2}}\right) \\ \dot{p2} &= - 0.5 d^{2} m \left(\frac{9.82 \sin{\left(th_{2} \right)}}{d} - \frac{36 \left(2 p_{1} - 3 p_{2} \cos{\left(th_{1} - th_{2} \right)}\right) \left(- 3 p_{1} \cos{\left(th_{1} - th_{2} \right)} + 8 p_{2}\right) \sin{\left(th_{1} - th_{2} \right)}}{d^{4} m^{2} \left(16 - 9 \cos^{2}{\left(th_{1} - th_{2} \right)}\right)^{2}}\right) \end{aligned} \]

Parameters

Symbol Default Role
d 1 arm length (sets the gravitational frequency scale)
m 1 arm mass (both arms equal)

State variables: th1, th2, p1, p2

Explore further

Reference

Marion (1965), Classical Dynamics of Particles and Systems, Academic Press
doi:10.1016/c2013-0-12598-6

BibTeX
BibTeX
@misc{doublependulum,
  title = {DoublePendulum system},
  note = {Marion (1965), Classical Dynamics of Particles and Systems, Academic Press},
  doi = {10.1016/c2013-0-12598-6}
}