part 3 · Foundations of Control Systems
A Primer on State-Space Models
Writing a mechanical system in state-space form, and reading its stability from the eigenvalues of one matrix.
A transfer function describes how one input affects one output. A state-space model keeps track of the internal variables as well, which makes it a natural fit for systems with several inputs and outputs and for computation. This primer builds a state-space model from a familiar example and shows what its main matrix tells you.
From a differential equation to states
A mass on a spring with stiffness and a damper with coefficient , driven by a force , obeys
where is the displacement. This is a second-order equation. To get a first-order vector equation, choose the state variables and . Then and , which in matrix form is
The general linear time-invariant form is
| Symbol | Meaning | Size for states, inputs, outputs |
|---|---|---|
| State vector | ||
| Input vector | ||
| Output vector | ||
| How the state evolves on its own | ||
| How inputs enter the state | ||
| How the state appears in the output | ||
| Direct path from input to output |
In the example , since the force does not affect the displacement instantaneously.
Stability from the eigenvalues of A
With the solution is . It decays to zero for every initial condition if and only if every eigenvalue of has a negative real part. For the example the characteristic polynomial is
with roots
For positive , and both roots have negative real part, so the damped oscillator is stable. When the roots form a complex pair, and the system oscillates while it decays.
import numpy as np
m, c, k = 1.0, 0.5, 4.0
A = np.array([[0.0, 1.0],
[-k / m, -c / m]])
print(np.linalg.eigvals(A)) # approximately -0.25 + 1.984j and -0.25 - 1.984j
The real part, , sets the decay rate. The imaginary part, , sets the oscillation frequency in radians per second.
Why it is worth the extra notation
The same form describes a single mass or a robot arm with many joints, and standard linear algebra routines operate on it directly. The limits matter too. The model above is linear, so a real spring that stiffens or a damper that saturates needs linearization around an operating point, and the conclusions then hold only near that point.