Inverted Pendulum Simulator

This tool simulates an inverted pendulum: a mass on top of a light rigid column, pivoted at the ground and held upright by a rotational spring at its base, like a tall building swaying in the wind. A rotational damper resists the motion, and an optional horizontal force pushes on the mass. For small angles its motion follows the ODE below, where θ is the column's angle from vertical (in radians) at time t, θ′ is the angular velocity, θ″ is the angular acceleration, m is the mass, L the height, c the damping, κ the base stiffness, g = 9.81, and F(t) is an external force you choose from a family of common functions.

equation of motion
External Force

Set the parameters and the forcing, then watch the motion, the angle–angular-velocity phase portrait, and the time series move together. Gravity appears in the equation as −mgL, which weakens the base spring. If κ < mgL, the column cannot stand upright and tips over (see Physics & Mathematics).

Motion

inverted pendulum with a base spring
Playback
show forces
t = 0.00
Parameters m, L, c, κ
ODE
Initial condition θ(0), θ′(0)
External forcing F(t), at the top
Solution
Signatures
moment of inertia—
effective stiffness—
natural frequency—
damping ratio—
eigenvalues—
natural (quasi) period—
forcing period—
amplitude of particular solution—
phase lag—
practical resonance—
—
Parameter presets
External force presets