Interesting Examples of Computational Physics
  • Welcome to the blog of Computational Physics at the IFM!
  • Dynamical Systems
    • The simple pendulum
    • The spherical pendulum
  • The wave equation
    • The simple discretization
    • Boundary conditions
    • Interfaces between mediums
    • Knots on ropes
    • 2D wave equation
  • Time dependent Schrödinger equation
    • The Crank-Nicolson method
    • Free wave packet
    • Quantum Tunneling
    • Harmonic Oscillator
    • Forced Harmonic Oscillator
    • 2D Harmonic Oscillator
    • Wave-particle duality
Powered by GitBook
On this page
  1. Dynamical Systems

The spherical pendulum

PreviousThe simple pendulumNextThe wave equation

Last updated 1 year ago

In this section, we are going to look at the more general case of the simple pendulum. The mass will no longer be constrained to a plane. Since the only restriction on the mass is that its distance to the origin is L, the system has two degrees of freedom. To describe the system, we choose spherical coordinates. The hamiltonian of the system is then:

H=pθ22mL2+pφ22mL2sin⁡2θ+mgLcos⁡θH = \frac{p_{\theta}^2}{2mL^2} + \frac{p_{\varphi}^2}{2mL^2\sin^2\theta}+mgL\cos\thetaH=2mL2pθ2​​+2mL2sin2θpφ2​​+mgLcosθ

Since we have two degrees of freedom, we also have two canonical momenta. The corresponding equations are the following:

θ˙=pθmL2,pθ˙=mgLsin⁡θ+pφ2mL2sin⁡2θtan⁡θ,φ˙=pφmL2sin⁡2θ,pφ˙=0.\begin{align} \dot{\theta} &= \frac{p_{\theta}}{mL^2}, \nonumber \\ \dot{p_{\theta}} &= mgL\sin\theta + \frac{p_{\varphi}^2}{mL^2\sin^2\theta \tan\theta},\nonumber \\ \dot{\varphi} &= \frac{p_{\varphi}}{mL^2\sin^2\theta},\nonumber \\ \dot{p_{\varphi}} &= 0.\nonumber \end{align}θ˙pθ​˙​φ˙​pφ​˙​​=mL2pθ​​,=mgLsinθ+mL2sin2θtanθpφ2​​,=mL2sin2θpφ​​,=0.​

By looking at the equations, we can see that the axial angular momentum is a conserved quantity. This is a consequence of the axial symmetry that the system has. If we set the system to the following initial conditions:

L = 1.0  # Length of the pendulum arm (meters)
g = 9.81 # Gravitational acceleration (m/s^2)
m = 1.0  # Mass (kg)

theta_0   = 2.6  # In radians
p_theta_0 = 0.0  # Theta momentum
phi_0     = 0.0  # In radians 
p_phi_0 = 0.5    # Axial momentum
Nt = 401               # Number of time steps
dt = 0.025             # Time resolution

and evolve it with the Runge-Kutta method, we can obtain the first of these animations:

We can see that the pendulum follows a very peculiar movement, it is not cahotic, but it is definitely not intuitive.

Precession of the pendulum.
Another precession movement but this time, the pendulum has enough energy to flip over.