r/ControlTheory

Random thought

Its a sunday, so as a casual timepass you think, let me just write some code to check the controllability of a state space equation. so you start writing it, then realise, higher powers of matrices can lead to numerical instability. so now, you decide to study the controllability gramian and then you realise you don't fully understand why the gramian works, so now you are trying to look in lyapunov and his equations, then his theory starts talking about energy functions and positive definite matrices, so obviously, you open Gilbert Strang's video on symmetric and positive definite matrices. while watching that, you realise the code also requires an actual algorithm, so now you're studying numerical linear algebra. gaussian elimination. cholesky decomposition. At this point, what started as a sunday timepass has somehow turned into a full semester course. And then you decide to leave it and use the MATLAB command instead, so you stare at the screen for a while, reconsider your life decisions, and think maybe teaching high school students wasn't such a bad decision after all.

reddit.com
u/night_Crawler_29 — 11 days ago
▲ 23 r/ControlTheory+2 crossposts

controlsys v1.12.0: a control-systems toolbox for Go (MIT)

controlsys is a Go package for linear control systems. It works on continuous-time and discrete-time models. The main model form is state space.

Main capabilities:

  • Models: state space, transfer function, zero-pole-gain (ZPK), frequency-response data (FRD), model arrays and tunable blocks.
  • Analysis: Bode, Nyquist and Nichols plots, gain and phase margins, disk margins and step metrics.
  • Design: LQR, LQG, Kalman filters, H2 and H-infinity synthesis, pole placement and PID tuning.
  • Simulation: step, impulse, initial-condition and arbitrary-input responses.
  • Model reduction: balanced truncation and modal truncation.
  • Delays: input, output and internal delays, with Pade and Thiran approximations.
  • Conversion: ZOH, FOH, Tustin, matched, impulse and least-squares methods between continuous and discrete time, in both directions and for resampling. We test the results against MATLAB behaviour.

New in v1.12.0:

  • Tustin conversion with Thiran filters is approximately 30% faster than in v1.11.0.
  • Tustin conversion with Thiran filters now supports MIMO models with delays on individual input-to-output paths.
  • ThiranDelay now accepts short delays when the filter is stable.

Install:

go get plantcontrol.org/v1/controlsys

Repo: https://github.com/PlantControl/controlsys
Release notes: https://github.com/PlantControl/controlsys/releases/tag/v1.12.0

We want your feedback, especially from people who use MATLAB or python-control.

u/8bitjam — 12 days ago