Cart & inverted pendulum
The cart–inverted-pendulum is the benchmark plant for teaching manual balancing and linear–quadratic control. This page integrates the planar coupled equations with an adjustable horizontal force F. Accelerations are obtained each sub-step by solving the 2×2 linear system from ΣF and Στ about the pendulum pivot on the cart. There is no sensor noise, no motor saturation model, and no automatic LQR — only your choice of F.
Who it's for: Controls courses and advanced undergrad mechanics labs.
Key terms
- Inverted pendulum
- Cart-pole
- Underactuated system
- Nonlinear coupling
- Manual control
How it works
Planar cart of mass M with a point mass m on a rigid rod of length L. You apply horizontal force F; accelerations are solved from the coupled linear system each sub-step, then positions are updated (explicit Euler). Try balancing θ ≈ 0 with gentle nudges — LQR is left as an extension.
Frequently asked questions
- Why does the description no longer claim symplectic integration?
- The implementation uses an explicit update with accelerations from the instantaneous configuration; it is simple and robust for play, not a symplectic splitting integrator.
- Can I stabilize θ = 0 with constant F?
- Not globally; the inverted equilibrium is unstable without feedback that reacts to θ and θ̇ (or a swing-up strategy).
More from Classical Mechanics
Other simulators in this category — or see all 84.
Woodpecker Toy
Stick–slip sleeve on a rod: static hold, spring loading, then kinetic slip — a qualitative hop cycle.
Vortex Ring (Smoke Ring)
Self-propelling toroidal vortex shown as a 2D cross-section: counter-rotating Lamb–Oseen pair drifts at V_self ≈ Γ/(4πa).
Rayleigh–Taylor Instability
Heavy fluid above light: Fourier modes grow as exp(σt) with σ = √(A g k); mushrooming fingers reach down.
Faraday Waves
Vertical parametric drive of a thin liquid layer: Mathieu sub-harmonic instability locks stripes, squares or hexagons.
Airfoil Streamlines (Joukowski)
Potential flow over a Joukowski airfoil: stream-function bands with the Kutta condition fixing circulation.
Projectile Motion
Launch projectiles with adjustable angle, velocity, and gravity. Trace parabolic paths with real-time graphs.