Notes · System modelling

System modelling

What a model is made of, and the distinctions — linear or nonlinear, continuous or discrete, actuated or underactuated, exact or uncertain — that decide what you can do with it.


This is a brief overview of the key concepts in system modelling, which we will use for control law design.

How does the state enter? linear nonlinear How does time advance? continuous discrete Enough independent inputs? fully actuated underactuated Does the law of motion drift? time-invariant time-varying Is the model exact? nominal uncertain Left column: the convenient case. Every step right removes tools from the kit.
A model is fixed by answering five independent questions, and the answers are what decide which controllers are available later.

State, input, dynamics

A model has three pieces. The state \(x \in \mathbb{R}^n\) is a set of variables that describe the system at a given time and allow you to predict its future. The input \(u \in \mathbb{R}^m\) is what you are allowed to command - a force, a torque, a thrust, a wheel speed. The dynamics \(f\) tie them together:

$$\dot{x} = f(x, u).$$

The defining property of a state is sufficiency: if you know \(x(t_0)\) and the whole input signal \(u(\cdot)\) on \([t_0, t]\), you can compute \(x(t)\) without knowing anything else about what happened before \(t_0\).

Example - a mass on a line

Let \(p\) be position and \(v\) velocity, and let the input be acceleration. Position alone is not a state: knowing where the mass is tells you nothing about where it goes next. Position and velocity together are.

$$x = \begin{bmatrix} p \\ v \end{bmatrix}, \qquad \dot{x} = \begin{bmatrix} v \\ u \end{bmatrix}.$$

Choosing the state is a modelling decision. Adding states increaes fidelity of the model it represents (motor lag, tire slip, an integrator on the error), but at the same time it costs extra dimension, identification effort, and often controlability.

Continuous time and discrete time

Physics is written in continuous time,

$$\dot{x} = f(x,u),$$

but controllers run on computers at a fixed rate, so the model you actually implement is a difference equation

$$x_{k+1} = F(x_k, u_k),$$

where the input is held constant between the sampling time \(\Delta t\). Both descriptions of the same robot coexist: you analyse in continuous time and implement in discrete time, or you discretise once and do everything discretely.

Δt true trajectory held between samples
The controller only sees the dots. Everything between them is the discretization's problem.

Three ways to get \(F\) from \(f\), in increasing order of cost and accuracy:

  • Forward Euler. \(x_{k+1} = x_k + \Delta t\, f(x_k, u_k)\). 1st order prediction, common.
  • Runge-Kutta 4. Four evaluations per step. 4th order prediction, more accurate.
  • Exact discretization (linear systems only). For \(\dot x = Ax + Bu\) with \(u\) held constant over each interval, $$A_d = e^{A\Delta t}, \qquad B_d = \left(\int_0^{\Delta t} e^{A\tau}\,d\tau\right) B,$$ which is exact, not an approximation.

A controller proven stable or safe in continuous time may not be so in discrete time.

Linear and nonlinear systems

A system is linear when it can be written as

$$\dot{x} = A(t) x(t) + B(t) u, \qquad y = C(t) x + D(t) u.$$

inear systems are commonly divided into linear time-invariant (LTI) and linear time-varying (LTV) systems.

LTI systems

A linear system is time-invariant when its system matrices are constant:

$$\dot{x} = A x + B u, \qquad y = C x + D u.$$

The matrices \(A,B,C,D\) do not explicitly depend on time. Consequently, the same relationship between the state and input applies at every time. LTI systems have particularly convenient analytical properties and are the standard setting for many classical control methods, including LQR.

LTV systems

A linear system is time-varying when its system matrices depend explicitly on time:

$$\dot{x}=A(t)x+B(t)u, \qquad y=C(t)x+D(t)u.$$

The system is still linear in \(x\) and \(u\), but its dynamics change with time. For example, a robot following a time-varying reference trajectory may be described by an LTV model obtained by linearizing nonlinear dynamics along that trajectory.

The distinction can therefore be summarized as

$$ \begin{array}{lll} \text{LTI:} & \dot{x}=Ax+Bu, & A,B\text{ are constant}, \\ \text{LTV:} & \dot{x}=A(t)x+B(t)u, & A(t),B(t)\text{ vary with time}. \end{array} $$

Both are linear systems; the difference is whether their system matrices are constant or time-dependent.

Nonlinear systems

A general continuous-time nonlinear system is written as

$$\dot{x}=f(x,u),\qquad y=h(x,u),$$

where \(f\) and \(h\) are generally nonlinear functions of the state \(x\) and control input \(u\). Unlike linear systems, the dynamics may contain terms such as \(x^2\), \(xu\), \(\sin(x)\), or other nonlinear functions.

The distinction matters because linearity buys an enormous amount:

  • Closed-form solutions, transfer functions, frequency response.
  • Stability analysis is straightforward and well-developed for linear systems.
  • Controllability and observability reduced to rank tests on a single matrix.
  • Optimal control that solves in closed form (LQR) and convex MPC.

None of that survives nonlinearity intact. Most real robots are nonlinear: rotations, gravity, friction, contact, and aerodynamics all break superposition.

The control-affine systems

Fortunately, a huge fraction of robotic systems sit in a convenient middle class, control-affine:

$$\dot{x} = f(x) + g(x)\,u.$$

The state may enter as nonlinearly as it likes, but the input enters linearly. Here \(f(x)\) is the drift (what the system does with \(u = 0\)) and \(g(x)\) is the control-input matrix.

Example - pendulum

With \(x_1 = \theta\), \(x_2 = \dot\theta\) and torque input \(u\):

$$\dot{x} = \begin{bmatrix} x_2 \\[2pt] -\dfrac{g}{\ell}\sin x_1 - \dfrac{b}{m\ell^2}x_2 \end{bmatrix} + \begin{bmatrix} 0 \\[2pt] \dfrac{1}{m\ell^2} \end{bmatrix} u.$$

Nonlinear because of \(\sin x_1\), but control-affine because \(u\) appears linearly.

Control-affine structure provides a useful middle ground: it can capture nonlinear system dynamics while maintaining a linear dependence on the control input. This structure enables the use of many powerful nonlinear control techniques, including control Lyapunov functions and control barrier functions.

Linearization

Nonlinear systems are often well approximated by a linear one near an operating point \((x^\star, u^\star)\). Writing \(\delta x = x - x^\star\) and \(\delta u = u - u^\star\), a first-order Taylor expansion gives

$$\delta\dot{x} = A\,\delta x + B\,\delta u, \qquad A = \left.\frac{\partial f}{\partial x}\right|_{(x^\star,u^\star)}, \qquad B = \left.\frac{\partial f}{\partial u}\right|_{(x^\star,u^\star)}.$$

If \((x^\star, u^\star)\) is an equilibrium - \(f(x^\star,u^\star) = 0\) - then Lyapunov's indirect method applies: if every eigenvalue of \(A\) has strictly negative real part, the nonlinear system is locally asymptotically stable there. If any has strictly positive real part, it is unstable. Eigenvalues exactly on the imaginary axis tell you nothing and you have to go back to the nonlinear model.

x* f(x, u) Aδx + Bδu the approximation is only honest inside the shaded band
Linearization is local. The band where it is trustworthy is a design assumption you should state and, ideally, enforce.

Linearizing around a trajectory rather than a point gives a time-varying linear system \(\delta\dot x = A(t)\,\delta x + B(t)\,\delta u\), which is the basis of trajectory-tracking LQR and of iLQR/DDP.

Fully actuated and underactuated systems

A system is fully actuated when the dimension of input equals the number of degrees of freedom. It is underactuated when the dimension of input is less than the number of degrees of freedom.

τ₁ τ₂ 2 DOF, 2 inputs fully actuated F 2 DOF, 1 input underactuated
Left: every joint has its own motor. Right: the pole angle can only be influenced by moving the cart underneath it.

Importantly, underactuated does not mean uncontrollable.An underactuated system can still be controllable; it simply cannot independently command every degree of freedom at every instant.

Common underactuated systems: quadrotors (6 DOF, 4 inputs - to translate sideways a quadrotor must first tilt), cart-poles, Acrobots, legged robots during flight phases, fixed-wing aircraft, and any car with nonholonomic constraints.

Modelling uncertainty

Everything above is the nominal model. Real systems differ from it, and how you write the difference determines what kind of guarantee you can get.

Bounded (set-based) uncertainty

$$\dot{x} = f(x,u) + d, \qquad d \in \mathcal{D},\ \ \|d\| \le \bar{d}.$$

The disturbance is unknown but confined to a known set. This supports worst-case guarantees - robust control, tube MPC, input-to-state stability, robust CBFs - at the cost of conservatism, since you design against the worst member of \(\mathcal D\) whether or not it ever occurs.

Stochastic uncertainty

$$dx = f(x,u)\,dt + \sigma(x,u)\,dW_t.$$

The disturbance is a random process with known statistics. Guarantees become probabilistic: expected cost, chance constraints \(\Pr[x \in \mathcal{X}] \ge 1-\epsilon\), etc. Less conservative, but a probabilistic guarantee.

Outputs and estimation

You rarely measure the full state. The measurement model is

$$y = h(x,u) + \nu, \qquad \text{or linearly} \qquad y = Cx + Du + \nu,$$

with \(\nu\) sensor noise. A GPS gives position but not velocity; an encoder gives joint angle but not joint rate; a camera gives pixels.

Observability asks whether \(x(0)\) can be reconstructed from \(y(\cdot)\) and \(u(\cdot)\) over a finite window. For LTI systems it is the rank condition

$$\operatorname{rank} \begin{bmatrix} C \\ CA \\ \vdots \\ CA^{n-1}\end{bmatrix} = n,$$

the dual of controllability. If a system is observable you can build an observer - a Luenberger observer, a Kalman filter, a moving-horizon estimator - and feed its estimate \(\hat x\) to a controller designed as if the state were measured. For LTI systems the separation principle says designing the controller and observer independently still yields a stable closed loop; for nonlinear systems it generally does not, and the coupling has to be handled explicitly.

Classifying a model

Every model can be placed against the same checklist, and the placement is what tells you which controllers are candidates.

QuestionIf yesIf no
Is it \(\dot x = Ax+Bu\)? Pole placement, LQR, \(H_\infty\), convex MPC, frequency-domain design Go to the next rows
Is it control-affine? Feedback linearization, CLF-QP, CBF safety filters, sliding mode Nonlinear MPC, sampling-based, learned policies
Is it fully actuated? Computed torque, inverse dynamics, task-space control Trajectory optimization, partial feedback linearization, differential flatness
Is it time-invariant? Static feedback gains; analyse with eigenvalues Gain scheduling, time-varying LQR; eigenvalue tests are invalid
Is the disturbance bounded? Robust control, tube MPC, ISS, robust CBFs Stochastic MPC, chance constraints, LQG
Is the full state measured? Design the feedback law directly Add an observer; check the coupling if nonlinear