← all repositories
Shunichi09/PythonLinearNonlinearControl

A control-theory buffet in pure NumPy

Ten classic MPC, DDP, and shooting algorithms implemented with only scipy and numpy, no deep-learning frameworks required.

1k stars Python AgentsML Frameworks
PythonLinearNonlinearControl
Velocity · 7d
+0.4
★ / day
Trend
steady
star history

What it does PythonLinearNonlinearControl is a from-scratch Python toolkit for model-based control. It bundles ten algorithms—linear MPC, iLQR, DDP, CEM, two variants of MPPI, random shooting, and three NMPC flavors—into a modular pipeline of Model, Planner, Controller, and Runner. The goal is to let you prototype trajectory optimization without leaving the NumPy ecosystem.

The interesting bit The library deliberately avoids PyTorch or JAX. That makes it slower, but it also means you can read the source, implement your own dynamics gradients, and actually understand why the optimizer exploded. The README includes a clear matrix showing which algorithms need gradients or Hessians, so you can pick your poison without surprises.

Key highlights

  • Ten algorithms with direct links to the original papers and implementation scripts
  • Five toy environments including cartpole swing-up and two-wheeled tracking
  • Controllers fall back to numeric gradients if you don’t supply analytical ones
  • One-command example runner spits out animations via ffmpeg
  • MIT licensed, though iLQR and DDP are GPL3+

Caveats

  • “Documents: Coming soon !!” has been the status for a while
  • The NMPC-Newton script is listed as “Coming soon” despite being in the algorithm table
  • Parameter tuning (Q, R, Sf) is left entirely to you, and the README warns performance is sensitive to these
  • No GPU acceleration; the “easy to extend” claim assumes you are comfortable writing your own Jacobians

Verdict Worth a look if you are teaching control theory, debugging a custom dynamics model, or simply allergic to framework bloat. Skip it if you need production-grade real-time NMPC or automatic differentiation.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.