State-Space Representation Basics: Complete Beginner's Guide
State-space representation describes a dynamic system with a set of first-order differential equations instead of one large high-order equation. We collect every quantity that captures the system's present condition, called state variables, into a single column vector x. From the current state vector and the inputs acting on the system, its entire future behaviour can be predicted.
This form matters because modern control must handle many inputs and many outputs at once, which transfer functions handle poorly. State-space models are the starting point for state feedback, optimal control and computer simulation. Drone autopilots, car cruise controllers and robot balance systems are all designed this way.
Key Concepts
- State vector x: n state variables forming the smallest set of numbers that fully describes the system's present condition, for example position and velocity of a moving mass.
- Input vector u and output vector y: the m signals we can apply (motor voltage, force) and the p signals we measure (sensor readings).
- System matrix A (n by n): describes how the state evolves on its own with no input.
- Input matrix B (n by m): describes how each input pushes each state.
- Output matrix C (p by n): describes which combinations of states appear in the measurements.
- Feedthrough matrix D (p by m): any direct path from input to output; zero in most physical systems.
Formulas
- State equation: dx/dt = A·x + B·u. The rate of change of every state is a linear combination of current states and inputs.
- Output equation: y = C·x + D·u. Measurements are a linear combination of states and inputs.
- Transfer function: G(s) = C·inv(sI − A)·B + D, linking the state-space model to the classical frequency-domain view.
- Stability: the system is stable only if every eigenvalue of A has a negative real part.
- Assumption: A, B, C, D are constant (linear, time-invariant). Nonlinear systems are linearized around an operating point first.
Worked Example
Take a mass-spring-damper: 2 kg mass, spring 8 N/m, damper 4 N·s/m, pushed by force F. The physics equation is 2·x'' + 4·x' + 8·x = F. Choose states x1 = position (m), x2 = velocity (m/s). Then dx1/dt = x2, and dividing by 2 gives dx2/dt = −4·x1 − 2·x2 + 0.5·F. Reading off: A = [[0, 1], [−4, −2]], B = [[0], [0.5]], C = [[1, 0]], D = [[0]].
Find the resting position under constant F = 10 N. At rest x2 = 0 and dx2/dt = 0, so −4·x1 + 0.5·10 = 0, giving x1 = 1.25 m. This matches spring physics directly: x = F/k = 10/8 = 1.25 m. The matrices pass the sanity check.
Common Misconceptions
- Every state must be measurable. Not true. States are mathematical; an observer such as a Kalman filter estimates the hidden ones from available measurements.
- The A matrix is always constant. Only for linear time-invariant systems. Real systems like rockets are linearized around each operating point.
- More states give a better model. Use the minimum that captures the dynamics. Extra states add computation without information.
Real-World Applications
- Drone flight controllers feed back estimated position and velocity states many times per second to stay level.
- Chemical plants regulate reactor temperature and concentration with controllers built from state-space plant models.
- Power grids use state estimation to monitor network voltages and hold the 50 Hz frequency stable.
State-space form turns any dynamic system into two clean matrix equations that both engineers and computers can work with. Once you can write down A, B, C and D, you unlock simulation, stability checks, observers and optimal controllers.
Related blogs
- Transfer Functions and Block Diagram Reduction For students.
- Signal Flow Graphs: Complete Beginner's Guide For students.
- Time Response of First and Second Order Systems Guide.
- Stability: Routh-Hurwitz Criterion With easy examples.
- Root Locus Techniques: Complete Beginner's Guide Guide.
- Frequency Response: Bode and Nyquist Plots For students.