Unit 6 - Notes

ECE305 12 min read

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 for t ≥ t₀, completely determines the behavior of the system for any time t ≥ 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).
    TEXT
        x(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:

  1. The State Equation: A first-order matrix differential equation describing the evolution of the state vector.
    TEXT
        ẋ(t) = Ax(t) + Bu(t)
        
  2. The Output Equation: An algebraic equation that relates the state vector and the input vector to the output vector.
    TEXT
        y(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:

  1. ẋ(t) = Ax(t) + Bu(t)
  2. y(t) = Cx(t) + Du(t)

Step 1: Apply Laplace Transform to the State Equation
Assume zero initial conditions, x(0) = 0.

TEXT
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)

TEXT
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

TEXT
L[y(t)] = L[Cx(t) + Du(t)]
Y(s) = CX(s) + DU(s)

Step 4: Substitute X(s) into the Transformed Output Equation

TEXT
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:

TEXT
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

  1. Calculate (sI - A):
    TEXT
        (sI - A) = s[[1, 0], [0, 1]] - [[0, 1], [-2, -3]]
                 = [[s, -1], [2, s+3]]
        
  2. 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]]
  3. Calculate G(s) = C(sI - A)⁻¹ B + D:
    TEXT
        G(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 is G(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:

  1. The last row of the A matrix contains the negative coefficients of the denominator polynomial.
  2. The super-diagonal of A consists of ones, and all other elements are zero.
  3. The B matrix is a column vector with a 1 in the last row and zeros elsewhere.
  4. The C matrix contains the coefficients of the numerator polynomial.

Matrix Forms:

TEXT
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.

TEXT
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:

  1. The last column of the A matrix contains the negative coefficients of the denominator polynomial.
  2. The sub-diagonal of A consists of ones, and all other elements are zero.
  3. The C matrix is [0, 0, ..., 1].
  4. The B matrix contains the coefficients of the numerator polynomial.

Matrix Forms:

TEXT
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.

TEXT
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:

  1. Expand the transfer function using partial fraction expansion.
    G(s) = r₁/(s-p₁) + r₂/(s-p₂) + ... + rₙ/(s-pₙ) + D
    where pᵢ are the poles and rᵢ are the residues.
  2. Construct the state-space matrices.

Matrix Forms (for distinct poles):

TEXT
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:

  1. Φ(0) = e^(A*0) = I (Identity matrix)
  2. Φ(t₁)Φ(t₂) = Φ(t₁ + t₂)
  3. Φ⁻¹(t) = Φ(-t)
  4. 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:

TEXT
sX(s) - x(0) = AX(s)
(sI - A)X(s) = x(0)
X(s) = (sI - A)⁻¹ x(0)

Taking the inverse Laplace transform:
TEXT
x(t) = L⁻¹[(sI - A)⁻¹] x(0)

We define e^(At) = L⁻¹[(sI - A)⁻¹]. Therefore, the solution is:
TEXT
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).

TEXT
e^(-At)(ẋ - Ax) = e^(-At)Bu
d/dt [e^(-At)x(t)] = e^(-At)Bu

Integrate both sides from 0 to t:
TEXT
∫[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):
TEXT
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:
TEXT
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:

  1. Construct the matrix (sI - A).
  2. Calculate the inverse of this matrix, (sI - A)⁻¹ = adj(sI - A) / det(sI - A).
  3. Take the inverse Laplace transform of each element of the resulting matrix.

Example:
Find e^(At) for A = [[0, 1], [-2, -3]]

  1. (sI - A) = [[s, -1], [2, s+3]]
  2. 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)) ]]
  3. 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:

TEXT
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:

  1. Find the characteristic equation det(λI - A) = 0 and its roots (the eigenvalues λ₁, λ₂, ...).
  2. Any analytical function of A, such as e^(At), can be expressed as a polynomial in A of degree n-1:
    e^(At) = α₀(t)I + α₁(t)A + ... + αₙ₋₁(t)Aⁿ⁻¹
  3. This relationship also holds for the eigenvalues:
    e^(λᵢt) = α₀(t) + α₁(t)λᵢ + ... + αₙ₋₁(t)λᵢⁿ⁻¹
  4. Form a system of n linear 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 λ repeated k times, you get k equations.
  5. Solve the system of equations to find the coefficients α₀(t), α₁(t), ....
  6. 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]]

  1. det(λI - A) = λ² + 3λ + 2 = 0.
    Eigenvalues are λ₁ = -1, λ₂ = -2.
  2. n=2, so the polynomial is of degree 1: e^(At) = α₀(t)I + α₁(t)A.
  3. The relationship for eigenvalues is e^(λt) = α₀(t) + α₁(t)λ.
  4. Substitute the eigenvalues:
    • For λ₁ = -1: e⁻ᵗ = α₀(t) - α₁(t)
    • For λ₂ = -2: e⁻²ᵗ = α₀(t) - 2α₁(t)
  5. Solve for α₀(t) and α₁(t):
    • Subtracting the two equations: e⁻ᵗ - e⁻²ᵗ = α₁(t)
    • Substituting α₁(t) back: e⁻ᵗ = α₀(t) - (e⁻ᵗ - e⁻²ᵗ) => α₀(t) = 2e⁻ᵗ - e⁻²ᵗ
  6. Substitute coefficients back into the matrix polynomial:
    TEXT
        e^(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:

TEXT
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]]

  1. n=2. We need to form Q_c = [B AB].
  2. B = [[0], [1]]
  3. AB = [[0, 1], [-2, -3]] * [[0], [1]] = [[1], [-3]]
  4. Form Q_c:
    Q_c = [[0, 1], [1, -3]]
  5. 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 is n). 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:

TEXT
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]

  1. n=2. We need to form Q_o = [C; CA].
  2. C = [1, 0]
  3. CA = [1, 0] * [[0, 1], [-2, -3]] = [0, 1]
  4. Form Q_o:
    Q_o = [[1, 0], [0, 1]] (The identity matrix)
  5. 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 is n). The system is observable.