State-Space Introduction
State-space models describe systems using internal variables rather than only input-output equations. A state is a minimal set of variables that, together with the future input, determines the future output. This viewpoint is especially useful for multi-input multi-output systems, interconnected systems, simulation, and modern control.
In a signals and systems course, state space complements convolution and transform methods. Convolution emphasizes the impulse response of an LTI system. Transform methods emphasize poles, zeros, and frequency response. State space emphasizes first-order vector dynamics and internal structure. The same system can often be represented in all three ways.
Definitions
A continuous-time linear time-invariant state-space model is
Here is the state vector, is the input, is the output, and are constant matrices of compatible dimensions. Many books use for the state, but these notes use for state to avoid conflict with the input signal .
A discrete-time LTI state-space model is
The matrix controls internal dynamics. The matrix injects the input into the state. The matrix maps state to output. The matrix is a direct feedthrough term from input to output.
For continuous time, the zero-input response is
where the matrix exponential is
The zero-state response is
Thus
For discrete time,
The continuous-time transfer function for zero initial conditions is
The discrete-time transfer function is
Key results
State-space models convert higher-order scalar equations into first-order vector equations. For example, a second-order differential equation can be represented by choosing state variables such as position and velocity. This is not just bookkeeping: first-order vector form makes interconnection, simulation, and eigenvalue analysis systematic.
The eigenvalues of are the natural modes of the system. In continuous time, a mode associated with eigenvalue behaves like . For causal finite-dimensional LTI systems, internal asymptotic stability requires
for every eigenvalue of . In discrete time, modes behave like , and internal asymptotic stability requires
The transfer function denominator is related to
or
although pole-zero cancellations can hide internal modes from the input-output transfer function. This is one reason state-space analysis can reveal behavior that a transfer function alone may obscure.
For a continuous-time state-space model with impulse input and zero initial state, the impulse response is
in the single-input single-output case. The term represents direct feedthrough.
For discrete time, the impulse response is
and for ,
These formulas connect state space back to convolution.
State choice is not unique. If is a valid state, then is also a valid state for any invertible matrix , with transformed matrices
The transfer function is unchanged by this similarity transformation. This means state variables are coordinates for internal behavior, not directly observable physical quantities unless they are chosen that way.
Two structural ideas often appear after the introductory treatment. Controllability asks whether inputs can move the state through the whole state space. Observability asks whether outputs contain enough information to determine the state. A transfer function can hide uncontrollable or unobservable modes through pole-zero cancellation, while a state-space model can expose them. For this introductory page, the important point is that state space contains internal information beyond the external input-output formula.
For numerical simulation, state-space form is practical because first-order update rules are natural for computers. Continuous-time models can be integrated with ODE solvers, and discrete-time models can be iterated directly. This is one reason state-space notation is common in control, estimation, signal processing, and physics-based modeling.
The input-output transfer function assumes zero initial conditions, but state-space equations naturally include nonzero initial state. This distinction matters physically. A circuit capacitor may already be charged, a mass may already be moving, or a filter memory may contain previous samples. Transform methods can handle these cases, but state space makes the stored internal information explicit from the start.
Dimensions are a useful sanity check. If the state has length , then is . For a single input, is . For a single output, is . Checking matrix shapes often catches an incorrect state choice before any algebra is done.
Visual
| Representation | Main object | Best for | Typical equation |
|---|---|---|---|
| Convolution | impulse response | LTI input-output response | |
| Fourier response | or | filtering and spectra | |
| Laplace / | or with ROC | poles, stability, transients | rational system functions |
| State space | internal dynamics and MIMO systems |
Worked example 1: building a state model from a differential equation
Problem: Convert the differential equation
to continuous-time state-space form using
Method:
- Write the first state equation:
- Use the differential equation to solve for the second derivative:
- Substitute states:
- Arrange in matrix form:
- The output is , so
Checked answer:
The eigenvalues of are and , matching the natural modes of the differential equation.
Worked example 2: impulse response from discrete-time state space
Problem: A discrete-time system is defined by
with zero initial state. Find its impulse response.
Method:
- Identify matrices:
- For discrete-time state space, the impulse response satisfies
- For ,
- Substitute scalar values:
- Combine with the step:
Checked answer:
The system is causal and stable because the state eigenvalue has magnitude .
Code
import numpy as np
from scipy.signal import StateSpace, impulse
import matplotlib.pyplot as plt
A = np.array([[0, 1], [-2, -3]], dtype=float)
B = np.array([[0], [1]], dtype=float)
C = np.array([[1, 0]], dtype=float)
D = np.array([[0]], dtype=float)
eigvals = np.linalg.eigvals(A)
print("continuous-time eigenvalues:", eigvals)
sys = StateSpace(A, B, C, D)
t, y = impulse(sys, T=np.linspace(0, 8, 400))
n = np.arange(0, 12)
h_dt = np.where(n >= 1, 0.5 ** (n - 1), 0.0)
fig, ax = plt.subplots(1, 2, figsize=(10, 3))
ax[0].plot(t, y)
ax[0].set_title("CT impulse response")
ax[0].grid(True)
ax[1].stem(n, h_dt)
ax[1].set_title("DT state-space impulse response")
ax[1].grid(True)
plt.tight_layout()
plt.show()
Common pitfalls
- Using for both input and state without clarifying notation.
- Forgetting the direct feedthrough term , especially in impulse-response formulas.
- Assuming transfer-function stability always reveals internal stability. Hidden modes can be canceled in input-output form.
- Confusing continuous-time stability conditions with discrete-time ones. CT uses left half-plane; DT uses inside the unit circle.
- Treating state variables as unique. Many different state choices can represent the same input-output behavior.