Unit 6 - Notes
Unit 6: State Space Analysis
1. Introduction to State Space Representation
State space analysis is a modern control theory method that provides a more complete description of a system than the classical transfer function approach. It is particularly useful for analyzing Multi-Input Multi-Output (MIMO) systems, non-linear systems, and time-varying systems.
1.1 Core Concepts
- State: The state of a dynamic system is the smallest set of variables whose knowledge at time
t=t₀, together with the knowledge of the input fort ≥ t₀, completely determines the behavior of the system for any timet ≥ t₀. - State Variables: The variables that form the state of the system are called state variables. They are typically denoted as
x₁,x₂, ...,xₙ. - State Vector: A column vector whose elements are the state variables of the system. It is denoted by
x(t).
TEXTx(t) = [x₁(t), x₂(t), ..., xₙ(t)]ᵀ - State Space: The n-dimensional space where the state vector
x(t)represents a point. The trajectory of this point over time describes the system's dynamic behavior.
1.2 State Space Model
A linear time-invariant (LTI) system is represented by two equations:
- The State Equation: A first-order matrix differential equation describing the evolution of the state vector.
TEXTẋ(t) = Ax(t) + Bu(t) - The Output Equation: An algebraic equation that relates the state vector and the input vector to the output vector.
TEXTy(t) = Cx(t) + Du(t)
Where:
x(t): State vector (n x 1)ẋ(t): Derivative of the state vector (n x 1)u(t): Input or control vector (p x 1)y(t): Output vector (q x 1)A: System matrix or State matrix (n x n)B: Input matrix or Control matrix (n x p)C: Output matrix (q x n)D: Feedforward or Direct Transmission matrix (q x p)
2. Conversion: State Space to Transfer Function
A transfer function G(s) = Y(s) / U(s) relates the Laplace transform of the output to the Laplace transform of the input, assuming zero initial conditions.
2.1 Derivation
Given the state space model:
ẋ(t) = Ax(t) + Bu(t)y(t) = Cx(t) + Du(t)
Step 1: Apply Laplace Transform to the State Equation
Assume zero initial conditions, x(0) = 0.
L[ẋ(t)] = L[Ax(t) + Bu(t)]
sX(s) - x(0) = AX(s) + BU(s)
sX(s) = AX(s) + BU(s)
Step 2: Solve for the State Vector X(s)
sX(s) - AX(s) = BU(s)
(sI - A)X(s) = BU(s)
X(s) = (sI - A)⁻¹ BU(s)
Here,
I is the identity matrix of the same dimension as A. The term (sI - A)⁻¹ is the inverse of the matrix (sI - A).
Step 3: Apply Laplace Transform to the Output Equation
L[y(t)] = L[Cx(t) + Du(t)]
Y(s) = CX(s) + DU(s)
Step 4: Substitute X(s) into the Transformed Output Equation
Y(s) = C[(sI - A)⁻¹ BU(s)] + DU(s)
Y(s) = [C(sI - A)⁻¹ B + D] U(s)
Step 5: Identify the Transfer Function G(s)
The transfer function G(s) for a Single-Input Single-Output (SISO) system, or the transfer function matrix for a MIMO system, is:
G(s) = C(sI - A)⁻¹ B + D
Example
Find the transfer function for the system with:
A = [[0, 1], [-2, -3]], B = [[0], [1]], C = [1, 0], D = 0
- Calculate (sI - A):
TEXT(sI - A) = s[[1, 0], [0, 1]] - [[0, 1], [-2, -3]] = [[s, -1], [2, s+3]] - Calculate the inverse (sI - A)⁻¹:
Recall that for a 2x2 matrix[[a, b], [c, d]], the inverse is(1/det) * [[d, -b], [-c, a]].det(sI - A) = s(s+3) - (-1)(2) = s² + 3s + 2(sI - A)⁻¹ = (1 / (s² + 3s + 2)) * [[s+3, 1], [-2, s]]
- Calculate G(s) = C(sI - A)⁻¹ B + D:
TEXTG(s) = [1, 0] * (1 / (s² + 3s + 2)) * [[s+3, 1], [-2, s]] * [[0], [1]] + 0 = (1 / (s² + 3s + 2)) * [1, 0] * [[s+3, 1], [-2, s]] * [[0], [1]] = (1 / (s² + 3s + 2)) * [s+3, 1] * [[0], [1]] = (1 / (s² + 3s + 2)) * [(s+3)*0 + 1*1] = 1 / (s² + 3s + 2)
The transfer function isG(s) = 1 / (s² + 3s + 2).
3. Transfer Function Decomposition (TF to State Space)
This process involves converting a transfer function into a state space model. There are multiple possible state space representations (canonical forms) for a given transfer function.
Given a transfer function:
G(s) = Y(s)/U(s) = (bₘsᵐ + bₘ₋₁sᵐ⁻¹ + ... + b₁) / (sⁿ + aₙ₋₁sⁿ⁻¹ + ... + a₀) where m < n.
3.1 Controllable Canonical Form (CCF)
Also known as the "phase-variable" form. The coefficients of the denominator of the transfer function are used to form the A matrix.
Procedure:
- The last row of the
Amatrix contains the negative coefficients of the denominator polynomial. - The super-diagonal of
Aconsists of ones, and all other elements are zero. - The
Bmatrix is a column vector with a1in the last row and zeros elsewhere. - The
Cmatrix contains the coefficients of the numerator polynomial.
Matrix Forms:
A = [[0, 1, 0, ..., 0],
[0, 0, 1, ..., 0],
...,
[0, 0, 0, ..., 1],
[-a₀, -a₁, -a₂, ..., -aₙ₋₁]]
B = [[0], [0], ..., [0], [1]]
C = [b₀, b₁, b₂, ..., bₘ, 0, ..., 0] (padded with zeros if m < n-1)
D = [bₙ] (if numerator and denominator have same degree, otherwise D=0)
Example:
G(s) = (s + 3) / (s² + 7s + 12)
Here, b₁=1, b₀=3 and a₁=7, a₀=12. The order is n=2.
A = [[0, 1], [-12, -7]]
B = [[0], [1]]
C = [3, 1]
D = [0]
3.2 Observable Canonical Form (OCF)
This is the dual of the CCF.
Procedure:
- The last column of the
Amatrix contains the negative coefficients of the denominator polynomial. - The sub-diagonal of
Aconsists of ones, and all other elements are zero. - The
Cmatrix is[0, 0, ..., 1]. - The
Bmatrix contains the coefficients of the numerator polynomial.
Matrix Forms:
A = [[0, 0, ..., -a₀],
[1, 0, ..., -a₁],
[0, 1, ..., -a₂],
...,
[0, 0, ..., 1, -aₙ₋₁]]ᵀ = [[0, 1, 0, ..., 0],
[0, 0, 1, ..., 0],
...,
[-a₀, -a₁, ..., -aₙ₋₁]]ᵀ
= A_ccfᵀ
B = [[b₀], [b₁], ..., [bₙ₋₁]] = C_ccfᵀ
C = [0, 0, ..., 1] = B_ccfᵀ
D = [bₙ]
Note:
A_ocf = A_ccfᵀ, B_ocf = C_ccfᵀ, C_ocf = B_ccfᵀ. This is the principle of duality.
Example:
G(s) = (s + 3) / (s² + 7s + 12)
b₁=1, b₀=3 and a₁=7, a₀=12.
A = [[0, -12], [1, -7]]
B = [[3], [1]]
C = [0, 1]
D = [0]
3.3 Diagonal (or Parallel) Canonical Form
This form is used when the poles of the transfer function are distinct. The A matrix becomes a diagonal matrix with the system's poles (eigenvalues) on the diagonal.
Procedure:
- Expand the transfer function using partial fraction expansion.
G(s) = r₁/(s-p₁) + r₂/(s-p₂) + ... + rₙ/(s-pₙ) + D
wherepᵢare the poles andrᵢare the residues. - Construct the state-space matrices.
Matrix Forms (for distinct poles):
A = [[p₁, 0, ..., 0],
[0, p₂, ..., 0],
...,
[0, 0, ..., pₙ]]
B = [[1], [1], ..., [1]]
C = [r₁, r₂, ..., rₙ]
D = [value from partial fraction expansion, often 0]
Note: If any poles are repeated, the system cannot be fully diagonalized. The resulting
A matrix will be in Jordan Canonical Form, which has the eigenvalues on the diagonal and ones on the super-diagonal for blocks corresponding to repeated eigenvalues.
4. Solutions of State Equations
The solution of the state equation ẋ = Ax + Bu describes the system's state vector x(t) over time.
4.1 The State Transition Matrix (STM)
The STM, denoted by Φ(t), relates the state of the system at time t to the state at time t₀ for a zero-input system (u(t)=0).
For an LTI system, Φ(t) = e^(At).
Properties of the STM:
Φ(0) = e^(A*0) = I(Identity matrix)Φ(t₁)Φ(t₂) = Φ(t₁ + t₂)Φ⁻¹(t) = Φ(-t)d/dt [Φ(t)] = A Φ(t)
4.2 Solution of the Homogeneous Equation (Zero-Input Response)
For u(t) = 0, the state equation is ẋ = Ax.
The solution gives the system's response to its initial conditions x(0).
Derivation:
Taking the Laplace transform of ẋ = Ax:
sX(s) - x(0) = AX(s)
(sI - A)X(s) = x(0)
X(s) = (sI - A)⁻¹ x(0)
Taking the inverse Laplace transform:
x(t) = L⁻¹[(sI - A)⁻¹] x(0)
We define
e^(At) = L⁻¹[(sI - A)⁻¹]. Therefore, the solution is:x(t) = e^(At) x(0) = Φ(t) x(0)
4.3 Solution of the Non-Homogeneous Equation (Complete Response)
The complete solution for ẋ = Ax + Bu is the sum of the zero-input response (ZIR) and the zero-state response (ZSR).
Derivation using Integrating Factor:
Rewrite as ẋ - Ax = Bu. The integrating factor is e^(-At).
e^(-At)(ẋ - Ax) = e^(-At)Bu
d/dt [e^(-At)x(t)] = e^(-At)Bu
Integrate both sides from
0 to t:∫[0, t] d/dτ [e^(-Aτ)x(τ)] dτ = ∫[0, t] e^(-Aτ)Bu(τ) dτ
[e^(-Aτ)x(τ)] from 0 to t = ∫[0, t] e^(-Aτ)Bu(τ) dτ
e^(-At)x(t) - e⁰x(0) = ∫[0, t] e^(-Aτ)Bu(τ) dτ
Solving for
x(t):e^(-At)x(t) = x(0) + ∫[0, t] e^(-Aτ)Bu(τ) dτ
x(t) = e^(At)x(0) + e^(At)∫[0, t] e^(-Aτ)Bu(τ) dτ
The final form is obtained by moving
e^(At) inside the integral:x(t) = e^(At)x(0) + ∫[0, t] e^(A(t-τ))Bu(τ)dτ
Complete Solution Breakdown:
- Zero-Input Response (ZIR):
e^(At)x(0)- Response due to initial conditions. - Zero-State Response (ZSR):
∫[0, t] e^(A(t-τ))Bu(τ)dτ- Response due to the input signal.
5. Computing the State Transition Matrix e^(At)
5.1 Laplace Inverse Method
This method directly uses the definition derived from solving the state equation.
Formula:
e^(At) = L⁻¹[(sI - A)⁻¹]
Procedure:
- Construct the matrix
(sI - A). - Calculate the inverse of this matrix,
(sI - A)⁻¹ = adj(sI - A) / det(sI - A). - Take the inverse Laplace transform of each element of the resulting matrix.
Example:
Find e^(At) for A = [[0, 1], [-2, -3]]
(sI - A) = [[s, -1], [2, s+3]]det(sI - A) = s² + 3s + 2 = (s+1)(s+2)
(sI - A)⁻¹ = (1 / (s+1)(s+2)) * [[s+3, 1], [-2, s]]
= [[ (s+3)/((s+1)(s+2)), 1/((s+1)(s+2)) ], [ -2/((s+1)(s+2)), s/((s+1)(s+2)) ]]- Take the inverse Laplace transform of each element using partial fractions:
(s+3)/((s+1)(s+2)) = 2/(s+1) - 1/(s+2)=>2e⁻ᵗ - e⁻²ᵗ1/((s+1)(s+2)) = 1/(s+1) - 1/(s+2)=>e⁻ᵗ - e⁻²ᵗ-2/((s+1)(s+2)) = -2/(s+1) + 2/(s+2)=>-2e⁻ᵗ + 2e⁻²ᵗs/((s+1)(s+2)) = -1/(s+1) + 2/(s+2)=>-e⁻ᵗ + 2e⁻²ᵗ
Result:
e^(At) = [[2e⁻ᵗ - e⁻²ᵗ, e⁻ᵗ - e⁻²ᵗ],
[-2e⁻ᵗ + 2e⁻²ᵗ, -e⁻ᵗ + 2e⁻²ᵗ]]
5.2 Caley-Hamilton Theorem Method
Theorem: Every square matrix A satisfies its own characteristic equation. If Δ(λ) = det(λI - A) = 0 is the characteristic equation, then Δ(A) = 0.
Procedure:
- Find the characteristic equation
det(λI - A) = 0and its roots (the eigenvaluesλ₁, λ₂, ...). - Any analytical function of
A, such ase^(At), can be expressed as a polynomial inAof degreen-1:
e^(At) = α₀(t)I + α₁(t)A + ... + αₙ₋₁(t)Aⁿ⁻¹ - This relationship also holds for the eigenvalues:
e^(λᵢt) = α₀(t) + α₁(t)λᵢ + ... + αₙ₋₁(t)λᵢⁿ⁻¹ - Form a system of
nlinear equations by substituting each eigenvalueλᵢinto the equation from step 3.- If eigenvalues are repeated, differentiate the equation with respect to
λand then substitute the repeated eigenvalue. For an eigenvalueλrepeatedktimes, you getkequations.
- If eigenvalues are repeated, differentiate the equation with respect to
- Solve the system of equations to find the coefficients
α₀(t), α₁(t), .... - Substitute these coefficients back into the matrix polynomial from step 2 to find
e^(At).
Example:
Find e^(At) for A = [[0, 1], [-2, -3]]
det(λI - A) = λ² + 3λ + 2 = 0.
Eigenvalues areλ₁ = -1,λ₂ = -2.n=2, so the polynomial is of degree 1:e^(At) = α₀(t)I + α₁(t)A.- The relationship for eigenvalues is
e^(λt) = α₀(t) + α₁(t)λ. - Substitute the eigenvalues:
- For
λ₁ = -1:e⁻ᵗ = α₀(t) - α₁(t) - For
λ₂ = -2:e⁻²ᵗ = α₀(t) - 2α₁(t)
- For
- Solve for
α₀(t)andα₁(t):- Subtracting the two equations:
e⁻ᵗ - e⁻²ᵗ = α₁(t) - Substituting
α₁(t)back:e⁻ᵗ = α₀(t) - (e⁻ᵗ - e⁻²ᵗ)=>α₀(t) = 2e⁻ᵗ - e⁻²ᵗ
- Subtracting the two equations:
- Substitute coefficients back into the matrix polynomial:
TEXTe^(At) = (2e⁻ᵗ - e⁻²ᵗ)I + (e⁻ᵗ - e⁻²ᵗ)A = (2e⁻ᵗ - e⁻²ᵗ) [[1, 0], [0, 1]] + (e⁻ᵗ - e⁻²ᵗ) [[0, 1], [-2, -3]] = [[2e⁻ᵗ - e⁻²ᵗ, 0], [0, 2e⁻ᵗ - e⁻²ᵗ]] + [[0, e⁻ᵗ - e⁻²ᵗ], [-2(e⁻ᵗ - e⁻²ᵗ), -3(e⁻ᵗ - e⁻²ᵗ)]] = [[2e⁻ᵗ - e⁻²ᵗ, e⁻ᵗ - e⁻²ᵗ], [-2e⁻ᵗ + 2e⁻²ᵗ, -e⁻ᵗ + 2e⁻²ᵗ]]
This result matches the Laplace Inverse method.
6. Controllability and Observability
These are two fundamental concepts in modern control theory that determine the feasibility of control and state estimation.
6.1 Controllability
Definition: A system is completely state controllable if it is possible to transfer the system from any arbitrary initial state x(t₀) to any desired final state x(t_f) in a finite time interval [t₀, t_f] using some unconstrained control input u(t).
In simple terms: Can the inputs affect all of the state variables?
Kalman's Test for Controllability:
A system is completely state controllable if and only if the controllability matrix Q_c has full rank n.
rank(Q_c) = n
The controllability matrix Q_c is an n x np matrix defined as:
Q_c = [B AB A²B ... Aⁿ⁻¹B]
For a system to be controllable, the determinant of
Q_c must be non-zero (if p=1, so Q_c is square).
Example:
Is the system controllable? A = [[0, 1], [-2, -3]], B = [[0], [1]]
n=2. We need to formQ_c = [B AB].B = [[0], [1]]AB = [[0, 1], [-2, -3]] * [[0], [1]] = [[1], [-3]]- Form
Q_c:
Q_c = [[0, 1], [1, -3]] - Check the rank by calculating the determinant:
det(Q_c) = (0)*(-3) - (1)*(1) = -1 ≠ 0
Since the determinant is non-zero, the rank is 2 (which isn). The system is controllable.
6.2 Observability
Definition: A system is completely observable if any initial state x(t₀) can be uniquely determined from the knowledge of the system's output y(t) and input u(t) over a finite time interval [t₀, t_f].
In simple terms: Can the state variables be determined by observing the outputs?
Kalman's Test for Observability:
A system is completely observable if and only if the observability matrix Q_o has full rank n.
rank(Q_o) = n
The observability matrix Q_o is a qn x n matrix defined as:
Q_o = [C; CA; CA²; ...; CAⁿ⁻¹] (where ; denotes stacking rows)
or alternatively, its transpose is often used:
Q_oᵀ = [Cᵀ AᵀCᵀ (Aᵀ)²Cᵀ ... (Aᵀ)ⁿ⁻¹Cᵀ]
For a system to be observable, the determinant of Q_o must be non-zero (if q=1, so Q_o is square).
Example:
Is the system observable? A = [[0, 1], [-2, -3]], C = [1, 0]
n=2. We need to formQ_o = [C; CA].C = [1, 0]CA = [1, 0] * [[0, 1], [-2, -3]] = [0, 1]- Form
Q_o:
Q_o = [[1, 0], [0, 1]](The identity matrix) - Check the rank by calculating the determinant:
det(Q_o) = (1)*(1) - (0)*(0) = 1 ≠ 0
Since the determinant is non-zero, the rank is 2 (which isn). The system is observable.