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

More from Engineering

Other simulators in this category — or see all 23.

View category →
NewSchool

A* / Dijkstra Pathfinding (Grid)

Interactive 40×28 grid pathfinder: A* (f=g+h), Dijkstra, or greedy best-first; Manhattan / octile / Euclidean heuristics, 4- vs 8-connectivity, paint walls + weighted cells, watch open / closed sets expand.

Launch Simulator
NewUniversity / research

3-Link 3D Arm Inverse Kinematics (CCD)

Continuation of two-link-arm-ik into 3D: 3 revolute joints (yaw + 2 pitches) solved with constrained Cyclic Coordinate Descent. Drag target in 3D or follow a helix / lemniscate / figure-8 trajectory.

Launch Simulator
NewUniversity / research

Bicycle Model & Stanley Controller

Kinematic bicycle (rear-axle): δ = θ_e + atan2(k_e·e, v) Stanley path-following law. Pick oval, race-track, lemniscate, sine-road or S-curve and tune k_e, v, L; live cross-track e(t) and steering δ(t).

Launch Simulator
NewSchool

Stress–Strain & Hooke’s Law

Qualitative σ–ε curve: elastic Hooke region, yield, strain hardening, necking, and fracture. Drag strain and tune E, σ_y, σ_u.

Launch Simulator
NewSchool

Quadcopter 2D (Pitch)

Side view: two rotors, PD on thrust split vs pitch — whiteboard quad slice.

Launch Simulator
NewSchool

Watt Governor (schematic)

Flyballs and sleeve vs RPM; steam throttle gap — speed feedback cartoon.

Launch Simulator
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/Engineering/MPC Pendulum Swing-Up (MPPI)

MPC Pendulum Swing-Up (MPPI)

This interactive simulator explores MPC Pendulum Swing-Up (MPPI) in Engineering. Sampling-based Model Predictive Control: K candidate torque rollouts over horizon H, MPPI cost-weighted update, bounded torque |u|≤u_max — swing up an inverted pendulum live and watch the planner replan. Use the controls to change the scenario; watch the visualization and any graphs or readouts to connect the model with lectures, labs, and homework.

Who it's for: For learners comfortable with heavier math or second-level detail. Typical context: Engineering.

Key terms

  • mpc
  • pendulum
  • swing
  • mppi
  • mpc pendulum
  • engineering

MPC (sampling-based MPPI)

40
120
1.5N·m
1
0.05s
2N·m

Cost weights

8
0.05
0.005
50

Pendulum physics

1kg
0.7m
0.1N·m·s

Difficulty preset

Shortcuts

  • •Pause / Play; tweak horizon, samples, λ on the fly

Measured values

θ0.0°
ω0.00rad/s
u (applied)0.00N·m
deviation 1+cos θ0.000
m·g·L (gravity torque)6.87N·m
direct-lift feasible?no — must swing

How it works

Sampling-based Model Predictive Control (MPPI) drives a damped pendulum from hanging (θ = 0) to the upright fixed point (θ = π) under a bounded torque |u| ≤ u_max. Every Δt the controller samples K candidate torque sequences over a horizon H, simulates each forward with RK4, and re-fits the mean by an exponentially weighted average of the costs (MPPI update with temperature λ). The first action is applied; the plan is shifted and warm-started for the next step. Try the Swing-up preset where u_max < m·g·L: the controller has to *pump* energy by swinging back and forth before catching the inverted equilibrium. Purple lines are the K candidate rollouts; green is the best one.

Key equations

Iθ̈ = − m g L sinθ − bθ̇ + u, |u| ≤ u_max
min J = Σ [q_θ(1+cosθ) + q_ω ω² + r_u u²] + q_term · (1+cosθ_T)²
MPPI: μ_t ← Σ w_k u_t^k / Σ w_k, w_k = exp(−(J_k − J_min)/λ)