Modelling Physical Systems for Control

Controllers are designed from models. Learn how to write differential equations for electrical, mechanical, thermal, fluid and process systems, the analogies between them, linearisation around an operating point, transfer functions, first-order-plus-dead-time (FOPDT) process models, and system identification from a step test — with an Euler simulation of a draining tank.

A controller is only as good as the understanding of the process behind it. A model tells you how the process output responds to inputs: how fast, how much, with how much delay — the numbers you need to tune a PID or design any controller.

Models come from physics (first principles: mass, energy and momentum balances) or from data (system identification: bump the process and fit a model to the response). Practising engineers use both.

An analogy

A model is like a flight simulator of your process: you can crash it a hundred times on the computer to learn how to fly the real plant safely.

Balances give differential equations

Accumulation = in − out (+ generation). A tank accumulates liquid volume, a room accumulates heat, a capacitor accumulates charge, a mass accumulates momentum. Writing the balance and the flow laws (Ohm, Fourier, orifice, Newton) gives the model.

Analogies between domains

The same mathematics appears everywhere:

Linearisation and transfer functions

Real processes are nonlinear (√h outflow, radiation T⁴, valve characteristics). Around a steady operating point, a Taylor series gives a linear model in deviation variables. Laplace-transforming gives transfer functions G(s) that can be combined with block-diagram algebra and analysed with root locus, Bode or Nyquist.

Empirical models and identification

Most process loops are tuned from a step (bump) test: in manual, step the controller output by 5–10%, record the PV, and fit a FOPDT model (K, τ, θ) by the tangent method or two-point method. Integrating processes (level with pump outflow) show a ramp and are modelled as K·e^(−θs)/s. Advanced identification uses PRBS excitation and least-squares or subspace methods to fit ARX/state-space models for MPC.

Formulas

Worked example: Thermal time constant

Given: Oven: C_th = 5 kJ/K, R_th = 0.02 K/W

Find: τ and steady rise for 2 kW.

Answer: τ = 100 s, ΔT = 40 K

Worked example: Step-test identification

Given: Output step 10%, PV rises 5% total; 28.3% point at 12 s, 63.2% at 20 s

Find: K, τ, θ.

Answer: G = 0.5·e^(−8s)/(12s + 1)

Worked example: Tank linearisation

Given: A = 2 m², k = 0.1, h_s = 0.25 m

Find: τ.

Answer: 20 s

Simulating a nonlinear tank and finding its linear model

# Euler simulation of a tank level: A dh/dt = qin - k*sqrt(h)
import math
A, k, qin = 2.0, 0.1, 0.05            # m^2, m^2.5/s, m^3/s
h, dt = 0.0, 1.0
for t in range(0, 2001):
    if t in (0, 100, 500, 1000, 2000):
        print(f"t={t:5d} s  h={h:.3f} m")
    h += dt * (qin - k * math.sqrt(max(h, 0))) / A
print(f"steady state h = (qin/k)^2 = {(qin/k)**2:.3f} m")
# linearised time constant at steady state: tau = 2*A*sqrt(h)/k
hs = (qin / k) ** 2
print(f"linearised tau = {2*A*math.sqrt(hs)/k:.1f} s")
# t=    0 s  h=0.000 m
# t=  100 s  h=0.249 m
# t=  500 s  h=0.250 m
# t= 1000 s  h=0.250 m
# t= 2000 s  h=0.250 m
# steady state h = (qin/k)^2 = 0.250 m
# linearised tau = 20.0 s

Euler integration (x += dt·f(x)) is the simplest simulator — the same idea runs inside every process simulator. The linearised model is valid only near h = 0.25 m; at other levels τ and K change, which is why nonlinear processes may need gain scheduling.

Common mistakes

Applications

Key takeaways

Going further