D. Dynamical Systems, Stability & Feedback Control
State-space models, Lyapunov stability, invariant sets, frequency response, LQR, PID and MPC
This primer assumes:
- A first course in linear algebra: matrices, determinants, eigenvalues and eigenvectors, diagonalisation (baseline)
- Single-variable calculus: derivatives, integrals, the exponential function, Taylor expansions (baseline)
- Sequences, limits & series and compact sets (Primer 0)
- Positive definite matrices & quadratic forms (Primer A)
- Matrix norms and the spectral norm (Primer A)
- Gradients, Jacobians & the chain rule (Primer B)
- Lipschitz continuity (Primer B)
- Quadratic programs, only for the MPC part (Primer B)
- Expectation and variance, only for noisy systems (Primer C)
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.
- Foundations: Models, linear stability, Lyapunov certificates and comparison. Section practice: 1, 2, 3, 4.
- Feedback tools: Feedback, frequency gains and nonlinear feedback. Section practice: 5, 6, 7.
- Planning tools: Reachability, realisations and optimal control. Section practice: 8, 9.
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
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
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
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
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.
- 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
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.
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$.
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
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.
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.
Equilibria and linearisation
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)$.
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.
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
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.
- Dynamics, trajectories, horizons, closed loops: Module 1 (what "safe" means), Module 2 (notation), Module 7 (viability kernel), Module 11 (closed loop $F_\pi$), Module 14 (feedback setup).
- Control-affine dynamics: Module 1 (CBF theorem), Module 8 (the policy update as a control-affine plant).
- Lipschitz fields, uniqueness, maximal intervals, completeness: Module 1, Module 6 (Picard–Lindelöf and the tail property), Module 10.
- Linearised nominal models: Module 4 (controller tuning), Module 14 (linearised pendulum).
- Euler, ZOH, sample-and-hold, saturation: Module 6 explorer, Module 7, Module 10 (sampled CBF-QP), Module 11 explorer.
- Fixed-point iterations: Module 13. Switching and dwell time: Module 5.
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
Show worked solution
- $x_1=0.5(2)+1=2$. The first input exactly offsets the contraction.
- $x_2=0.5(2)+0=1$, then $x_3=0.5(1)-1=-0.5$. Inputs with different indices affect different transitions.
- 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
Show worked solution
- The closed loop is $x_{t+1}=0.5x_t-0.25x_t=0.25x_t$.
- An equilibrium satisfies $x_*=0.25x_*$, so $x_*=0$.
- 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
Show worked solution
- $-x+x^2=x(x-1)=0$ gives equilibria $0$ and $1$.
- $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.
- 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
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.
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).
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).
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$.
Schur and Hurwitz stability
- 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|$.
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$.
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$
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.
- Matrix powers, Schur versus Hurwitz, spectral radius: Module 2 (Lyapunov LMI), Module 14 (LTI plant).
- Affine recurrences and monotone convergence: Module 6 explorer. Complex modes on the unit circle, linearisation and local stability: Module 8 (PID Lagrangian).
- Neumann series: Module 9 (trust-region bound). Matrix exponentials: Module 10 ($e^{(F-GK_\alpha)t}$), Module 13 (skew-symmetric exponentials).
- Saddles and stable manifolds: Module 10 (undesirable equilibria of CBF filters), Module 14, Exercise 14.4.
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
Show worked solution
- The coordinates evolve independently: $x_t=(2(0.5)^t,(-1.2)^t)$.
- Thus $x_1=(1,-1.2)$ and $x_2=(0.5,1.44)$. The second coordinate alternates sign and grows in magnitude.
- 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
Show worked solution
- The exact trajectory is $x(t)=(3e^{-t},4e^{-2t})$.
- Its squared norm is $9e^{-2t}+16e^{-4t}$. Since $t\ge0$, $e^{-4t}\le e^{-2t}$.
- 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
Show worked solution
- $A^t=0.5^tI+t\,0.5^{t-1}N$, since every term involving $N^2$ is zero.
- 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$.
- 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
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.
- 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\}$.
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.
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).
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}$.
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).
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.
$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.
($\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.
Forward invariance, controlled invariance and Nagumo's condition
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).
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.
Three relatives: contraction, control Lyapunov functions, and checking the conditions
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.
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.
- Stability notions, positive definite $V$, sublevel sets, regions of attraction: Module 1, Module 2 (does a Lyapunov matrix exist?), Module 4 (Lyapunov decrease preview), Module 11 (compact sublevel sets, radial unboundedness).
- Exponential bounds, CLFs, contraction metrics: Module 11 (neural certificates), Module 10 (Sontag's CLFs); contraction versus Lyapunov: Module 1, Module 2.
- Forward invariance of flows: Module 9. Controlled invariance and viability: Module 1, Module 7.
- Nagumo, regular values, tangent cones, stability of sets: Module 1, Module 7 (tangency condition), Module 10.
- SOS and gridding with Lipschitz margins: Module 1, Exercise 1.4, Module 11.
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
Show worked solution
- $V'(x)=2x$, so $\dot V=(2x)(-2x)=-4x^2=-4V$.
- The scalar differential equation has solution $V(t)=V(0)e^{-4t}=x_0^2e^{-4t}$.
- 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
Show worked solution
- $A^\top P+PA=2A=\operatorname{diag}(-2,-4)$, which is negative definite.
- Thus $\dot V=-2x_1^2-4x_2^2\le-2(x_1^2+x_2^2)=-2V$.
- 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
Show worked solution
- $\dot V=2x(-x+x^3)=-2x^2(1-x^2)$. On $V\le c$, this is at most $-2(1-c)V$.
- 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}$.
- 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
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.
- $\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$.
| Function | Class | Remark |
|---|---|---|
| $\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\}$ | none | not 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$.
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$.
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).
- 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$.
- 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)$.
- 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.
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$.
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.
- Extended class-$\mathcal K$ and $\mathcal K_\infty$ functions: Module 1 (CBF theorem), Module 7 (CBF background), Module 10 (notation).
- The comparison lemma and the sign reversal $v=-\eta$, $w=-y$: Module 10 (forward invariance and asymptotic stability of $C$). Lie derivatives and the CBF input set: Module 7 (Lie-derivative background), Module 10.
- ISS and its safety analogue: Module 10 (robust CBFs, ISSf), Module 11 (ISS in the approximation error).
- $\mathcal K_\infty$ stage costs and summable costs: Module 11 (certified approximate MPC); square summability: Module 14.
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
Show worked solution
- 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.
- $2r$ and $r^2$ grow without bound, so both are class-$\mathcal K_\infty$ as well as class-$\mathcal K$.
- $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
Show worked solution
- The comparison solution is $z(t)=4e^{-3t}$, so $V(t)\le4e^{-3t}$.
- Require $4e^{-3t}\le0.2$, equivalently $e^{-3t}\le1/20$.
- 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
Show worked solution
- The condition is $-u\ge-2(1-x)$, hence $u\le2(1-x)$.
- 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$.
- 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
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.
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).
The linear-quadratic regulator (LQR)
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$.
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$,
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
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.
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).
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)$.
- Policies and closed loops: Module 1, Module 7 ($u:X\to U$). Parameterised controllers and trajectory outcomes: Module 6, Module 5.
- Deadbeat gain, overshoot and stationary spread: Module 1 explorer.
- LQR, Riccati equation, weights, average cost: Module 4, Module 6 (LQR-weight space), Module 11 (LQR on a linearisation). Pole placement: Module 10 (HOCBF gains).
- PID and integral action on constraint violations: Module 1 (PID multipliers), Module 2 (the multiplier integrates the violation), Module 7, Module 8.
- PD and impedance control: Module 6, Module 14 explorer. Observers and innovations: Module 11, Module 14 (Youla-REN).
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
Show worked solution
- The closed-loop equation is $\dot x=(2-k)x$, with solution $x(t)=x_0e^{(2-k)t}$.
- This decays to zero for every initial state exactly when $2-k\lt0$, so $k\gt2$.
- 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
Show worked solution
- Rearrange to $P^2-2P-1=0$, or $(P-1)^2=2$. The positive root is $P=1+\sqrt2\approx2.414214$.
- The optimal unconstrained input is $u=-Px$. Substitution gives $\dot x=(1-P)x=-\sqrt2\,x$.
- 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
Show worked solution
- For $x\gt1/2$, every admissible input satisfies $\dot x\ge2x-1\gt0$. The state cannot initially move inward or cross the boundary downward.
- 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.
- 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
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.
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$.
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.
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).
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$.
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.
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
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.
- Signal norms, zero-state induced gains, $\ell_2$ gain $\gamma$: Module 2 (notation), Module 14 (signal spaces, $\|\Delta\|_\infty$).
- Fourier transforms, Parseval, transfer matrices, $\mathcal H_\infty$, Hermitian order, KYP: Module 2 (IQCs), Module 2 (dissipativity and KYP), Module 14 ($\Pi=\Psi^{*}M\Psi$, $M(j\omega)=m_0-H(j\omega)$, $\|h\|_1$, properness).
- Return difference, gain and delay margins: Module 4. Poles, impulse responses, convolution: Module 10 (HOCBFs).
- Transfer functions and nilpotent resolvents: Module 12, Exercise 12.6. DFT/FFT block diagonalisation: Module 13 (Cayley per FFT frequency). $\mathcal H_2$ performance: Module 14. Storage and supply: Module 1.
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
Show worked solution
- Set $e=x-1/2$. Then $\dot e=-2e$ and $e(0)=-1/2$.
- Thus $x(t)=(1-e^{-2t})/2\to1/2$.
- $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
Show worked solution
- $|G(j\omega)|=1/\sqrt{4+\omega^2}$, because reciprocal complex numbers have reciprocal moduli.
- At $0$ this is $1/2=0.5$; at $2$ it is $1/\sqrt8\approx0.353553$.
- 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
Show worked solution
- $\|h\|_1=\sum_{t=1}^\infty0.5^{t-1}=1/(1-0.5)=2$.
- $\|h\|_2^2=\sum_{t=1}^\infty0.25^{t-1}=4/3$, so $\|h\|_2=2/\sqrt3\approx1.154701$.
- 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
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.
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.
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.
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.
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).
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.
- Small-gain reasoning, component gain versus closed-loop certificate: Module 1, Module 12, Module 14 (cascades).
- Slope-restricted activations and sectors: Module 1. Lur'e loops, circle and Popov criteria, bounded causal operators, well-posedness: Module 2.
- Absolute stability, Aizerman's conjecture, loop transformations: Module 14. 2-D Lur'e systems: Module 12. LFTs and star products: Module 11.
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
Show worked solution
- If $|v|\le1$, then $\varphi(v)=v$, so $v\varphi(v)=v^2\ge0$.
- If $|v|\gt1$, then $\varphi(v)$ is the sign of $v$, and $v\varphi(v)=|v|$. Here $0\le|v|\le v^2$.
- 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
Show worked solution
- Differentiate: $\dot V=2x(-x+0.8\varphi(x))=-2x^2+1.6x\varphi(x)$.
- Bound the nonlinear term by $1.6x^2$, yielding $\dot V\le-0.4V$. Hence $|x(t)|\le|x_0|e^{-0.2t}$.
- 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
Show worked solution
- With $V=x^2$, $\dot V=-2x^2-2x\varphi(x)\le-2V$, because the sector product is nonnegative.
- 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.
- 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
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.
$(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.
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.
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$).
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).
- FIR realisations, nilpotent state matrices, acausal filters: Module 2, Module 14 (Zames–Falb multipliers realised by FIR filters). Controllability: Module 2 (KYP lemma).
- Stabilisability and detectability: Module 4 (LQR tuning), Module 14 (observer-based Youla parameterisation).
- Controllability Gramians and the Stein equation: Module 13, Module 13 (Cayley–Gramian CNNs). Roesser models: Module 12.
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
Show worked solution
- $AB=(0.5,0)^\top$, so the controllability matrix is $\begin{bmatrix}1&0.5\\0&0\end{bmatrix}$.
- Its rank is $1$, less than the state dimension $2$, so it cannot span all target states.
- 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
Show worked solution
- The scalar Gramian is $W_2=\int_0^2 1\,dt=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$.
- 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
Show worked solution
- $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)$.
- The original transfer function is $G(s)=1/(s+1)+1/(s+2)$.
- 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
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.
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).
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
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
- At time $t$ measure the state $x_t$.
- 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$.
- Apply only the first input $u_t=u^\ast_{0|t}$; discard the rest of the plan.
- 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.
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.
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).
- Dynamic programming and splitting a return: Module 7, Module 10, Module 12 (value-function recursion over layers).
- Reachable tubes, safety values, quantifiers, robust Hamiltonians, viscosity solutions: Module 1, Module 7, Module 7 ($\arg\max_u\min_d$), Module 9 (FISOR), Module 10.
- MPC, terminal sets, recursive feasibility: Module 1, Module 6 (backups as safety filters, terminal safe sets), Module 9, Module 10, Module 11, Module 14 (imitating MPC), Module 15.
- Minkowski sums, outer ellipsoids, tube MPC, predictive filters: Module 7, Module 10. Optimisation over signals: Module 10.
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
Show worked solution
- The objective is $g(u)=u^2+(2+u)^2=2u^2+4u+4$.
- $g'(u)=4u+4=0$ gives $u_*=-1$. Since $g''=4\gt0$, this is the unique global minimum.
- 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
Show worked solution
- The last-step minimiser is $u=-x/2$, and substituting gives $V_1(x)=x^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$.
- 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
Show worked solution
- 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.
- 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.
- 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.
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.
- 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.
- "Stable focus" spirals in; the ellipses tilt but still certify.
- "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$.
- 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).
- 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).
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.
- 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
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
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
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.
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:
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
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.
Further Reading
| Resource | Type | Read 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., 2015 | Phase portraits, fixed points, linearisation and bifurcations with geometric intuition. |
| Linear Systems Theory (Hespanha) | Textbook, 2nd ed., Princeton UP 2018 | Matrix exponentials, Lyapunov equations, controllability, observers, realisations, LQR. |
| Nonlinear Systems (Khalil) | Textbook, 3rd ed., Prentice Hall 2002 | Existence and uniqueness, Lyapunov theory, comparison lemma, ISS, circle and Popov criteria. |
| Mathematical Control Theory (Sontag) | Textbook, 2nd ed., Springer 1998; online copy | Rigorous controllability, observability, feedback and Lyapunov/ISS theory. |
| Linear Matrix Inequalities in System and Control Theory (Boyd, El Ghaoui, Feron, Balakrishnan) | Monograph, SIAM 1994; free PDF | Lyapunov 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), 1997 | The IQC framework behind Modules 2 and 14; small gain, passivity and multipliers in one theorem. |
| Set Invariance in Control (Blanchini) | Survey, Automatica 35(11), 1999 | Invariant and controlled invariant sets, Nagumo's theorem, set-based control. |
| Control Barrier Functions: Theory and Applications (Ames, Coogan, Egerstedt, Notomista, Sreenath, Tabuada) | Tutorial, ECC 2019 | Class-$\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 2017 | Backward reachable sets and tubes, HJI equations, computational tools. |
| Calculus of Variations and Optimal Control Theory (Liberzon) | Textbook, Princeton UP 2012 | Dynamic programming, the HJB equation, LQR, and the maximum principle. |
| Model Predictive Control: Theory, Computation, and Design (Rawlings, Mayne, Diehl) | Textbook, 2nd ed., Nob Hill 2017 | Terminal ingredients, recursive feasibility, robust and tube MPC. |
| Predictive Control for Linear and Hybrid Systems (Borrelli, Bemporad, Morari) | Textbook, Cambridge UP 2017 | Invariant-set computations, Minkowski and Pontryagin set operations, explicit MPC. |