PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry
ENRUESPTFRDE

Related simulators

Similar topics nearby (including related fields) — or browse all 85 in Classical Mechanics.

View category →
NewSchool

Huygens Pendulum Sync

Launch Simulator

Two pendula + κ(θ₁−θ₂) on shared beam; phases drift toward lock.

NewFeaturedUniversity / research

Double Pendulum

Launch Simulator

Mesmerizing chaotic motion with path tracing.

NewSchool

Center of Mass System

Launch Simulator

2–4 bodies or rod: R_cm, V_cm; explosion with ΣΔp = 0; |P| and |V_cm| graphs.

NewUniversity / research

Poincaré Section (Double Pendulum)

Launch Simulator

(θ₁, ω₁) when sin θ₂ crosses 0 with ω₂>0; RK4, chaotic return map.

NewUniversity / research

Cart–Pole: LQR vs MPC vs PID

Launch Simulator

Nonlinear cart inverted pendulum: linearize about upright φ = θ, discrete-time LQR from DARE (Q, R → K), finite-horizon LQ MPC with DARE terminal cost, and hand-tuned PID — same force limit, kicks, and plant as the mechanics cart-pole.

NewSchool

Pendulum Collision

Launch Simulator

Two bobs: hit along normal, e elastic; θ¨ between hits vs 1D collisions.

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Classical Mechanics/Cart & inverted pendulum

Cart & inverted pendulum

Horizontal force on a cart with a hinged rod: coupled (M+m)ẍ and mL²θ̈ integrated for manual balancing.

Plant

1.2 kg
0.22 kg
0.55 m
0 N
HintTune F to fight the fall

About this model

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).