Engineering Mathematics II

Chapter 7
Systems of Differential Equations and State-Space Models

Bachelor Program in Mechatronics Engineering
Engineering Mathematics II   •   Bachelor

Systems of Differential Equations and State-Space Models

Introduction and Context

Mechatronic systems combine mechanical, electrical, electronic, computer, and control subsystems. These subsystems are coupled: motor current produces torque, torque produces motion, motion may generate back electromotive force, and sensors feed measurements to a controller. A single differential equation is often insufficient to describe such interactions. Systems of differential equations and state-space models provide a systematic mathematical framework for representing, analysing, and designing these systems.

A state-space model expresses a dynamic system as a set of first-order differential equations. In matrix form, the continuous-time linear time-invariant (LTI) model is

ẋ(t) = Ax(t) + Bu(t)
y(t) = Cx(t) + Du(t)

Here, x(t) ∈ ℝⁿ is the state vector, u(t) ∈ ℝᵐ is the input vector, y(t) ∈ ℝᵖ is the output vector, A is the n × n system matrix, B is the n × m input matrix, C is the p × n output matrix, and D is the p × m direct-feedthrough matrix. A, B, C, and D may be constant for an LTI model or time-dependent for a linear time-varying model.

State-space methods are important because they handle multiple inputs and outputs naturally, include initial conditions directly, and support eigenvalue, stability, controllability, observability, simulation, and feedback analysis.

Learning Objectives

By the end of this chapter, the reader should be able to:

  1. Formulate coupled physical systems as first-order matrix differential equations.
  2. Construct state-space models from mechanical and electrical laws.
  3. Solve homogeneous systems using eigenvalues and eigenvectors.
  4. Interpret modes, modal coordinates, and phase portraits.
  5. Assess continuous-time stability from system eigenvalues.
  6. Explain controllability and its engineering significance.
  7. Calculate system responses using the matrix exponential and convolution.
  8. Recognise modelling assumptions, limitations, and implementation issues.

1. From Coupled Equations to First-Order Form

Many physical models initially appear as higher-order or coupled equations. For example, a two-degree-of-freedom mechanical system may be represented by

M q̈(t) + K q(t) = F u(t)

where q(t) ∈ ℝⁿ is the displacement vector, M is the mass matrix, K is the stiffness matrix, F maps actuator inputs into forces, and u(t) is the input vector. For a conventional mechanical system, M and K have units kg and N/m respectively, while q has units m and u has units appropriate to the actuator.

To obtain a first-order model, define the state vector

x(t) = [ q(t) ; q̇(t) ]

where the semicolon indicates vertical concatenation. Assuming M is nonsingular,

q̈(t) = −M⁻¹Kq(t) + M⁻¹Fu(t)

Therefore,

ẋ(t) = [ 0 I ; −M⁻¹K 0 ] x(t) + [ 0 ; M⁻¹F ]u(t)

This transformation is valid when the equations are linear, M is invertible, and the chosen coordinates completely describe the dynamic configuration.

State, input, and output

A state is a minimal set of variables that, together with future inputs, determines future system behaviour. For a mass–spring system, position and velocity are states. For an electrical inductor–capacitor circuit, inductor current and capacitor voltage are natural states. A state is not necessarily a directly measurable quantity.

The input is an externally imposed variable, such as motor voltage, applied force, or reference command. The output is the quantity selected for measurement or control, such as position, speed, or current.

Different state choices can describe the same physical system. If z = Tx, where T is nonsingular, then z is an alternative coordinate system. The transformed matrices are

Az = TAT⁻¹, Bz = TB, Cz = CT⁻¹, Dz = D

The eigenvalues are unchanged by this similarity transformation, although the numerical entries and physical interpretation of individual states may change.

2. Building a Mechatronic State-Space Model

DC motor example

Consider an armature-controlled DC motor with armature resistance R, inductance L, torque constant Kₜ, back-emf constant Kₑ, rotor inertia J, viscous friction coefficient b, armature voltage v(t), current i(t), and angular position θ(t). Under the usual linear assumptions—constant parameters, unsaturated magnetic circuit, and negligible backlash—the equations are

L di/dt + Ri + Kₑω = v
J dω/dt + bω = Kₜi − τL
dθ/dt = ω

where ω = dθ/dt and τ_L is the load torque. Choose

x = [ θ ; ω ; i ]

with input vector u = [v; τ_L]. Then

ẋ = [ 0 1 0 ;
0 −b/J Kₜ/J ;
0 −Kₑ/L −R/L ]x
+ [ 0 0 ;
0 −1/J ;
1/L 0 ]u

If position is measured, y = θ, then

y = [1 0 0]x

The units are consistent: θ is rad (dimensionless in SI), ω is rad/s, i is A, v is V, J is kg·m², b is N·m·s/rad, R is Ω, and L is H. The constants Kₜ and Kₑ have compatible SI numerical values when torque is in N·m and back emf is in V·s/rad.

This model reveals coupling directly. Current affects acceleration through Kₜ/J, while speed affects current through the back-emf term −Kₑ/L.

Rigid two-mass system

For two inertias connected by a flexible shaft, let θ₁ and θ₂ be angular positions, J₁ and J₂ inertias, k shaft stiffness, c shaft damping, and τ(t) an applied motor torque. With no external damping for simplicity,

J₁θ̈₁ = τ − k(θ₁ − θ₂) − c(θ̇₁ − θ̇₂)
J₂θ̈₂ = k(θ₁ − θ₂) + c(θ̇₁ − θ̇₂)

The state vector x = [θ₁, θ₂, ω₁, ω₂]ᵀ produces a four-dimensional first-order model. Its modes include a rigid-body mode, in which both masses rotate together, and a flexible mode, in which they rotate relative to one another. This distinction is central to vibration suppression and servo-drive design.

3. Equilibrium and Linearisation

An equilibrium xₑ for constant input uₑ satisfies

0 = f(xₑ, uₑ)

For a nonlinear model ẋ = f(x,u), define perturbations δx = x − xₑ and δu = u − uₑ. A first-order Taylor expansion gives

δẋ ≈ Aδx + Bδu

where

A = ∂f/∂x |_(xₑ,uₑ), B = ∂f/∂u |_(xₑ,uₑ)

The approximation is useful near the equilibrium, provided higher-order terms are small. It may be inaccurate for large motions, actuator saturation, contact, friction reversal, magnetic saturation, or geometric nonlinearities. Linearisation is therefore a local engineering model, not a universal replacement for the nonlinear system.

4. Eigenvalues, Eigenvectors, and Modes

For the unforced system

ẋ = Ax

try a solution x(t) = ve^{λt}, where v is a nonzero vector. Substitution gives

Av = λv

The admissible values of λ satisfy the characteristic equation

det(λI − A) = 0

The roots λ are the eigenvalues and the associated vectors v are eigenvectors. If A has n linearly independent eigenvectors, define V = [v₁ v₂ … vₙ] and Λ = diag(λ₁, λ₂, …, λₙ). Then A = VΛV⁻¹ and

x(t) = VeΛtV⁻¹x(0)

Since e^{Λt} is diagonal,

eΛt = diag(eλ₁t, eλ₂t, …, eλₙt)

The general homogeneous response is consequently a linear combination of modes:

x(t) = ∑ᵢ cᵢvᵢeλᵢt

The constants cᵢ are determined by x(0). If eigenvalues are complex, they occur in conjugate pairs for real A. A pair λ = σ ± jω_d produces a real response involving e^{σt}cos(ω_dt) and e^{σt}sin(ω_dt). Here σ is the exponential growth or decay rate and ω_d is the damped oscillation frequency in rad/s.

Worked example: a two-state oscillator

Consider

A = [ 0 1 ; −4 −1 ]

The characteristic polynomial is

det(λI − A) = λ² + λ + 4

Thus,

λ = (−1 ± √(1 − 16))/2 = −0.5 ± j√15/2

or approximately λ = −0.5 ± j1.936. Since both eigenvalues have negative real parts, the origin is asymptotically stable. The response oscillates while its envelope decays approximately as e^(−0.5t). The oscillation period is approximately 2π/1.936 = 3.25 s.

For a second-order characteristic polynomial λ² + 2ζωₙλ + ωₙ², the natural frequency is ωₙ and damping ratio is ζ. Comparing coefficients gives ωₙ = 2 rad/s and ζ = 0.25 in this example. This standard interpretation applies when the polynomial is genuinely second order and has the stated normalised form.

If A is defective and does not possess a complete eigenvector basis, generalized eigenvectors are required. Terms such as te^{λt} can then appear. Numerical software should use a matrix-exponential algorithm rather than relying blindly on an eigenvector decomposition.

5. Matrix Exponential and Forced Response

The state-transition matrix is

Φ(t) = eAt

and the solution of ẋ = Ax + Bu with x(0) = x₀ is

x(t) = eAtx₀ + ∫₀ᵗ eA(t−τ)Bu(τ)dτ

The first term is the zero-input response and the integral is the zero-state response. This formula assumes A and B are constant and the input is sufficiently well behaved for the integral to exist.

For a constant input u(t) = u₀ and nonsingular A,

x(t) = eAtx₀ + A⁻¹(eAt − I)Bu₀

At equilibrium, ẋ = 0, so

xₑ = −A⁻¹Bu₀

provided A is nonsingular. If A is singular, equilibrium must instead be found directly from Axₑ + Bu₀ = 0; an equilibrium may be nonunique or may not exist.

For a unit impulse input, the state response is e^{At}B. For a step input, it is the integral of e^{At}B. These forms are useful for simulation and for checking numerical software.

6. Phase Portraits and Geometric Interpretation

For a two-state system, a phase portrait plots one state against another, commonly position versus velocity. Each initial condition generates a trajectory. The equilibrium is a point where the vector field is zero.

For a stable node, trajectories approach the equilibrium without sustained oscillation. For a stable focus, trajectories spiral inward. For an unstable focus, they spiral outward. A saddle has stable and unstable directions and is therefore unstable. A centre has closed trajectories in the ideal undamped case and is stable in the sense of bounded motion, but not asymptotically stable.

The eigenvectors determine principal directions in the phase plane. Real eigenvalues produce straight-line modal directions; complex eigenvalues produce rotation combined with exponential scaling. Phase portraits are especially valuable for identifying qualitative behaviour that may not be obvious from a time plot.

7. Stability

For a continuous-time LTI system ẋ = Ax, the origin is asymptotically stable if and only if every eigenvalue of A has strictly negative real part:

Re(λᵢ) < 0 for all i

It is unstable if at least one eigenvalue has positive real part. Eigenvalues on the imaginary axis require additional examination. A simple, non-repeated pair on the imaginary axis may produce bounded oscillation, whereas repeated imaginary-axis eigenvalues with deficient eigenvectors can produce unbounded polynomial terms.

For a discrete-time model x[k+1] = A_d x[k] + B_d u[k], asymptotic stability requires

|λᵢ(Ad)| < 1 for all i

The continuous-time and discrete-time criteria must not be confused. Under zero-order-hold sampling with period Tₛ, continuous and discrete eigenvalues are related by λ_d = e^{λ_cTₛ}, assuming the sampled model corresponds appropriately to the continuous system.

For low-order systems, the Routh–Hurwitz criterion can assess stability without explicitly calculating roots. For higher-order numerical models, eigenvalue computation is usually practical, but scaling and numerical conditioning should be checked.

8. Controllability

A system is controllable if an input can transfer the state from any initial state to any desired final state in finite time, under the model assumptions. For the continuous-time pair (A,B), the controllability matrix is

𝒞 = [ B AB A²B … Aⁿ⁻¹B ]

The system is completely controllable if

rank(𝒞) = n

where n is the number of states. For a single-input system, 𝒞 has n columns; for multiple inputs, it has n blocks of columns.

Controllability is not the same as actuator strength. A system may be mathematically controllable but practically difficult to control if some modes require very large input energy. Rank tests can also be numerically unreliable for badly scaled systems, so singular values of 𝒞 or controllability Gramians are often examined in engineering software.

A useful modal interpretation is the Popov–Belevitch–Hautus test: (A,B) is controllable if and only if

rank([ λI − A B ]) = n

for every eigenvalue λ of A. This test identifies an uncontrollable mode directly.

Example: controllability

Let

A = [0 1; 0 0], B = [0; 1]

Then

𝒞 = [ B AB ] = [0 1; 1 0]

Its determinant is −1, so rank(𝒞) = 2. Both states are controllable even though the input acts directly only on the second state: the input changes velocity, and velocity changes position.

In design, lack of controllability can result from actuator placement, mechanical symmetry, disconnected subsystems, or an inappropriate model. It cannot generally be repaired by changing feedback gains alone.

9. Applied Case: Position Control of a Motorised Linear Axis

Background

Consider an illustrative laboratory linear axis driven by a DC motor and belt transmission. The design objective is accurate position tracking while avoiding excessive oscillation and current demand. The motor, load, and drive electronics are represented by a linear model around a chosen operating point.

Problem

The axis exhibits slow settling and overshoot when a position command changes. Before selecting a controller, the engineering team must determine whether the actuator can influence all important dynamic modes and whether the model predicts stable open-loop behaviour.

Analysis

The selected state vector is x = [position; velocity; motor current]ᵀ. The motor equations yield matrices A and B as derived earlier. Numerical parameter values are inserted only after consistent SI conversion. Eigenvalues of A reveal electrical and mechanical modes. A lightly damped complex pair indicates mechanical oscillation, while a large negative real eigenvalue may represent a fast electrical transient.

The controllability matrix is calculated from A and B. If it has full rank, voltage can influence every state in the ideal model. The output matrix C = [1 0 0] represents a position encoder. If only position is measured, an observer may be needed to estimate velocity and current; observability is therefore considered alongside controllability, although it is not identical to it.

Approach and solution

The team first checks units, parameter uncertainty, saturation limits, sampling period, and encoder resolution. It then uses eigenvalue analysis to identify the dominant mode. Feedback gains are selected to move closed-loop poles to desired locations, subject to current and voltage constraints. Simulation includes step commands, disturbance torque, sensor noise, quantisation, and actuator saturation.

A practical implementation uses a discrete-time model. With sampling period Tₛ and zero-order-hold input, the exact conversion is

Ad = eATₛ
Bd = ∫₀ᵀₛ eAτB dτ

The integral expression is valid whether or not A is invertible. If A is invertible, B_d = A⁻¹(A_d − I)B. The controller is implemented at a sampling rate sufficiently faster than the dominant closed-loop dynamics, while computational delay is included in validation.

Outcome

The model identifies the flexible mechanical mode as the main cause of overshoot. Feedback is tuned to increase damping without demanding current beyond the drive rating. A reference prefilter reduces command-induced excitation, and a current limit protects the actuator. Hardware tests are conducted gradually, beginning with low-amplitude commands and emergency shutdown provisions.

Learning points

  1. A state-space model exposes interactions that separate transfer functions may hide.
  2. Eigenvalues identify dominant and potentially dangerous modes.
  3. Full controllability is necessary for arbitrary state regulation but does not guarantee robust performance.
  4. Simulation must include nonidealities such as saturation, delay, noise, and parameter variation.
  5. Safe commissioning requires engineering judgement beyond mathematical stability.

10. Limitations, Professional Practice, and Contemporary Tools

State-space models depend on assumptions. Linear models omit nonlinear friction, saturation, dead zones, backlash, impacts, thermal effects, and parameter changes unless these are explicitly included. A model can be mathematically elegant but physically misleading if coordinates, signs, units, or boundary conditions are wrong.

Best practice includes:

  • define positive directions and reference frames before writing equations;
  • retain units during derivation and numerical substitution;
  • verify limiting cases, such as zero damping or zero coupling;
  • compare simulation with experimental data;
  • scale states and inputs when numerical conditioning is poor;
  • document parameter sources and uncertainty;
  • test actuator limits and sensor faults;
  • distinguish local linear stability from global nonlinear behaviour.

Modern engineering software computes eigenvalues, matrix exponentials, rank, Gramians, simulations, and discrete conversions. Artificial intelligence can assist with parameter identification, anomaly detection, symbolic manipulation, and model reduction, but generated equations must be checked against conservation laws, units, experimental data, and safety requirements. In safety-critical mechatronic systems, traceability, validation, cybersecurity, and fail-safe behaviour are essential. A controller should not be deployed solely because a numerical simulation appears successful.

Model reduction may remove fast or weakly coupled states to simplify control design. This is useful only when the discarded dynamics cannot significantly affect the operating bandwidth, stability margins, or safety. Robust design is required when uncertain parameters can move eigenvalues or reduce controllability.

Chapter Summary

Coupled mechatronic systems are naturally represented by first-order matrix differential equations. A state-space model consists of system, input, output, and feedthrough matrices, with states chosen to capture the system’s memory. Mechanical, electrical, and electromechanical laws can be converted systematically into this form.

Eigenvalues and eigenvectors reveal natural modes, decay rates, oscillation frequencies, and stability. The matrix exponential gives the homogeneous response, while convolution gives the response to arbitrary inputs. Phase portraits provide geometric insight for two-state systems. Continuous-time asymptotic stability requires all eigenvalues to have negative real parts.

Controllability determines whether inputs can influence all states. The controllability matrix and PBH test provide algebraic tests, although practical controllability also depends on actuator authority and numerical conditioning. Successful engineering application requires careful units, validation, treatment of nonlinearities, discretisation, saturation, noise, uncertainty, and safety.

Key Terms

State: A variable in a minimal set that determines future system behaviour with the input.

State vector: An organised column containing all selected state variables.

State-space model: A first-order matrix representation of system dynamics and outputs.

System matrix A: Matrix describing internal state evolution.

Input matrix B: Matrix describing how inputs affect state derivatives.

Output matrix C: Matrix mapping states to measured or reported outputs.

Feedthrough matrix D: Matrix describing direct input-to-output transmission.

Equilibrium: A state and input combination for which the state derivative is zero.

Linearisation: Approximation of a nonlinear model near an operating point.

Eigenvalue: A scalar satisfying Av = λv for a nonzero vector v.

Eigenvector: A direction preserved by a linear transformation, apart from scaling.

Mode: A characteristic component of a system response associated with an eigenvalue.

State-transition matrix: The matrix e^{At} that maps initial states in an LTI system.

Phase portrait: A plot of state trajectories in a state plane.

Asymptotic stability: Convergence of system states to equilibrium as time tends to infinity.

Controllability: Ability to transfer the state between desired conditions using inputs.

Controllability matrix: Matrix [B AB … Aⁿ⁻¹B] used in a rank test.

Modal coordinates: Coordinates aligned with system eigenvectors or generalized eigenvectors.

Zero-order hold: Assumption that a digital control input remains constant between samples.

Model reduction: Simplification that removes dynamics judged unimportant for a specified purpose.

Review Questions

5 Short Answer Questions

  1. What is meant by a state of a dynamic system?
  2. State the continuous-time LTI state-space equations and define A, B, C, and D.
  3. How are eigenvalues related to the stability of a continuous-time LTI system?
  4. What physical coupling is represented by the back-emf term in a DC motor model?
  5. State the full-rank condition for controllability.

5 Long Answer Questions

  1. Derive a first-order state-space model for a mass–spring–damper system with force input and displacement output.
  2. Explain how eigenvalues and eigenvectors determine the modal response of an LTI system.
  3. Describe the matrix-exponential solution for an LTI system with arbitrary input and initial condition.
  4. Compare mathematical controllability with practical controllability in a mechatronic actuator.
  5. Explain why linearisation is useful and identify situations in which it may be unreliable.

3 Analytical / Application Questions

  1. For A = [[0, 1], [−9, −2]], calculate the eigenvalues, classify stability, and describe the expected time response.
  2. A two-mass drive has a low-frequency rigid-body mode and a higher-frequency flexible mode. Explain how each mode would appear in a position response and propose two methods for reducing flexible-mode excitation.
  3. Design a modelling and validation procedure for a sampled motor-position control system. Include state selection, parameter measurement, controllability checking, discretisation, saturation testing, and experimental safety precautions.

Multiple Choice Questions with Answers

Question 1

Which equation represents a continuous-time LTI state model?

A. [[M:x = Ax + Bu]]

B. [[M:ẋ = Ax + Bu]]

C. [[M:y = Ax + Bu]]

D. [[M:u = Ax + By]]

Correct Answer: B. [[M:ẋ = Ax + Bu]]

Question 2

For a continuous-time LTI system, asymptotic stability requires which condition?

A. All eigenvalues have positive real parts

B. All eigenvalues have zero real parts

C. All eigenvalues have negative real parts

D. All eigenvalues have magnitude greater than one

Correct Answer: C. All eigenvalues have negative real parts

Question 3

For a two-state system with A = [[M:0,1], [M:−4,−1]], what are the approximate eigenvalues?

A. [[M:0.5 ± j1.936]]

B. [[M:−0.5 ± j1.936]]

C. [[M:−1 ± j4]]

D. [[M:4 ± j1]]

Correct Answer: B. [[M:−0.5 ± j1.936]]

Question 4

What is the controllability matrix for a single-input two-state system?

A. [[M:[A B]]]

B. [[M:[B AB]]]

C. [[M:[C CA]]]

D. [[M:[I A]]]

Correct Answer: B. [[M:[B AB]]]

Question 5

In the DC motor model, the back-emf term couples which variables?

A. Position and load torque

B. Speed and armature current equation

C. Current and shaft stiffness only

D. Voltage and rotor inertia only

Correct Answer: B. Speed and armature current equation

Question 6

If a real system matrix has a complex eigenvalue λ = σ + jω, what must also be an eigenvalue?

A. σ − jω

B. −σ + jω

C. −σ − jω only

D. 1/λ only

Correct Answer: A. σ − jω

Question 7

What does a stable focus typically produce in a two-dimensional phase portrait?

A. Outward spirals

B. Inward spirals

C. A single straight trajectory only

D. Unbounded parallel lines

Correct Answer: B. Inward spirals

Question 8

For the discrete-time system x[k+1] = A_d x[k], asymptotic stability requires eigenvalues of A_d to satisfy:

A. [[M:|λᵢ| < 1]]

B. [[M:Re(λᵢ) < 0]]

C. [[M:|λᵢ| > 1]]

D. [[M:λᵢ = 0]]

Correct Answer: A. [[M:|λᵢ| < 1]]

Question 9

If the controllability matrix of an n-state system has rank n, the system is:

A. Observable only

B. Completely controllable

C. Necessarily nonlinear

D. Unstable by definition

Correct Answer: B. Completely controllable

Question 10

Which expression gives the zero-input response of an LTI system with initial state x₀?

A. [[M:e^{At}x₀]]

B. [[M:Ax₀ + Bu]]

C. [[M:Cx₀ + Du]]

D. [[M:e^{Bt}x₀]]

Correct Answer: A. [[M:e^{At}x₀]]

Engineering Mathematics II
Chapter 7 of 15