D. Dynamical Systems, Stability & Feedback Control

State-space models, Lyapunov stability, invariant sets, frequency response, LQR, PID and MPC

Before you start

This primer assumes:

Study route — Build control intuition from one-dimensional models

No previous control course is needed. Begin with a scalar recursion and distinguish a state from its derivative. Sections 1–4 build the language of trajectories and certificates; sections 5–9 apply it to controllers and optimisation. Read a numeric example before its general theorem, and return to the longer frequency-domain or Riccati derivations after the section practice.

Begin with the three readiness checks. If a check is difficult, use its review link and worked answer, then try again without looking. After each section, try its Easy problem, use the separate hint if needed, and continue to Medium once you can explain the steps. Hard problems combine ideas or expose a common mistake. Keep the answers closed on your first attempt.

The original cumulative exercises combine sections after this guided practice. Finish a study session by explaining one worked solution in your own words, then changing a number and solving it again.

Readiness checks — a short prerequisite refresher

These checks are diagnostic, with the needed calculation explained in each answer. A gap tells you where to review; it is not a reason to skip this primer.

Exercise D.R1 — Readiness: Find a discrete equilibrium

For the update $x_{t+1}=0.5x_t+1$, find a state that does not change after an update.

Review if needed: functions and fixed points.

Show hint
Set the next state equal to the current one.
Show worked solution

A fixed point satisfies $x_*=0.5x_*+1$. Subtracting $0.5x_*$ gives $0.5x_*=1$, hence $x_*=2$. Substitution checks it: $0.5(2)+1=2$. Discrete-time equilibrium is a fixed-point equation; continuous-time equilibrium instead asks for zero rate of change.

Exercise D.R2 — Readiness: A derivative is a rate

For $x(t)=3e^{-2t}$, compute $\dot x(t)$ and express it as a multiple of $x(t)$. What is the difference between $x(0)$ and $\dot x(0)$?

Review if needed: derivatives and the chain rule.

Show hint
Differentiate the exponential using its inner derivative $-2$.
Show worked solution

$\dot x(t)=-6e^{-2t}=-2x(t)$. At zero, the state is $3$ while its rate is $-6$. A state can be measured in metres and its derivative in metres per second; they are different quantities. Over a small time interval $\Delta t$, the local approximation is $x(t+\Delta t)\approx x(t)+\Delta t\dot x(t)$, not $x(t+\Delta t)=\dot x(t)$.

Exercise D.R3 — Readiness: A quadratic form measures size

Let $P=\operatorname{diag}(1,2)$ and $x=(1,-2)^\top$. Compute $V=x^\top Px$. Bound $V$ between multiples of $\|x\|_2^2$.

Review if needed: positive definite quadratic forms.

Show hint
The eigenvalues are $1$ and $2$, and $V=x_1^2+2x_2^2$.
Show worked solution

Here $\|x\|_2^2=1+4=5$ and $V=1+2(4)=9$. For every vector, $\|x\|_2^2\le V\le2\|x\|_2^2$, because each squared coordinate has a coefficient between $1$ and $2$. This comparison lets a decrease in a quadratic certificate imply a bound on the physical state.

Book contents · Apply this chapter to a real decision · Glossary

Contents
1. State-Space Models, Trajectories & Equilibria 2. Linear Systems: Solutions, Eigenvalues & Stability 3. Lyapunov Functions, Invariant Sets & Regions of Attraction 4. Class-K Functions & the Comparison Lemma 5. Feedback Control: State Feedback, LQR & PID 6. Transfer Functions, Frequency Response, Gains & Parseval 7. Feedback with Nonlinearities: Lur'e Systems & Sector Conditions 8. Controllability, Gramians & State-Space Realizations 9. Optimal Control, Dynamic Programming & MPC Walkthrough: From the Bellman Equation to the Riccati Equation Interactive: Phase Portraits & Lyapunov Ellipses Application lab & chapter review Exercises Further Reading Flashcards

Every control-theoretic guarantee in this section is a statement about a dynamical system: a set that trajectories never leave (safety), a point they approach (stability), or a bound on how much a disturbance can be amplified (a gain). This primer builds these three ideas from a first course in linear algebra and calculus. It starts with what a state is, solves linear systems exactly, and then introduces the certificates the modules rely on: Lyapunov functions, invariant sets, comparison functions, gains and quadratic constraints, and value functions. Every concept ends with the module sections that use it.

Notation — this page
  • State $x\in X\subseteq\mathbb R^n$, input $u\in U\subseteq\mathbb R^m$, output $y$ or $z$, disturbance $w$ or $d$.
  • Continuous time $t\in\mathbb R_{\ge0}$ with $\dot x=\mathrm dx/\mathrm dt$; discrete time $t\in\mathbb N=\{0,1,2,\dots\}$ with states $x_t$. Some modules write $k$ for the discrete time or for a sample index.
  • $\|\cdot\|$ is the Euclidean norm on vectors and the spectral norm on matrices; $\rho(A)=\max_i|\lambda_i(A)|$ is the spectral radius; $P\succ0$ ($P\succeq0$) means positive (semi)definite (Primer A).
  • Complex numbers: $j^2=-1$ (the CMDP pages write $i$), $\bar z$ is the conjugate, $M^{*}=\bar M^{\top}$ the conjugate transpose.
  • $V$ denotes a Lyapunov certificate, a storage function or an optimal cost-to-go, depending on the section. These functions serve different purposes: a cost-to-go becomes a Lyapunov certificate only when it has the required positivity and decrease properties. The RL value of Primer E is an expected return. $h$ is a barrier function and $\alpha$ a class-$\mathcal K$ function (Section 4; in Section 6, $h_k$ is an impulse response and $h(x,w)$ an output map); $\gamma$ is an $\ell_2$ gain in Sections 6–7 and a discount factor only in the Neumann-series example of Section 2 and where Section 9 says so.

1. State-Space Models, Trajectories & Equilibria

Start here — Turn a model into an actual trajectory

The recursion $x_{t+1}=0.5x_t+u_t$ gives the next state directly. The differential equation $\dot x=-2x+u$ gives a rate that must be integrated over time. Keeping these two meanings separate prevents many mistakes with equilibria, simulation and stability tests.

When ready, try the Easy, Medium and Hard practice for this section. For a prerequisite gap, review functions and fixed points.

The state is the smallest summary of the past that, together with the future inputs, determines the future. For a pendulum it is the angle and the angular velocity; for a learning algorithm it can be the policy parameters together with a Lagrange multiplier.

Definition — State-space model, trajectory, horizon
A continuous-time model is a vector differential equation, a discrete-time model a recursion:
$$\dot x(t)=f\big(x(t),u(t)\big),\ \ x(0)=x_0,\qquad\qquad x_{t+1}=f(x_t,u_t),\ \ t=0,1,2,\dots$$
with $f:X\times U\to\mathbb R^n$. The state space $X$ and input space $U$ encode what is allowed (for example actuator limits $|u|\le u_{\max}$). A trajectory from $x_0$ under inputs $u$ is, in discrete time, the sequence $x_1=f(x_0,u_0)$, $x_2=f(x_1,u_1),\dots$; in continuous time, for continuous inputs, a differentiable function with $\dot x=f(x,u)$, equivalently the integral equation $x(t)=x_0+\int_0^tf(x(s),u(s))\,\mathrm ds$ (one integral per component). For piecewise-continuous inputs (sample-and-hold, switching, see below) a trajectory is the continuous solution of the integral equation: it satisfies the differential equation between the switching times and may have corners there (for $\dot x=u$ with $u=0$ before $t=1$ and $u=1$ afterwards, $x(t)=\max\{0,t-1\}$). A system without input, or whose input is fixed by a feedback law, is autonomous: $\dot x=f(x)$. The horizon is finite ($0\le t\le T$) or infinite (all $t\ge0$). Modules write the state at time $t$ as $\varphi(t;x_0,u)$, $\varphi^u_x(t)$, $\xi(t)$ or $\phi(k;x;\mathbf u)$.

Example. The pendulum $\ddot\theta=\frac gl\sin\theta-b\dot\theta+u$ (angle $\theta$ measured from the upright position, as in Module 11's explorer) is second order. With $x_1=\theta$, $x_2=\dot\theta$ it becomes two first-order equations, $\dot x_1=x_2$, $\dot x_2=\frac gl\sin x_1-bx_2+u$: here $n=2$, $m=1$. A discrete example: $x_{t+1}=0.5x_t+u_t$ with $u_t=1$ and $x_0=0$ gives $0,\ 1,\ 1.5,\ 1.75,\ 1.875,\dots\to2$.

Definition — Control-affine dynamics
$$\dot x=f(x)+g(x)\,u,\qquad f:\mathbb R^n\to\mathbb R^n,\quad g:\mathbb R^n\to\mathbb R^{n\times m}.$$ The dynamics may be nonlinear in the state, but the input enters linearly through the matrix-valued function $g$. Pendulum: $f(x)=(x_2,\ \tfrac gl\sin x_1-bx_2)$, $g(x)=(0,1)^{\top}$. Unicycle with position $(p_1,p_2)$, heading $\psi$ and input $u=(v,\omega)$: $\dot p_1=v\cos\psi$, $\dot p_2=v\sin\psi$, $\dot\psi=\omega$, so $g(x)=\begin{bmatrix}\cos\psi & 0\\ \sin\psi & 0\\ 0 & 1\end{bmatrix}$ depends on the state. Not control-affine: $\dot x=u^2$ or $\dot x=\sin u$.

Why it matters. For any differentiable function $h$ of the state, the chain rule gives $\frac{\mathrm d}{\mathrm dt}h(x)=\nabla h(x)^{\top}f(x)+\nabla h(x)^{\top}g(x)\,u$, which is affine in $u$. A requirement such as "$\dot h\ge$ something" is therefore a half-space of inputs, and choosing the input closest to a desired one is a quadratic program. This is the reason control barrier function filters are QPs (Section 4, Module 10).

Models, disturbances and closed loops. We design on a nominal model $\hat f$; the physical plant differs from it, for example $x_{t+1}=f(x_t,u_t)+w_t$ with a process disturbance $w_t$. A guarantee proved for the model transfers to the plant only with margins for this mismatch (Modules 4 and 11). Substituting a controller $u=\pi(x)$ gives the autonomous closed loop $x_{t+1}=f(x_t,\pi(x_t))=:F_\pi(x_t)$. If the controller has memory (an integrator, an observer, a multiplier), the closed-loop state is the pair (plant state, controller state), for example $(\theta,\lambda)$ in Module 8.

Existence, uniqueness and forward completeness

Definition — Lipschitz and locally Lipschitz vector fields
$f$ is Lipschitz on $D$ with constant $L$ if $\|f(x)-f(y)\|\le L\|x-y\|$ for all $x,y\in D$, and locally Lipschitz if every point has a neighbourhood on which it is Lipschitz (equivalently, it is Lipschitz on every compact subset of its domain; for $f$ defined on all of $\mathbb R^n$, on every bounded set). Continuously differentiable functions are locally Lipschitz (Primer B). Example: $x^2$ is Lipschitz with constant $2R$ on $[-R,R]$ but not on $\mathbb R$; $\sqrt{|x|}$ is not Lipschitz on any neighbourhood of $0$; $1/x$ is locally Lipschitz on $(0,\infty)$ but not Lipschitz on the bounded set $(0,1)$, which is not compact.
Theorem — Existence and uniqueness on a maximal interval (Picard–Lindelöf)
Assumption. $f:\mathbb R^n\to\mathbb R^n$ is locally Lipschitz. Statement. For every $x_0$ the equation $\dot x=f(x)$, $x(0)=x_0$, has exactly one solution on a maximal interval $[0,\tau_{\max}(x_0))$ with $\tau_{\max}\in(0,\infty]$. If $\tau_{\max}\lt\infty$, then $\|x(t)\|\to\infty$ as $t\uparrow\tau_{\max}$ (finite escape); hence a solution that stays in a compact set exists for all $t\ge0$. If $f$ is globally Lipschitz, $\tau_{\max}=\infty$ for every $x_0$: the system is forward complete. For a closed loop apply this to $x\mapsto f(x,\pi(x))$, which is locally Lipschitz when $f$ and $\pi$ are.

In words. Local Lipschitz continuity gives a unique trajectory for a while; it does not promise that the trajectory lasts forever. Three one-line examples: $\dot x=x^2$, $x_0=1$ has the unique solution $x(t)=1/(1-t)$, which escapes at $t=1$. $\dot x=\sqrt{|x|}$, $x_0=0$ has two solutions, $x\equiv0$ and $x(t)=t^2/4$ (check: $\tfrac{\mathrm d}{\mathrm dt}\tfrac{t^2}{4}=\tfrac t2=\sqrt{t^2/4}$). $\dot x=-x$ is globally Lipschitz and forward complete.

Proof sketch — uniqueness by Grönwall, existence by Picard iteration

Uniqueness. Let $x,y$ be two solutions with the same $x_0$ on $[0,T]$, staying in a set where $f$ is $L$-Lipschitz. Then $e(t)=\|x(t)-y(t)\|\le\int_0^tL\,e(s)\,\mathrm ds$. With $E(t)=\int_0^te(s)\,\mathrm ds$ this reads $E'\le LE$, so $(e^{-Lt}E)'=e^{-Lt}(E'-LE)\le0$; since $E(0)=0$ and $E\ge0$, $E\equiv0$ and therefore $e\equiv0$.

Existence. The Picard iterates $x^{(k+1)}(t)=x_0+\int_0^tf(x^{(k)}(s))\,\mathrm ds$ define a contraction on continuous functions over a short interval, whose fixed point is the solution (Primer 0). Gluing such pieces gives the maximal interval. If $f$ is globally $L$-Lipschitz, $\|f(x)\|\le\|f(0)\|+L\|x\|$, and Grönwall's inequality gives $\|x(t)\|\le(\|x_0\|+\|f(0)\|t)\,e^{Lt}$, which cannot blow up in finite time.

Why it matters
A safety claim reads "the trajectory from $x_0$ stays in $C$ for all $t\ge0$". It needs a unique trajectory (otherwise one solution may stay while another leaves) and existence for all $t$ (otherwise "for all $t$" silently means "until escape"). Invariance on the maximal interval (Module 10) is therefore weaker than invariance for all time; the two agree when $C$ is compact. Uniqueness for a time-invariant $f$ also gives the tail property: restarting at $x(t_1)$ reproduces the tail of the original trajectory, whatever happened before $t_1$ (GoSafeOpt's backups, Module 6). A Lipschitz $f$ alone is not enough under feedback: a discontinuous $\pi$ can destroy uniqueness.

Equilibria and linearisation

Definition — Equilibrium (fixed point)
$x^\ast$ is an equilibrium of $\dot x=f(x)$ if $f(x^\ast)=0$, and of $x_{t+1}=f(x_t)$ if $f(x^\ast)=x^\ast$. With an input, a pair $(x^\ast,u^\ast)$ with $f(x^\ast,u^\ast)=0$ (respectively $=x^\ast$). A trajectory that starts at an equilibrium stays there. Shifting coordinates, $\tilde x=x-x^\ast$, moves the equilibrium to the origin, which is why stability results are stated for $x^\ast=0$.

Examples. The unforced pendulum has $x_2=0$ and $\sin x_1=0$: the upright position $\theta=0$ and the hanging position $\theta=\pi$. The affine map $x_{t+1}=ax_t+b$ with $a\ne1$ has the single fixed point $x^\ast=b/(1-a)$.

Fact — Attracting fixed points of scalar iterations
Let $s_{k+1}=g(s_k)$ with $g$ continuously differentiable and $g(s^\ast)=s^\ast$. If $|g'(s^\ast)|\lt1$, then iterates that start close enough to $s^\ast$ converge to it; if $|g'(s^\ast)|\gt1$, nearby iterates move away. Reason: by the mean value theorem $s_{k+1}-s^\ast=g(s_k)-g(s^\ast)=g'(\xi_k)(s_k-s^\ast)$ for some $\xi_k$ between $s_k$ and $s^\ast$; on an interval around $s^\ast$ where $|g'|\le q\lt1$ the error shrinks by the factor $q$ at every step.

Worked example (Module 13). A Parseval-network update acts on each singular value as $g(s)=(1+\beta)s-\beta s^3$. Then $g(1)=1$ and $g'(1)=1-2\beta$, so the criterion certifies that $s^\ast=1$ attracts when $|1-2\beta|\lt1$, i.e. $0\lt\beta\lt1$ (and repels for $\beta\gt1$). With $\beta=0.1$ and $s_0=0.5$ the iterates are $0.5375$, $0.5757$, $0.6142$, $0.6525$, $0.6899,\dots$, converging to $1$ and eventually shrinking the error by about $g'(1)=0.8$ per step.

Definition — Linearisation
At an equilibrium $(x^\ast,u^\ast)$ take the Jacobians (Primer B) $A=\frac{\partial f}{\partial x}(x^\ast,u^\ast)$, $B=\frac{\partial f}{\partial u}(x^\ast,u^\ast)$. For small deviations $\delta x=x-x^\ast$, $\delta u=u-u^\ast$ a first-order Taylor expansion gives $$\delta\dot x\approx A\,\delta x+B\,\delta u\qquad\text{or}\qquad \delta x_{t+1}\approx A\,\delta x_t+B\,\delta u_t,$$ with an error that is small compared with $\|(\delta x,\delta u)\|$. Conclusions drawn from $(A,B)$ are local: they hold near the equilibrium only.

Example. For the pendulum with $g/l=10$, $b=0.1$: at the upright equilibrium $A=\begin{bmatrix}0 & 1\\ 10\cos0 & -0.1\end{bmatrix}=\begin{bmatrix}0 & 1\\ 10 & -0.1\end{bmatrix}$ and $B=\begin{bmatrix}0\\ 1\end{bmatrix}$; at the hanging one $\cos\pi=-1$ turns the $10$ into $-10$. Section 2 reads off stability from the eigenvalues (Exercise D.1). Scaled coordinates. Module 11 works in normalised coordinates $z=S^{-1}x$ with $S=\mathrm{diag}(0.5,1.5)$; then a quadratic form becomes $x^{\top}Px=z^{\top}(S^{\top}PS)z$ and the Jacobian becomes $S^{-1}AS$.

Sampling, holding, saturating and switching

Definition — Euler discretisation and zero-order hold
Forward Euler replaces $\dot x=f(x,u)$ by $x_{k+1}=x_k+\Delta t\,f(x_k,u_k)$, a first-order Taylor step with local error of order $\Delta t^2$. It is a modelling choice, not the exact solution. With a zero-order hold (ZOH) the input is held constant between samples, $u(t)=u_k$ on $[k\Delta t,(k+1)\Delta t)$. For linear systems this has an exact sampled model, $x_{k+1}=A_dx_k+B_du_k$ with $A_d=e^{A\Delta t}$ and $B_d=\int_0^{\Delta t}e^{As}\,\mathrm ds\,B$ (matrix exponential: Section 2); for the scalar $\dot x=ax+bu$, $a\ne0$: $x_{k+1}=e^{a\Delta t}x_k+\frac{e^{a\Delta t}-1}{a}\,b\,u_k$.

Example. For $\dot x=-x$ with $\Delta t=0.1$ Euler multiplies by $0.9$ per step, the exact factor is $e^{-0.1}=0.9048$. With $\Delta t=2.5$ Euler multiplies by $1-2.5=-1.5$ and diverges, while the true system shrinks by $e^{-2.5}=0.082$ per step. Sample-and-hold control computes $u_k=\kappa(x(t_k))$ only at the sampling instants and cannot react in between. If $\|\dot x\|\le M$ along the trajectory, then $\|x(t)-x(t_k)\|\le M\Delta t$ on $[t_k,t_k+\Delta t)$, so a margin checked at the samples must include this buffer: for the safe set $\{x\le1\}$, speed $|\dot x|\le2$ and $\Delta t=0.05$, require $x_k\le0.9$. Saturation clips inputs, componentwise $\mathrm{sat}(u)=\max\{-u_{\max},\min\{u_{\max},u\}\}$ or radially $u\mapsto u\min\{1,u_{\max}/\|u\|\}$ (defined as $0$ at $u=0$, and otherwise keeping the direction); a saturated linear feedback is a nonlinear system (Section 7).

Switched systems. $\dot x=f_{\sigma(t)}(x)$ with a piecewise-constant mode $\sigma(t)\in\{1,\dots,M\}$. The dwell time is the minimum time between consecutive switches. Switching fast enough between individually stable modes can destabilise, whereas a sufficiently long minimum dwell time preserves stability when, for example, every mode is linear with a Hurwitz matrix (Section 2). Rapid back-and-forth switching near a threshold is called chattering; an ideal switching law and its sampled implementation can then behave very differently.

Where this is used
Pitfall
A discretised model is a different dynamical system. Its equilibria, stability and invariant sets must be checked for the map itself: the Euler map of a stable ODE can be unstable (above), and a set that the flow never leaves can be left in one Euler step (Section 3).

Practice — Turn a model into an actual trajectory

Easy checks the basic operation; Medium connects steps; Hard asks you to justify a conclusion or identify a limitation. Each solution explains why the steps work.

Exercise D.S1 — Easy: Apply a recursion one step at a time

For $x_{t+1}=0.5x_t+u_t$, start at $x_0=2$ and apply $u_0=1$, $u_1=0$, $u_2=-1$. Find $x_1,x_2,x_3$. If the input were always $1$, what would the equilibrium be?

Review if needed: this section and functions and fixed points.

Show hint
Use the newest state in each substitution. A discrete equilibrium satisfies $x_*=f(x_*,u_*)$.
Show worked solution
  1. $x_1=0.5(2)+1=2$. The first input exactly offsets the contraction.
  2. $x_2=0.5(2)+0=1$, then $x_3=0.5(1)-1=-0.5$. Inputs with different indices affect different transitions.
  3. For constant input $1$, solve $x_*=0.5x_*+1$, giving $x_*=2$. The computed sequence left that equilibrium because the subsequent inputs changed.
Exercise D.S2 — Medium: Close the loop before analysing it

Use the feedback law $u_t=-0.25x_t$ in the same model. Write the closed-loop recursion, its equilibrium, and its solution from $x_0=4$.

Review if needed: this section and functions and fixed points.

Show hint
Substitute the controller into the plant. The resulting multiplier is $0.5-0.25$.
Show worked solution
  1. The closed loop is $x_{t+1}=0.5x_t-0.25x_t=0.25x_t$.
  2. An equilibrium satisfies $x_*=0.25x_*$, so $x_*=0$.
  3. Repeated substitution gives $x_t=4(0.25)^t$: the first states are $4,1,0.25,0.0625$. Since $|0.25|\lt1$, every initial state converges to zero. Feedback changed the dynamics rather than adding a separate property to the open-loop recursion.
Exercise D.S3 — Hard: Two equilibria, two local behaviours

For the continuous-time model $\dot x=-x+x^2$, find all equilibria and the linearisation at each. From $x=0.1$, compute one forward-Euler step of length $0.2$. Explain why this step is not an exact solution.

Review if needed: this section and functions and fixed points.

Show hint
Continuous equilibria satisfy $f(x_*)=0$. The linearised rate is $f'(x_*)$.
Show worked solution
  1. $-x+x^2=x(x-1)=0$ gives equilibria $0$ and $1$.
  2. $f'(x)=-1+2x$. Near $0$ the perturbation obeys $\dot\xi\approx-\xi$, locally asymptotically stable; near $1$ it obeys $\dot\xi\approx\xi$, unstable.
  3. Euler uses $x_{\rm next}=x+\Delta t f(x)$, giving $0.1+0.2(-0.1+0.01)=0.082$. It freezes the rate at the start of the interval. The true rate changes as the state moves, so Euler is an approximation, unlike an exact discrete-time model.

2. Linear Systems: Solutions, Eigenvalues & Stability

Start here — Separate continuous and discrete stability tests

One coordinate already shows the two stability rules: $x_{t+1}=-1.2x_t$ grows in magnitude, while $\dot x=-1.2x$ decays. Discrete time tests eigenvalue magnitudes; continuous time tests real parts. The matrix statements generalise these scalar facts.

When ready, try the Easy, Medium and Hard practice for this section. For a prerequisite gap, review eigenvalues and eigenvectors.

Linear systems are the one class we can solve in closed form, and every local analysis of a nonlinear system reduces to one (Section 1). Their behaviour is written in the eigenvalues of a single matrix.

Definition — Linear time-invariant (LTI) state-space system
$$x_{t+1}=Ax_t+Bu_t,\quad y_t=Cx_t+Du_t\qquad\text{or}\qquad \dot x=Ax+Bu,\quad y=Cx+Du,$$ with state matrix $A\in\mathbb R^{n\times n}$, input matrix $B\in\mathbb R^{n\times m}$, output matrix $C\in\mathbb R^{p\times n}$ and direct feedthrough $D\in\mathbb R^{p\times m}$, all constant in time.

Solutions. Iterating the recursion (induction on $t$) gives $$x_t=A^tx_0+\sum_{s=0}^{t-1}A^{t-1-s}Bu_s .$$ For the scalar example of Section 1 ($a=0.5$, $b=1$, $u_s=1$, $x_0=0$): $x_t=\sum_{s=0}^{t-1}0.5^{t-1-s}=2(1-0.5^t)$, i.e. $0,1,1.5,1.75,\dots$ An affine scalar recurrence $x_{t+1}=ax_t+b$ ($a\ne1$) is solved by subtracting its fixed point $x^\ast=b/(1-a)$: $x_{t+1}-x^\ast=a(x_t-x^\ast)$, so $x_t-x^\ast=a^t(x_0-x^\ast)$. For $0\lt a\lt1$ the approach is monotone (no overshoot), for $-1\lt a\lt0$ it alternates in sign, for $|a|\gt1$ it diverges. In Module 6's explorer, the Euler step of $\dot x=-x+u+w$ under the proportional controller $u=\kappa(\rho-x)$, $x_{k+1}=x_k+\Delta t\,[-(1+\kappa)x_k+\kappa\rho+w]$, has $a=1-\Delta t(1+\kappa)$ and $x^\ast=(\kappa\rho+w)/(1+\kappa)$; with $\kappa=3$, $\rho=0.8$, $w=0.6$, $\Delta t=0.0025$ this is $a=0.99$ and $x^\ast=0.75$. From $x_0=0$ the state rises monotonically, so the supremum of the state along the infinite trajectory is the limit $x^\ast$ itself (approached, never exceeded).

Definition — Matrix exponential
$$e^{M}=I+M+\frac{M^2}{2!}+\frac{M^3}{3!}+\cdots\qquad(\text{converges for every square }M).$$ Properties: (i) $\frac{\mathrm d}{\mathrm dt}e^{At}=Ae^{At}=e^{At}A$; (ii) $(e^{M})^{\top}=e^{M^{\top}}$; (iii) $e^{M+N}=e^{M}e^{N}$ if $MN=NM$, false in general; (iv) $e^{-M}e^{M}=I$, so $e^M$ is always invertible; (v) if $M=V\Lambda V^{-1}$ with $\Lambda$ diagonal, then $e^{Mt}=Ve^{\Lambda t}V^{-1}$ with $e^{\Lambda t}=\mathrm{diag}(e^{\lambda_it})$. The continuous-time solution is $x(t)=e^{At}x_0+\int_0^te^{A(t-s)}Bu(s)\,\mathrm ds$: differentiate $e^{-At}x(t)$ to get $e^{-At}(\dot x-Ax)=e^{-At}Bu$, integrate from $0$ to $t$, multiply by $e^{At}$.

Examples. $N=\begin{bmatrix}0 & 1\\ 0 & 0\end{bmatrix}$ is nilpotent ($N^2=0$), so $e^{Nt}=I+Nt=\begin{bmatrix}1 & t\\ 0 & 1\end{bmatrix}$: a double integrator drifts linearly. For the skew-symmetric $J=\begin{bmatrix}0 & -\theta\\ \theta & 0\end{bmatrix}$ the series sums to the rotation $e^{J}=\begin{bmatrix}\cos\theta & -\sin\theta\\ \sin\theta & \cos\theta\end{bmatrix}$. In general $J^{\top}=-J$ gives $(e^{J})^{\top}e^{J}=e^{-J}e^{J}=I$ by (ii) and (iv): the exponential of a skew-symmetric matrix is orthogonal (Module 13's SOC layers).

Background — Complex numbers for eigenvalues
$z=a+jb$ with $j^2=-1$; conjugate $\bar z=a-jb$; modulus $|z|=\sqrt{a^2+b^2}=\sqrt{z\bar z}$; polar form $z=re^{j\theta}$ with $r=|z|$ and Euler's formula $e^{j\theta}=\cos\theta+j\sin\theta$. Powers are easy in polar form: $z^t=r^te^{jt\theta}$, so the modulus is multiplied by $r$ and the angle advanced by $\theta$ at every step. A real matrix has complex eigenvalues in conjugate pairs $\lambda,\bar\lambda$ with conjugate eigenvectors, and the corresponding real solutions are $r^t(c_1\cos t\theta+c_2\sin t\theta)$: an oscillation inside the envelope $r^t$ with a nominal cycle length of $2\pi/|\theta|$ steps. This is an exact period only if $N\theta$ is a multiple of $2\pi$ for some integer $N$ (for $\theta=1$ it never is), and the decaying envelope makes the full solution nonperiodic anyway.

Modes. If $Av=\lambda v$ and $x_0=v$, then $x_t=\lambda^tv$ and $e^{At}v=e^{\lambda t}v$. For diagonalisable $A$ with $x_0=\sum_ic_iv_i$, $x_t=\sum_ic_i\lambda_i^tv_i$ and $x(t)=\sum_ic_ie^{\lambda_it}v_i$: every solution is a superposition of modes, and the slowest one (largest $|\lambda|$ in discrete time, largest $\mathrm{Re}\,\lambda$ in continuous time) dominates in the end. Example: $A=\begin{bmatrix}0.9 & -0.3\\ 0.3 & 0.9\end{bmatrix}$ has $\lambda=0.9\pm0.3j$, $|\lambda|=\sqrt{0.9}=0.9487$ and $\theta=\arctan(1/3)=0.3218$: trajectories spiral inward, shrinking by $0.9487$ per step and turning once about every $2\pi/0.3218\approx19.5$ steps (a nominal cycle length, not an exact period). The matrix $M=\begin{bmatrix}0 & -1\\ 1 & 1\end{bmatrix}$ (Module 8's integral-only multiplier loop with $cK_I=1$) has $\lambda=\tfrac12\pm\tfrac{\sqrt3}{2}j=e^{\pm j\pi/3}$ of modulus $1$: indeed $M^3=-I$ and $M^6=I$, a sustained oscillation of period $6$.

Fact — Eigenvalues of a $2\times2$ matrix from trace and determinant
With $\tau=\operatorname{tr}A$ and $\Delta=\det A$ the characteristic polynomial is $\lambda^2-\tau\lambda+\Delta$, so $\lambda=\tfrac\tau2\pm\sqrt{\tau^2/4-\Delta}$. The eigenvalues are complex iff $\tau^2\lt4\Delta$, and then $|\lambda|^2=\lambda\bar\lambda=\Delta$.

Schur and Hurwitz stability

Definition and theorem — Schur and Hurwitz matrices
$A$ is Schur stable if every eigenvalue satisfies $|\lambda|\lt1$, i.e. the spectral radius $\rho(A)\lt1$ (open unit disk), and Hurwitz if every eigenvalue has $\mathrm{Re}\,\lambda\lt0$ (open left half-plane). Then:
  • every trajectory of $x_{t+1}=Ax_t$ tends to $0$ $\iff$ $A^t\to0$ $\iff$ $A$ is Schur; the decay is geometric: for every $q\in(\rho(A),1)$ there is $c\ge1$ with $\|A^t\|\le c\,q^t$;
  • every trajectory of $\dot x=Ax$ tends to $0$ $\iff$ $A$ is Hurwitz, and then $\|e^{At}\|\le c\,e^{-\mu t}$ for every $\mu$ smaller than $\min_i|\mathrm{Re}\,\lambda_i|$.
Exact sampling maps an eigenvalue $\lambda$ of $A$ to $e^{\lambda\Delta t}$, an eigenvalue of $e^{A\Delta t}$, and $|e^{\lambda\Delta t}|=e^{\mathrm{Re}\lambda\,\Delta t}\lt1\iff\mathrm{Re}\,\lambda\lt0$: the left half-plane is mapped into the unit disk.

Proof for diagonalisable $A$. $A^t=V\Lambda^tV^{-1}$ gives $\|A^t\|\le\|V\|\,\|V^{-1}\|\,\rho(A)^t$. Conversely, an eigenvector $v$ with $|\lambda|\ge1$ gives $\|A^tv\|=|\lambda|^t\|v\|\not\to0$ (for complex $v$ one of the real vectors $\mathrm{Re}\,v$, $\mathrm{Im}\,v$ does not decay). Non-diagonalisable matrices add polynomial factors $t^k\lambda^t$ from Jordan blocks, which still vanish when $|\lambda|\lt1$; this is why $q$ must be strictly larger than $\rho(A)$. Tests for $2\times2$ matrices: Hurwitz $\iff\tau\lt0$ and $\Delta\gt0$; Schur $\iff|\Delta|\lt1$ and $|\tau|\lt1+\Delta$ (the $n=2$ case of Jury's test). Examples: $\begin{bmatrix}0 & 1\\ -2 & -3\end{bmatrix}$ has $\tau=-3$, $\Delta=2$: Hurwitz (eigenvalues $-1,-2$). The spiral matrix above has $\Delta=0.9$, $\tau=1.8\lt1.9$: Schur. Marginal cases are not asymptotically stable: $M$ above oscillates forever, and the Jordan block $\begin{bmatrix}1 & 1\\ 0 & 1\end{bmatrix}^t=\begin{bmatrix}1 & t\\ 0 & 1\end{bmatrix}$ grows although both eigenvalues equal $1$.

Pitfall — $\rho(A)\lt1$ does not mean $\|A\|\lt1$
$\rho(A)\le\|A\|$ for every induced norm, so $\|A\|\lt1$ is sufficient for decay ($\|A^t\|\le\|A\|^t$) but not necessary. $A=\begin{bmatrix}0.5 & 10\\ 0 & 0.5\end{bmatrix}$ has $\rho(A)=0.5$ but $\|A\|\approx10.0$: from $x_0=(0,1)$ the state jumps to $x_1=(10,0.5)$, and $\|A^t\|$ is $10.02,\ 10.01,\ 7.50,\ 5.00,\ 3.13,\dots$ before the geometric decay wins. Such transient growth of non-normal matrices matters for safety: a stable system may leave a safe set before it settles.
Theorem — Neumann series (matrix geometric series)
If $\|A\|\lt1$ for some induced norm (more generally, if $\rho(A)\lt1$), then $I-A$ is invertible and $$(I-A)^{-1}=\sum_{t=0}^{\infty}A^t,\qquad \|(I-A)^{-1}\|\le\frac{1}{1-\|A\|}\ \ (\text{when }\|A\|\lt1).$$ Proof. Telescoping, $(I-A)\sum_{t=0}^{T-1}A^t=I-A^T\to I$. The series converges absolutely because $\|A^t\|\le\|A\|^t$ (or $\le cq^t$), and $\|\sum_tA^t\|\le\sum_t\|A\|^t=1/(1-\|A\|)$.

Example (Module 9). For a column-stochastic transition matrix $P$ (columns sum to one, so $\|P\|_1=1$) and a discount $0\lt\gamma\lt1$: $\|\gamma P\|_1=\gamma\lt1$, hence $(I-\gamma P)^{-1}=\sum_t\gamma^tP^t$ with $\|(I-\gamma P)^{-1}\|_1\le1/(1-\gamma)$. Applied to an initial distribution $\mu$, $P^t\mu$ is the state distribution after $t$ steps, so $(1-\gamma)(I-\gamma P)^{-1}\mu$ is the discounted average of the successive distributions. Scalar check: $1/(1-0.5)=2=1+0.5+0.25+\cdots$

Theorem — Local stability from the linearisation (Lyapunov's indirect method)
Let $f$ be continuously differentiable with equilibrium $x^\ast$ and Jacobian $A$ there. Continuous time: $A$ Hurwitz $\Rightarrow$ $x^\ast$ is locally exponentially stable; an eigenvalue with $\mathrm{Re}\,\lambda\gt0$ $\Rightarrow$ unstable. Discrete time: $A$ Schur $\Rightarrow$ locally exponentially stable; an eigenvalue with $|\lambda|\gt1$ $\Rightarrow$ unstable. Eigenvalues on the boundary are inconclusive ($\dot x=-x^3$ and $\dot x=x^3$ both have $A=0$). The conclusion is local: it holds for initial states close enough to $x^\ast$, with no estimate of how close (Section 3 provides one and the proof). A projection or saturation that is inactive near $x^\ast$ (for example $[\lambda]_+$ at a multiplier $\lambda^\ast\gt0$) does not change $A$ and can be ignored locally, but not for global claims.

Phase portraits in the plane. For $\dot x=Ax$ with $A\in\mathbb R^{2\times2}$: two real eigenvalues of the same sign give a node (stable if negative), opposite signs a saddle, a complex pair a focus (spiral; stable if $\mathrm{Re}\,\lambda\lt0$), a purely imaginary pair a center (closed orbits). At a saddle with $\lambda_s\lt0\lt\lambda_u$ and eigenvectors $v_s,v_u$, $x(t)=c_se^{\lambda_st}v_s+c_ue^{\lambda_ut}v_u$ tends to $0$ only if $c_u=0$, i.e. $x_0$ lies on the line through $v_s$, the stable manifold; for a nonlinear system it is a curve tangent to $v_s$. Example: $A=\begin{bmatrix}0 & 1\\ 1 & 0\end{bmatrix}$ has $\lambda=\pm1$, $v_s=(1,-1)$: from $x_0=(1,-1)$ the state decays like $e^{-t}$, from $(1,-0.99)$ it diverges. Converging along one special curve is not stability. Conversely, feedback can create unwanted equilibria: where a safety filter exactly cancels the nominal controller, the closed loop can have an equilibrium on the boundary of the safe set that is even asymptotically stable, so the system stops short of its goal (Module 10). The explorer at the end of this page draws all four portraits.

Where this is used

Practice — Separate continuous and discrete stability tests

Easy checks the basic operation; Medium connects steps; Hard asks you to justify a conclusion or identify a limitation. Each solution explains why the steps work.

Exercise D.S4 — Easy: A negative eigenvalue can still be unstable

Consider the discrete system $x_{t+1}=Ax_t$ with $A=\operatorname{diag}(0.5,-1.2)$ and $x_0=(2,1)$. Find $x_1,x_2$ and decide stability.

Review if needed: this section and eigenvalues and eigenvectors.

Show hint
Discrete eigenvalues must have magnitude less than one; their sign alone is insufficient.
Show worked solution
  1. The coordinates evolve independently: $x_t=(2(0.5)^t,(-1.2)^t)$.
  2. Thus $x_1=(1,-1.2)$ and $x_2=(0.5,1.44)$. The second coordinate alternates sign and grows in magnitude.
  3. The eigenvalue $-1.2$ has magnitude $1.2\gt1$, so the origin is unstable. The condition on negative real parts belongs to continuous time, not to this recursion.
Exercise D.S5 — Medium: Solve and bound a continuous trajectory

For $\dot x=\operatorname{diag}(-1,-2)x$ and $x(0)=(3,4)$, find $x(t)$ and an upper bound on $\|x(t)\|_2$ of the form $Ce^{-t}$.

Review if needed: this section and eigenvalues and eigenvectors.

Show hint
Each scalar equation $\dot z=az$ has solution $z(t)=e^{at}z(0)$.
Show worked solution
  1. The exact trajectory is $x(t)=(3e^{-t},4e^{-2t})$.
  2. Its squared norm is $9e^{-2t}+16e^{-4t}$. Since $t\ge0$, $e^{-4t}\le e^{-2t}$.
  3. Therefore $\|x(t)\|_2^2\le25e^{-2t}$ and $\|x(t)\|_2\le5e^{-t}$. Both eigenvalues have negative real part, and the bound proves exponential convergence with an explicit rate and prefactor.
Exercise D.S6 — Hard: Stable eigenvalues allow transient amplification

Let $A=\begin{bmatrix}0.5&10\\0&0.5\end{bmatrix}$ in discrete time, with $x_0=(0,1)$. Show that the system is asymptotically stable even though $\|x_1\|_2\gt\|x_0\|_2$. Derive $x_t$ for $t\ge1$.

Review if needed: this section and eigenvalues and eigenvectors.

Show hint
Write $A=0.5I+N$ where $N^2=0$, so only the first two binomial terms survive.
Show worked solution
  1. $A^t=0.5^tI+t\,0.5^{t-1}N$, since every term involving $N^2$ is zero.
  2. Applying this to $(0,1)$ gives $x_t=(10t\,0.5^{t-1},0.5^t)$. At $t=1$, $x_1=(10,0.5)$ has norm $\sqrt{100.25}\approx10.0125$, compared with initial norm $1$.
  3. Both $0.5^t$ and $t\,0.5^{t-1}$ tend to zero, so every trajectory tends to zero. Stability does not require the Euclidean norm to decrease at every step; a suitable Lyapunov norm can behave differently.

3. Lyapunov Functions, Invariant Sets & Regions of Attraction

Start here — Use a scalar certificate along a trajectory

A Lyapunov function is a scalar measure of distance from an equilibrium. For $V=x^2$ and $\dot x=-2x$, the chain rule gives $\dot V=-4x^2$. A decreasing certificate can prove behaviour for every state in a region without solving each trajectory.

When ready, try the Easy, Medium and Hard practice for this section. For a prerequisite gap, review gradients and the chain rule.

Solving a nonlinear system is usually impossible. Lyapunov's idea is to certify its behaviour without solving it: find an "energy" that can only decrease along trajectories. The same device certifies safety, because the sublevel sets of such a function are sets that trajectories cannot leave.

Definition — Stability notions (equilibrium shifted to $0$)
For $\dot x=f(x)$ with unique solutions, or $x_{t+1}=f(x_t)$, and $f(0)=0$ ($0$ is an equilibrium):
  • Lyapunov stable: for every $\varepsilon\gt0$ there is $\delta\gt0$ with $\|x_0\|\lt\delta\Rightarrow\|x(t)\|\lt\varepsilon$ for all $t\ge0$ ("start close, stay close").
  • Attractive: there is $\delta_0\gt0$ with $\|x_0\|\lt\delta_0\Rightarrow x(t)\to0$. Asymptotically stable: stable and attractive; globally (GAS) if every trajectory converges.
  • Exponentially stable: there are $c,\lambda,\delta_0\gt0$ with $\|x(t)\|\le c\,e^{-\lambda t}\|x_0\|$ whenever $\|x_0\|\lt\delta_0$ (discrete time: $c\,q^t$ with $q\lt1$).
  • Region of attraction: $\mathcal R=\{x_0:\ x(t)\to0\}$.
For a set $C$ instead of a point, replace $\|x\|$ by the distance $\mathrm{dist}(x,C)=\inf_{y\in C}\|x-y\|$ (Module 10's asymptotic stability of a safe set). A violation measure such as $\max\{0,-h(x)\}$ tending to $0$ is not the same as $\mathrm{dist}(x(t),C)\to0$ when $C$ is unbounded; near a compact $C$ with a regular boundary the two agree.

Neither half implies the other. The center $\dot x=\begin{bmatrix}0 & 1\\ -1 & 0\end{bmatrix}x$ moves on circles: stable, not attractive. On the circle, $\dot\theta=1-\cos\theta$ carries every angle to $\theta=0$ (mod $2\pi$), but from $\theta_0=0.01$ the state first travels all the way around: attractive, not stable. An equilibrium reached only along a special curve, like the saddle of Section 2, is neither.

Definition — Positive definite and radially unbounded functions; sublevel sets
$V:D\to\mathbb R$ with $0\in D$ is positive definite (on $D$) if $V(0)=0$ and $V(x)\gt0$ for all $x\in D\setminus\{0\}$. It is radially unbounded ($D=\mathbb R^n$) if $V(x)\to\infty$ as $\|x\|\to\infty$. Its sublevel sets are $\mathcal V(c)=\{x:\ V(x)\le c\}$.

Examples. A quadratic form $V=x^{\top}Px$ with $P\succ0$ satisfies $\lambda_{\min}(P)\|x\|^2\le V(x)\le\lambda_{\max}(P)\|x\|^2$ (Primer A): positive definite, radially unbounded, with ellipsoidal sublevel sets. $V=x_1^2+x_2^4$ is positive definite but not quadratic. Positive definiteness belongs to a function on a domain: $V=1-\cos x_1+\tfrac12x_2^2$ is positive definite on $(-2\pi,2\pi)\times\mathbb R$ but not on $\mathbb R^2$. $V=\frac{x_1^2}{1+x_1^2}+x_2^2$ is positive definite but not radially unbounded: $V(x_1,0)\lt1$ for every $x_1$, so $\mathcal V(1)$ contains the whole $x_1$-axis and is unbounded, and a decreasing $V$ then no longer confines the state. Barbashin and Krasovskii's example (Kuznetsov et al., arXiv 2021, Example 1) is $\dot x_1=-\frac{2x_1}{(1+x_1^2)^2}+2x_2$, $\dot x_2=-\frac{2(x_1+x_2)}{(1+x_1^2)^2}$ with this $V$: $\dot V=-\frac{4}{(1+x_1^2)^2}\big(\frac{x_1^2}{(1+x_1^2)^2}+x_2^2\big)\lt0$ for $x\ne0$, yet every solution that starts with $x_1x_2\ge2$ is unbounded. A continuous $V$ has closed sublevel sets; if they are also bounded they are compact (Primer 0).

Theorem — Lyapunov's direct method
Continuous time. $f$ locally Lipschitz, $f(0)=0$, $D\ni0$ open, $V:D\to\mathbb R$ continuously differentiable and positive definite. Along a solution the chain rule gives $\frac{\mathrm d}{\mathrm dt}V(x(t))=\dot V(x(t))$ with $$\dot V(x):=\nabla V(x)^{\top}f(x).$$ (a) If $\dot V(x)\le0$ on $D$, the origin is Lyapunov stable. (b) If $\dot V(x)\lt0$ on $D\setminus\{0\}$, it is asymptotically stable. (c) If moreover $D=\mathbb R^n$ and $V$ is radially unbounded, it is globally asymptotically stable.
Discrete time. The same with $f$ and $V$ continuous and the decrease $\Delta V(x):=V(f(x))-V(x)$ in place of $\dot V$.

In words. A function that is zero only at the equilibrium and never increases along trajectories traps them near it; if it strictly decreases, they converge. No trajectory is ever computed. Why the assumptions: positive definiteness makes "small $V$" mean "small $x$"; strict decrease at every $x\ne0$ prevents trajectories from stalling on a level; radial unboundedness excludes escape along unbounded sublevel sets. Example where linearisation fails: $\dot x=-x^3$ has Jacobian $0$ at the origin (inconclusive), but $V=x^2/2$ gives $\dot V=-x^4\lt0$ for $x\ne0$, and $V$ is radially unbounded: GAS. It is not exponentially stable: the solution $x(t)=x_0/\sqrt{1+2x_0^2t}$ decays only like $t^{-1/2}$.

Theorem — Invariant sublevel sets and region-of-attraction estimates
Assumptions. $x_{t+1}=F(x_t)$ with $F$ continuous and $F(0)=0$; $V$ continuous and positive definite; for some $c\gt0$ the sublevel set $\mathcal V(c)$ is compact; $\Delta V(x)\lt0$ for all $x\in\mathcal V(c)\setminus\{0\}$. Statement. $\mathcal V(c)$ is forward invariant and every trajectory starting in it converges to $0$, so $\mathcal V(c)\subseteq\mathcal R$. (Continuous time: the same with $\dot V\lt0$ on $\mathcal V(c)\setminus\{0\}$ and $\mathcal V(c)$ inside the domain of $V$.)
Proof — why one strict inequality on a compact set is enough

Invariance. If $x_t\in\mathcal V(c)$, then $V(x_{t+1})\le V(x_t)\le c$ (strictly smaller unless $x_t=0$, and $F(0)=0$).

Convergence of $V$. $V(x_t)$ is non-increasing and bounded below by $0$, so it converges to some $v^\ast\ge0$ (Primer 0). Suppose $v^\ast\gt0$. Then every $x_t$ lies in $K=\{x:\ v^\ast\le V(x)\le c\}$, a closed subset of the compact $\mathcal V(c)$ that does not contain $0$. The continuous function $\Delta V$ attains its maximum on $K$, and this maximum $-\eta$ is negative. Hence $V(x_{t+1})\le V(x_t)-\eta$ for every $t$, which drives $V$ below $0$: a contradiction. So $V(x_t)\to0$.

Convergence of $x$. For $\varepsilon\gt0$ let $m_\varepsilon=\min\{V(x):\ x\in\mathcal V(c),\ \|x\|\ge\varepsilon\}$ (if this compact set is empty there is nothing to show). It is positive, being the minimum of a positive continuous function on a compact set. Eventually $V(x_t)\lt m_\varepsilon$, hence $\|x_t\|\lt\varepsilon$. $\blacksquare$

Worked example. $\dot x=-x+x^3$ has equilibria $0,\pm1$. With $V=x^2/2$: $\dot V=-x^2+x^4=-x^2(1-x^2)\lt0$ for $0\lt|x|\lt1$. Every sublevel set $\{x^2/2\le c\}$ with $c\lt\tfrac12$ lies in $|x|\lt1$ and is therefore an invariant subset of the region of attraction; their union is $(-1,1)$, which here is exactly $\mathcal R$ (the points $\pm1$ are equilibria, and from $|x_0|\gt1$ the state escapes in finite time).

Theorem — Exponential stability from Lyapunov bounds
If $k_1\|x\|^a\le V(x)\le k_2\|x\|^a$ and $\dot V(x)\le-k_3\|x\|^a$ for all $x$ (constants $k_1,k_2,k_3,a\gt0$), then $$\|x(t)\|\le\Big(\frac{k_2}{k_1}\Big)^{1/a}e^{-\frac{k_3}{a k_2}t}\,\|x_0\|.$$ Proof. $\dot V\le-k_3\|x\|^a\le-\tfrac{k_3}{k_2}V$, so $\frac{\mathrm d}{\mathrm dt}\big(e^{k_3t/k_2}V\big)=e^{k_3t/k_2}\big(\dot V+\tfrac{k_3}{k_2}V\big)\le0$ and $V(x(t))\le e^{-k_3t/k_2}V(x_0)$. Sandwich: $k_1\|x(t)\|^a\le e^{-k_3t/k_2}k_2\|x_0\|^a$; take $a$-th roots. Discrete time: $\Delta V\le-k_3\|x\|^a$ gives $V(x_{t+1})\le(1-k_3/k_2)V(x_t)$, a geometric decay.

Quadratic Lyapunov functions and the Lyapunov equation

For $\dot x=Ax$ and $V=x^{\top}Px$: $\dot V=\dot x^{\top}Px+x^{\top}P\dot x=x^{\top}(A^{\top}P+PA)x$. For $x_{t+1}=Ax_t$: $\Delta V=x^{\top}(A^{\top}PA-P)x$. The decrease condition becomes a matrix equation.

Theorem — The Lyapunov equation
$A$ is Hurwitz $\iff$ for some (equivalently, every) $Q\succ0$ the Lyapunov equation $A^{\top}P+PA=-Q$ has a solution $P\succ0$. The solution is then unique, $P=\int_0^\infty e^{A^{\top}t}Qe^{At}\,\mathrm dt$.
$A$ is Schur $\iff$ for some (equivalently, every) $Q\succ0$ the discrete Lyapunov (Stein) equation $A^{\top}PA-P=-Q$ has a solution $P\succ0$; then $P=\sum_{k\ge0}(A^{\top})^kQA^k$. Module 2 turns the inequality versions into LMIs.
Proof sketch — the Lyapunov equation

($\Leftarrow$) $V=x^{\top}Px$ satisfies $\dot V=-x^{\top}Qx\le-\lambda_{\min}(Q)\|x\|^2$ and $\lambda_{\min}(P)\|x\|^2\le V\le\lambda_{\max}(P)\|x\|^2$; the exponential theorem ($a=2$) gives $e^{At}x_0\to0$ for every $x_0$, so $A$ is Hurwitz. ($\Rightarrow$) If $A$ is Hurwitz, $\|e^{At}\|\le ce^{-\mu t}$ makes the integral converge; $x^{\top}Px=\int_0^\infty\|Q^{1/2}e^{At}x\|^2\mathrm dt\gt0$ for $x\ne0$; and $A^{\top}P+PA=\int_0^\infty\frac{\mathrm d}{\mathrm dt}\big(e^{A^{\top}t}Qe^{At}\big)\mathrm dt=0-Q$. The discrete case replaces the integral by the sum: $A^{\top}PA-P=\sum_{k\ge1}(A^{\top})^kQA^k-\sum_{k\ge0}(A^{\top})^kQA^k=-Q$.

Local stability from the linearisation (the proof promised in Section 2): write $f(x)=Ax+r(x)$ with $\|r(x)\|\le\epsilon\|x\|$ for $\|x\|\le\delta(\epsilon)$, and take $P$ with $A^{\top}P+PA=-I$. Then $\dot V=-\|x\|^2+2x^{\top}Pr(x)\le-(1-2\epsilon\|P\|)\|x\|^2\lt0$ for $0\lt\|x\|\le\delta$ once $\epsilon\lt1/(2\|P\|)$; a small sublevel set of $V$ is an invariant region-of-attraction estimate and the exponential theorem applies.

Worked example. $A=\begin{bmatrix}0 & 1\\ -2 & -3\end{bmatrix}$ (eigenvalues $-1,-2$), $Q=I$, $P=\begin{bmatrix}p_1 & p_2\\ p_2 & p_3\end{bmatrix}$. Multiplying out, $$A^{\top}P+PA=\begin{bmatrix}-4p_2 & p_1-3p_2-2p_3\\ p_1-3p_2-2p_3 & 2p_2-6p_3\end{bmatrix}=-I,$$ so $p_2=\tfrac14$, then $2p_2-6p_3=-1$ gives $p_3=\tfrac14$, and $p_1=3p_2+2p_3=\tfrac54$. $P=\begin{bmatrix}1.25 & 0.25\\ 0.25 & 0.25\end{bmatrix}$ has trace $1.5\gt0$ and determinant $0.25\gt0$, so $P\succ0$ (eigenvalues $(3-\sqrt5)/4\approx0.190983$ and $(3+\sqrt5)/4\approx1.309017$), and $V=x^{\top}Px$ certifies $\dot V=-\|x\|^2$. The exponential theorem with $k_1=(3-\sqrt5)/4$, $k_2=(3+\sqrt5)/4$, $k_3=1$, $a=2$ gives $\|x(t)\|\le\frac{3+\sqrt5}{2}\,e^{-(3-\sqrt5)t/2}\|x_0\|\le2.619\,e^{-0.3819t}\|x_0\|$ for $t\ge0$: valid, but slower than the true rate $e^{-t}$ of the slowest mode. Lyapunov bounds are certificates, not exact rates.

Common mistake — stable eigenvalues do not make $\|x\|$ decrease
For the same Hurwitz $A$, $V=\|x\|^2$ is not a Lyapunov function: $\frac{\mathrm d}{\mathrm dt}\|x\|^2=x^{\top}(A+A^{\top})x=-2x_1x_2-6x_2^2$, which equals $+0.14$ at $x=(1,-0.1)$. The Euclidean norm can grow for a while; the ellipsoids of the right $P$ are what shrink. The explorer shows these ellipses for any eigenvalues you choose.

Forward invariance, controlled invariance and Nagumo's condition

Definition — Forward invariance and controlled invariance
A set $S$ is forward (positively) invariant for $\dot x=f(x)$ if $x_0\in S$ implies $x(t)\in S$ for all $t$ in the solution's interval; for $x_{t+1}=F(x_t)$ this means $F(S)\subseteq S$. For a system with inputs, $S$ is controlled invariant if for every $x\in S$ there is an admissible $u\in U$ with $f(x,u)\in S$ (continuous time: some admissible input keeps the trajectory in $S$). Invariance under a fixed policy $\pi$ asks $f(x,\pi(x))\in S$; controlled invariance only asks that some good input exists at every state, and a policy that always picks one then makes $S$ invariant. The viability kernel of a constraint set $K$ is the largest controlled invariant subset of $K$.

Example. $x_{t+1}=2x_t+u_t$ with $|u_t|\le0.5$ and constraint set $K=[-1,1]$. The interval $[-0.5,0.5]$ is controlled invariant: $u=-x$ is admissible there and gives $x_{t+1}=x_t$. Under the fixed policy $u\equiv0$ only $\{0\}$ is invariant. From $x_0=0.6$ nothing works: the best input $u=-0.5$ gives $0.7$, then $0.9$, then $1.3\notin K$. Section 9 computes this kernel by backward iteration. Pitfall: invariance of a flow does not survive discretisation. $[0,\infty)$ is invariant for $\dot x=-x$, yet the Euler map $x\mapsto(1-\Delta t)x$ with $\Delta t=2$ sends $1$ to $-1$; an algorithm that follows a flow in finite steps inherits invariance only approximately (Module 9).

Theorem — Nagumo's condition (smooth boundary form)
Assumptions. $f$ locally Lipschitz; $C=\{x:\ h(x)\ge0\}$ with $h$ continuously differentiable and $\nabla h(x)\ne0$ whenever $h(x)=0$ ("$0$ is a regular value of $h$"). Statement. $C$ is forward invariant if and only if $$\dot h(x)=\nabla h(x)^{\top}f(x)\ \ge\ 0\qquad\text{for every }x\text{ with }h(x)=0 .$$ For a general closed set, Nagumo's theorem reads $f(x)\in T_C(x)$ for all $x\in C$, with the (Bouligand) tangent cone $T_C(x)=\{v:\ \liminf_{\tau\downarrow0}\mathrm{dist}(x+\tau v,C)/\tau=0\}$, the directions in which one can move while staying in $C$ to first order. At an interior point $T_C(x)=\mathbb R^n$; at a regular boundary point of $\{h\ge0\}$ it is the half-space $\{v:\ \nabla h(x)^{\top}v\ge0\}$.

Intuition. Nothing happens in the interior; on the boundary the velocity must point inward or be tangent. For the unit disk, $h=1-\|x\|^2$ and $\dot x=Ax$: the rotation $A=\begin{bmatrix}0 & 1\\ -1 & 0\end{bmatrix}$ gives $\dot h=-2x^{\top}Ax=0$ (tangent, invariant); $A=\begin{bmatrix}-1 & 1\\ -1 & -1\end{bmatrix}$ gives $\dot h=2\|x\|^2\gt0$ on the boundary (inward, invariant); the constant field $\dot x=(1,0)$ gives $\dot h=-2$ at $(1,0)$ and leaves. For control-affine dynamics $\dot h=\nabla h^{\top}f+\nabla h^{\top}g\,u$, so the boundary condition is a linear inequality in $u$ (Section 4). Why the assumptions: for $h=-x^2$ and $C=\{0\}$ the gradient vanishes on the boundary, $\dot h(0)=0$ holds for every $f$, yet $\dot x=1$ leaves $C$. Without uniqueness, $\dot x=\sqrt{|x|}$ with $C=\{x\le0\}$ satisfies the boundary test at $x=0$ ($\dot h=-f(0)=0$) while the solution $t^2/4$ leaves.

Caveat — Nagumo has zero margin
The condition only constrains the boundary and allows trajectories to approach it at any speed, so model error or a sampled implementation can push the state across. Control barrier functions (Section 4) demand a controlled rate of approach everywhere, not only on the boundary.

Three relatives: contraction, control Lyapunov functions, and checking the conditions

Definition — Contraction (incremental stability)
$\dot x=f(x)$ is contracting with rate $\lambda\gt0$ if any two trajectories satisfy $\|x(t)-y(t)\|\le c\,e^{-\lambda t}\|x(0)-y(0)\|$. A sufficient condition with a constant metric $M\succ0$: $MJ(x)+J(x)^{\top}M\preceq-2\lambda M$ for all $x$, with $J=\partial f/\partial x$; then $c=\sqrt{\lambda_{\max}(M)/\lambda_{\min}(M)}$. (Proof: for $\delta=x-y$, $\frac{\mathrm d}{\mathrm dt}\delta^{\top}M\delta=\int_0^1\delta^{\top}\big(MJ+J^{\top}M\big)\big|_{y+s\delta}\,\delta\,\mathrm ds\le-2\lambda\,\delta^{\top}M\delta$.) In discrete time, a map from a nonempty closed subset of $\mathbb R^n$ into itself with Lipschitz constant $0\le q\lt1$ is a contraction; completeness gives a unique fixed point and convergence of every trajectory (the Banach theorem in Primer E). Module 11 allows a state-dependent metric $M(x)$.

Stability is not contraction. $\dot x=-x/(1+x^2)$ is GAS ($V=x^2$, $\dot V=-2x^2/(1+x^2)$), but it is not contracting. Trajectories from $2$ and $3$ first move apart, $\frac{\mathrm d}{\mathrm dt}(y-x)=f(3)-f(2)=-0.3+0.4=0.1\gt0$, and the gap reaches about $1.36$ before both converge; this rules out $c=1$. It does not by itself rule out a bound with an overshoot factor $c\gt1$, but none exists: since $|f|\le\tfrac12$, the trajectory from $x(0)=R$ still has $x(R)\ge R-\tfrac R2=\tfrac R2$ while $y\equiv0$ from $y(0)=0$, so the gap at time $R$ is at least $R/2$, whereas a contraction bound allows only $c\,e^{-\lambda R}R$, which is smaller for large $R$. Lyapunov decrease towards one point says nothing about distances between trajectories.

Definition — Control Lyapunov function (CLF)
For $\dot x=f(x)+g(x)u$, a continuously differentiable, positive definite, radially unbounded $V$ is a CLF if $\inf_{u\in U}\big[L_fV(x)+L_gV(x)\,u\big]\lt0$ for every $x\ne0$, with $L_fV=\nabla V^{\top}f$ and $L_gV=\nabla V^{\top}g$. It is exponential if the following infimum is attained and $k_1\|x\|^a\le V\le k_2\|x\|^a$ and $\inf_u\big[L_fV+L_gVu+cV\big]\le0$ for some $c\gt0$. A Lyapunov function certifies a given closed loop; a CLF certifies that a decreasing input exists at every state, and a regular feedback that picks such inputs (Sontag's formula, a CLF-QP) is still needed. Example: $\dot x=x+u$, $V=x^2/2$: $L_fV=x^2$, $L_gV=x$, and $u=-2x$ gives $-x^2\lt0$.

How the conditions are checked in practice. (i) Linear systems: the Lyapunov equation or LMI (Module 2). (ii) Polynomial systems: sum-of-squares. A polynomial is SOS if it is a sum of squares of polynomials, which holds iff $p(x)=m(x)^{\top}Gm(x)$ for a vector of monomials $m(x)$ and some $G\succeq0$; SOS implies $p\ge0$ (sufficient, not necessary), and finding $G$ is a semidefinite program. Example: $x^2-2x+2=\begin{bmatrix}1\\ x\end{bmatrix}^{\top}\begin{bmatrix}2 & -1\\ -1 & 1\end{bmatrix}\begin{bmatrix}1\\ x\end{bmatrix}$ with $G\succeq0$ (trace $3$, determinant $1$); indeed it equals $(x-1)^2+1$. (iii) Gridding with a Lipschitz margin: if $\Delta V$ is $L$-Lipschitz on a region, every point of which lies within $\tau$ of a grid point $x_i$, then $\Delta V(x_i)\lt-L\tau$ at all grid points implies $\Delta V(x)\le\Delta V(x_i)+L\|x-x_i\|\lt-L\tau+L\tau=0$ everywhere.

Where this is used

Practice — Use a scalar certificate along a trajectory

Easy checks the basic operation; Medium connects steps; Hard asks you to justify a conclusion or identify a limitation. Each solution explains why the steps work.

Exercise D.S7 — Easy: Differentiate the certificate, not just the state

For $\dot x=-2x$, take $V(x)=x^2$. Compute $\dot V$ along trajectories and solve for $V(t)$ from initial state $x_0$.

Review if needed: this section and gradients and the chain rule.

Show hint
The chain rule gives $\dot V=V'(x)\dot x$.
Show worked solution
  1. $V'(x)=2x$, so $\dot V=(2x)(-2x)=-4x^2=-4V$.
  2. The scalar differential equation has solution $V(t)=V(0)e^{-4t}=x_0^2e^{-4t}$.
  3. Taking square roots gives $|x(t)|=|x_0|e^{-2t}$. The certificate decreases at twice the exponent of the state magnitude because it is quadratic.
Exercise D.S8 — Medium: Check a matrix Lyapunov inequality by hand

For $\dot x=Ax$ with $A=\operatorname{diag}(-1,-2)$, use $P=I$ and $V=x^\top Px$. Compute $A^\top P+PA$ and derive a decay bound.

Review if needed: this section and gradients and the chain rule.

Show hint
For a quadratic certificate, $\dot V=x^\top(A^\top P+PA)x$. Compare the result with $-2V$.
Show worked solution
  1. $A^\top P+PA=2A=\operatorname{diag}(-2,-4)$, which is negative definite.
  2. Thus $\dot V=-2x_1^2-4x_2^2\le-2(x_1^2+x_2^2)=-2V$.
  3. Comparison yields $V(t)\le V(0)e^{-2t}$. Because $P=I$, $V=\|x\|_2^2$, so $\|x(t)\|_2\le\|x(0)\|_2e^{-t}$. Positive definiteness of $P$ is what turns a bound on $V$ into a state bound.
Exercise D.S9 — Hard: An invariant sublevel is a local guarantee

For $\dot x=-x+x^3$, use $V=x^2$ to prove that every sublevel $V\le c$ with $0\lt c\lt1$ is forward invariant and converges to zero. Why does the same conclusion fail for $c=1$?

Review if needed: this section and gradients and the chain rule.

Show hint
Inside the sublevel, $1-x^2\ge1-c\gt0$. Inspect the states $x=\pm1$.
Show worked solution
  1. $\dot V=2x(-x+x^3)=-2x^2(1-x^2)$. On $V\le c$, this is at most $-2(1-c)V$.
  2. At the boundary $V=c$, the derivative is negative, so a trajectory cannot cross outward. The polynomial vector field is locally Lipschitz; remaining in this bounded sublevel also prevents finite escape. Comparison gives $V(t)\le V(0)e^{-2(1-c)t}$.
  3. At $c=1$, the boundary states $x=\pm1$ are equilibria and do not converge to zero. The closed sublevel remains invariant, but invariance alone does not prove attraction to the origin.

4. Class-K Functions & the Comparison Lemma

Start here — Translate differential inequalities into bounds

Replace a complicated trajectory inequality with a scalar equation you can solve. For example, $\dot V\le-3V$ and $V(0)=4$ imply $V(t)\le4e^{-3t}$. The direction of the inequality matters, especially when turning a barrier condition into a constraint on the control input.

When ready, try the Easy, Medium and Hard practice for this section. For a prerequisite gap, review monotonic functions.

Lyapunov and barrier conditions are differential inequalities such as $\dot V\le-\alpha_3(\|x\|)$ or $\dot h\ge-\alpha(h)$. Comparison functions describe rates without committing to a formula, and the comparison lemma turns a scalar differential inequality into a bound on the solution.

Definition — Comparison functions
  • $\alpha:[0,a)\to[0,\infty)$ is class $\mathcal K$ if it is continuous, strictly increasing and $\alpha(0)=0$. It is class $\mathcal K_\infty$ if moreover $a=\infty$ and $\alpha(r)\to\infty$ as $r\to\infty$.
  • $\alpha:(-b,a)\to\mathbb R$ ($a,b\gt0$) is extended class $\mathcal K$ if it is continuous, strictly increasing and $\alpha(0)=0$; then $\alpha(r)\lt0$ for $r\lt0$. It is extended class $\mathcal K_\infty$ if it is defined on all of $\mathbb R$ with $\alpha(r)\to\pm\infty$ as $r\to\pm\infty$.
  • $\beta:[0,a)\times[0,\infty)\to[0,\infty)$ is class $\mathcal{KL}$ if it is continuous, $\beta(\cdot,s)$ is class $\mathcal K$ for each fixed $s$, and $\beta(r,\cdot)$ is decreasing with $\beta(r,s)\to0$ as $s\to\infty$ for each fixed $r$.
FunctionClassRemark
$\alpha_0r$, $\alpha_0\gt0$$\mathcal K_\infty$; extended $\mathcal K_\infty$ on $\mathbb R$the linear choice used in most CBF filters
$r^3$extended $\mathcal K_\infty$flat at $0$
$\arctan r$$\mathcal K$ and extended $\mathcal K$, not $\mathcal K_\infty$bounded
$\sqrt r$; $\ \mathrm{sgn}(r)\sqrt{|r|}$$\mathcal K_\infty$; extended $\mathcal K_\infty$not Lipschitz at $0$
$re^{-s}$; $\ r/(1+rs)$$\mathcal{KL}$the second solves $\dot x=-x^2$, $x(0)=r$
$r^2$ on $\mathbb R$; $\ r+1$; $\ \min\{r,1\}$nonenot increasing for $r\lt0$; $\alpha(0)\ne0$; not strictly increasing

Why they appear. For a time-invariant system with locally Lipschitz $f$, the origin is GAS exactly when there is a $\beta\in\mathcal{KL}$ with $\|x(t)\|\le\beta(\|x_0\|,t)$ for all $x_0$ and $t\ge0$ (Khalil 2002, Lemma 4.5): the first argument encodes "start close, stay close", the second "converge". A general Lyapunov theorem reads: $\alpha_1(\|x\|)\le V(x)\le\alpha_2(\|x\|)$ and $\dot V\le-\alpha_3(\|x\|)$ with $\alpha_i\in\mathcal K_\infty$ imply GAS; the exponential theorem of Section 3 is the case $\alpha_i(r)=k_ir^a$.

Lemma — Comparison lemma (simplified from Khalil 2002, Lemma 3.4)
Assumptions. $F:\mathbb R\to\mathbb R$ is locally Lipschitz (what is really needed is that the comparison equation has unique solutions); $w$ solves $\dot w=F(w)$, $w(0)=w_0$, on $[0,T)$; $v$ is differentiable with $\dot v(t)\le F(v(t))$ and $v(0)\le w_0$. Statement. $v(t)\le w(t)$ for all $t\in[0,T)$.
In words: a quantity whose growth is bounded by the right-hand side stays below the solution of the equation with equality.

The linear case, in full. If $\dot v\le-av$, then $\frac{\mathrm d}{\mathrm dt}(e^{at}v)=e^{at}(\dot v+av)\le0$, so $v(t)\le e^{-at}v(0)$, whatever the sign of $v$. A nonlinear case: $\dot v\le-v^2$ with $v(0)=1$ is compared with $\dot w=-w^2$, $w(0)=1$, whose solution is $w(t)=1/(1+t)$; hence $v(t)\le1/(1+t)$, e.g. $v(3)\le0.25$.

Proof sketch — the first-crossing argument

Compare first with $w_\varepsilon$ solving $\dot w_\varepsilon=F(w_\varepsilon)+\varepsilon$, $w_\varepsilon(0)=w_0+\varepsilon$, so that $v(0)\lt w_\varepsilon(0)$. If $v$ ever reached $w_\varepsilon$, then at the first time $t_1$ with $v(t_1)=w_\varepsilon(t_1)$ the function $v$ arrives from below, so $\dot v(t_1)\ge\dot w_\varepsilon(t_1)=F(v(t_1))+\varepsilon$, contradicting $\dot v(t_1)\le F(v(t_1))$. Hence $v\lt w_\varepsilon$. Because solutions of $\dot w=F(w)$ are unique, $w_\varepsilon\to w$ as $\varepsilon\to0$, which gives $v\le w$. Without uniqueness the limit can select a different solution, and the lemma can fail.

From $\dot h\ge-\alpha(h)$ to $h(x(t))\ge0$: a preview of Module 10

Let $\eta(t)=h(x(t))$ along a closed-loop trajectory with $\dot\eta\ge-\alpha(\eta)$ and $\eta(0)\ge0$, where $\alpha$ is extended class $\mathcal K$ (and locally Lipschitz, for simplicity).

  1. Comparison system. $\dot y=-\alpha(y)$, $y(0)=\eta(0)\ge0$. Since $\alpha(0)=0$, $y\equiv0$ is a solution, and by uniqueness no other solution can cross it: $y(t)\ge0$ for all $t$.
  2. Flip the signs, because the lemma is stated with "$\le$". Put $v=-\eta$, $w=-y$ and $F(s)=\alpha(-s)$. Then $\dot v=-\dot\eta\le\alpha(\eta)=\alpha(-v)=F(v)$, $\dot w=-\dot y=\alpha(y)=\alpha(-w)=F(w)$, and $v(0)=w(0)$.
  3. Conclude. The comparison lemma gives $v\le w$, i.e. $h(x(t))=\eta(t)\ge y(t)\ge0$: the trajectory never leaves $C=\{h\ge0\}$.

For the linear choice $\alpha(r)=\alpha_0r$ the comparison solution is explicit: $h(x(t))\ge h(x_0)e^{-\alpha_0t}$. With $\alpha_0=2$ and $h(x_0)=0.5$, $h(x(1))\ge0.5e^{-2}\approx0.068$. The barrier may decrease, but ever more slowly as the boundary approaches. Outside $C$ ($h\lt0$) the bound $\dot h\ge-\alpha(h)\gt0$ pushes $h$ back up, which is why $\alpha$ must be defined for negative arguments: small violations are corrected. Discrete time needs no lemma: $h(x_{t+1})-h(x_t)\ge-\kappa\,h(x_t)$ with $\kappa\in(0,1]$ gives $h(x_t)\ge(1-\kappa)^th(x_0)\ge0$ by induction.

Definition — Lie derivatives and the control barrier function condition
For $\dot x=f(x)+g(x)u$ and a continuously differentiable $h$: $L_fh(x)=\nabla h(x)^{\top}f(x)$ (a scalar) and $L_gh(x)=\nabla h(x)^{\top}g(x)$ (a $1\times m$ row), so $\dot h=L_fh+L_gh\,u$. Assume $U$ is nonempty and the supremum below is attained at every $x$ (for example, $U$ is compact, since the expression is continuous in $u$). Then $h$ is a (zeroing) control barrier function on $D\supseteq C=\{h\ge0\}$ if for some extended class-$\mathcal K$ function $\alpha$ $$\sup_{u\in U}\big[L_fh(x)+L_gh(x)\,u+\alpha(h(x))\big]\ \ge\ 0\qquad\text{for all }x\in D .$$ The admissible inputs $K_{\rm cbf}(x)=\{u\in U:\ L_fh+L_ghu+\alpha(h)\ge0\}$ form a half-space intersected with $U$. Any locally Lipschitz feedback with $u(x)\in K_{\rm cbf}(x)$ gives $\dot h\ge-\alpha(h)$, hence forward invariance of $C$ by the argument above (with $\nabla h\ne0$ on the boundary; Module 10 states the precise theorem).

Example: a wall. $\dot x=u$, safe set $C=\{x\le1\}$, $h=1-x$: $L_fh=0$, $L_gh=-1$, so $K_{\rm cbf}(x)=\{u:\ u\le\alpha_0(1-x)\}$. With $\alpha_0=2$ at $x=0.8$ the speed towards the wall may not exceed $0.4$. The safety filter $u=\min\{u_{\rm nom},\alpha_0(1-x)\}$ leaves any command away from the wall untouched and caps the approach speed in proportion to the remaining distance; even at the cap, $1-x(t)=(1-x_0)e^{-\alpha_0t}$ never reaches $0$.

Definition — Input-to-state stability (ISS)
$\dot x=f(x,d)$ is ISS if there are $\beta\in\mathcal{KL}$ and $\gamma\in\mathcal K$ such that for every $x_0$ and every bounded disturbance signal $d$ $$\|x(t)\|\le\beta(\|x_0\|,t)+\gamma\Big(\sup_{0\le s\le t}\|d(s)\|\Big)\qquad\text{for all }t\ge0 .$$ The initial condition is forgotten, and the state ends in a ball whose radius is set by the disturbance size (practical stability, ultimate boundedness) instead of converging to $0$.

Example. $\dot x=-x+d$ has $x(t)=e^{-t}x_0+\int_0^te^{-(t-s)}d(s)\,\mathrm ds$, so $|x(t)|\le e^{-t}|x_0|+\sup|d|$ because $\int_0^te^{-(t-s)}\mathrm ds\le1$: ISS with $\beta(r,t)=re^{-t}$ and $\gamma(r)=r$. Non-example: $\dot x=-x+xd$ is GAS for $d=0$, but $d\equiv2$ gives $\dot x=x$, which diverges. Module 10's input-to-state safety is the barrier analogue: the safe set is inflated by $\gamma(\|d\|_\infty)$ rather than kept exactly.

Fact — Summable costs force convergence
If $\alpha\in\mathcal K$ and $\sum_{t=0}^{\infty}\alpha(\|x_t\|)\lt\infty$, then $x_t\to0$. Proof. The terms of a convergent series tend to $0$ (Primer 0), so $\alpha(\|x_t\|)\to0$. Given $\varepsilon\gt0$, eventually $\alpha(\|x_t\|)\lt\alpha(\varepsilon)$, and because $\alpha$ is strictly increasing, $\|x_t\|\lt\varepsilon$. Special case: $\sum_t\|x_t\|^2\lt\infty\Rightarrow x_t\to0$. MPC assumes a stage cost $\ell(x,u)\ge\alpha_\ell(\|x\|)$ with $\alpha_\ell\in\mathcal K_\infty$ (a lower bound valid for all state sizes) and, with a nonnegative terminal cost, bounds $\sum_t\alpha_\ell(\|x_t\|)$ by the initial optimal cost (Section 9).
Where this is used

Practice — Translate differential inequalities into bounds

Easy checks the basic operation; Medium connects steps; Hard asks you to justify a conclusion or identify a limitation. Each solution explains why the steps work.

Exercise D.S10 — Easy: Class K or class K infinity?

On $r\ge0$, classify $\alpha_1(r)=2r$, $\alpha_2(r)=r^2$ and $\alpha_3(r)=r/(1+r)$ as class-$\mathcal K$ and/or class-$\mathcal K_\infty$.

Review if needed: this section and monotonic functions.

Show hint
Class $\mathcal K$ means continuous, strictly increasing and zero at zero. Class $\mathcal K_\infty$ also requires unbounded growth.
Show worked solution
  1. All three are continuous, zero at zero and strictly increasing for nonnegative arguments. For $r^2$, strict increase holds even though its derivative at zero is zero.
  2. $2r$ and $r^2$ grow without bound, so both are class-$\mathcal K_\infty$ as well as class-$\mathcal K$.
  3. $r/(1+r)$ approaches $1$, so it is class-$\mathcal K$ but not class-$\mathcal K_\infty$. The unboundedness requirement is separate from monotonicity.
Exercise D.S11 — Medium: Time to enter a target sublevel

A nonnegative differentiable quantity satisfies $\dot V\le-3V$ with $V(0)=4$. Give an upper bound on $V(t)$ and a time after which $V(t)\le0.2$ is guaranteed.

Review if needed: this section and monotonic functions.

Show hint
Compare with $\dot z=-3z$, then solve the resulting exponential inequality.
Show worked solution
  1. The comparison solution is $z(t)=4e^{-3t}$, so $V(t)\le4e^{-3t}$.
  2. Require $4e^{-3t}\le0.2$, equivalently $e^{-3t}\le1/20$.
  3. Taking logarithms gives $t\ge\ln(20)/3\approx0.998577$. This is a sufficient entry time; the actual quantity can decrease faster than the comparison solution.
Exercise D.S12 — Hard: Derive a safety-filter constraint with the right sign

For $\dot x=u$, define the safe set by $h(x)=1-x\ge0$. Enforce $\dot h\ge-2h$. Derive the allowable inputs and choose the closest one to desired input $u_{\rm des}=1$ at $x=0.9$. Explain what happens at the boundary.

Review if needed: this section and monotonic functions.

Show hint
Because $h'(x)=-1$, $\dot h=-u$. Reversing an inequality changes its sign.
Show worked solution
  1. The condition is $-u\ge-2(1-x)$, hence $u\le2(1-x)$.
  2. At $x=0.9$, the upper limit is $0.2$. Minimising $(u-1)^2$ over this half-line projects the desired input onto its endpoint: $u=0.2$.
  3. At $x=1$, the constraint becomes $u\le0$, preventing motion outward. If the condition is enforced continuously and a solution exists, comparison gives $h(t)\ge h(0)e^{-2t}\ge0$. One sampled check alone does not establish continuous-time enforcement.

5. Feedback Control: State Feedback, LQR & PID

Start here — Design feedback and then check its assumptions

Substitute the controller into the plant before assessing stability. For $\dot x=2x+u$ and $u=-kx$, the actual closed-loop rate is $2-k$. Controllers with saturation or internal memory require analysing the resulting dynamics as well.

When ready, try the Easy, Medium and Hard practice for this section. For a prerequisite gap, review minimisation and constraints.

Feedback means computing the input from measurements, so that the system corrects its own errors. Everything a reinforcement-learning agent calls a policy is a feedback controller in this sense.

Definition — Controllers as policies
A static state-feedback controller (policy) is a function $\pi:X\to U$; the input value at time $t$ is the vector $u_t=\pi(x_t)$ (several modules overload the letter and write $u:X\to U$). Substituting it gives the autonomous closed loop $x_{t+1}=f(x_t,\pi(x_t))=:F_\pi(x_t)$. A stationary policy uses the same function at every time; a nonstationary or history-dependent one ($u_t=\pi_t(x_0,\dots,x_t)$) can be made stationary by adding its memory to the state. A parameterised controller $\pi_\theta$ (or $\pi^a$) is fixed during an experiment: the parameter $\theta$ is not the input, the physical state evolves under $\pi_\theta$, and the measured trajectory is condensed into a scalar outcome $J(\theta)$ (a cost, the smallest safety margin), which is what safe Bayesian optimisation evaluates. Linear state feedback $u=-Kx$ gives $x_{t+1}=(A-BK)x_t$; some papers write $u=Kx$ or $u=Fx$ with $F=-K$, so always check the sign.

Worked example: deadbeat gain and overshoot (Module 1's explorer). $x_{t+1}=x_t+u_t+w_t$ with $u_t=-k(x_t-x_g)$. The error $e_t=x_t-x_g$ obeys $e_{t+1}=(1-k)e_t+w_t$. Without noise $e_t=(1-k)^te_0$: for $0\lt k\lt1$ the error shrinks monotonically; $k=1$ is deadbeat ($e_1=0$ from any $e_0$); for $1\lt k\lt2$ the state overshoots and the error alternates in sign while shrinking; for $k\ge2$, $|1-k|\ge1$ and a nonzero initial error does not converge to zero. With independent noise of variance $\sigma^2$, $\mathrm{Var}(e_{t+1})=(1-k)^2\mathrm{Var}(e_t)+\sigma^2\to\frac{\sigma^2}{1-(1-k)^2}=\frac{\sigma^2}{k(2-k)}$. This stationary variance is smallest at the deadbeat gain, where it still equals $\sigma^2$: feedback cannot remove noise that enters after the input is chosen. For $k=0.5$ or $k=1.5$ the standard deviation is $\sigma/\sqrt{0.75}\approx1.155\sigma$. The limit describes a distribution, not an equilibrium (Primer C).

Fact — Pole placement
If $(A,B)$ is controllable (Section 8), the eigenvalues of $A-BK$ can be placed at any $n$ numbers closed under complex conjugation. Example: the double integrator $\dot x_1=x_2$, $\dot x_2=u$ with $u=-k_1x_1-k_2x_2$ has $A-BK=\begin{bmatrix}0 & 1\\ -k_1 & -k_2\end{bmatrix}$ and characteristic polynomial $s^2+k_2s+k_1$. Poles at $-p_1,-p_2$ require $s^2+k_2s+k_1=(s+p_1)(s+p_2)$, i.e. $k_1=p_1p_2$ and $k_2=p_1+p_2$. For $p=(1,2)$: $K=[2,\ 3]$, which produces the Hurwitz matrix of the Lyapunov example in Section 3.

The linear-quadratic regulator (LQR)

Theorem — Infinite-horizon discrete-time LQR (statement)
Problem. Minimise $J(x_0,u)=\sum_{t=0}^{\infty}\big(x_t^{\top}Qx_t+u_t^{\top}Ru_t\big)$ subject to $x_{t+1}=Ax_t+Bu_t$, with $Q\succeq0$ (state penalty) and $R\succ0$ (input penalty).
Assumptions. $(A,B)$ stabilisable and $(Q^{1/2},A)$ detectable (Section 8).
Statement. The discrete algebraic Riccati equation (DARE) $$P=Q+A^{\top}PA-A^{\top}PB\,(R+B^{\top}PB)^{-1}B^{\top}PA$$ has a unique solution $P\succeq0$ for which $A-BK$ is Schur, where $K=(R+B^{\top}PB)^{-1}B^{\top}PA$. The optimal input is the linear feedback $u_t=-Kx_t$ and the optimal cost is $x_0^{\top}Px_0$. In continuous time: $A^{\top}P+PA-PBR^{-1}B^{\top}P+Q=0$ and $K=R^{-1}B^{\top}P$.
Proof — optimality by completing the square

Let $S=R+B^{\top}PB\succ0$, so $K=S^{-1}B^{\top}PA$ and $A^{\top}PB=K^{\top}S$. The DARE says $Q+A^{\top}PA-P=A^{\top}PBS^{-1}B^{\top}PA=K^{\top}SK$. Hence, for every $x$ and $u$,

$$\begin{aligned}x^{\top}Qx+u^{\top}Ru+(Ax+Bu)^{\top}P(Ax+Bu)-x^{\top}Px&=x^{\top}(Q+A^{\top}PA-P)x+2x^{\top}A^{\top}PBu+u^{\top}Su\\&=x^{\top}K^{\top}SKx+2x^{\top}K^{\top}Su+u^{\top}Su=(u+Kx)^{\top}S(u+Kx).\end{aligned}$$

Summing along a trajectory from $t=0$ to $T-1$ telescopes the $P$-terms: $\sum_{t\lt T}(x_t^{\top}Qx_t+u_t^{\top}Ru_t)=x_0^{\top}Px_0-x_T^{\top}Px_T+\sum_{t\lt T}(u_t+Kx_t)^{\top}S(u_t+Kx_t)$. For any input with finite cost, $u_t\to0$ and $Q^{1/2}x_t\to0$, and detectability then forces $x_t\to0$, so $x_T^{\top}Px_T\to0$. Therefore $J\ge x_0^{\top}Px_0$, with equality exactly when $u_t=-Kx_t$. The walkthrough in Section 9 derives the DARE itself by dynamic programming.

Worked example. $A=B=Q=R=1$: the DARE reads $P=1+P-\frac{P^2}{1+P}$, i.e. $P^2=P+1$, so $P=\frac{1+\sqrt5}{2}\approx1.618$, $K=\frac{P}{1+P}\approx0.618$, and the closed loop is $x_{t+1}=0.382\,x_t$. The weights set the aggressiveness. Keeping $A=B=Q=1$ and varying $R=r$: $P=\frac{1+\sqrt{1+4r}}{2}$ and $K=\frac{P}{r+P}$, so $r=0.1$ gives $K=0.916$ (nearly deadbeat, cheap input), $r=1$ gives $0.618$, and $r=10$ gives $0.270$ (gentle, expensive input). In Module 4 the weights used to design $K$, $(W_x(\theta),W_u(\theta))$, are the tuning parameters, while fixed weights $(Q,R)$ evaluate the resulting closed loop. Average cost with noise: for $x_{t+1}=Ax_t+Bu_t+w_t$ with independent zero-mean $w_t$ of covariance $W$ and $u=-Kx$ stabilising, $\lim_{T\to\infty}\frac1T\mathbb E\sum_{t\lt T}(x_t^{\top}Qx_t+u_t^{\top}Ru_t)=\operatorname{tr}(WP_K)$, where $P_K=Q+K^{\top}RK+(A-BK)^{\top}P_K(A-BK)$ (a Stein equation, Section 3). In the scalar example $P_K=\frac{1+0.618^2}{1-0.382^2}=1.618=P$, so with $W=0.01$ the average cost is $0.0162$; the LQR gain also minimises this average cost.

PID control and integral action

Definition — PID controller
With reference $r$, measured output $y$ and error $e=r-y$: $$u(t)=K_Pe(t)+K_I\int_0^te(s)\,\mathrm ds+K_D\,\dot e(t),\qquad u_k=K_Pe_k+K_I\,I_k+K_D(e_k-e_{k-1}),\ \ I_k=I_{k-1}+e_k .$$ The discrete law uses gains per sample: sampling the continuous law with interval $h$ (rectangle rule $h\sum_ke_k$ for the integral, backward difference $(e_k-e_{k-1})/h$ for the derivative) turns $K_I$ into $hK_I$ and $K_D$ into $K_D/h$; for $h=1$ the two forms coincide.
P reacts to the present error, I accumulates past errors and can supply a nonzero steady input at zero tracking error (removing a constant steady error when the closed loop converges), D reacts to the trend, which damps oscillations but amplifies measurement noise. With actuator limits the integrator can wind up: it keeps accumulating while the input sits at its limit. Anti-windup prevents integration that drives the actuator further into saturation: conditional integration stops only while the error pushes deeper into saturation (so the integrator can still unwind), and back-calculation feeds the saturation discrepancy $u_{\rm sat}-u_{\rm cmd}$ back into the integrator. Freezing it whenever the input is saturated is not enough in general: for $\dot x=-x+u$, $u=\mathrm{sat}(I)$ with limit $1$, $\dot I=-x$, the start $x=1$, $I=2$ would stay there forever, whereas integrating brings $I$ back below $1$ and releases the saturation. The projection $[\cdot]_+$ in multiplier updates is a one-sided saturation.
Fact — Integral action removes steady-state error
If a closed loop that contains an integrator $I_{k+1}=I_k+e_k$ converges to an equilibrium, the error there is zero: at an equilibrium $I_{k+1}=I_k$, hence $e=0$. This holds for any constant disturbance and any model error, provided the loop converges, which still has to be checked.

Example. Plant $x_{t+1}=0.5x_t+u_t+d$ with an unknown constant $d=1$ and reference $r=1$. P-only control $u=K_P(r-x)$ with $K_P=1$ settles where $x=0.5x+(1-x)+1$, i.e. $x=4/3$: an offset of $-1/3$ that a larger $K_P$ shrinks but never removes. PI control with $K_P=0.5$, $K_I=0.25$ has state $(x_t,I_{t-1})$ and loop matrix $\begin{bmatrix}0.5-K_P-K_I & K_I\\ -1 & 1\end{bmatrix}$ with trace $0.75$ and determinant $0.5-K_P=0$, eigenvalues $0$ and $0.75$: it converges, and by the fact above to $x=1$ exactly (the integrator settles at $I=-2$, cancelling $d$).

The multiplier as a controller. The Lagrangian update $\lambda_{k+1}=[\lambda_k+K_I(J_C(\theta_k)-d)]_+$ of constrained RL is an integral controller: the plant is the policy optimiser, the output is the expected cost $J_C$, the reference is the budget $d$, and the error is the constraint violation. If it converges with $\lambda\gt0$, the constraint holds with equality. In the simplified multiplier loop of Module 8 (the matrix $M$ of Section 2), integral-only updates give a sustained oscillation (for $0\lt cK_I\lt4$, Exercise D.2); this is a property of that loop, not of integral control in general (for $\dot x=-x+u$, $u=I$, $\dot I=0.1(r-x)$ the error has the real poles $-0.11$ and $-0.89$). PID Lagrangians add a proportional term (react to the current violation) and a derivative term (react to increases) to improve the damping (Module 8). A small $K_I$ makes the multiplier slow compared with the policy: two timescales.

PD control and impedance. $u=-k_p\theta-k_d\dot\theta$ is P on the angle and D on its rate (the error derivative when the reference is $0$). It acts like a virtual spring of stiffness $k_p$ and a damper $k_d$; an impedance controller $u=-k(x-x_{\rm ref})-b\dot x$ prescribes exactly this spring–damper behaviour around a desired position (Module 6). A saturating PD law, $u=\mathrm{sat}(\cdot)$ or a small tanh network, keeps the input bounded (Module 14's explorer).

Definition — Observer and output feedback
If only $y_t=Cx_t$ is measured, a (Luenberger) observer runs a copy of the model corrected by the innovation $y_t-C\hat x_t$ (measured minus predicted output): $$\hat x_{t+1}=A\hat x_t+Bu_t+L\,(y_t-C\hat x_t).$$ Subtracting from $x_{t+1}=Ax_t+Bu_t$, the error $e_t=x_t-\hat x_t$ obeys $e_{t+1}=(A-LC)e_t$, independently of $u$; choose $L$ with $A-LC$ Schur (possible iff $(C,A)$ is detectable, Section 8). With the observer-based controller $u=-K\hat x=-Kx+Ke$ the closed loop in the coordinates $(x,e)$ is $$\begin{bmatrix}x_{t+1}\\ e_{t+1}\end{bmatrix}=\begin{bmatrix}A-BK & BK\\ 0 & A-LC\end{bmatrix}\begin{bmatrix}x_t\\ e_t\end{bmatrix},$$ block triangular, so its eigenvalues are those of $A-BK$ together with those of $A-LC$ (separation principle).

Example. Scalar $a=2$, $b=c=1$ (unstable plant, only $x$ measured): $K=1.5$ gives $a-bK=0.5$, $L=1.8$ gives $a-Lc=0.2$, and the closed loop has eigenvalues $\{0.5,0.2\}$. The augmented state (plant state, estimation error) is the state of the closed loop; Module 11 writes it as $\xi=(x,\hat x-x)$.

Where this is used

Practice — Design feedback and then check its assumptions

Easy checks the basic operation; Medium connects steps; Hard asks you to justify a conclusion or identify a limitation. Each solution explains why the steps work.

Exercise D.S13 — Easy: Find the stabilising feedback gains

The plant is $\dot x=2x+u$. Use $u=-kx$. For which real gains $k$ is the origin asymptotically stable? What happens at $k=2$?

Review if needed: this section and minimisation and constraints.

Show hint
Substitute the feedback first. Continuous-time exponential decay requires a negative coefficient.
Show worked solution
  1. The closed-loop equation is $\dot x=(2-k)x$, with solution $x(t)=x_0e^{(2-k)t}$.
  2. This decays to zero for every initial state exactly when $2-k\lt0$, so $k\gt2$.
  3. At $k=2$, every state stays constant. The origin is stable but not attractive. At $k\lt2$, nonzero states grow exponentially. Stabilising gains are determined by the closed-loop dynamics, not by the feedback sign alone.
Exercise D.S14 — Medium: Solve a scalar continuous-time LQR

For $\dot x=x+u$, minimise $\int_0^\infty(x^2+u^2)\,dt$. Use a value function $V(x)=Px^2$ and the scalar Riccati equation $2P-P^2+1=0$. Find the positive solution, optimal feedback and closed-loop rate.

Review if needed: this section and minimisation and constraints.

Show hint
Complete the square in $P$. LQR uses $u=-Px$ here because $B=R=1$.
Show worked solution
  1. Rearrange to $P^2-2P-1=0$, or $(P-1)^2=2$. The positive root is $P=1+\sqrt2\approx2.414214$.
  2. The optimal unconstrained input is $u=-Px$. Substitution gives $\dot x=(1-P)x=-\sqrt2\,x$.
  3. The rate is negative, so the cost is finite and the state converges exponentially. The other root $1-\sqrt2$ is negative and would give a growing closed loop, so it is not the stabilising value-function solution.
Exercise D.S15 — Hard: Actuator limits change what can be stabilised

For $\dot x=2x+u$ with $|u|\le1$, show that no admissible control can drive an initial state $x_0\gt1/2$ toward zero. For unsaturated feedback $u=-3x$, where is the requested input within the actuator limit?

Review if needed: this section and minimisation and constraints.

Show hint
Even the most negative admissible input gives $\dot x\ge2x-1$. For the feedback, impose $|-3x|\le1$.
Show worked solution
  1. For $x\gt1/2$, every admissible input satisfies $\dot x\ge2x-1\gt0$. The state cannot initially move inward or cross the boundary downward.
  2. More explicitly, comparison with $\dot z=2z-1$ gives $x(t)\ge1/2+(x_0-1/2)e^{2t}$ while the solution exists. This grows away from zero.
  3. The feedback request obeys the limit only when $3|x|\le1$, i.e. $|x|\le1/3$. The unconstrained stability calculation therefore gives a useful local design, but cannot justify global stability for the saturated plant.

6. Transfer Functions, Frequency Response, Gains & Parseval

Start here — Connect time responses to gains

Time-domain and frequency-domain descriptions refer to the same input-output map. A complex number $a+jb$ has modulus $\sqrt{a^2+b^2}$, where $j^2=-1$; thus $|2+2j|=\sqrt8$. This calculation is enough to begin the scalar frequency-response practice below.

When ready, try the Easy, Medium and Hard practice for this section. For a prerequisite gap, review geometric series.

Sections 1–5 followed one trajectory. Robustness asks a different question: how much can a system amplify a whole input signal? For linear systems the answer is read off frequency by frequency, and this is where the complex-valued conditions of Modules 2 and 14 come from.

Definition — Signals, energy, and the $\ell_2$ gain
A discrete-time signal is a whole sequence $w=(w_0,w_1,\dots)$, $w_t\in\mathbb R^m$, not a single vector. Its energy norm is $\|w\|_2=\big(\sum_{t\ge0}\|w_t\|^2\big)^{1/2}$; $\ell_2$ is the space of signals with finite energy; the finite-horizon norm $\|w\|_{2,T}=\big(\sum_{t=0}^{T}\|w_t\|^2\big)^{1/2}$ is always finite. In continuous time $\|w\|_{L_2}=\big(\int_0^\infty\|w(t)\|^2\mathrm dt\big)^{1/2}$. The peak norm is $\|w\|_\infty=\sup_t\|w_t\|$.
A system maps input signals to output signals, $z=G(w)$. It is causal if $z_t$ depends only on $w_0,\dots,w_t$. It has finite $\ell_2$ gain $\gamma$ if $\|G(w)\|_{2,T}\le\gamma\|w\|_{2,T}$ for all inputs and all $T$ (for a state-space system: starting from the zero state). The smallest such $\gamma$ is the induced $\ell_2$ gain; a causal operator with finite gain is called bounded.

Examples. $w_t=0.5^t$ has $\|w\|_2^2=1+\frac14+\frac1{16}+\cdots=\frac43$. The constant signal $w_t=1$ has $\|w\|_\infty=1$ but infinite energy. The zero initial state matters: a nonzero $x_0$ produces output even for $w=0$, and a gain measures amplification of the input only.

LTI systems are convolutions. From the solution formula of Section 2 with $x_0=0$, $$z_t=\sum_{s=0}^{t}h_{t-s}\,w_s,\qquad h_0=D,\quad h_k=CA^{k-1}B\ \ (k\ge1),$$ where $(h_k)$ is the impulse response (the output for $w=(1,0,0,\dots)$). For $x_{t+1}=0.5x_t+w_t$, $z_t=x_t$: $h_0=0$, $h_k=0.5^{k-1}$. A finite impulse response (FIR) filter has $h_k=0$ for $k\gt r$, for example the moving average $z_t=\frac12(w_t+w_{t-1})$. The sum $\|h\|_1=\sum_k|h_k|$ (here $2$) bounds the peak gain, $\|z\|_\infty\le\|h\|_1\|w\|_\infty$.

Definition — $z$-transform and transfer function
$\hat w(z)=\sum_{t\ge0}w_tz^{-t}$. A delay by one step multiplies by $z^{-1}$, and convolution becomes multiplication: $\hat z(z)=H(z)\hat w(z)$ with the transfer function $$H(z)=\sum_{k\ge0}h_kz^{-k}=C(zI-A)^{-1}B+D .$$ Derivation: transforming $x_{t+1}=Ax_t+Bw_t$ with $x_0=0$ gives $z\hat x=A\hat x+B\hat w$, so $\hat x=(zI-A)^{-1}B\hat w$; $(zI-A)^{-1}$ is the resolvent. The poles of $H$ are eigenvalues of $A$ (all of them for a minimal realisation, Section 8), and $H$ is stable when its poles lie strictly inside the unit circle. Continuous time uses the Laplace transform $\hat w(s)=\int_0^\infty w(t)e^{-st}\mathrm dt$, differentiation becomes multiplication by $s$ (zero initial state) and $G(s)=C(sI-A)^{-1}B+D$, stable when all poles have negative real part.

Examples. $H(z)=\frac1{z-0.5}=\frac{z^{-1}}{1-0.5z^{-1}}=z^{-1}+0.5z^{-2}+0.25z^{-3}+\cdots$ reproduces $h_k=0.5^{k-1}$. If $A$ is nilpotent ($A^r=0$), the Neumann series of Section 2 terminates: $(zI-A)^{-1}=z^{-1}(I-A/z)^{-1}=z^{-1}I+z^{-2}A+\cdots+z^{-r}A^{r-1}$, so $H$ is a polynomial in $z^{-1}$, an FIR filter (Section 8). A chain of $r$ integrators ($h^{(r)}=\mu$) has $G(s)=1/s^r$. Properness: $G$ is proper if $G(\infty)$ is finite (numerator degree at most denominator degree) and strictly proper if $G(\infty)=0$ ($D=0$). Every $(A,B,C,D)$ gives a proper $G$; the pure differentiator $G(s)=s$ has no state-space realisation and amplifies high frequencies without bound. Real-rational means a ratio of polynomials with real coefficients; the stable proper real-rational transfer matrices form the set $\mathcal{RH}_\infty$. A stable proper inverse $G^{-1}$ requires $G(\infty)=D$ invertible and all zeros of $G$ in the stable region. For $G(s)=-s/(s+1)$ (Module 14): $1+G(s)=1/(s+1)$, whose inverse $s+1$ is improper, so the feedback loop through $1+G$ cannot be inverted by a bounded operator.

Poles, impulse responses and a positivity argument (Module 10). Pole placement on an integrator chain gives $\ddot h+(p_1+p_2)\dot h+p_1p_2h=e(t)$, i.e. the transfer function $\frac1{(s+p_1)(s+p_2)}$ with real poles $-p_1,-p_2$ ($0\lt p_1\lt p_2$). Its impulse response is the convolution of two decaying exponentials, $$g(t)=\frac{e^{-p_1t}-e^{-p_2t}}{p_2-p_1}\ \ge\ 0,$$ so $h(t)=h_{\rm hom}(t)+\int_0^tg(t-s)e(s)\,\mathrm ds\ge h_{\rm hom}(t)$ whenever the forcing is $e\ge0$: a nonnegative input can only raise $h$. With complex poles $g$ changes sign and this argument fails.

Background — Complex vectors and Hermitian matrices
For complex vectors and matrices use the conjugate transpose, $v^{*}=\bar v^{\top}$, $M^{*}=\bar M^{\top}$. $M$ is Hermitian if $M=M^{*}$; then $v^{*}Mv$ is real for every $v$, and $M\succeq0$ means $v^{*}Mv\ge0$ for all complex $v$. Congruence $R^{*}MR$ replaces $R^{\top}MR$. Conjugation is essential for energy: $v=(1,j)$ has $v^{\top}v=1+j^2=0$ but $v^{*}v=2$. Also $|e^{j\omega}|=1$, $\mathrm{Re}\,z=\tfrac12(z+\bar z)$, and for real-rational $H$, $H(e^{-j\omega})=\overline{H(e^{j\omega})}$, so it suffices to look at $\omega\in[0,\pi]$.
Definition — Frequency response
For stable $H$ and the complex sinusoid $w_t=e^{j\omega t}$, $z_t=\sum_kh_ke^{j\omega(t-k)}=H(e^{j\omega})e^{j\omega t}$ (exactly for a two-sided input, after the transient for a one-sided one). For $w_t=\cos\omega t$ the steady-state output is $|H(e^{j\omega})|\cos(\omega t+\angle H(e^{j\omega}))$: each frequency is scaled by $|H|$ and phase-shifted. In continuous time use $G(j\omega)$.

Example. For $H(z)=\frac1{z-0.5}$: $|H(e^{j0})|=2$ (a constant input $1$ produces $0,1,1.5,1.75,\dots\to2$), while $|H(e^{j\pi})|=|1/(-1.5)|=0.667$ (the alternating input $1,-1,1,\dots$ is attenuated).

Theorem — Parseval
For $w\in\ell_2$ with discrete-time Fourier transform $\hat w(e^{j\omega})=\sum_tw_te^{-j\omega t}$ (for a general $\ell_2$ signal this series converges in the mean-square sense, as the limit of the transforms of the truncations $w_0,\dots,w_T$, so $\hat w$ is defined for almost every $\omega$; it converges pointwise if $\sum_t\|w_t\|\lt\infty$, while for $w_t=(t+1)^{-3/4}\in\ell_2$ it diverges at $\omega=0$; the continuous-time transform of an $L_2$ signal is likewise a mean-square limit), $$\sum_{t}\|w_t\|^2=\frac1{2\pi}\int_{-\pi}^{\pi}\|\hat w(e^{j\omega})\|^2\,\mathrm d\omega;\qquad\text{continuous time: }\int_0^\infty\|w(t)\|^2\mathrm dt=\frac1{2\pi}\int_{-\infty}^{\infty}\|\hat w(j\omega)\|^2\mathrm d\omega .$$ Proof (finite sequences; general ones by a limit). $\|\hat w\|^2=\hat w^{*}\hat w=\sum_t\sum_sw_t^{\top}w_s\,e^{-j\omega(s-t)}$ and $\frac1{2\pi}\int_{-\pi}^{\pi}e^{-j\omega(s-t)}\mathrm d\omega$ is $1$ if $t=s$ and $0$ otherwise.

Example. $w=(1,1,0,0,\dots)$: $\hat w=1+e^{-j\omega}$, $|\hat w|^2=(1+\cos\omega)^2+\sin^2\omega=2+2\cos\omega$, and $\frac1{2\pi}\int_{-\pi}^{\pi}(2+2\cos\omega)\,\mathrm d\omega=2=1^2+1^2$.

Theorem — The $\mathcal H_\infty$ norm is the $\ell_2$ gain
For stable $H$ let $\|H\|_\infty=\sup_{\omega\in[-\pi,\pi]}\sigma_{\max}\big(H(e^{j\omega})\big)$ (for scalar $H$: $\max_\omega|H(e^{j\omega})|$). Then $\|z\|_2\le\|H\|_\infty\|w\|_2$ for every $w\in\ell_2$ (zero initial state), and no smaller constant works: $\|H\|_\infty$ is the induced $\ell_2$ gain. Proof of the bound. Parseval twice: $\|z\|_2^2=\frac1{2\pi}\int\|H\hat w\|^2\le\frac1{2\pi}\int\sigma_{\max}(H)^2\|\hat w\|^2\le\|H\|_\infty^2\|w\|_2^2$. Tightness: concentrate the input's energy near the maximising frequency.

Example. $\|1/(z-0.5)\|_\infty=2$, attained at $\omega=0$: a long constant input yields outputs close to $2$, so the energy ratio approaches $4$. The $\mathcal H_2$ norm is an average instead of a worst case: $\|H\|_2^2=\sum_k\|h_k\|_F^2=\frac1{2\pi}\int_{-\pi}^{\pi}\|H(e^{j\omega})\|_F^2\mathrm d\omega$, the energy of the impulse response or the output power under unit white noise. Here $\|H\|_2^2=\sum_{k\ge1}0.25^{k-1}=\frac43$, so $\|H\|_2=1.155\lt\|H\|_\infty=2$. For state-space systems $\|H\|_2^2=\operatorname{tr}(CW_cC^{\top})+\|D\|_F^2$ with the controllability Gramian $W_c$ of Section 8.

Definition — DFT, FFT and circular convolution
For $x\in\mathbb C^N$ the (unitary) discrete Fourier transform is $X=Fx$, $F_{kn}=\frac1{\sqrt N}e^{-j2\pi kn/N}$; $F$ is unitary, so $\|X\|=\|x\|$. A circular convolution $y_n=\sum_mc_mx_{(n-m)\bmod N}$ is multiplication by a circulant matrix, and every circulant matrix is diagonalised by the DFT: $y=F^{*}\mathrm{diag}(\tilde c)\,Fx$ with $\tilde c_k=\sum_mc_me^{-j2\pi km/N}$. A multi-channel convolution becomes block diagonal: one $c_{\rm out}\times c_{\rm in}$ matrix per frequency, and its spectral norm is the largest spectral norm over the frequencies. The FFT is an algorithm computing the DFT in $O(N\log N)$ operations; it is not a different transform.

Example. $N=2$: $F=\frac1{\sqrt2}\begin{bmatrix}1 & 1\\ 1 & -1\end{bmatrix}$. Circular convolution with the kernel $(a,b)$ is the circulant $\begin{bmatrix}a & b\\ b & a\end{bmatrix}$, whose eigenvalues $a+b$ and $a-b$ are $\tilde c_0$ and $\tilde c_1$, with the DFT vectors as eigenvectors.

Return difference, gain and delay margins

Break the loop $u=-Kx$ at the plant input. The loop transfer function is $L(z)=K(zI-A)^{-1}B$ (single input), and the matrix determinant lemma gives $\det(zI-A+BK)=\det(zI-A)\,\big(1+L(z)\big)$: barring cancellations, the closed-loop poles are the zeros of the return difference $1+L(z)$. The smallest distance $\min_\omega|1+L(e^{j\omega})|$ of the Nyquist curve $L(e^{j\omega})$ from $-1$ measures how close the loop is to instability. The gain margin is the range of factors $\kappa$ for which $u=-\kappa Kx$ still stabilises; the delay margin is the largest extra input delay the loop tolerates. Example (Module 4). The LQR gain $K=0.618$ for $A=B=1$ gives $L(z)=\frac{0.618}{z-1}$; at $\omega=\pi$, $|1+L(-1)|=|1-0.309|=0.691$, the minimum over $\omega$. The closed-loop pole $1-0.618\kappa$ is stable iff $0\lt\kappa\lt3.236$. With a one-step delay, $x_{t+1}=x_t-0.618x_{t-1}$ is still stable (roots of modulus $\sqrt{0.618}=0.786$); a two-step delay puts roots on the unit circle ($e^{\pm j\pi/5}$ for the unrounded gain $K=(\sqrt5-1)/2$), and a three-step delay destabilises. Continuous-time LQR guarantees $|1+L(j\omega)|\ge1$ (gain margin $[\tfrac12,\infty)$, phase margin at least $60^\circ$); discrete-time LQR does not, as $0.691\lt1$ shows.

Dissipativity: from a storage function to a gain

Definition — Storage function and supply rate (dissipativity)
A system $x_{t+1}=f(x_t,w_t)$, $z_t=h(x_t,w_t)$ is dissipative with respect to a supply rate $s(w,z)$ if there is a storage function $V\ge0$ with $$V(x_{t+1})-V(x_t)\le s(w_t,z_t)\qquad\text{for all }t:$$ stored energy grows at most by the energy supplied. The QSR supply rates are $s(w,z)=w^{\top}Qw+2w^{\top}Sz+z^{\top}Rz$ with symmetric $Q,R$. The $\ell_2$-gain supply is $Q=\gamma^2I$, $S=0$, $R=-I$, i.e. $s=\gamma^2\|w\|^2-\|z\|^2$; passivity is $s=2w^{\top}z$.

Storage implies gain. If $V\ge0$, $V(x_0)=0$ and $V(x_{t+1})-V(x_t)\le\gamma^2\|w_t\|^2-\|z_t\|^2$, summing over $t=0,\dots,T$ telescopes the left side to $V(x_{T+1})-V(x_0)\ge0$, hence $\sum_{t\le T}\|z_t\|^2\le\gamma^2\sum_{t\le T}\|w_t\|^2$ for every $T$.

Example. For $x_{t+1}=0.5x_t+w_t$, $z_t=x_t$, take $V=2x^2$ and $\gamma=2$: $2(0.5x+w)^2-2x^2-4w^2+x^2=-0.5x^2+2xw-2w^2=-0.5(x-2w)^2\le0$. The certificate proves the gain is at most $2=\|H\|_\infty$, so it is tight.

For LTI systems and $V=x^{\top}Px$ the dissipation inequality is a matrix inequality in $P$, $$\begin{bmatrix}A^{\top}PA-P+C^{\top}C & A^{\top}PB+C^{\top}D\\ B^{\top}PA+D^{\top}C & B^{\top}PB+D^{\top}D-\gamma^2I\end{bmatrix}\preceq0,$$ here $\begin{bmatrix}-0.5 & 1\\ 1 & -2\end{bmatrix}\preceq0$ (determinant $0$, trace $-2.5$). The KYP lemma (Module 2) turns this into an equivalence, under hypotheses: for Schur $A$ and controllable $(A,B)$ (a minimal realisation suffices) the LMI has a solution $P\succeq0$ exactly when $\|H\|_\infty\le\gamma$, i.e. when $\sigma_{\max}(H(e^{j\omega}))\le\gamma$ at every $\omega$ (the bounded-real lemma); with strict inequalities on both sides controllability is not needed. One matrix inequality replaces infinitely many frequency conditions. Feasibility always implies the gain bound (the storage argument above), but the converse can fail without the hypotheses: for $A=2$, $B=0$, $C=1$, $D=0$ the zero-state transfer function is $H=0$, yet the first diagonal entry of the LMI is $3P+1$, which cannot be nonpositive for $P\ge0$. That is why frequency-domain criteria (the circle criterion, IQCs) reappear as LMIs in Modules 2 and 14.

Definition — Quadratic constraints and integral quadratic constraints (glossary)
A static quadratic constraint (QC) holds at every time: $\begin{bmatrix}v_t\\ w_t\end{bmatrix}^{\top}M\begin{bmatrix}v_t\\ w_t\end{bmatrix}\ge0$ (e.g. a sector condition, Section 7). An integral quadratic constraint (IQC) only requires such an inequality after summing over time, possibly after filtering: $\sum_tr_t^{\top}Mr_t\ge0$ with $r=\Psi\begin{bmatrix}v\\ w\end{bmatrix}$, or in the frequency domain $\int\begin{bmatrix}\hat v\\ \hat w\end{bmatrix}^{*}\Pi(e^{j\omega})\begin{bmatrix}\hat v\\ \hat w\end{bmatrix}\mathrm d\omega\ge0$ with a Hermitian-valued multiplier $\Pi=\Psi^{*}M\Psi$. A QC that holds at every $t$ also holds summed ($\Pi$ constant). IQCs describe dynamic uncertainty, delays and the correlation over time of memoryless nonlinearities (Zames–Falb multipliers, Module 14).
Where this is used

Practice — Connect time responses to gains

Easy checks the basic operation; Medium connects steps; Hard asks you to justify a conclusion or identify a limitation. Each solution explains why the steps work.

Exercise D.S16 — Easy: A constant input and the DC gain

For $\dot x=-2x+u$, $y=x$, start at $x(0)=0$ and hold $u(t)=1$. Solve $x(t)$ and find the steady output. Compare with $G(0)$ for transfer function $G(s)=1/(s+2)$.

Review if needed: this section and geometric series.

Show hint
The equilibrium is $1/2$. The difference from equilibrium decays with rate $-2$.
Show worked solution
  1. Set $e=x-1/2$. Then $\dot e=-2e$ and $e(0)=-1/2$.
  2. Thus $x(t)=(1-e^{-2t})/2\to1/2$.
  3. $G(0)=1/2$ gives the same steady response to a unit constant input. The transfer function describes the zero-initial-state input-output map; a nonzero initial state adds its own transient.
Exercise D.S17 — Medium: Evaluate a frequency response

For $G(s)=1/(s+2)$, compute $|G(j\omega)|$ at $\omega=0$ and $\omega=2$, and find its $H_\infty$ norm. Here $j^2=-1$.

Review if needed: this section and geometric series.

Show hint
The modulus of $2+j\omega$ is $\sqrt{4+\omega^2}$.
Show worked solution
  1. $|G(j\omega)|=1/\sqrt{4+\omega^2}$, because reciprocal complex numbers have reciprocal moduli.
  2. At $0$ this is $1/2=0.5$; at $2$ it is $1/\sqrt8\approx0.353553$.
  3. The denominator is smallest at $\omega=0$, so $\|G\|_{H_\infty}=\sup_\omega|G(j\omega)|=0.5$. This stable system's induced $L_2$ gain is the same number; it measures worst input-output energy amplification, not a particular initial-state transient.
Exercise D.S18 — Hard: Two norms of one impulse response

For the discrete system $x_{t+1}=0.5x_t+u_t$, $y_t=x_t$, with zero initial state, a unit impulse at time $0$ gives $h_0=0$ and $h_t=0.5^{t-1}$ for $t\ge1$. Compute its $\ell_1$ and $\ell_2$ norms and the induced $\ell_\infty$ gain. Why are the two norms different?

Review if needed: this section and geometric series.

Show hint
Sum the geometric series once for $h_t$ and once for $h_t^2$. A constant input attains the asymptotic positive-kernel gain.
Show worked solution
  1. $\|h\|_1=\sum_{t=1}^\infty0.5^{t-1}=1/(1-0.5)=2$.
  2. $\|h\|_2^2=\sum_{t=1}^\infty0.25^{t-1}=4/3$, so $\|h\|_2=2/\sqrt3\approx1.154701$.
  3. Convolution gives $|y_t|\le\|h\|_1\|u\|_\infty$, and a unit constant input approaches output $2$, so the induced $\ell_\infty$ gain is exactly $2$. The $\ell_2$ norm of the impulse response measures energy from one impulse; it is not this worst-case bounded-input gain.

7. Feedback with Nonlinearities: Lur'e Systems & Sector Conditions

Start here — Read a nonlinearity as a constraint

A sector gives information about a nonlinearity for every input. Saturation obeys $0\le v\varphi(v)\le v^2$, which preserves sign information that a norm bound may discard. A sufficient test failing means that this test did not certify stability; it does not establish instability.

When ready, try the Easy, Medium and Hard practice for this section. For a prerequisite gap, review Lipschitz bounds.

A neural network in a control loop, a saturating actuator and a clipped multiplier update have the same structure: a linear system in feedback with a memoryless nonlinearity about which we only know inequalities. Classical absolute-stability theory asks for stability for every nonlinearity that satisfies them.

Definition — Lur'e system and well-posedness
A Lur'e system is a linear system in feedback with a static (memoryless) nonlinearity $\phi$: $$x_{t+1}=Ax_t+Bw_t,\qquad v_t=Cx_t+Dw_t,\qquad w_t=\phi(v_t)$$ (continuous time analogously; a minus sign for negative feedback is absorbed into $\phi$ or $B$). The loop is well posed if its equations have a unique solution for every initial state and input. With $D=0$ there is no algebraic loop: in discrete time the recursion $x_{t+1}=Ax_t+B\phi(Cx_t)$ is explicit, while in continuous time one also needs $\phi$ locally Lipschitz (for $A=0$, $B=C=1$, $\phi(v)=\sqrt{|v|}$ the solution from $0$ is not unique, Section 1). Otherwise $w=\phi(Cx+Dw)$ must be solved for $w$, which has a unique solution for instance when $\|D\|\cdot\mathrm{Lip}(\phi)\lt1$ (a contraction) or when $D$ is strictly lower triangular and $\phi$ acts componentwise ($\phi_i$ depends on $v_i$ only), as for a feedforward network (Module 14): then $w_1,w_2,\dots$ follow by substitution. Triangularity alone is not enough: for $D=\begin{bmatrix}0 & 0\\ 1 & 0\end{bmatrix}$, $Cx=0$ and $\phi(v)=(v_2,0)$, every $w=(a,0)$ solves $w=\phi(Dw)$.

Examples. Saturated state feedback $u=\mathrm{sat}(-Kx)$ on $x_{t+1}=Ax_t+Bu_t$: $v=-Kx$, $w=\mathrm{sat}(v)$. A neural controller $u=W_1\phi(W_0x)$ on a linear plant: the plant and all weight matrices form the linear block, and the stacked activations form a diagonal static nonlinearity, one scalar function per neuron.

Definition — Sector and slope conditions
A scalar $\phi$ lies in the sector $[\alpha,\beta]$ if $(\phi(v)-\alpha v)(\phi(v)-\beta v)\le0$ for all $v$: its graph lies between the lines $\alpha v$ and $\beta v$ (for $v\ne0$: $\alpha\le\phi(v)/v\le\beta$). It is slope-restricted on $[\alpha,\beta]$ if every chord satisfies $\alpha\le\frac{\phi(v)-\phi(v')}{v-v'}\le\beta$ for $v\ne v'$. Slope-restricted with $\phi(0)=0$ implies the sector condition (take $v'=0$), not conversely. Expanding the product gives the quadratic-constraint form $$\begin{bmatrix}v\\ \phi(v)\end{bmatrix}^{\top}\begin{bmatrix}-2\alpha\beta & \alpha+\beta\\ \alpha+\beta & -2\end{bmatrix}\begin{bmatrix}v\\ \phi(v)\end{bmatrix}\ \ge\ 0,$$ which can be multiplied by any $\lambda\ge0$ and added to other inequalities (the S-procedure, Module 2). A local sector holds only for $v$ in an interval.

Examples. ReLU, tanh and saturation are slope-restricted on $[0,1]$ and hence in the sector $[0,1]$; leaky ReLU $\max\{v,av\}$ ($0\lt a\lt1$) on $[a,1]$. The chord slope $\tanh(v)/v$ decreases in $|v|$, so on $|v|\le2$ tanh lies in the local sector $[\tanh(2)/2,\,1]\approx[0.482,1]$: knowing that pre-activations stay bounded buys a positive lower sector bound. The slope restriction on that interval is weaker, $[\operatorname{sech}^2(2),1]\approx[0.0707,1]$, since $\tanh'(v)=\operatorname{sech}^2v$ and chords near $|v|=2$ are much flatter than the chord to the origin.

Definition — Absolute stability; Aizerman's conjecture
The Lur'e system is absolutely stable for the sector $[\alpha,\beta]$ if its origin is globally asymptotically stable for every $\phi$ in the sector. Aizerman's conjecture claimed that it suffices to check the linear loops $w=kv$ for every constant $k\in[\alpha,\beta]$. It is false in general (counterexamples go back to Pliss, 1958): a nonlinearity can use a different effective gain in different parts of the state space. Certificates must therefore use the sector or slope inequality itself, not only the constant gains it contains. For first-order systems the conjecture holds (example below), which is why low-dimensional intuition misleads.
Theorem — Circle criterion, sector $[0,\beta]$ (statement)
Assumptions. Negative feedback $v=G(u)$, $u=-\phi(v)$ with $\phi$ (possibly time-varying) in the sector $[0,\beta]$, $\beta\gt0$; $G$ stable (poles in the open left half-plane, or strictly inside the unit circle in discrete time); the loop is well posed. Statement. If there is $\varepsilon\gt0$ with $$1+\beta\,\mathrm{Re}\,G(j\omega)\ \ge\ \varepsilon\ \ \text{for all }\omega\qquad(\text{discrete time: }1+\beta\,\mathrm{Re}\,G(e^{j\omega})\ge\varepsilon),$$ the loop is stable for every such $\phi$: finite gain from external inputs, and global asymptotic stability of the origin when $(A,B,C)$ is a minimal realisation (Khalil 2002, Theorem 7.1). For a general sector $[\alpha,\beta]$ with $0\lt\alpha\lt\beta$ and stable $G$, the Nyquist curve of $G$ must stay outside, and not encircle, the disk whose diameter is the segment between $-1/\alpha$ and $-1/\beta$: hence the name.

Where the condition comes from. Multiplying the sector QC by $\lambda\ge0$ and adding it to a dissipation inequality with storage $x^{\top}Px$ gives one LMI (the S-procedure); by the KYP lemma (under its stability and controllability hypotheses, Section 6) that LMI is feasible exactly when the frequency condition holds.

Theorem — Popov criterion (statement)
Continuous time, $G$ stable and strictly proper with a minimal realisation $(A,B,C)$, and a time-invariant $\phi$ in the sector $[0,k]$. If for some $q\ge0$ with $1+q\lambda\ne0$ for every eigenvalue $\lambda$ of $A$ the function $Z(s)=\frac1k+(1+qs)G(s)$ is strictly positive real (Khalil 2002, Theorem 7.3), the loop is absolutely stable. For stable $G$ this means $$\frac1k+\mathrm{Re}\big[(1+j\omega q)\,G(j\omega)\big]\gt0\qquad\text{for all }\omega,$$ and, if this expression tends to $0$ as $\omega\to\infty$, also $\lim_{\omega\to\infty}\omega^2\big(\frac1k+\mathrm{Re}[(1+j\omega q)\,G(j\omega)]\big)\gt0$: positivity at every finite frequency alone is not enough. The factor $1+j\omega q$ is a dynamic multiplier; it is valid only because $\phi$ does not change over time. $q=0$ recovers the circle test.

Worked example (continuous time). $G(s)=\frac1{(s+1)(s+2)}$ with $\phi$ in $[0,k]$. Constant gains give $s^2+3s+2+k$, Hurwitz for every $k\gt-2$. Circle: $\mathrm{Re}\,G(j\omega)=\frac{2-\omega^2}{(2-\omega^2)^2+9\omega^2}$ has minimum $-\frac{\sqrt2}{12+9\sqrt2}\approx-0.0572$ at $\omega^2=2+3\sqrt2$ ($\omega\approx2.50$), so the circle criterion certifies only $k\lt9+6\sqrt2\approx17.5$. Popov with $q=\tfrac13$: $\mathrm{Re}[(1+j\omega q)G]=\mathrm{Re}\,G-q\,\omega\,\mathrm{Im}\,G=\frac{2}{(2-\omega^2)^2+9\omega^2}\gt0$, so every finite sector $[0,k]$ is certified for time-invariant $\phi$. The circle criterion, which also covers time-varying gains, is conservative here. Discrete time, first order. $G(z)=\frac1{z-0.5}$: $\mathrm{Re}\,G(e^{j\omega})=\frac{\cos\omega-0.5}{1.25-\cos\omega}$, minimal $-\tfrac23$ at $\omega=\pi$, so the circle criterion certifies $\beta\lt1.5$; the constant-gain loop $x_{t+1}=(0.5-k)x_t$ is stable exactly for $-0.5\lt k\lt1.5$. For this first-order loop the two agree.

Loop transformations. A sector can be moved by redefining the blocks. $\tilde\phi(v)=\phi(v)-\alpha v$ lies in $[0,\beta-\alpha]$ if the term $\alpha v$ is moved into the linear part ($\tilde G=G/(1+\alpha G)$ in negative feedback, which requires $1+\alpha G$ to be invertible: well-posedness again). The symmetric form writes $\phi(v)=\frac{\alpha+\beta}2v+\frac{\beta-\alpha}2\delta(v)$ with $\delta$ in the sector $[-1,1]$: a gain-one uncertainty around the midpoint gain, which is the small-gain view. Module 14 transforms slope bounds $[\mu,\nu]$ the same way; the transformed nonlinearity is then a monotone relation, a set of pairs $(a,b)$ with $(a-a')(b-b')\ge0$ for any two of its pairs, which may be multivalued (a vertical piece in its graph).

Theorem — Small-gain theorem
Assumptions. The feedback interconnection $e_1=r_1+G_2(e_2)$, $e_2=r_2+G_1(e_1)$ is well posed, and $G_1,G_2$ are causal with finite $\ell_2$ gains $\gamma_1,\gamma_2$. Statement. If $\gamma_1\gamma_2\lt1$, then for all $T$ $$\|e_1\|_{2,T}\le\frac{\|r_1\|_{2,T}+\gamma_2\|r_2\|_{2,T}}{1-\gamma_1\gamma_2},$$ and similarly for $e_2$: the closed loop has finite gain. Proof. $\|e_1\|_{2,T}\le\|r_1\|_{2,T}+\gamma_2\|e_2\|_{2,T}\le\|r_1\|_{2,T}+\gamma_2(\|r_2\|_{2,T}+\gamma_1\|e_1\|_{2,T})$; the truncated norms are finite, so the term $\gamma_1\gamma_2\|e_1\|_{2,T}$ can be moved to the left. $\blacksquare$

Example. $G_1=\frac1{z-0.5}$ (gain $2$) in feedback with $G_2=0.4\tanh$ (gain $0.4$): $0.8\lt1$, stable. A network controller with $\pi(0)=0$ and Lipschitz constant $L$ has gain $L$, since $\|\pi(x)\|\le L\|x\|$ (in general $L$ is an incremental gain, Module 12), so in feedback with a plant of gain $\gamma$ it is certified by $\gamma L\lt1$. Without $\pi(0)=0$ there is no zero-referenced gain: $\pi(x)=0.4x+1$ has $L=0.4$, and with the plant $\frac1{z-0.5}$ ($\gamma=2$) we get $\gamma L=0.8\lt1$, yet $x_{t+1}=0.5x_t+\pi(x_t)$ has no equilibrium at the origin (it settles at $x=10$). Shift the coordinates to a closed-loop equilibrium first, or use incremental gains for both blocks. Three cautions. (i) Small gain ignores signs and phases, so it is conservative: $\frac1{z-0.5}$ in negative feedback with a constant gain $k$ is stable for all $0\le k\lt1.5$, but small gain only certifies $|k|\lt0.5$. (ii) A finite gain for each component is not a closed-loop certificate: gains $2$ and $1$ in positive feedback give $x_{t+1}=1.5x_t$, unstable. (iii) A cascade (series connection) of stable systems is always stable with gain at most $\gamma_1\gamma_2$, without any condition; this is why Module 14's Youla parameterisation, which keeps the learned block outside every feedback loop, needs no small-gain test.

Definition — Linear fractional representation (LFT)
Partition a linear system as $z=P_{11}d+P_{12}w$, $v=P_{21}d+P_{22}w$ and close the lower channel with a block $w=\Delta v$. Eliminating $v$ and $w$ gives $$z=\big[P_{11}+P_{12}\Delta(I-P_{22}\Delta)^{-1}P_{21}\big]d=:(\Delta\star P)\,d,$$ defined when $I-P_{22}\Delta$ is invertible (well-posedness). A Lur'e system is the case $\Delta=\phi$; uncertain parameters, delays or a neural network can all be pulled out into $\Delta$.
Where neural-network activations fit
Common activations are slope-restricted on $[0,1]$ (the sigmoid on $[0,\tfrac14]$), so the stacked activations satisfy one sector or slope QC per neuron, combined with a diagonal multiplier $T=\mathrm{diag}(\lambda_i)\succeq0$ (Modules 2 and 12). The Lipschitz constant of a network is its incremental gain; if the network maps $0$ to $0$ it also bounds the gain that small-gain arguments use. Because the same scalar function acts in every channel and has bounded slopes, richer dynamic (Zames–Falb) multipliers than the circle criterion's are valid (Module 14).
Where this is used

Practice — Read a nonlinearity as a constraint

Easy checks the basic operation; Medium connects steps; Hard asks you to justify a conclusion or identify a limitation. Each solution explains why the steps work.

Exercise D.S19 — Easy: Check a saturation sector

Define $\varphi(v)=\max(-1,\min(v,1))$. Verify $0\le v\varphi(v)\le v^2$ for every real $v$. What sector does this establish?

Review if needed: this section and Lipschitz bounds.

Show hint
Treat $|v|\le1$ and $|v|\gt1$ separately.
Show worked solution
  1. If $|v|\le1$, then $\varphi(v)=v$, so $v\varphi(v)=v^2\ge0$.
  2. If $|v|\gt1$, then $\varphi(v)$ is the sign of $v$, and $v\varphi(v)=|v|$. Here $0\le|v|\le v^2$.
  3. Thus the nonlinearity lies in sector $[0,1]$: the origin-to-point slope is between $0$ and $1$. This is a pointwise statement about every input, not an estimate obtained by sampling a few values.
Exercise D.S20 — Medium: Verify a small-gain conclusion directly

Consider $\dot x=-x+0.8\varphi(x)$, where $\varphi(0)=0$ and $\varphi$ is globally $1$-Lipschitz. Show directly with $V=x^2$ that the origin is globally exponentially stable. Relate this to loop gain $0.8$.

Review if needed: this section and Lipschitz bounds.

Show hint
The Lipschitz property gives $|\varphi(x)|\le|x|$, so $x\varphi(x)\le x^2$.
Show worked solution
  1. Differentiate: $\dot V=2x(-x+0.8\varphi(x))=-2x^2+1.6x\varphi(x)$.
  2. Bound the nonlinear term by $1.6x^2$, yielding $\dot V\le-0.4V$. Hence $|x(t)|\le|x_0|e^{-0.2t}$.
  3. The stable linear block $0.8/(s+1)$ has $H_\infty$ norm $0.8$, and the nonlinearity has gain at most $1$. Their product is below one, matching small gain. Global Lipschitz dynamics ensure solutions exist for all forward time here.
Exercise D.S21 — Hard: A failed sufficient condition is not instability

Let $\dot x=-x-\varphi(x)$, where $\varphi$ is locally Lipschitz and satisfies $0\le x\varphi(x)\le3x^2$ for all $x$, with $\varphi(0)=0$. A norm-only small-gain test uses bounds $1$ and $3$ and fails. Prove stability anyway.

Review if needed: this section and Lipschitz bounds.

Show hint
The negative feedback sign and the nonnegative sector product help the derivative of $x^2$.
Show worked solution
  1. With $V=x^2$, $\dot V=-2x^2-2x\varphi(x)\le-2V$, because the sector product is nonnegative.
  2. Therefore $|x(t)|\le|x_0|e^{-t}$. Local Lipschitz continuity gives uniqueness, and this bounded trajectory cannot escape in finite time, so the conclusion holds globally.
  3. The product of the coarse gain bounds is $3\gt1$, so small gain provides no certificate. It does not predict instability. The sector retains sign information that absolute gain bounds discard, allowing the direct proof to succeed.

8. Controllability, Gramians & State-Space Realizations

Start here — Ask which states inputs can reach

Controllability asks whether inputs can reach every state, not whether an uncontrolled state decays. If the second coordinate receives no input or coupling, starting it at zero keeps it zero. Rank and Gramians turn this physical observation into algebra.

When ready, try the Easy, Medium and Hard practice for this section. For a prerequisite gap, review rank and null spaces.

Can the input move the state everywhere? Can the output reveal it? The answers are rank tests, and their quantitative versions, the Gramians, reappear as storage functions in Module 13. The second half turns input–output descriptions (a transfer function, a convolution) into state-space form.

Definition and test — Controllability and observability
With unconstrained inputs $u\in\mathbb R^m$, $(A,B)$ is controllable if every state can be steered to every other state in finite time. For $x_{t+1}=Ax_t+Bu_t$ this holds iff $$\operatorname{rank}\,\mathcal C=n,\qquad\mathcal C=\begin{bmatrix}B & AB & \cdots & A^{n-1}B\end{bmatrix}.$$ Reason: $x_n=A^nx_0+\begin{bmatrix}B & AB & \cdots & A^{n-1}B\end{bmatrix}\begin{bmatrix}u_{n-1}\\ \vdots\\ u_0\end{bmatrix}$, so the reachable displacements are the range of $\mathcal C$, and more steps add no new directions because $A^n$ is a combination of $I,\dots,A^{n-1}$ (Cayley–Hamilton). The same rank test holds in continuous time.
$(C,A)$ is observable if the initial state can be reconstructed from the outputs $y_0,\dots,y_{n-1}$ (inputs known), iff $\operatorname{rank}\,\mathcal O=n$ with $\mathcal O=\begin{bmatrix}C\\ CA\\ \vdots\\ CA^{n-1}\end{bmatrix}$. Duality: $(C,A)$ is observable iff $(A^{\top},C^{\top})$ is controllable.

Example. Position and velocity, $A=\begin{bmatrix}1 & 1\\ 0 & 1\end{bmatrix}$. A force on the velocity, $B=\begin{bmatrix}0\\ 1\end{bmatrix}$: $\mathcal C=\begin{bmatrix}0 & 1\\ 1 & 1\end{bmatrix}$ has determinant $-1$, controllable. A push on the position only, $B=\begin{bmatrix}1\\ 0\end{bmatrix}$: $\mathcal C=\begin{bmatrix}1 & 1\\ 0 & 0\end{bmatrix}$ has rank $1$, and the velocity can never be changed. Measuring the position, $C=\begin{bmatrix}1 & 0\end{bmatrix}$: $\mathcal O=\begin{bmatrix}1 & 0\\ 1 & 1\end{bmatrix}$, observable (the velocity is $y_1-y_0$). Measuring the velocity, $C=\begin{bmatrix}0 & 1\end{bmatrix}$: $\mathcal O=\begin{bmatrix}0 & 1\\ 0 & 1\end{bmatrix}$, and the absolute position is invisible.

Definition — Stabilisability and detectability
$(A,B)$ is stabilisable if some $K$ makes $A-BK$ Schur (Hurwitz in continuous time); equivalently every uncontrollable mode is already stable; test: $\operatorname{rank}\begin{bmatrix}\lambda I-A & B\end{bmatrix}=n$ for every eigenvalue $\lambda$ of $A$ with $|\lambda|\ge1$ ($\mathrm{Re}\,\lambda\ge0$ in continuous time). $(C,A)$ is detectable if some $L$ makes $A-LC$ Schur; equivalently every unobservable mode is stable; test: $\operatorname{rank}\begin{bmatrix}\lambda I-A\\ C\end{bmatrix}=n$ for those $\lambda$. These are the weakest conditions under which LQR (stabilisable $(A,B)$, detectable $(Q^{1/2},A)$) and observer-based control work.

Example. $A=\mathrm{diag}(0.5,2)$, $B=\begin{bmatrix}0\\ 1\end{bmatrix}$: the mode $0.5$ cannot be influenced but decays anyway, so $(A,B)$ is stabilisable, and $K=\begin{bmatrix}0 & 1.8\end{bmatrix}$ gives $A-BK=\mathrm{diag}(0.5,0.2)$. With $B=\begin{bmatrix}1\\ 0\end{bmatrix}$ the unstable mode $2$ is uncontrollable and no feedback helps: not stabilisable.

Definition — Controllability Gramian
For Schur $A$ (discrete time): $W_c=\sum_{k\ge0}A^kBB^{\top}(A^{\top})^k$. It solves the Stein (discrete Lyapunov) equation $$W_c-AW_cA^{\top}=BB^{\top},$$ because $AW_cA^{\top}=\sum_{k\ge1}A^kBB^{\top}(A^{\top})^k=W_c-BB^{\top}$, and $W_c\succ0$ iff $(A,B)$ is controllable: $x^{\top}W_cx=\sum_k\|B^{\top}(A^{\top})^kx\|^2=0$ exactly when $x$ is orthogonal to the range of $\mathcal C$. The finite-horizon Gramian $W_N=\sum_{k=0}^{N-1}A^kBB^{\top}(A^{\top})^k=\mathcal C_N\mathcal C_N^{\top}$, with $\mathcal C_N=\begin{bmatrix}B & AB & \cdots & A^{N-1}B\end{bmatrix}$, exists for every $A$. Continuous time: $W_c=\int_0^\infty e^{At}BB^{\top}e^{A^{\top}t}\mathrm dt$ with $AW_c+W_cA^{\top}+BB^{\top}=0$.

Meaning: minimum energy. The least input energy $\sum_k\|u_k\|^2$ that steers $0$ to $x$ in $N$ steps is $x^{\top}W_N^{-1}x$ when $W_N\succ0$, i.e. when $\mathcal C_N$ has rank $n$ (the least-norm solution of $\mathcal C_N\mathbf u=x$ is $\mathbf u=\mathcal C_N^{\top}W_N^{-1}x$). If $W_N$ is singular, only $x\in\operatorname{range}W_N$ can be reached in $N$ steps, at the least energy $x^{\top}W_N^{\dagger}x$ with the pseudoinverse $W_N^{\dagger}$; for the delay register below and $N=1$, $W_1=\mathrm{diag}(1,0)$ and $x=(0,1)$ is unreachable. Directions in which the Gramian is small are expensive to reach. The inverse Gramian is thus a "required supply", which is why it can serve as a storage function (Module 13's Cayley–Gramian layers). Examples. Scalar $a=0.5$, $b=1$: $W_c=\sum_k0.25^k=\frac43$, and indeed $\frac43-0.25\cdot\frac43=1$. The delay register $A=\begin{bmatrix}0 & 0\\ 1 & 0\end{bmatrix}$, $B=\begin{bmatrix}1\\ 0\end{bmatrix}$ has $A^2=0$ and $W_c=BB^{\top}+ABB^{\top}A^{\top}=\mathrm{diag}(1,0)+\mathrm{diag}(0,1)=I$: a finite sum. The dual observability Gramian $W_o=\sum_k(A^{\top})^kC^{\top}CA^k$ measures the output energy of the free response, $\sum_t\|y_t\|^2=x_0^{\top}W_ox_0$, and $\|H\|_2^2=\operatorname{tr}(CW_cC^{\top})+\|D\|_F^2$ (Section 6; here $\frac43$ for $c=1$).

Definition — Realisation
$(A,B,C,D)$ realises a transfer function $H$ if $C(zI-A)^{-1}B+D=H(z)$. Realisations are not unique: for invertible $T$, $(TAT^{-1},TB,CT^{-1},D)$ realises the same $H$ (new state coordinates, same input–output behaviour). A realisation of smallest state dimension is minimal, which holds iff it is controllable and observable; then the poles of $H$ are exactly the eigenvalues of $A$.

FIR filters as delay registers. $y_t=h_0w_t+h_1w_{t-1}+h_2w_{t-2}$ is realised by storing the last two inputs, $x_t=(w_{t-1},w_{t-2})$: $$x_{t+1}=\begin{bmatrix}0 & 0\\ 1 & 0\end{bmatrix}x_t+\begin{bmatrix}1\\ 0\end{bmatrix}w_t,\qquad y_t=\begin{bmatrix}h_1 & h_2\end{bmatrix}x_t+h_0w_t .$$ The state update inserts the new sample and shifts the register ($z^{-1}$ is one delay). Check: $(zI-A)^{-1}=\begin{bmatrix}z^{-1} & 0\\ z^{-2} & z^{-1}\end{bmatrix}$, so $C(zI-A)^{-1}B+D=h_0+h_1z^{-1}+h_2z^{-2}$. $A$ is nilpotent ($A^2=0$), and the zero initial state is exactly zero padding. For multi-channel convolutions every entry becomes an identity block or a kernel matrix (Module 12, Exercise 12.6). An IIR example: $H(z)=\frac{b_1z+b_0}{z^2+a_1z+a_0}$ is realised by $A=\begin{bmatrix}-a_1 & -a_0\\ 1 & 0\end{bmatrix}$, $B=\begin{bmatrix}1\\ 0\end{bmatrix}$, $C=\begin{bmatrix}b_1 & b_0\end{bmatrix}$, $D=0$, since $\det(zI-A)=z^2+a_1z+a_0$ and $(zI-A)^{-1}B=\frac{1}{\det(zI-A)}\begin{bmatrix}z\\ 1\end{bmatrix}$. Acausal FIR filters such as $h_{-1}w_{t+1}+h_0w_t+h_1w_{t-1}$ use a future sample and have no causal realisation, but delaying the output by one step makes them causal; inside an IQC multiplier they are allowed, because the multiplier only appears in an inequality summed over the whole signal (Modules 2 and 14).

2-D (Roesser) systems in one paragraph. For images, "time" runs in two directions $(i_1,i_2)$. A Roesser model carries a horizontal state $x_1$, passed to the right, and a vertical state $x_2$, passed downwards: $$\begin{bmatrix}x_1(i_1{+}1,i_2)\\ x_2(i_1,i_2{+}1)\\ y(i_1,i_2)\end{bmatrix}=\begin{bmatrix}A_{11} & A_{12} & B_1\\ A_{21} & A_{22} & B_2\\ C_1 & C_2 & D\end{bmatrix}\begin{bmatrix}x_1(i_1,i_2)\\ x_2(i_1,i_2)\\ u(i_1,i_2)\end{bmatrix}.$$ A 2-D convolution is a 2-D FIR filter with such a realisation, and a convolutional network becomes a 2-D Lur'e system. The analogy has limits: there is no single ordering of time, dissipation inequalities telescope along rows and along columns separately, and minimal realisations are not guaranteed in general (Module 12).

Where this is used

Practice — Ask which states inputs can reach

Easy checks the basic operation; Medium connects steps; Hard asks you to justify a conclusion or identify a limitation. Each solution explains why the steps work.

Exercise D.S22 — Easy: An unreachable coordinate

For $A=\operatorname{diag}(0.5,0.25)$ and $B=(1,0)^\top$ in a two-state discrete system, form the controllability matrix $[B\ AB]$. Is the system controllable from zero?

Review if needed: this section and rank and null spaces.

Show hint
The second coordinate receives no input and has no coupling from the first.
Show worked solution
  1. $AB=(0.5,0)^\top$, so the controllability matrix is $\begin{bmatrix}1&0.5\\0&0\end{bmatrix}$.
  2. Its rank is $1$, less than the state dimension $2$, so it cannot span all target states.
  3. Indeed, from $x_{2,0}=0$, the second coordinate remains zero forever. Inputs can reach points on the first coordinate axis, but not a state with nonzero second coordinate. Stability of $A$ does not imply controllability.
Exercise D.S23 — Medium: A Gramian is a reachability scale

For the continuous integrator $\dot x=u$, $x(0)=0$, require $x(2)=1$. Compute the horizon-$2$ controllability Gramian and the minimum input energy $\int_0^2u(t)^2dt$. Give an input that attains it.

Review if needed: this section and rank and null spaces.

Show hint
Here $e^{At}=1$ and $B=1$. Cauchy–Schwarz bounds the square of $\int_0^2u$.
Show worked solution
  1. The scalar Gramian is $W_2=\int_0^2 1\,dt=2$.
  2. The endpoint constraint is $\int_0^2u(t)dt=1$. Cauchy–Schwarz gives $1\le2\int_0^2u(t)^2dt$, so energy is at least $1/2$, also $x_f^2/W_2$.
  3. The constant input $u(t)=1/2$ reaches $x(2)=1$ and uses energy $2(1/2)^2=1/2$. It attains the lower bound, proving optimality rather than merely suggesting a candidate.
Exercise D.S24 — Hard: Change coordinates without changing the transfer map

For $A=\operatorname{diag}(-1,-2)$, $B=(1,1)^\top$, $C=(1,1)$ and $D=0$, define $z=Tx$ with $T=\operatorname{diag}(2,1)$. Compute the transformed matrices and show that the transfer function is unchanged.

Review if needed: this section and rank and null spaces.

Show hint
Use $A_z=TAT^{-1}$, $B_z=TB$, $C_z=CT^{-1}$.
Show worked solution
  1. $T$ commutes with the diagonal $A$, so $A_z=A$. The input matrix becomes $B_z=(2,1)^\top$, and the output row becomes $C_z=(1/2,1)$.
  2. The original transfer function is $G(s)=1/(s+1)+1/(s+2)$.
  3. The transformed map is $(1/2)(2)/(s+1)+(1)(1)/(s+2)$, the same $G(s)$. Internal coordinates and matrix entries changed, while the physical input-output behaviour did not. The transformation must be invertible for this equivalence.

9. Optimal Control, Dynamic Programming & MPC

Start here — Optimise a cost-to-go and preserve feasibility

Cost-to-go means the best remaining cost as a function of the current state. In $\min_u[u^2+(x+u)^2]$, effort competes with the next state's size. Dynamic programming solves this tradeoff backward; MPC repeatedly solves a finite version and applies its first action.

When ready, try the Easy, Medium and Hard practice for this section. For a prerequisite gap, review quadratic programs.

So far the controller was given. Optimal control computes it from a cost; dynamic programming turns the computation into a backward recursion on value functions; MPC solves a short-horizon version online; reachability runs the same recursion with a minimum over time instead of a sum.

Definition — Finite-horizon optimal control and the value function
Minimise over input sequences $u_0,\dots,u_{N-1}$ $$J_N(x_0,\mathbf u)=\sum_{t=0}^{N-1}\ell(x_t,u_t)+V_f(x_N)\quad\text{s.t.}\quad x_{t+1}=f(x_t,u_t),\ x_t\in X,\ u_t\in U,$$ with stage cost $\ell$ and terminal cost $V_f$ (infinite horizon: $\sum_{t\ge0}\ell$, or $\sum_t\gamma^t\ell$ with a discount $0\lt\gamma\lt1$ as in RL). The decision variable is a whole sequence, in continuous time a whole function $u(\cdot)$; its solution is an open-loop plan from $x_0$. The value function (cost-to-go) $V_k(x)$ is the optimal cost from state $x$ with $N-k$ steps to go.
Theorem — Dynamic programming principle (Bellman)
$$V_N=V_f,\qquad V_k(x)=\min_{u\in U}\big[\ell(x,u)+V_{k+1}(f(x,u))\big],$$ with the convention $V_k(x)=+\infty$ for $x\notin X$ (and $V_N=+\infty$ outside a terminal set if one is imposed, as in MPC below), so that an input whose successor violates a constraint, or has no feasible continuation, is never chosen; read "min" as "inf" if no minimiser exists. A minimising $u$ at every $(k,x)$ gives an optimal feedback policy. Infinite horizon: the Bellman equation $V(x)=\min_u[\ell(x,u)+V(f(x,u))]$ (with $\gamma V$ when discounted). For a fixed policy the minimum disappears (policy evaluation): $V^\pi(x)=\ell(x,\pi(x))+V^\pi(f(x,\pi(x)))$.
Proof. Split the cost into the first stage plus the rest. Whatever $u_k$ is, the best continuation from $f(x,u_k)$ costs $V_{k+1}(f(x,u_k))$, and gluing $u_k$ to any admissible continuation is admissible (the constraints act stage by stage). So the minimum over whole sequences equals the minimum over $u_k$ of stage cost plus optimal tail.

Tiny example. States $x\in\{0,1,2,3\}$, inputs $u\in\{-1,0,1\}$ that keep $x+u$ in range, $\ell=x^2+|u|$, $N=2$, $V_2=0$. Then $V_1(x)=x^2$ (use $u=0$), and $V_0(x)=x^2+\min_u[|u|+(x+u)^2]$ gives $V_0=(0,2,6,14)$; from $x=2$ the optimal first move is $u=-1$ ($4+1+1=6$). In RL the same split reads "reward now plus discounted value of the next state" (Primer E). When the exact value function is too complicated, one propagates an upper bound instead: if $\bar V_N\ge V_f$ and $\bar V_k(x)\ge\ell(x,u)+\bar V_{k+1}(f(x,u))$ for the inputs actually used, then $\bar V_k$ bounds their cost-to-go from above, and quadratic $\bar V_k$ turn each step into a matrix inequality (Module 12 does this layer by layer).

Key equation — Hamilton–Jacobi–Bellman (HJB)
For $\dot x=f(x,u)$ and cost $\int_0^\infty\ell(x,u)\,\mathrm dt$, a differentiable value function satisfies $$0=\min_{u\in U}\big[\ell(x,u)+\nabla V(x)^{\top}f(x,u)\big]\qquad(\text{finite horizon: }-\partial_tV=\min_u[\ell+\nabla_xV^{\top}f],\ V(x,T)=V_f(x)).$$ Derivation: dynamic programming over a short interval $\delta$, $V(x)\approx\min_u[\ell(x,u)\delta+V(x+f(x,u)\delta)]$, and $V(x+f\delta)\approx V(x)+\nabla V^{\top}f\,\delta$; cancel $V(x)$ and divide by $\delta$. The term $\nabla V^{\top}f$ is the rate of change of $V$ along the flow.

Example. $\dot x=u$, $\ell=x^2+u^2$, $V=px^2$: $0=\min_u[x^2+u^2+2pxu]$ gives $u=-px$ and $0=(1-p^2)x^2$, so $p=1$, $V=x^2$, $u=-x$ (the continuous Riccati equation of Section 5 with $A=0$, $B=Q=R=1$). Viscosity solutions (a black box). Value functions are often not differentiable. The minimum time to reach $\{-1,1\}$ from $x\in[-1,1]$ with $\dot x=u$, $|u|\le1$, is $V(x)=1-|x|$, with a kink at $0$ where the optimal action switches. Where $V$ is differentiable, the HJB equation is $0=\min_{|u|\le1}[1+V'(x)u]=1-|V'(x)|$. For the viscosity formulation use $|V'(x)|-1=0$ on $(-1,1)$ with boundary values $V(-1)=V(1)=0$: the sign matters in the inequalities for smooth test functions touching $V$ from above or below. At the kink, a test function touching from above has slope in $[-1,1]$, so the subsolution inequality $|\varphi'|-1\le0$ holds; no smooth test function touches from below there. This boundary-value problem has the unique continuous viscosity solution $1-|x|$. More general HJB and reachability equations need their own comparison-principle and boundary assumptions for uniqueness; the modules use these results as an interface to grid-based solvers.

Reachability and safety value functions

Definition — Backward reachable sets and tubes; quantifiers
For a target set $\mathcal T$: the backward reachable set $\{x_0:\ \exists u(\cdot),\ x(T)\in\mathcal T\}$ and the backward reachable tube $\{x_0:\ \exists u(\cdot)\ \exists t\in[0,T],\ x(t)\in\mathcal T\}$. Safety uses the unavoidable version for a failure set $X_F$: $\{x_0:\ \forall u(\cdot)\ \exists t\in[0,T],\ x(t)\in X_F\}$, the states from which failure cannot be avoided; for $T=\infty$ its complement is the viability kernel. With a disturbance $d\in\mathcal D$ the quantifiers alternate (the controller has a strategy such that for every disturbance the trajectory avoids $X_F$), and their order matters: a controller that must commit before seeing $d$ is weaker than one that reacts. HJ reachability gives the disturbance the information advantage (non-anticipative strategies, Module 10).
Definition — Safety value function and its Bellman equation (discrete time)
Let $K=\{x:\ l(x)\ge0\}$ be the constraint set, with margin $l$ (e.g. a signed distance; Module 10's notation, not the stage cost $\ell$). The best worst margin along the future is $$V(x)=\sup_{u_0,u_1,\dots}\ \inf_{t\ge0}\ l(x_t),\qquad V(x)=\min\Big\{l(x),\ \sup_{u\in U}V(f(x,u))\Big\},$$ with $\sup_u\inf_{d\in\mathcal D}V(f(x,u,d))$ under disturbances. (An infinite trajectory need not attain its worst margin: $x_{t+1}=x_t/2$, $l(x)=x$, $x_0=1$ has margins $1,\tfrac12,\tfrac14,\dots$ with infimum $0$ but no minimum.) If the supremum over input sequences is attained, for example for compact $U$ and continuous $f,l$, the safe set $\{V\ge0\}$ is the viability (discriminating) kernel of $K$. In general only $\{V\gt0\}\subseteq\text{kernel}\subseteq\{V\ge0\}$ holds and $V(x)=0$ is inconclusive: for $U=(0,1]$, $f(x,u)=-u$, $l(x)=x$ and $x_0=0$ every input leaves $K=[0,\infty)$ at once, yet the constant inputs $u=\varepsilon$ give worst margin $-\varepsilon$, so $V(0)=0$. Module 9's FISOR uses the mirrored convention $h\le0$ safe, $V_h=\min_\pi\max_th(s_t)$, safe set $\{V_h\le0\}$.

Continuous time (black box, Module 10): on a horizon $[0,T]$, $V$ is the viscosity solution of the HJI variational inequality $$\min\Big\{l(x)-V(x,t),\ \ \partial_tV(x,t)+\max_{u\in U}\min_{d\in\mathcal D}\nabla_xV(x,t)^{\top}f(x,u,d)\Big\}=0,\qquad V(x,T)=l(x).$$ The robust Hamiltonian $H(x,p)=\max_u\min_dp^{\top}f(x,u,d)$ is the best worst-case rate of change of $V$ when $p=\nabla V$ (the gradient turns a velocity into a rate of change of $V$), and the safe action on the boundary of the safe set is $\arg\max_u\min_d\nabla V^{\top}f(x,u,d)$: the controller commits, then the disturbance answers.

Worked example: the viability kernel by backward iteration. $x_{t+1}=2x_t+u_t$, $|u_t|\le0.5$, $K=[-1,1]$. The controllable predecessor of a set $S$ is $\mathrm{Pre}(S)=\{x:\ \exists u\in U,\ f(x,u)\in S\}$ (robust version: $\exists u\ \forall d$). Iterate $X^0=K$, $X^{k+1}=X^k\cap\mathrm{Pre}(X^k)$, the states that can stay in $K$ for $k+1$ more steps. For $S=[-c,c]$, $\mathrm{Pre}(S)=\{x:\ |2x|\le c+0.5\}$, so $c\mapsto(c+0.5)/2$: $1\to0.75\to0.625\to0.5625\to\cdots\to0.5$. The kernel is $[-0.5,0.5]$, the largest controlled invariant subset of $K$ found in Section 3; it is the greatest fixed point of the iteration, and the value iteration $V_{k+1}=\min\{l,\sup_uV_k\circ f\}$ with $l(x)=1-|x|$ computes the same sets (here $U$ is compact, so the supremum is attained).

Model predictive control

Algorithm 1: Receding-horizon MPC
  1. At time $t$ measure the state $x_t$.
  2. Solve $\min\sum_{k=0}^{N-1}\ell(x_{k|t},u_{k|t})+V_f(x_{N|t})$ s.t. $x_{0|t}=x_t$, $x_{k+1|t}=f(x_{k|t},u_{k|t})$, $x_{k|t}\in X$, $u_{k|t}\in U$, $x_{N|t}\in X_f$.
  3. Apply only the first input $u_t=u^\ast_{0|t}$; discard the rest of the plan.
  4. Set $t\leftarrow t+1$ and repeat.

$x_{k|t}$ (some modules write $x_{n|t}$) is the state predicted $k$ steps ahead at time $t$: a planned state, which differs from the realised $x_{t+k}$ under model error or disturbances. MPC is an implicit feedback policy $x\mapsto u^\ast_{0}(x)$, evaluated by optimisation; its input–output pairs can be recorded and imitated by a neural network, which then needs its own certificate (Modules 11 and 14). Stochastic MPC treats random disturbances through chance constraints; robust and tube MPC protect against every disturbance in a bounded set.

Theorem — Recursive feasibility and stability from terminal ingredients
Assumptions (nominal model, no disturbances). A terminal controller $\kappa_f$ keeps the terminal set invariant with admissible inputs: $f(x,\kappa_f(x))\in X_f\subseteq X$ and $\kappa_f(x)\in U$ for $x\in X_f$; the terminal cost is nonnegative, $V_f\ge0$ on $X_f$, and decreases, $V_f(f(x,\kappa_f(x)))-V_f(x)\le-\ell(x,\kappa_f(x))$ on $X_f$; $\ell(x,u)\ge\alpha_\ell(\|x\|)$ with $\alpha_\ell\in\mathcal K_\infty$; and an optimal plan exists whenever the problem is feasible (for example $U$ and $X_f$ compact, $X$ closed, and $f,\ell,V_f$ continuous). Statement. If the MPC problem is feasible at $t=0$, it is feasible at every $t$, the constraints hold forever, and the optimal cost decreases, $V_N(x_{t+1})\le V_N(x_t)-\ell(x_t,u_t)$. Because $V_N\ge0$, telescoping gives $\sum_t\alpha_\ell(\|x_t\|)\le V_N(x_0)$, hence $x_t\to0$ (Section 4). Why $V_f\ge0$: for $x_{t+1}=2x_t$, $U=\{0\}$, $\ell=x^2$, $V_f=-x^2$ the decrease condition holds ($-3x^2\le-x^2$) and $V_N$ decreases, yet $x_t=2^tx_0$ diverges. (For the stronger claim that $V_N$ is a Lyapunov function, which also gives stability, one needs in addition $0\in\operatorname{int}X_f$ and $V_f(x)\le\beta(\|x\|)$ on $X_f$ for some $\beta\in\mathcal K$; then $V_N(0)=0$ and $V_N\le\beta(\|x\|)$ near $0$.)
Proof — the shifted candidate

The optimal plan at $t$ ends in $x^\ast_{N|t}\in X_f$. At $t+1$ the state is $x^\ast_{1|t}$ (nominal model), and the shifted plan $(u^\ast_{1|t},\dots,u^\ast_{N-1|t},\kappa_f(x^\ast_{N|t}))$ is feasible: its first $N-1$ states are those of the old plan, and the last step stays in $X_f$ by invariance. Its cost is $V_N(x_t)-\ell(x_t,u_t)-V_f(x^\ast_{N|t})+\ell(x^\ast_{N|t},\kappa_f)+V_f\big(f(x^\ast_{N|t},\kappa_f)\big)\le V_N(x_t)-\ell(x_t,u_t)$ by the terminal decrease, and the optimum is no larger. Summing (telescoping) gives $\sum_{t\le T}\ell(x_t,u_t)\le V_N(x_0)-V_N(x_{T+1})\le V_N(x_0)$, where $V_N\ge0$ uses $\ell\ge0$ and $V_f\ge0$ on $X_f$.

Tiny example. $x_{t+1}=x_t+u_t$, $|u_t|\le1$, $N=2$, $X_f=\{0\}$ ($\kappa_f=0$, $V_f=0$): the problem is feasible exactly for $|x_0|\le2$. From $x_0=2$ the plan is $(-1,-1)$; at $t=1$ ($x=1$) the shifted candidate $(-1,0)$ is feasible. Without a terminal set, a short-sighted plan can steer into states from which no admissible input prevents a later violation: feasible now does not imply feasible next step.

Safety filters and shields. A safety filter takes a proposed input $u_{\rm prop}$ (from RL, a human or a nominal controller), applies it if it is certified safe and otherwise replaces it, ideally by $\arg\min_{u\in U_{\rm safe}(x)}\|u-u_{\rm prop}\|$. Instances: the CBF-QP ($U_{\rm safe}=K_{\rm cbf}$, Section 4); the predictive safety filter, whose $U_{\rm safe}(x)$ are the first inputs of $N$-step plans that end in a terminal safe set; a backup policy plus a trigger that switches to it (Module 6); and shields in discrete settings, which block actions whose successors leave the winning region of a safety game. A filter that must match an unknown future desired input $u_{\rm des}(\cdot)$ over an infinite horizon, $\arg\min_{v(\cdot)}\int\|v-u_{\rm des}\|^2$, cannot be solved online, which is why filters act one step (or $N$ steps) at a time.

Definition — Minkowski sum and Pontryagin difference
$A\oplus B=\{a+b:\ a\in A,\ b\in B\}$ (all pairs of possible values added) and $A\ominus B=\{x:\ x+b\in A\ \text{for all}\ b\in B\}$ (what is left after reserving room for every $b$); always $(A\ominus B)\oplus B\subseteq A$. Intervals: $[-1,1]\oplus[-0.2,0.2]=[-1.2,1.2]$, $[-1,1]\ominus[-0.2,0.2]=[-0.8,0.8]$; balls: $\mathcal B_r\oplus\mathcal B_s=\mathcal B_{r+s}$. The sum of two ellipsoids is generally not an ellipsoid, so one uses an outer approximation: with $\mathcal E(Q)=\{x:\ x^{\top}Q^{-1}x\le1\}$, $\mathcal E(Q_1)\oplus\mathcal E(Q_2)\subseteq\mathcal E\big((1+\tfrac1c)Q_1+(1+c)Q_2\big)$ for every $c\gt0$ (compare support functions: $(\sqrt a+\sqrt b)^2\le(1+\tfrac1c)a+(1+c)b$). It is conservative (containment, not equality); in one dimension $c=a/b$ recovers the exact interval of radius $a+b$ for radii $a,b$.

Tube MPC. True system $x_{t+1}=Ax_t+Bu_t+w_t$, $w_t\in W$ (compact, containing $0$); nominal plan $z_{t+1}=Az_t+Bv_t$; ancillary feedback $u_t=v_t+K(x_t-z_t)$. The deviation $e_t=x_t-z_t$ obeys $e_{t+1}=(A+BK)e_t+w_t$, independently of the plan, so with $e_0=0$ it stays in $E=W\oplus(A+BK)W\oplus(A+BK)^2W\oplus\cdots$ (a robust positively invariant set when $A+BK$ is Schur; $0\in W$ is needed here: for $A+BK=\tfrac12$ and $W=\{1\}$ the set is $E=\{2\}$, but $e_1=1\notin E$). Planning the nominal trajectory under tightened constraints $z_t\in X\ominus E$, $v_t\in U\ominus KE$ (and a terminal set inside them) keeps the true $x_t=z_t+e_t\in X$ and $u_t\in U$ for every disturbance sequence. Numbers: $x_{t+1}=x_t+u_t+w_t$, $|w_t|\le0.1$, $K=-0.5$, so $A+BK=0.5$ and $E=[-0.2,0.2]$ ($0.1(1+0.5+0.25+\cdots)$). With $X=U=[-1,1]$: $z_t\in[-0.8,0.8]$ and, since $KE=[-0.1,0.1]$, $v_t\in[-0.9,0.9]$. Probabilistic regions (conformal prediction, Module 15) enter the planner in exactly the same way, as tightened constraints. When the disturbance bound depends on the state, $W$ becomes a set-valued map $x\mapsto W(x)$ (a map that returns a set); its continuity is measured with a distance between sets such as the Hausdorff distance $d_H(S,S')=\max\{\sup_{s\in S}\mathrm{dist}(s,S'),\ \sup_{s'\in S'}\mathrm{dist}(s',S)\}$ (Module 10).

Where this is used

Practice — Optimise a cost-to-go and preserve feasibility

Easy checks the basic operation; Medium connects steps; Hard asks you to justify a conclusion or identify a limitation. Each solution explains why the steps work.

Exercise D.S25 — Easy: A one-step control problem

Let $x_1=x_0+u_0$ with $x_0=2$. Minimise $u_0^2+x_1^2$ over an unconstrained scalar input. Find the optimal input, next state and cost.

Review if needed: this section and quadratic programs.

Show hint
Substitute the dynamics into the objective before differentiating.
Show worked solution
  1. The objective is $g(u)=u^2+(2+u)^2=2u^2+4u+4$.
  2. $g'(u)=4u+4=0$ gives $u_*=-1$. Since $g''=4\gt0$, this is the unique global minimum.
  3. The next state is $x_1=1$, and the cost is $1+1=2$. Driving directly to zero with $u=-2$ would cost $4$, so penalising effort changes the preferred action.
Exercise D.S26 — Medium: Bellman recursion over two steps

For $x_{t+1}=x_t+u_t$, minimise $u_0^2+u_1^2+x_2^2$ from $x_0=3$. First solve the final-step value $V_1(x)=\min_u[u^2+(x+u)^2]$, then optimise the first action.

Review if needed: this section and quadratic programs.

Show hint
The final-step calculation gives $V_1(x)=x^2/2$. Use it as the terminal cost of the first minimisation.
Show worked solution
  1. The last-step minimiser is $u=-x/2$, and substituting gives $V_1(x)=x^2/2$.
  2. The first objective is $u_0^2+(3+u_0)^2/2$. Its derivative is $2u_0+3+u_0$, so $u_0=-1$ and $x_1=2$.
  3. The final optimiser gives $u_1=-x_1/2=-1$ and $x_2=1$. The total cost is $1+1+1=3$. This backward computation avoids optimising all future decisions independently of their resulting states.
Exercise D.S27 — Hard: A terminal set gives a recursive feasibility argument

Consider $x_{t+1}=x_t+u_t$ with constraints $|x_t|\le2$, $|u_t|\le1$. An MPC plan of length $N$ obeys these constraints and ends in $X_f=[-0.5,0.5]$. Show that terminal feedback $u=-x$ is feasible in $X_f$, then construct a feasible candidate plan at the next time after executing the first action. Assume the model is exact and there are no disturbances.

Review if needed: this section and quadratic programs.

Show hint
Drop the executed first action, keep the remainder of the plan, and append one terminal-feedback action.
Show worked solution
  1. For $x\in X_f$, $|u|=|x|\le0.5\le1$, and $x+u=0\in X_f$. Thus $X_f$ is invariant under the terminal feedback and satisfies the state constraint.
  2. After executing the first planned input, the exact next state equals the old plan's predicted state $x_1$. Shift the remaining $N-1$ actions forward; all their predicted states remain feasible.
  3. Append $u=-x_N$ at the old terminal state. The appended transition ends at zero in $X_f$. This constructs a feasible next optimisation candidate. Feasibility does not by itself prove cost decrease or stability, and model errors would require an additional robustness argument.

Interactive: Phase Portraits & Lyapunov Ellipses

The plant is the linearised inverted pendulum $\dot x_1=x_2$, $\dot x_2=x_1+u$ (open-loop eigenvalues $\pm1$, a saddle). The sliders choose the closed-loop eigenvalues; the explorer computes the pole-placement gain of $u=-Kx$ (Section 5), the closed-loop matrix $A_{\rm cl}=A-BK$, solves $A_{\rm cl}^{\top}P+PA_{\rm cl}=-I$ in closed form (Section 3) and integrates trajectories with a fourth-order Runge–Kutta method. In the saturated mode the same gain acts through an actuator limit, $u=\mathrm{sat}(-Kx)$ with $|u|\le u_{\max}$ (Sections 1 and 7); the readouts about $V$, $\|x\|$ and sampling then describe the linear design and hold only where the input is not clipped.

Phase Portraits & Lyapunov Ellipses

State plane $x_1=\theta$ (horizontal), $x_2=\dot\theta$ (vertical), both in $[-3.2,3.2]$. Grey arrows: direction of the vector field. Blue: trajectories. Teal ellipses: level sets $x^{\top}Px=c$ of the Lyapunov function. Purple dashed: real eigenvector directions. Saturated mode: orange dashed lines $Kx=\pm u_{\max}$ bound the region where the input is not clipped, the green ellipse is the certified invariant set, and the dots are grid starts simulated for 20 s: teal if the trajectory enters the green ellipse (convergence proved), red if it leaves radius 8 (divergence proved, see below), grey if neither happened.

What to look for.

  1. The default (stable node, $\lambda=-1,-2$) gives $K=[3,3]$ and exactly the matrix of Section 3; the readout reproduces $P=\begin{bmatrix}1.25 & 0.25\\ 0.25 & 0.25\end{bmatrix}$. Trajectories cross every ellipse inwards, yet $\lambda_{\max}(A_{\rm cl}+A_{\rm cl}^{\top})=0.16\gt0$: the Euclidean norm can grow for a moment.
  2. "Stable focus" spirals in; the ellipses tilt but still certify.
  3. "Saddle": no positive definite $P$ exists, and only starts on the stable eigenvector line converge. "Center": closed orbits; the Lyapunov equation is singular because $\lambda_1+\lambda_2=0$. The readout also shows the eigenvalues $e^{\lambda h}$ of the sampled system: inside the unit circle exactly when $\mathrm{Re}\,\lambda\lt0$.
  4. Saturated mode: inside the green ellipse $\{x^{\top}Px\le c^\ast\}$ with $c^\ast=u_{\max}^2/(KP^{-1}K^{\top})$ the input is never clipped (Cauchy–Schwarz), so the loop is linear, $V$ decreases, and the ellipse is invariant: every dot inside it converges. A dot is teal when its trajectory enters the ellipse (convergence proved) and red when it leaves radius $8$ (divergence proved, see the box below). Passing close to the origin proves nothing: with the "Saddle" preset (no certificate) some starts pass within radius $0.02$ of the origin and leave again, so no dot is teal. The clipped loop has two extra equilibria $(\pm u_{\max},0)$, saddles whose stable manifolds bound the true region of attraction. By default only $3$ of the $169$ grid starts lie in the certified ellipse while $97$ converge: the certificate is safe but conservative (Module 14's local sector constraints enlarge it).
  5. Faster poles ($\sigma=-3$, $\delta=-2$) raise $K$ to $[6,6]$ and shrink the unclipped region, so $c^\ast$ drops from $0.111$ to $0.011$ while the set of converging grid starts does not change: an aggressive linear design does not buy a larger certified region. Lowering $u_{\max}$ to $1$ shrinks both ($59$ converging starts).
Going deeper — why leaving radius $8$ proves divergence of the clipped loop

Write $w=x_1+x_2$, $z=x_2-x_1$ and $s=\mathrm{sat}(-Kx)$ with $|s|\le u_{\max}$. The clipped loop $\dot x_1=x_2$, $\dot x_2=x_1+s$ becomes $\dot w=w+s$ and $\dot z=-z+s$. The second equation is stable: if $|z|\gt u_{\max}$ then $\frac{\mathrm d}{\mathrm dt}|z|\le-|z|+u_{\max}\lt0$, so $|z(t)|\le\max\{|z(0)|,u_{\max}\}\le5.4$ for every grid start ($|x_i(0)|\le2.7$, $u_{\max}\le5$). Radius $8$ means $w^2+z^2=2(x_1^2+x_2^2)\gt128$, hence $|w|\gt\sqrt{128-5.4^2}\gt9.9\gt u_{\max}$. Once $|w|\gt u_{\max}$, the first equation gives $\frac{\mathrm d}{\mathrm dt}\big(|w|-u_{\max}\big)\ge|w|-u_{\max}$, so $|w|$ grows exponentially and the trajectory diverges.

From the mathematics to a real decision

A controller chooses an input, but a physical system keeps moving between choices. To judge the controller, we need a state, a clock, input limits, and a requirement on the resulting trajectory. This chapter develops those ingredients for a room-temperature controller and a braking robot. All coefficients and limits define hypothetical systems; the calculations are not empirical claims about a particular building or robot.

What you will learn to do
  • Convert a continuous rate model into an exact update for a held input.
  • Check convergence, actuator limits, and temperature limits as separate requirements.
  • Turn a stopping-distance calculation into a state-based safety condition.
  • Include delay and measurement uncertainty before stating a guarantee.

Choose states and units before tuning feedback

Suppose a room loses heat to surroundings held at $18\,{}^\circ\mathrm C$. Its heater input $u$ is measured in kilowatts and must satisfy $0\le u\le2$. Assume the room is well mixed, the temperature sensor is exact, and the model is valid throughout $20$ to $24\,{}^\circ\mathrm C$. With time $t$ in minutes, define

$$\dot T=-\frac{T-18}{20}+0.2u.$$

The first coefficient has units per minute; the second has units degrees Celsius per minute per kilowatt. Thus both terms give a temperature rate. The model describes thermal inertia: setting an input does not instantly set the temperature. It also omits people, sunlight and parameter drift, so any guarantee initially concerns this ideal system.

The target is $22\,{}^\circ\mathrm C$. At equilibrium, the temperature rate is zero, giving $0=-(22-18)/20+0.2u_*$ and therefore $u_*=1$ kW. Introduce temperature error $x=T-22$ and input deviation $v=u-1$. Substitution gives $\dot x=-0.05x+0.2v$. The target becomes $x=0$, and heater limits become $-1\le v\le1$. This shift keeps the constant heating needed at the target visible.

Suppose the controller reads the sensor every five minutes and keeps its selected input constant until the next reading. Write $x_k$ for the error at the $k$th reading and $v_k$ for that held deviation. The sampling interval is part of the controller specification, not just a plotting preference.

Worked example 1 — Tune a held-input temperature controller

Step 1: integrate over a sampling interval. With $v_k$ constant and elapsed time $s$ measured from the reading, solving the scalar differential equation gives

$$x(k\Delta+s)=e^{-0.05s}x_k+4(1-e^{-0.05s})v_k,\qquad 0\le s\le\Delta.$$

Differentiation checks the solution, and setting $s=0$ recovers $x_k$. At $\Delta=5$ minutes, put $a=e^{-0.25}\approx0.778801$ and $b=4(1-a)\approx0.884797$. The exact sampled model is $x_{k+1}=ax_k+bv_k$. Here $a$ is dimensionless and $b$ has units degrees Celsius per kilowatt.

Step 2: close the loop. Choose $v_k=-0.5x_k$, where the gain is $0.5$ kilowatts per degree Celsius. Then

$$x_{k+1}=qx_k,\qquad q=a-0.5b\approx0.336402.$$

Since $|q|\lt1$, the sampled error tends to zero: $x_k=q^kx_0$. For an initial temperature of $20\,{}^\circ\mathrm C$, $x_0=-2$. The first input is $u_0=1-0.5(-2)=2$ kW. The first two sampled errors are $x_1\approx-0.672805$ and $x_2\approx-0.226333$ degrees Celsius, corresponding to temperatures about $21.3272$ and $21.7737\,{}^\circ\mathrm C$.

Step 3: check the input and state region. For every $|x_k|\le2$, the commanded input $1-0.5x_k$ lies between $0$ and $2$ kW. Also $|x_{k+1}|=q|x_k|\le2$, so induction proves that this region is preserved at readings. The candidate Lyapunov function $V(x)=x^2$ satisfies $V(x_{k+1})=q^2V(x_k)\approx0.113167V(x_k)$, a strict decrease away from the target.

Step 4: inspect what happens between readings. Substituting the held feedback value into the exact trajectory gives $x(k\Delta+s)=(3e^{-0.05s}-2)x_k$. On $0\le s\le5$, this multiplier decreases from $1$ to $q$, remaining positive. The trajectory therefore stays between $x_k$ and $qx_k$. It never leaves $[-2,2]$, so the full temperature trajectory stays within $20$ to $24\,{}^\circ\mathrm C$. This conclusion uses the held-input model, not only the sampled eigenvalue.

Before increasing the gain, decide which improvement is wanted. Faster temperature recovery, smaller peak heater demand and lower energy use are different objectives. Energy over an interval is input power integrated over time; a small temperature error does not by itself measure that energy. Changing the sampling interval also changes both coefficients of the update, so the gain should be reassessed with the new clock rather than copied unchanged.

Common wrong approach — Analyse a different clock

Substituting $v(t)=-0.5x(t)$ gives the continuously updated equation $\dot x=-0.15x$. Its five-minute multiplier is $e^{-0.75}\approx0.472367$, which differs from $0.336402$. Continuous feedback changes the input while the temperature changes; the actual controller holds it fixed. Repair the argument by integrating with the held input first, then substituting the sampled feedback. Likewise, stability alone does not check actuator limits.

Worked example 2 — Decide whether a robot can still stop

Now a robot approaches a wall. Let $d$ be remaining distance in metres and $v\ge0$ the speed toward the wall in metres per second. The state needs both quantities: equal distances with different speeds can require different decisions. While moving, assume $\dot d=-v$ and available braking acceleration is exactly $a=1\ \mathrm{m/s}^2$. The brake stops the robot at zero speed and then holds it there.

Step 1: derive the required distance. Starting at speed $v_0$, full braking gives $v(t)=v_0-at$ until stopping at $t_*=v_0/a$. Integrate speed over this interval:

$$\int_0^{t_*}(v_0-at)\,\mathrm dt=v_0\frac{v_0}{a}-\frac a2\left(\frac{v_0}{a}\right)^2=\frac{v_0^2}{2a}.$$

At $d_0=0.8$ m and $v_0=1$ m/s, stopping requires $0.5$ m. Immediate braking leaves $0.3$ m of clearance. The relevant safety quantity is $h(d,v)=d-v^2/(2a)$, measured in metres. The condition $h\ge0$ means stopping before or at the wall is possible under these assumptions; a strictly positive clearance would require a positive margin.

Step 2: check the condition along the braking trajectory. While braking, the chain rule gives $\dot h=\dot d-(v/a)\dot v=-v-(v/a)(-a)=0$. Thus $h$ remains constant until stopping. Afterwards $v=0$ and the distance stays fixed. This is an all-time argument for this specified backup action, not a list of successful simulated positions.

Step 3: include decision delay. Suppose the robot coasts for $\tau=0.4$ seconds before braking starts. Coasting consumes distance $v_0\tau=0.4$ m, leaving $0.4$ m for a brake that still needs $0.5$ m. The robot cannot avoid the wall under this delayed strategy. The admissible delay satisfies

$$v_0\tau+\frac{v_0^2}{2a}\le d_0,\qquad \tau\le\frac{d_0-v_0^2/(2a)}{v_0}=0.3\text{ seconds}.$$

Step 4: state the operational conclusion. Immediate braking is feasible, but the proposed $0.4$-second delay is too long. A sampled monitor must reserve distance for everything that happens before braking begins. The braking condition also assumes the stated acceleration is available; estimating it optimistically would invalidate the clearance calculation.

Change a physical assumption and rebuild the argument

Exercise D.B1 — Easy: Translate a comfort deadline into readings

For example 1, starting at $20\,{}^\circ\mathrm C$, require $|T-22|\le0.3\,{}^\circ\mathrm C$ at a reading. Find the first reading that meets it and the elapsed time. Does the input remain admissible before that reading?

Review: discrete linear trajectories; the held temperature controller.

Show hint

Use $|x_k|=2q^k$ and check successive integer values of $k$, including zero.

Show worked solution

At $k=0$ the error magnitude is $2$. At $k=1$ it is about $0.672805$, still above $0.3$. At $k=2$ it is about $0.226333$, so the first qualifying reading is two intervals later, after $10$ minutes. The first held input is $2$ kW and the second is $1-0.5(-0.672805)\approx1.336402$ kW, both admissible. The between-reading argument also shows the temperature stays inside its allowed interval while approaching the tolerance.

Exercise D.B2 — Medium: Select a gain against bounded disturbances

Use $v_k=-kx_k$ with $0\le k\le0.5$. Suppose sampled errors obey $x_{k+1}=(a-bk)x_k+w_k$, with $|w_k|\le0.1\,{}^\circ\mathrm C$. Choose all gains that make $[-0.2,0.2]$ invariant at readings. Continue to respect heater limits for commands at every $|x_k|\le2$.

Review: invariant regions; sampling and actuator limits.

Show hint

Here $a-bk$ is positive. Bound the next error by $(a-bk)0.2+0.1$, and require this to be at most $0.2$.

Show worked solution

The worst next magnitude is $0.2(a-bk)+0.1$. Invariance requires $a-bk\le0.5$, so $k\ge(a-0.5)/b\approx0.315101$ kW per degree Celsius. Heater limits throughout $|x_k|\le2$ require $1-2k\ge0$ and $1+2k\le2$, giving $k\le0.5$. Thus the allowable range is approximately $[0.315101,0.5]$. The interval is invariant only if the state starts in it; this calculation does not establish when a colder room enters it. The disturbance assumption describes sampled updates, so it alone does not bound temperature excursions between readings.

Exercise D.B3 — Hard: Budget braking delay under measurement uncertainty

The robot's distance lies in $[0.72,0.78]$ m, its speed in $[0.9,1.1]$ m/s, and braking acceleration is at least $1\ \mathrm{m/s}^2$. During a $0.2$-second delay it coasts. Is $d\ge0$ guaranteed for every allowed state? Find the largest delay that the interval information certifies, allowing zero final clearance.

Review: states and trajectories; the stopping-distance condition.

Show hint

The difficult case has the smallest distance, largest speed and weakest braking. Include both delay travel and braking distance.

Show worked solution

Worst-case travel is $1.1(0.2)+1.1^2/(2\cdot1)=0.22+0.605=0.825$ m, exceeding the available $0.72$ m. Hence the proposed delay lacks a guarantee; this allowed worst case actually fails the stopping condition. Solving $1.1\tau+0.605\le0.72$ gives $\tau\le0.115/1.1\approx0.104545$ seconds. Using midpoint estimates would give $1(0.2)+1^2/2=0.7\le0.75$, an optimistic conclusion that omits measurement uncertainty. The robust bound assumes the entire stated interval is possible and that speed stays constant during the delay.

Exercise D.B4 — Hard: Repair a controller after input saturation

Increase the temperature gain to $1$ kW per degree Celsius, but clip $u=1-x$ into $[0,2]$. Starting at $x_0=-2$, compare the unclipped prediction with the actual first sampled error. Prove that sampled errors in $[-2,2]$ remain in that interval for the clipped controller.

Review: feedback and actuator saturation; the exact sampled model.

Show hint

Write the map in three pieces: $v=1$ for $x\le-1$, $v=-x$ for $|x|\le1$, and $v=-1$ for $x\ge1$. Check the endpoints of each affine piece.

Show worked solution

The unclipped multiplier is $a-b\approx-0.105996$, predicting $x_1\approx0.211992$. But the requested $u_0=3$ kW clips to $2$, so the actual update is $-2a+b\approx-0.672805$. On $[-2,-1]$, the increasing map $ax+b$ ranges from $-0.672805$ to $0.105996$. On $[-1,1]$, $(a-b)x$ ranges between $-0.105996$ and $0.105996$. On $[1,2]$, $ax-b$ ranges from $-0.105996$ to $0.672805$. Their union lies in $[-2,2]$, proving sampled invariance by induction. Each held-input scalar trajectory is monotone between its endpoints, so the full temperature trajectory also stays inside this interval. The unclipped linear formula cannot be used outside $|x|\le1$.

Read a guarantee as a statement about trajectories

Explain without looking back why temperature error is a useful shifted state, why a stable sampled multiplier needs an input-limit check, and why distance alone cannot determine a braking decision. Identify the exact step that extends a statement from sampled times to the entire trajectory in each worked example.

The method is to model rates, derive the actual controller's update, state the allowed initial region, and propagate a property through time. A Lyapunov decrease supports convergence; an invariant region supports staying within limits; a stopping backup supports recoverability. Continue to barrier certificates for state-dependent safety constraints, learning-based MPC for uncertain prediction and planning, and offset-free tracking for controllers that must remove persistent tracking errors.

Exercises

These cumulative problems connect several ideas. If a step feels too large, return to the section practice route, where each topic has an Easy, Medium and Hard problem with a separate hint, worked solution and prerequisite review link.

Exercise D.1 — Pendulum equilibria, linearisation, and an Euler trap

For $\ddot\theta=10\sin\theta-0.1\dot\theta+u$ with $u=0$: (a) find the equilibria; (b) linearise at $\theta=0$ and $\theta=\pi$ and classify both with eigenvalues; (c) discretise the hanging equilibrium's linearisation with forward Euler, $\Delta t=0.1$, and compare the modulus of its eigenvalues with exact sampling.

Show answer

(a) With $x=(\theta,\dot\theta)$: $x_2=0$ and $\sin x_1=0$, so $\theta=0$ (upright) and $\theta=\pi$ (hanging), modulo $2\pi$.

(b) $A_0=\begin{bmatrix}0 & 1\\ 10 & -0.1\end{bmatrix}$ has $\Delta=-10\lt0$, hence real eigenvalues of opposite signs, $\lambda=\frac{-0.1\pm\sqrt{0.01+40}}{2}\approx3.113,\ -3.213$: a saddle, unstable. $A_\pi=\begin{bmatrix}0 & 1\\ -10 & -0.1\end{bmatrix}$ has $\tau=-0.1\lt0$, $\Delta=10\gt0$ (Hurwitz) and $\tau^2\lt4\Delta$: $\lambda=(-1\pm j\sqrt{3999})/20\approx-0.05\pm3.162j$, a lightly damped stable focus; by the indirect method the hanging equilibrium is locally exponentially stable.

(c) Euler gives $I+0.1A_\pi$ with eigenvalues $1+0.1\lambda=(199\pm j\sqrt{3999})/200\approx0.995\pm0.316j$ and $|1+0.1\lambda|^2=1+2(0.1)\mathrm{Re}\,\lambda+0.01|\lambda|^2=1-0.01+0.01\cdot10=1.09$, so the modulus is $\sqrt{1.09}\approx1.044\gt1$: the Euler model oscillates with growing amplitude. Exact sampling gives $|e^{0.1\lambda}|=e^{-0.005}\approx0.995\lt1$. Euler added energy; stability must be checked for the discrete model that is actually used (Section 1's pitfall). The upright equilibrium stays a saddle (approximately $1.311$ and $0.679$).

Exercise D.2 — Stability of a multiplier loop from trace and determinant

Module 8's PI multiplier loop is $x_{k+1}=Mx_k$ with $M=\begin{bmatrix}1-c(K_P+K_I) & -cK_I\\ 1 & 1\end{bmatrix}$, $c\gt0$. (a) Compute $\operatorname{tr}M$ and $\det M$. (b) For $K_P=0$, show that complex eigenvalues lie on the unit circle, and find the period for $cK_I=1$. (c) Derive the exact stability region from the $2\times2$ Schur test. (d) Evaluate $c=1$, $K_P=K_I=0.5$.

Show answer

(a) $\operatorname{tr}M=2-c(K_P+K_I)$ and $\det M=1-c(K_P+K_I)+cK_I=1-cK_P$.

(b) $K_P=0$ gives $\det M=1$. The eigenvalues are complex iff $\tau^2\lt4\Delta=4$, i.e. $0\lt cK_I\lt4$, and then $|\lambda|=\sqrt{\Delta}=1$: $\lambda=e^{\pm j\vartheta}$ with $\cos\vartheta=\tau/2=1-cK_I/2$. For $cK_I=1$, $\vartheta=\pi/3$: period $6$ ($M^6=I$, Section 2). In this loop, integral-only control oscillates forever.

(c) $|\Delta|\lt1\iff0\lt cK_P\lt2$; $\tau\lt1+\Delta\iff cK_I\gt0$; $-\tau\lt1+\Delta\iff c(2K_P+K_I)\lt4$.

(d) $\tau=1$, $\Delta=0.5$: all three conditions hold ($0.5\lt2$, $0.5\gt0$, $1.5\lt4$). Since $\tau^2=1\lt2=4\Delta$, $\lambda=0.5\pm0.5j$, modulus $\sqrt{0.5}\approx0.707$ and angle $\pi/4$: a damped oscillation with a cycle of $8$ steps whose envelope shrinks by the exact factor $\sqrt{0.5}\approx0.707$ per step. The proportional term turned a sustained oscillation into a decaying one.

Exercise D.3 — A Lyapunov matrix and a region-of-attraction estimate

(a) Solve $A^{\top}P+PA=-I$ for $A=\begin{bmatrix}0 & 1\\ -1 & -1\end{bmatrix}$ and check $P\succ0$. (b) For the scalar map $x_{t+1}=0.5x_t+x_t^2$, use $V=x^2$: where is $\Delta V\lt0$, and which sublevel set is certified by the theorem of Section 3? (c) Compare with the true region of attraction of $0$.

Show answer

(a) With $P=\begin{bmatrix}p_1 & p_2\\ p_2 & p_3\end{bmatrix}$: $A^{\top}P+PA=\begin{bmatrix}-2p_2 & p_1-p_2-p_3\\ p_1-p_2-p_3 & 2p_2-2p_3\end{bmatrix}=-I$ gives $p_2=\tfrac12$, $p_3=1$, $p_1=\tfrac32$. $P=\begin{bmatrix}1.5 & 0.5\\ 0.5 & 1\end{bmatrix}$ has trace $2.5$ and determinant $1.25$, so $P\succ0$ (eigenvalues $(5-\sqrt5)/4\approx0.691$, $(5+\sqrt5)/4\approx1.809$). Check: $A^{\top}P=\begin{bmatrix}-0.5 & -1\\ 1 & -0.5\end{bmatrix}$, and adding its transpose gives $-I$.

(b) $\Delta V=(0.5x+x^2)^2-x^2=x^2\big[(0.5+x)^2-1\big]\lt0\iff x\ne0$ and $|0.5+x|\lt1$, i.e. $-1.5\lt x\lt0.5$. For $c\gt0$ as in the theorem, the sublevel sets $\{x^2\le c\}=[-\sqrt c,\sqrt c]$ lie in this interval iff $\sqrt c\lt0.5$, so every $[-\sqrt c,\sqrt c]$ with $c\lt0.25$ is certified: together they give $(-0.5,0.5)$.

(c) The fixed points are $0$ and $0.5$ (repelling, $g'(0.5)=1.5$), and $g(-1)=0.5$. For $x_0\in(-1,0.5)$, $g(x_0)\in[-\tfrac1{16},0.5)$, and from there, for $x_t\ne0$, $|x_{t+1}|=|x_t|\,|0.5+x_t|\lt|x_t|$ with the factor bounded below $1$, so the iterates converge to $0$; outside $[-1,0.5]$ they diverge. The region of attraction is $(-1,0.5)$. The symmetric $V=x^2$ cannot certify the asymmetric part $(-1,-0.5]$: certificates give subsets, and a better-shaped $V$ gives a better estimate.

Exercise D.4 — The comparison lemma and a one-dimensional safety filter

(a) A differentiable $v$ satisfies $\dot v\le-2v+1$ and $v(0)=3$. Bound $v(t)$. (b) For $\dot x=u$, $C=\{x\le1\}$, $h=1-x$ and $\alpha(r)=2r$, give $K_{\rm cbf}(x)$ and the filtered input $u=\min\{u_{\rm nom},2(1-x)\}$ for $u_{\rm nom}=1$ at $x=0$ and $x=0.8$. (c) Compute the filtered trajectory from $x_0=0$ with $u_{\rm nom}\equiv1$ and verify $h(x(t))\ge h(x_0)e^{-2t}$.

Show answer

(a) $F(w)=-2w+1$ is Lipschitz, and $\dot w=-2w+1$, $w(0)=3$ has $w(t)=0.5+2.5e^{-2t}$. The comparison lemma gives $v(t)\le0.5+2.5e^{-2t}$, e.g. $v(1)\le0.5+2.5e^{-2}\lt0.839$ (the comparison value rounds to $0.838$).

(b) $L_fh=0$, $L_gh=-1$, so $K_{\rm cbf}(x)=\{u:\ -u+2(1-x)\ge0\}=\{u\le2(1-x)\}$. At $x=0$ the cap is $2\ge1$: $u=1$ passes unchanged. At $x=0.8$ the cap is $0.4$: $u=0.4$.

(c) While $2(1-x)\ge1$, i.e. $x\le0.5$, $u=1$ and $x=t$ (until $t=0.5$). Afterwards $u=2(1-x)$, so $\frac{\mathrm d}{\mathrm dt}(1-x)=-2(1-x)$ and $1-x(t)=0.5e^{-2(t-0.5)}$, which never reaches $0$. Check with $h(x_0)=1$: for $t\le0.5$, $1-t\ge e^{-2t}$, because the difference $(1-t)-e^{-2t}$ is concave, equals $0$ at $t=0$ and $0.5-e^{-1}\approx0.132$ at $t=0.5$; for $t\gt0.5$, $0.5e^{1}e^{-2t}\ge e^{-2t}$, since $0.5e^1\approx1.359\gt1$.

Exercise D.5 — LQR for an unstable plant, gain margin, and integral action

(a) Solve the scalar DARE for $a=1.2$, $b=q=r=1$; give $K$, the closed-loop pole and the range of factors $\kappa$ for which $u=-\kappa Kx$ still stabilises. (b) The plant $x_{t+1}=0.8x_t+u_t+d$ has an unknown constant $d=0.5$ and reference $r=1$. Find the steady state under $u=0.5(r-x)$, then show that the PI law with $K_P=0.5$, $K_I=0.2$ converges and find its steady state.

Show answer

(a) $p=1+1.44p-\frac{1.44p^2}{1+p}$; multiplying by $1+p$: $p^2-1.44p-1=0$, so the positive solution is $p=\frac{1.44+\sqrt{1.44^2+4}}{2}\approx1.952$. Using this unrounded $p$, $K=\frac{abp}{r+b^2p}=\frac{1.2p}{1+p}\approx0.794$, and the closed-loop pole is $1.2-K\approx0.406$. With $\kappa$: $|1.2-\kappa K|\lt1\iff\frac{0.2}{K}\lt\kappa\lt\frac{2.2}{K}$; these exact boundary values round to $0.252$ and $2.772$, respectively. Unlike the stable plant of Section 6, the gain can be reduced only to about a quarter: an unstable plant needs a minimum amount of feedback.

(b) P only: $x=0.8x+0.5(1-x)+0.5$ gives $x=1/0.7=10/7\approx1.429$, an offset of $-3/7\approx-0.429$. PI with state $(x_t,I_{t-1})$ and $u_t=(K_P+K_I)e_t+K_II_{t-1}$: $M=\begin{bmatrix}0.8-0.7 & 0.2\\ -1 & 1\end{bmatrix}$, $\tau=1.1$, $\Delta=0.1+0.2=0.3$; Schur since $|0.3|\lt1$ and $1.1\lt1.3$ (eigenvalues $0.6$ and $0.5$). At the equilibrium $e=0$, so $x=1$, and $x=0.8x+u+d$ gives $u=-0.3=K_II$, i.e. $I=-1.5$: the integrator has learned to cancel $d$.

Exercise D.6 — One system, four gains

$x_{t+1}=0.8x_t+w_t$, $z_t=0.6x_t$, $x_0=0$. (a) Give the impulse response and $H(z)$. (b) Compute $\|h\|_1$, $\|H\|_\infty$ and $\|H\|_2$, and check $\|H\|_2$ with the controllability Gramian. (c) Show that $V=1.8x^2$ is a storage function certifying the $\ell_2$ gain $3$.

Show answer

(a) $h_0=D=0$, $h_k=CA^{k-1}B=0.6\cdot0.8^{k-1}$; $H(z)=\frac{0.6}{z-0.8}$.

(b) $\|h\|_1=0.6/(1-0.8)=3$. $|H(e^{j\omega})|=0.6/|e^{j\omega}-0.8|$ is largest where $|e^{j\omega}-0.8|$ is smallest, at $\omega=0$: $\|H\|_\infty=0.6/0.2=3$ (for a nonnegative impulse response the peak gain and the energy gain coincide with the DC gain). $\|H\|_2^2=\sum_k0.36\cdot0.64^{k-1}=0.36/0.36=1$. Gramian: $W_c=1/(1-0.64)=25/9\approx2.778$ and $c^2W_c=0.36\cdot(25/9)=1$. Multiplying the rounded Gramian display gives $0.36\cdot2.778=1.00008$.

(c) $V(x_{t+1})-V(x_t)-9w^2+z^2=1.8(0.8x+w)^2-1.8x^2-9w^2+0.36x^2=-0.288x^2+2.88xw-7.2w^2=-0.288(x-5w)^2\le0$. So $V(x_{t+1})-V(x_t)\le9\|w_t\|^2-\|z_t\|^2$, and summing with $V(x_0)=0$ gives $\sum\|z_t\|^2\le9\sum\|w_t\|^2$: gain at most $3=\|H\|_\infty$, a tight certificate.

Exercise D.7 — Small gain versus the circle criterion

Close the loop of Exercise D.6 as $w=-\phi(z)$ with $\phi(v)=\kappa\tanh v$, $\kappa\gt0$. (a) Which $\kappa$ does the small-gain theorem certify? (b) Which does the circle criterion certify ($\phi$ in the sector $[0,\kappa]$)? (c) Compare with the constant gains $\phi(v)=kv$.

Show answer

(a) The gain of $\kappa\tanh$ is $\kappa$ (slope at most $\kappa$), that of $H$ is $3$: small gain needs $3\kappa\lt1$, i.e. $\kappa\lt\tfrac13$.

(b) $\mathrm{Re}\,H(e^{j\omega})=\frac{0.6(\cos\omega-0.8)}{1.64-1.6\cos\omega}$ is increasing in $\cos\omega$ (its derivative in $\cos\omega$ is $0.6\cdot0.36/(1.64-1.6\cos\omega)^2\gt0$), so its minimum is at $\omega=\pi$: $0.6(-1.8)/3.24=-\tfrac13$. The circle condition $1+\kappa\,\mathrm{Re}\,H\ge\varepsilon\gt0$ holds for all $\omega$ iff $\kappa\lt3$.

(c) $x_{t+1}=(0.8-0.6k)x_t$ is stable iff $-\tfrac13\lt k\lt3$. The circle criterion recovers the whole constant-gain range $[0,3)$ for every nonlinearity in the sector (first-order loop), whereas small gain, which ignores the sign of the feedback, gives only a ninth of it.

Exercise D.8 — A viability kernel and a tube

(a) Compute the viability kernel of $K=[-1,1]$ for $x_{t+1}=1.5x_t+u_t$, $|u_t|\le0.3$, by backward iteration. (b) For $x_{t+1}=x_t+u_t+w_t$ with $|w_t|\le0.2$, ancillary gain $K=-0.6$ and $X=[-2,2]$, $U=[-1,1]$: compute the error set $E$ and the tightened constraints of tube MPC.

Show answer

(a) $\mathrm{Pre}([-c,c])=\{x:\ |1.5x|\le c+0.3\}$, so $c_{k+1}=\min\{c_k,(c_k+0.3)/1.5\}$: the radii, rounded to three decimals, are $1\to0.867\to0.778\to0.719\to0.679\to\cdots$, converging to the fixed point of $c=(c+0.3)/1.5$, i.e. $c=0.6$. The kernel is $[-0.6,0.6]$; there $u=-0.5x$ is admissible and gives $x_{t+1}=x_t$.

(b) $A+BK=0.4$, so $e_{t+1}=0.4e_t+w_t$ and $E=[-r,r]$ with $r=0.2(1+0.4+0.16+\cdots)=0.2/0.6=\tfrac13$. Tightened: $z_t\in X\ominus E=[-\tfrac53,\tfrac53]$ and, since $KE=[-0.2,0.2]$, $v_t\in U\ominus KE=[-0.8,0.8]$. Every disturbance sequence then keeps $x_t=z_t+e_t\in[-2,2]$ and $u_t=v_t+Ke_t\in[-1,1]$.

Further Reading

ResourceTypeRead it for
Feedback Systems: An Introduction for Scientists and Engineers (Åström, Murray)Textbook, 2nd ed., Princeton UP; free PDF (2020)The gentlest complete tour: state space, stability, PID, frequency response, margins.
Nonlinear Dynamics and Chaos (Strogatz)Textbook, 2nd ed., 2015Phase portraits, fixed points, linearisation and bifurcations with geometric intuition.
Linear Systems Theory (Hespanha)Textbook, 2nd ed., Princeton UP 2018Matrix exponentials, Lyapunov equations, controllability, observers, realisations, LQR.
Nonlinear Systems (Khalil)Textbook, 3rd ed., Prentice Hall 2002Existence and uniqueness, Lyapunov theory, comparison lemma, ISS, circle and Popov criteria.
Mathematical Control Theory (Sontag)Textbook, 2nd ed., Springer 1998; online copyRigorous controllability, observability, feedback and Lyapunov/ISS theory.
Linear Matrix Inequalities in System and Control Theory (Boyd, El Ghaoui, Feron, Balakrishnan)Monograph, SIAM 1994; free PDFLyapunov LMIs, bounded-real lemma, Lur'e systems and the S-procedure (Module 2).
System Analysis via Integral Quadratic Constraints (Megretski, Rantzer)IEEE TAC 42(6), 1997The IQC framework behind Modules 2 and 14; small gain, passivity and multipliers in one theorem.
Set Invariance in Control (Blanchini)Survey, Automatica 35(11), 1999Invariant and controlled invariant sets, Nagumo's theorem, set-based control.
Control Barrier Functions: Theory and Applications (Ames, Coogan, Egerstedt, Notomista, Sreenath, Tabuada)Tutorial, ECC 2019Class-$\mathcal K$ functions, the comparison argument and CBF-QPs (Module 10).
Hamilton–Jacobi Reachability: A Brief Overview and Recent Advances (Bansal, Chen, Herbert, Tomlin)Tutorial, CDC 2017Backward reachable sets and tubes, HJI equations, computational tools.
Calculus of Variations and Optimal Control Theory (Liberzon)Textbook, Princeton UP 2012Dynamic programming, the HJB equation, LQR, and the maximum principle.
Model Predictive Control: Theory, Computation, and Design (Rawlings, Mayne, Diehl)Textbook, 2nd ed., Nob Hill 2017Terminal ingredients, recursive feasibility, robust and tube MPC.
Predictive Control for Linear and Hybrid Systems (Borrelli, Bemporad, Morari)Textbook, Cambridge UP 2017Invariant-set computations, Minkowski and Pontryagin set operations, explicit MPC.

Flashcards