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
For $x(t)=3e^{-2t}$, the chain rule multiplies the exponential by the derivative of its exponent:
At $t=0$, $e^0=1$, so $x(0)=3$ and $\dot x(0)=-6$. The first is a state value; the second is its rate of change. For example, metres and metres per second are different units.
Over a small positive time interval $\Delta t$, the first-order approximation is $x(\Delta t)\approx3-6\Delta t$. A negative rate says that the state is initially decreasing; it does not say that the state itself equals $-6$. At a general time, $x(t+\Delta t)\approx 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
With $x=(1,-2)^\top$ and $P=\operatorname{diag}(1,2)$, the Euclidean squared length is $x^\top x=1^2+(-2)^2=1+4=5$. First multiply $Px=(1,-4)^\top$, then
For any vector $z=(z_1,z_2)^\top$, $V(z)=z_1^2+2z_2^2$. Subtracting the proposed lower and upper comparisons gives
Thus $\|z\|_2^2\le V(z)\le2\|z\|_2^2$ for every vector. At the given point this reads $5\le9\le10$. In particular, an upper bound $V(z)\le B$ with $B\ge0$ implies $\|z\|_2\le\sqrt B$. This is how a quadratic certificate bounds physical state size; its value is not simply the state vector itself.
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
Plan. Substitute the controller into the plant to get one recursion in $x$ alone, then find its fixed point and unroll it.
Step 1 — Close the loop. The plant is $x_{t+1}=0.5x_t+u_t$ and the controller says $u_t=-0.25x_t$. Since the controller gives the value of $u_t$ at every time, we may replace $u_t$ in the plant by $-0.25x_t$:
The input has disappeared: the closed loop is a recursion in the state alone, with multiplier $0.25$.
Step 2 — Find the equilibrium. A discrete equilibrium is a state that the update maps to itself, $x_*=0.25x_*$. Subtract $0.25x_*$ from both sides:
where the last step divides by the nonzero number $0.75$. So the origin is the only equilibrium.
Step 3 — Unroll the recursion. Apply the update repeatedly, each time using the newest state:
The pattern $x_t=0.25^tx_0$ holds for every $t$ by induction: it is true at $t=0$ because $0.25^0=1$, and if $x_t=0.25^tx_0$ then $x_{t+1}=0.25\cdot0.25^tx_0=0.25^{t+1}x_0$. With $x_0=4$,
Step 4 — Decide convergence. Since $0\le0.25\lt1$, the powers $0.25^t$ shrink to zero as $t\to\infty$ (each step multiplies by a quarter). Hence $x_t=0.25^tx_0\to0$ for every initial state $x_0$, not only for $x_0=4$.
Check. Each listed value is one quarter of the previous one: $1=4/4$, $0.25=1/4$, $0.0625=0.25/4$. Substituting $x_*=0$ into the closed loop gives $0.25\cdot0=0$, so it is indeed fixed.
Interpretation. The open-loop multiplier was $0.5$; feedback changed it to $0.25=0.5^2$, so one closed-loop step shrinks the state as much as two open-loop steps (to a quarter instead of a half). Feedback changes the dynamics themselves 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
For continuous time an equilibrium has zero rate. Factor the right-hand side: $f(x)=-x+x^2=x(x-1)$. Thus the only equilibria are $x_*=0$ and $x_*=1$.
Let $\xi=x-x_*$ be a small deviation. The linearized equation is $\dot\xi=f'(x_*)\xi$, where $f'(x)=-1+2x$. At $0$ this gives $\dot\xi=-\xi$, whose solutions decay as $e^{-t}$; at $1$ it gives $\dot\xi=\xi$, whose nonzero solutions grow as $e^t$. Since the polynomial field is continuously differentiable, the indirect method makes $0$ locally exponentially stable and $1$ unstable. The conclusion at $0$ is local, not a claim about every initial state.
Forward Euler uses the starting rate throughout one time step:
The exact update would instead integrate the changing rate, $x(0.2)=0.1+\int_0^{0.2}f(x(s))\,ds$. Euler replaces that integral by $0.2f(0.1)$; as the state changes, so does $f(x(s))$. This is an approximation to a continuous trajectory.
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
Plan. Because $A$ is diagonal, split the system into two scalar recursions, iterate each, then apply the discrete-time eigenvalue test.
Step 1 — Decouple the coordinates. Write $x_t=(x_{1,t},x_{2,t})^\top$. Multiplying by a diagonal matrix multiplies each coordinate by its own diagonal entry and mixes nothing:
Each scalar recursion $z_{t+1}=\lambda z_t$ unrolls to $z_t=\lambda^tz_0$ (multiply by $\lambda$ once per step). With $x_0=(2,1)$:
Step 2 — Compute the first two states.
The first coordinate halves each step. The second flips sign each step (a negative multiplier) and its magnitude grows from $1$ to $1.2$ to $1.44$.
Step 3 — Apply the discrete-time stability test. The eigenvalues of a diagonal matrix are its diagonal entries, $0.5$ and $-1.2$. For $x_{t+1}=Ax_t$ the origin is asymptotically stable exactly when every eigenvalue has magnitude less than one, because then every $\lambda^t\to0$. Here
The second mode violates the test: $|x_{2,t}|=1.2^t\to\infty$ for the given start. So the origin is unstable.
Check. Using the closed form at $t=2$: $2(0.5)^2=0.5$ and $(-1.2)^2=1.44$, matching Step 2. Any start with $x_{2,0}\ne0$, however small, also grows, so this is not an artefact of the chosen initial state.
Interpretation. A negative eigenvalue is a stability sign only in continuous time, where the test is on real parts. In discrete time the test is on magnitude, and $-1.2$ produces an oscillation whose amplitude grows by $20\%$ per step.
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
Plan. Solve the two decoupled scalar equations, compute the squared norm, then replace the faster-decaying term by a slower one to get a single exponential bound.
Step 1 — Decouple and solve. The matrix is diagonal, so $\dot x=\operatorname{diag}(-1,-2)x$ means $\dot x_1=-x_1$ and $\dot x_2=-2x_2$, with no coupling. A scalar equation $\dot z=az$ has solution $z(t)=e^{at}z(0)$: differentiating gives $\dot z=ae^{at}z(0)=az$, and $t=0$ returns $z(0)$. Using $x_1(0)=3$, $x_2(0)=4$:
Step 2 — Compute the squared norm. The Euclidean norm squared is the sum of squared coordinates, and $(e^{-t})^2=e^{-2t}$, $(e^{-2t})^2=e^{-4t}$:
Step 3 — Bound the faster term by the slower one. For $t\ge0$ we have $-4t\le-2t$, and the exponential is increasing, so $e^{-4t}\le e^{-2t}$. Multiplying by $16\gt0$ keeps the direction:
Step 4 — Take square roots. Both sides are nonnegative and the square root is increasing, so the inequality is preserved; $\sqrt{25e^{-2t}}=5e^{-t}$:
Check. At $t=0$ both sides equal $\sqrt{9+16}=5$, so the prefactor $C=5=\|x(0)\|_2$ cannot be reduced. At $t=1$ the true squared norm is $9e^{-2}+16e^{-4}\approx1.511$, below the bound $25e^{-2}\approx3.383$.
Interpretation. Both eigenvalues, $-1$ and $-2$, have negative real part, and the slowest one sets the rate $e^{-t}$ in the bound. The result is exponential convergence with an explicit rate and prefactor, not only a qualitative "it decays".
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
Write $A=(1/2)I+N$ with $N=\begin{bmatrix}0&10\\0&0\end{bmatrix}$. Direct multiplication gives $N^2=0$, and $N$ commutes with the identity. The matrix binomial expansion therefore has only its terms with zero and one factors of $N$:
The first coefficient comes from selecting the identity term in all $t$ factors; the second has $t$ choices for the one factor of $N$. Every term with two or more factors of $N$ is zero. For the specified start, $Nx_0=(10,0)^\top$, so
Thus $\|x_1\|_2=\sqrt{100+0.25}\approx10.0125$, while $\|x_0\|_2=1$. Nevertheless both coefficients in $A^t$ tend to zero. For the polynomial-times-geometric term, the ratio of successive positive terms is $(t+1)/(2t)$, which is eventually at most $3/4$; it is then bounded by a decaying geometric sequence. Hence $A^t\to0$ and every trajectory converges to zero. Equivalently the two eigenvalues are $1/2$, so the linear system is Schur and asymptotically stable. Its transient Euclidean amplification can still matter for a state constraint.
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
Plan. Use the chain rule to turn the state equation into an equation for $V$, solve that scalar equation, and convert back to $|x|$.
Step 1 — Differentiate the certificate along trajectories. Along a solution $x(t)$, the function $t\mapsto V(x(t))$ is a composition, so the chain rule gives $\dot V=V'(x)\,\dot x$. Here $V'(x)=2x$ and $\dot x=-2x$:
where the last equality uses $V=x^2$. The derivative is negative whenever $x\ne0$, so $V$ strictly decreases away from the origin.
Step 2 — Solve the scalar equation for $V$. The equation $\dot V=-4V$ is of the form $\dot z=az$ with $a=-4$. Multiply by the positive factor $e^{4t}$: by the product rule $\frac{d}{dt}\big(e^{4t}V\big)=e^{4t}(\dot V+4V)=0$, so $e^{4t}V(t)$ is constant and equals its value $V(0)$ at $t=0$. With $V(0)=x_0^2$:
Step 3 — Return to the state. Since $V=x^2$, we have $x(t)^2=x_0^2e^{-4t}$. Taking nonnegative square roots, and using $\sqrt{e^{-4t}}=e^{-2t}$:
Check. The state equation has solution $x(t)=x_0e^{-2t}$ directly, and squaring it gives $x_0^2e^{-4t}$, which agrees with Step 2. At $t=0$ both sides of every formula reduce to the initial value.
Interpretation. The certificate decays with exponent $4$, twice the state's exponent $2$, because $V$ is quadratic in $x$. When reading a Lyapunov decay rate, always halve it to get the rate of the state norm for a quadratic $V$.
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
Here $P=I$ is positive definite and $A$ is diagonal, so $A^\top=A$. Multiplication gives
Both diagonal entries are negative. Applying the product rule to $V=x^\top Px=x_1^2+x_2^2$ along $\dot x=Ax$ gives
Multiply by the integrating factor $e^{2t}$: $(e^{2t}V(t))'=e^{2t}(\dot V+2V)\le0$. Therefore $e^{2t}V(t)\le V(0)$, or $V(t)\le V(0)e^{-2t}$. Since $V=\|x\|_2^2$, taking nonnegative square roots yields $\|x(t)\|_2\le\|x(0)\|_2e^{-t}$. This bounds every trajectory of the stated linear system, with an explicit rate and prefactor.
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
The chain rule gives $\dot V=2x\dot x=2x(-x+x^3)=-2x^2(1-x^2)$. The sublevel is the compact interval $S_c=[-\sqrt c,\sqrt c]$. For $0\lt c\lt1$ and $x\in S_c$, $x^2\le c$, hence $1-x^2\ge1-c\gt0$ and
At either endpoint, $V=c$ and $\dot V=-2c(1-c)\lt0$. Thus the vector field points strictly into the sublevel: a continuous trajectory cannot first cross from $V\le c$ to $V\gt c$ while its derivative at that boundary points downward. This proves forward invariance. The polynomial field is locally Lipschitz, so solutions are unique; staying in this compact interval also rules out finite escape and extends the solution for all forward time.
The integrating-factor inequality $(e^{2(1-c)t}V(t))'\le0$ now holds along the entire trajectory. It gives $V(t)\le V(0)e^{-2(1-c)t}$ and $|x(t)|\le|x_0|e^{-(1-c)t}\to0$.
For $c=1$, the interval $[-1,1]$ still stays invariant, but its endpoints satisfy $-x+x^3=0$. A trajectory starting at $1$ or $-1$ remains there, so not every state in this closed sublevel converges to zero. The strict coefficient $1-c$ disappears, exactly where those additional equilibria enter the set.
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
Class $\mathcal K$ requires continuity on $[0,\infty)$, value zero at zero and strict increase. All three functions are continuous and vanish at zero. To check strictness, take $0\le r\lt s$:
Thus all three are class $\mathcal K$. For $r^2$, a zero derivative at the single point $r=0$ does not prevent strict increase on the nonnegative domain.
Class $\mathcal K_\infty$ additionally requires unbounded growth. Both $2r$ and $r^2$ tend to infinity, so they are also class $\mathcal K_\infty$. In contrast, $r/(1+r)=1-1/(1+r)\to1$, so it is class $\mathcal K$ but not class $\mathcal K_\infty$.
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
Multiply the differential inequality by the positive factor $e^{3t}$. The product rule gives $(e^{3t}V(t))'=e^{3t}(\dot V+3V)\le0$, so $e^{3t}V(t)\le V(0)=4$. Therefore $V(t)\le4e^{-3t}$.
It suffices to make this upper bound at most $0.2$. Solve:
The logarithm is increasing, and dividing by $-3$ reverses the last inequality. The exact sufficient entry time is $\ln20/3\approx0.9985774$ in the time units of the model; for example $t=1$ is sufficient. The same guarantee holds at every later time because the comparison upper bound keeps decreasing. The actual quantity may enter sooner if its derivative is more negative than the stated bound.
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 safe variable is $h(x)=1-x$, so its chain-rule derivative along $\dot x=u$ is $\dot h=-u$. Enforcing $\dot h\ge-2h$ gives $-u\ge-2(1-x)$; multiplying by $-1$ reverses the inequality, giving the allowable half-line $u\le2(1-x)$.
At $x=0.9$ the cap is $2(0.1)=0.2$. The desired input $1$ is outside that half-line. On $u\le0.2$, the squared distance $(u-1)^2$ decreases as $u$ increases toward $1$, so its minimum is the feasible endpoint $u=0.2$. In general the closest input is $u=\min\{1,2(1-x)\}$.
At the boundary $x=1$, admissibility becomes $u\le0$: the velocity can be tangent or point away from the wall, but cannot point beyond it. To obtain the trajectory guarantee, enforce the constraint continuously. Then
This applies to initially safe states along an existing closed-loop solution; the displayed continuous filter is locally Lipschitz, so it has unique trajectories. An input selected from one sampled value is not automatically this continuously enforced filter: the cap must remain valid as the state moves.
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
Plan. Substitute the feedback into the plant, solve the resulting scalar equation, and read off when the exponential decays.
Step 1 — Close the loop. Replace $u$ in $\dot x=2x+u$ by $-kx$ and collect terms in $x$:
Step 2 — Solve it. This is $\dot x=ax$ with the constant $a=2-k$, whose solution is $x(t)=x_0e^{at}$ (differentiating gives $ax_0e^{at}=ax$, and $t=0$ gives $x_0$):
Step 3 — Decide when it decays. For $x_0\ne0$, $|x(t)|=|x_0|e^{(2-k)t}$ and there are three cases for the exponent:
Asymptotic stability asks that every trajectory stay close when it starts close and converge to $0$. Only the first case does both, so the stabilising gains are exactly $k\gt2$.
Step 4 — The borderline gain $k=2$. Then $\dot x=0$, so every state is an equilibrium and $x(t)=x_0$ forever. Starting within distance $\varepsilon$ keeps you within $\varepsilon$, so the origin is (Lyapunov) stable; but a nonzero start never approaches $0$, so it is not attractive and hence not asymptotically stable.
Check. With $k=3$: $\dot x=-x$ and $x(t)=x_0e^{-t}\to0$. With $k=1$: $\dot x=x$ and $x(t)=x_0e^{t}$ grows, even though the feedback $u=-x$ still pushes against the state.
Interpretation. The plant's own rate $+2$ must be overpowered: the feedback must remove more than $2$ units of rate. Stabilising gains are determined by the closed-loop coefficient $2-k$, not by the sign of the feedback 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 the supplied Riccati equation: $2P-P^2+1=0$ becomes $P^2-2P-1=0$, or $(P-1)^2=2$. Its roots are $1\pm\sqrt2$. The positive root is $P=1+\sqrt2\approx2.414214$.
To see the feedback, insert $V(x)=Px^2$ into the continuous Bellman expression for $\dot x=x+u$:
The Riccati equation makes the last coefficient zero. The remaining square is minimized by the unconstrained input $u_*=-Px$. Substitution into the plant gives $\dot x=(1-P)x=-\sqrt2\,x$, hence $x(t)=x_0e^{-\sqrt2 t}$. It converges exponentially, and both squared state and input have finite integrals.
The other root $1-\sqrt2\lt0$ would make $V$ negative for nonzero states even though the cost is nonnegative, and gives rate $1-P=+\sqrt2$. It is not the stabilizing value-function solution. Here the scalar plant is controllable and the positive state penalty detects its mode, as required by the LQR result.
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
The most negative admissible input is $u=-1$. Every input satisfying $|u|\le1$ therefore gives $\dot x=2x+u\ge2x-1$. Put $e=x-1/2$; then $\dot e\ge2e$. Multiplying by $e^{-2t}$ gives $(e^{-2t}e(t))'\ge0$, so
If $x_0\gt1/2$, the right side is always above $1/2$ and grows. No admissible input can make this state return toward zero or cross downward into the inner region. For bounded piecewise-continuous inputs the forced linear equation has a global solution; this lower bound holds for every forward time.
The requested feedback $u=-3x$ lies within the actuator range precisely when $3|x|\le1$, or $|x|\le1/3$. In that interval the actual unsaturated closed loop is $\dot x=2x-3x=-x$. Starting there keeps the state there as it decays, so it supplies a local stabilizing design. Outside it the clipped controller has different dynamics, and the impossibility bound above rules out a global stabilization claim under these input limits.
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
Plan. Find the equilibrium for $u=1$, shift the state so the equation becomes homogeneous, solve, and compare the limit with $G(0)$.
Step 1 — Find the constant-input equilibrium. With $u\equiv1$ the equation is $\dot x=-2x+1$. An equilibrium has zero rate: $0=-2x_*+1$, so $x_*=1/2$.
Step 2 — Shift to remove the constant. Define the deviation $e=x-1/2$. Because $1/2$ is a constant, $\dot e=\dot x$, and
The initial deviation is $e(0)=x(0)-1/2=0-1/2=-1/2$.
Step 3 — Solve and shift back. The equation $\dot e=-2e$ has solution $e(t)=e(0)e^{-2t}=-\tfrac12e^{-2t}$. Adding $1/2$ back:
Step 4 — Steady output. As $t\to\infty$, $e^{-2t}\to0$, so $y(t)=x(t)\to1/2$.
Step 5 — Compare with the DC gain. Evaluating the transfer function at $s=0$ (zero frequency, i.e. a constant signal):
For a stable system a constant input of size $1$ produces, after transients, a constant output of size $G(0)\cdot1$, which is the same $1/2$.
Check. Substituting the solution: $\dot x=e^{-2t}$ and $-2x+1=-(1-e^{-2t})+1=e^{-2t}$, equal; and $x(0)=(1-1)/2=0$ as required.
Interpretation. The transfer function describes the zero-initial-state input–output map, and $G(0)$ is its steady-state gain for constant inputs. A nonzero initial state would add its own transient $x(0)e^{-2t}$, which dies out without changing the limit.
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
Plan. Substitute $s=j\omega$, compute the modulus of the complex denominator, evaluate at the two frequencies, then maximise over $\omega$.
Step 1 — Write the frequency response. Setting $s=j\omega$ gives $G(j\omega)=\dfrac{1}{2+j\omega}$, a reciprocal of the complex number with real part $2$ and imaginary part $\omega$.
Step 2 — Take the modulus. For complex numbers $|1/z|=1/|z|$ (because $|z\cdot(1/z)|=|z|\,|1/z|=1$), and $|a+jb|=\sqrt{a^2+b^2}$. Therefore
Step 3 — Evaluate at the two frequencies.
Step 4 — Find the $H_\infty$ norm. By definition $\|G\|_{H_\infty}=\sup_{\omega\in\mathbb R}|G(j\omega)|$ (for a stable $G$; here the only pole is $s=-2$, in the left half-plane). Since $\omega^2\ge0$, the denominator satisfies $\sqrt{4+\omega^2}\ge\sqrt4=2$ with equality only at $\omega=0$, so $|G(j\omega)|\le1/2$ with equality at $\omega=0$:
Check. At $\omega=0$ the answer agrees with the DC gain $G(0)=1/2$. At $\omega=2$ (the corner frequency, equal to the pole magnitude) the gain is $1/\sqrt2$ of its DC value, the familiar $-3$ dB point. As $\omega\to\infty$, $|G|\to0$: a low-pass filter.
Interpretation. For this stable system the induced $L_2$ gain equals $\|G\|_{H_\infty}=0.5$: no finite-energy input can produce an output with more than half its energy-norm. It measures the worst input–output 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
Plan. Both norms are geometric series; then use the convolution formula to bound the output for any bounded input, and show a constant input attains the bound.
Step 1 — The $\ell_1$ norm. By definition $\|h\|_1=\sum_t|h_t|$. The term $h_0=0$ contributes nothing and every $h_t$ with $t\ge1$ is positive. Substituting $j=t-1$ and using $\sum_{j=0}^\infty r^j=1/(1-r)$ for $|r|\lt1$:
Step 2 — The $\ell_2$ norm. By definition $\|h\|_2^2=\sum_th_t^2$, and $(0.5^{t-1})^2=0.25^{t-1}$:
Step 3 — Upper bound on the peak-to-peak gain. With zero initial state the output is the convolution $y_t=\sum_{i=0}^{t}h_iu_{t-i}$. The triangle inequality and $|u_{t-i}|\le\|u\|_\infty=\sup_k|u_k|$ give
So the induced $\ell_\infty$ gain is at most $2$.
Step 4 — The bound is approached arbitrarily closely. Take the constant input $u_t=1$, so $\|u\|_\infty=1$. Then $y_t=\sum_{i=1}^{t}0.5^{i-1}=2(1-0.5^t)$ (finite geometric sum), giving $y_0,y_1,y_2,y_3,\ldots=0,1,1.5,1.75,\ldots\to2$. No constant smaller than $2$ can bound $|y_t|/\|u\|_\infty$ for all $t$, so the induced $\ell_\infty$ gain is exactly $2=\|h\|_1$.
Step 5 — Why the two norms differ. The $\ell_2$ norm squares each sample, and squaring numbers below $1$ shrinks them ($0.25^{t-1}\le0.5^{t-1}$), so the tail counts less: $4/3\lt2^2$. More fundamentally, $\|h\|_2$ measures the energy of the response to one impulse, whereas $\|h\|_1$ measures how much a persistent worst-case bounded input can pile up, since every past sample of $h$ is weighted by an input of full size.
Check. Directly from the system: with $u\equiv1$, the equilibrium of $x_{t+1}=0.5x_t+1$ is $x_*=2$, matching the limit in Step 4. Also $\|h\|_2\le\|h\|_1$ ($1.1547\le2$), as must hold for any sequence.
Interpretation. Different norms answer different questions: $\|h\|_1$ is the guarantee for bounded disturbances (peak in, peak out), and $\|h\|_2$ is the response energy to a single kick. Using the wrong one can understate a worst case by a large factor.
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
Plan. The saturation has three pieces; check both inequalities on each piece separately, which covers every real $v$.
Step 1 — Write the saturation piecewise. Evaluating $\max(-1,\min(v,1))$:
Step 2 — Middle piece, $|v|\le1$. Here $\varphi(v)=v$, so $v\varphi(v)=v^2$. Both inequalities hold: $0\le v^2$ (a square is nonnegative) and $v^2\le v^2$ (with equality).
Step 3 — Upper piece, $v\gt1$. Here $\varphi(v)=1$, so $v\varphi(v)=v$. Since $v\gt1\gt0$, we have $v\ge0$. For the upper bound, $v^2-v=v(v-1)\gt0$ because both factors are positive, so $v\le v^2$.
Step 4 — Lower piece, $v\lt-1$. Here $\varphi(v)=-1$, so $v\varphi(v)=-v=|v|\gt0$. For the upper bound, $v^2-|v|=|v|(|v|-1)\gt0$ because $|v|\gt1$, so $|v|\le v^2$.
Step 5 — Conclude the sector. The three pieces cover all of $\mathbb R$, so $0\le v\varphi(v)\le v^2$ for every real $v$. Dividing by $v^2\gt0$ when $v\ne0$ gives $0\le\varphi(v)/v\le1$: the slope of the line from the origin to the point $(v,\varphi(v))$ lies between $0$ and $1$. This is the sector $[0,1]$.
Check. $v=0.5$: $0.25$, and $0\le0.25\le0.25$. $v=3$: $3$, and $0\le3\le9$. $v=-2$: $(-2)(-1)=2$, and $0\le2\le4$. The upper bound is tight on $[-1,1]$ and the lower bound is approached as $|v|\to\infty$ (slope $1/|v|\to0$), so no narrower sector $[k_1,k_2]$ with $k_1\gt0$ or $k_2\lt1$ works.
Interpretation. Saturation never reverses the sign of a command and never amplifies it. This is a pointwise statement about every input, proved case by case, not an estimate obtained by sampling a few values; it is exactly the information the circle criterion needs.
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
The condition $\varphi(0)=0$ lets the Lipschitz bound compare with the origin: $|\varphi(x)|=|\varphi(x)-\varphi(0)|\le|x|$. Thus $x\varphi(x)\le|x|\,|\varphi(x)|\le x^2$, including both signs of $x$.
For $V=x^2$, the chain rule gives
The integrating factor $e^{0.4t}$ yields $V(t)\le V(0)e^{-0.4t}$. Taking square roots gives $|x(t)|\le|x_0|e^{-0.2t}$ for every initial state. The field $-x+0.8\varphi(x)$ is globally Lipschitz with constant at most $1+0.8=1.8$, so its unique solutions exist for all forward time. The estimate therefore proves global exponential stability.
For the same loop, the linear block $G(s)=0.8/(s+1)$ has induced $L_2$ gain $\sup_\omega0.8/\sqrt{1+\omega^2}=0.8$. Pointwise $|\varphi(x)|\le|x|$ gives gain at most $1$ for the memoryless block. There is no algebraic feedthrough loop, and the product $0.8\cdot1\lt1$ meets the small-gain condition. The direct derivative proof also provides an explicit state-decay rate.
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
Plan. Use $V=x^2$ directly: the sector condition tells us the sign of the nonlinear term in $\dot V$, which is all we need. Then explain why the norm test could not see this.
Step 1 — Differentiate the certificate. Along solutions, the chain rule gives $\dot V=2x\dot x$. Substituting $\dot x=-x-\varphi(x)$:
Step 2 — Use the sector's lower bound. The assumption $0\le x\varphi(x)$ says the nonlinear term is never negative, so $-2x\varphi(x)\le0$. Dropping it can only increase the right-hand side:
Note that the upper bound $x\varphi(x)\le3x^2$ was not needed: a large $\varphi$ with the correct sign only helps.
Step 3 — Integrate the inequality. Multiply by the positive factor $e^{2t}$. The product rule gives $\frac{d}{dt}\big(e^{2t}V(t)\big)=e^{2t}(\dot V+2V)\le0$, so $e^{2t}V(t)$ never increases and $e^{2t}V(t)\le V(0)$:
Step 4 — Make sure solutions exist for all time. The right-hand side $-x-\varphi(x)$ is locally Lipschitz, so from each $x_0$ there is a unique solution on some interval. A solution can only stop existing by escaping to infinity in finite time; but Step 3 keeps $|x(t)|\le|x_0|$ as long as it exists, so it cannot escape and extends to all $t\ge0$. The bound therefore holds for every initial state and every $t\ge0$: the origin is globally exponentially stable, with rate $1$.
Step 5 — Why small gain failed. Viewing the loop as the linear block $1/(s+1)$ (gain $1$) in negative feedback with $\varphi$ (gain bound $3$, since $|\varphi(x)|\le3|x|$ follows from the sector), the small-gain test needs $1\cdot3\lt1$, which is false. The test is only sufficient: its failure says "no certificate from this test", not "unstable". It used only magnitudes and discarded the sign information $x\varphi(x)\ge0$ that Step 2 relied on.
Check. Linear special case $\varphi(x)=3x$ (inside the sector): $\dot x=-4x$ and $|x(t)|=|x_0|e^{-4t}\le|x_0|e^{-t}$. Case $\varphi=0$: $\dot x=-x$, which attains the bound exactly, so the rate $1$ cannot be improved in general.
Interpretation. A sector condition carries the sign of the feedback, which a gain bound discards. Negative feedback of the correct sign, however strong, cannot destabilise this first-order loop.
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
Plan. Build $[B\ AB]$, compute its rank, apply the Kalman rank test, and confirm by looking at the second coordinate directly.
Step 1 — Compute $AB$. Multiply the diagonal matrix by the column $B$ entry by entry:
Step 2 — Form the controllability matrix. Place $B$ and $AB$ side by side as columns:
Step 3 — Compute its rank. The second row is zero, so $\det\mathcal C=1\cdot0-0.5\cdot0=0$ and the rank is less than $2$. The first column is nonzero, so the rank is exactly $1$. (Equivalently, the second column is $0.5$ times the first.)
Step 4 — Apply the rank test. Why these columns? From $x_0=0$, unrolling $x_{t+1}=Ax_t+Bu_t$ twice gives $x_2=ABu_0+Bu_1$, a combination of the columns of $\mathcal C$; for a two-state system, by Cayley–Hamilton, later powers $A^kB$ add no new directions. A system with $n$ states is controllable exactly when $\operatorname{rank}\mathcal C=n$. Here $1\lt2$, so the system is not controllable: reachable states lie only in the column span, the first coordinate axis.
Step 5 — Confirm directly. Writing the update coordinate by coordinate, $x_{1,t+1}=0.5x_{1,t}+u_t$ and $x_{2,t+1}=0.25x_{2,t}$. The input never enters the second equation, so starting from $x_{2,0}=0$ gives $x_{2,t}=0.25^t\cdot0=0$ for all $t$.
Check. Target $(1,0)$: one step with $u_0=1$ reaches it. Target $(0,1)$: impossible, since the second coordinate is always $0$. This agrees with the column span found in Step 4.
Interpretation. The second mode is stable ($|0.25|\lt1$) but invisible to the input: it decays on its own and cannot be steered. Stability of $A$ does not imply controllability, and controllability is a property of how $B$ enters, not of $A$ alone.
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
Plan. Evaluate the Gramian integral, turn the endpoint requirement into a constraint on $\int u$, use Cauchy–Schwarz to get a lower bound on energy, and exhibit an input that meets it.
Step 1 — The Gramian. For $\dot x=Ax+Bu$ the horizon-$T$ controllability Gramian is $W_T=\int_0^Te^{A\tau}BB^\top e^{A^\top\tau}d\tau$. The integrator has $A=0$ and $B=1$, so $e^{A\tau}=e^0=1$ and the integrand is $1$:
Step 2 — Turn the target into a constraint. Integrating $\dot x=u$ from $0$ to $2$ (fundamental theorem of calculus) and using $x(0)=0$:
Step 3 — Lower-bound the energy. The Cauchy–Schwarz inequality for integrals says $\left(\int_0^2 f g\,dt\right)^2\le\int_0^2f^2dt\int_0^2g^2dt$. Take $f=1$ and $g=u$:
Dividing by $2$: every input that reaches the target has energy $\int_0^2u^2\,dt\ge1/2$. This equals $x_f^2/W_2=1^2/2$, the general minimum-energy formula for a scalar target.
Step 4 — Attain the bound. Equality in Cauchy–Schwarz holds when $u$ is a constant multiple of $f=1$, so try $u(t)=c$. The constraint gives $2c=1$, so $c=1/2$. Its energy is
It reaches the target and achieves the lower bound, so it is optimal: the minimum energy is $1/2$, attained by $u(t)=1/2$.
Check. With $u=1/2$, $x(t)=t/2$ and $x(2)=1$. A competing input, $u=1$ on $[0,1]$ and $0$ after, also reaches $x(2)=1$ but costs $\int_0^1 1\,dt=1\gt1/2$, as the bound predicts. The general formula $u(t)=B^\top e^{A^\top(T-t)}W_T^{-1}x_f=1\cdot\tfrac12\cdot1$ gives the same input.
Interpretation. The Gramian is a reachability scale: the larger $W_T$, the cheaper it is to reach a given state. Doubling the horizon to $T=4$ would double $W$ and halve the minimum energy to $1/4$, by spreading the same total displacement over more time.
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
Plan. Derive the transformation rules from $z=Tx$, compute the new matrices, evaluate both transfer functions, and finally see why they must agree for any invertible $T$.
Step 1 — Derive the transformation rules. $T=\operatorname{diag}(2,1)$ has nonzero determinant $2$, so it is invertible with $T^{-1}=\operatorname{diag}(1/2,1)$ and $x=T^{-1}z$. Differentiate $z=Tx$ (a constant matrix passes through the derivative) and substitute the state equation:
So $A_z=TAT^{-1}$, $B_z=TB$, $C_z=CT^{-1}$ and $D_z=D=0$.
Step 2 — Compute the new matrices. Products of diagonal matrices are diagonal with the entries multiplied, so $TAT^{-1}=\operatorname{diag}(2\cdot(-1)\cdot\tfrac12,\ 1\cdot(-2)\cdot1)=\operatorname{diag}(-1,-2)=A$. Next,
Step 3 — Original transfer function. $G(s)=C(sI-A)^{-1}B+D$. Here $sI-A=\operatorname{diag}(s+1,s+2)$, whose inverse is $\operatorname{diag}\big(\tfrac{1}{s+1},\tfrac{1}{s+2}\big)$. For a diagonal system the product is a sum of terms $c_ib_i/(s-a_i)$:
Step 4 — Transformed transfer function. The same formula with $C_z$ and $B_z$ (and the same $A_z=A$):
The factor $2$ that $T$ put into the input column is exactly undone by the factor $1/2$ that $T^{-1}$ put into the output row.
Step 5 — Why this always works. For any invertible $T$, use $sI-TAT^{-1}=T(sI-A)T^{-1}$ (since $sI=T(sI)T^{-1}$), so its inverse is $T(sI-A)^{-1}T^{-1}$. Then
Check. At $s=0$: $G(0)=1+\tfrac12=\tfrac32$ and $G_z(0)=\tfrac12\cdot2+\tfrac12=\tfrac32$. The DC gains agree, as they must.
Interpretation. Internal coordinates and matrix entries changed, but the physical input–output behaviour did not. Invertibility of $T$ is essential: Step 5 cancels $T^{-1}T$, which is impossible for a singular $T$.
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
Plan. Substitute the dynamics into the cost to get a quadratic in $u_0$ alone, minimise it, then evaluate the state and cost.
Step 1 — Eliminate the state. The next state is determined by the input, $x_1=x_0+u_0=2+u_0$. Writing $u$ for $u_0$ and expanding $(2+u)^2=4+4u+u^2$:
Step 2 — Minimise. A differentiable function can only have an unconstrained minimum where its derivative vanishes:
Since $g''(u)=4\gt0$ everywhere, $g$ is convex, so this stationary point is the unique global minimum. Equivalently, completing the square gives $g(u)=2(u+1)^2+2$, which is smallest exactly when $u+1=0$.
Step 3 — Next state and cost.
Check. The completed square gives the same minimum value $2$. Compare with alternatives: $u=0$ costs $0+4=4$, and driving straight to zero with $u=-2$ costs $4+0=4$. Both exceed $2$.
Interpretation. Because effort and state error are weighted equally, the optimum splits the correction: it moves the state half way, from $2$ to $1$. Penalising effort changes the preferred action away from "go straight to the target".
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
Solve the last decision first. At a state $x$ with one decision left,
The square is nonnegative and is zero only at $u=-x/2$, so $V_1(x)=x^2/2$. This expresses the best remaining cost as a function of the state reached after the first action.
Starting from $x_0=3$, Bellman's first objective is the effort $u_0^2$ plus that optimal tail cost:
Its unique minimum is $u_0=-1$, giving $x_1=3-1=2$. The final-step feedback then gives $u_1=-x_1/2=-1$ and $x_2=2-1=1$. Directly the cost is $(-1)^2+(-1)^2+1^2=3$, agreeing with the first value minimum. The future action was optimized for the successor state, which is the reason to use the backward recursion.
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 any terminal state $x\in X_f=[-0.5,0.5]$, choose $\kappa_f(x)=-x$. Then $|\kappa_f(x)|=|x|\le0.5\le1$, and the successor is $x+\kappa_f(x)=0\in X_f$. The whole terminal set also obeys $|x|\le2$. Thus the terminal feedback is admissible and keeps the terminal set invariant.
Let a feasible length-$N$ plan, $N\ge1$, have states $x_0,\ldots,x_N$ and inputs $u_0,\ldots,u_{N-1}$, with $x_N\in X_f$. After executing $u_0$, the measured next state is exactly $x_1$ because there is no disturbance or model error. Use the candidate inputs
The first $N-1$ predicted transitions reproduce the feasible tail $x_1,\ldots,x_N$ of the old plan. The last input has magnitude at most $0.5$, and its successor is zero in $X_f$. Hence every input and state constraint, and the new terminal constraint, hold. For $N=1$ the old tail is empty and the candidate consists only of $-x_1$, with the same argument.
A feasible candidate proves that the next optimization problem has a feasible plan. Repeating the construction proves recursive feasibility from an initially feasible state. It does not by itself establish cost decrease or stability; those need terminal-cost assumptions. Disturbances would also break the exact equality with the old predicted $x_1$ and require a robustness margin.
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
Example 1 uses five-minute holds with $a=e^{-1/4}$, $b=4(1-a)$, and gain $0.5$ kW per degree Celsius. Thus $q=a-0.5b=3a-2\approx0.3364023492$, and the starting error is $x_0=20-22=-2\,{}^\circ\mathrm C$. The reading errors obey $x_k=q^kx_0$.
The first eligible reading is found by checking integer $k$, since the requirement is at a reading:
The first two values exceed $0.3$ and the third is below it. Hence $k=2$ is the first qualifying reading, at $2(5)=10$ minutes. Its temperature is about $22-0.2263331=21.7736669\,{}^\circ\mathrm C$.
The two inputs held before that reading are $u_0=1-0.5(-2)=2$ kW and $u_1=1-0.5(-2q)=1+q\approx1.3364023$ kW. Both obey $0\le u\le2$. More generally $|x_k|\le2$ keeps this command admissible. During each hold, $x(k\Delta+s)=(3e^{-0.05s}-2)x_k$ with $0\le s\le5$; the multiplier decreases from $1$ to the positive $q$. Each temperature stays between its adjacent readings, so these holds also remain in the model's allowed temperature interval.
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
Use the exact coefficients $a=e^{-1/4}$ and $b=4(1-a)\gt0$. For $0\le k\le0.5$, the closed-loop multiplier $q_k=a-bk$ is positive: its smallest value is $a-0.5b=3a-2\approx0.3364023$.
For $|x|\le0.2$ and $|w|\le0.1$ degrees Celsius, the next sampled error satisfies $|q_kx+w|\le0.2q_k+0.1$. Equal signs at the extreme state and disturbance attain this bound, so it gives the exact one-step invariance condition:
Commands throughout $|x_k|\le2$ must also obey $0\le1-kx_k\le2$. For nonnegative $k$, the smallest and largest commands are $1-2k$ and $1+2k$; both are admissible precisely when $k\le0.5$. Combining the requirements gives
The lower endpoint is approximately $0.31510146$; the exact expression defines the guarantee, since rounding it downward would slightly weaken the required bound. For any gain in this interval, induction keeps an initially sampled error in $[-0.2,0.2]$. This does not prove when a state outside that set enters it. The disturbance assumption concerns sampled updates and supplies no independent bound on 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
If the speed is $v$, the distance is $d$ and available braking magnitude is $a_b$, coasting for $\tau$ consumes $v\tau$ metres. Full braking then consumes $v^2/(2a_b)$ metres: integrating $v-a_bt$ until $t=v/a_b$ gives that formula. Thus nonnegative final clearance requires $v\tau+v^2/(2a_b)\le d$.
For nonnegative speeds and delays, travel increases with $v$ and decreases with $a_b$. The most difficult allowed state therefore has $d=0.72$ m, $v=1.1$ m/s and $a_b=1$ m/s$^2$. At the proposed delay,
This allowed case needs $0.105$ m more than is available, so $d\ge0$ is not guaranteed by the delayed-braking strategy. It is an actual counterexample under the model, not merely a failed sufficient estimate.
To certify every allowed state, solve the worst-case inequality:
This exact bound is the largest certified delay when zero final clearance is allowed: the worst case reaches the wall exactly at stopping at equality. A strictly positive clearance would require a smaller delay or an added margin. The calculation assumes the whole measurement intervals are possible, speed is constant while coasting, and at least the stated braking acceleration is available until rest. Midpoints would incorrectly predict $1(0.2)+1^2/2=0.7\le0.75$, omitting those permitted extremes.
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
Plan. Recall the exact sampled model, compute the unclipped and the clipped first step from $x_0=-2$, write the clipped controller as a three-piece map, and show each piece maps into $[-2,2]$ by checking its endpoints.
Step 1 — The sampled model. As in Example 1, write the heater command as $u=1+v$, where $v$ is the deviation from the nominal $1$ kW. With $v$ held over one five-minute interval, the error obeys $x(k\Delta+s)=4v_k+(x_k-4v_k)e^{-0.05s}$; at $s=5$ this gives
Step 2 — Unclipped prediction. The law $u=1-x$ means $v=u-1=-x$. Substituting:
From $x_0=-2$ this predicts $x_1=-2(a-b)=8-10a\approx0.2119921693$.
Step 3 — What actually happens. The requested command is $u_0=1-(-2)=3$ kW, above the $2$ kW limit, so it clips to $u_0=2$ kW, i.e. $v_0=2-1=1$. The actual first reading is
The unclipped formula predicted a small overshoot to $+0.21$; the saturated heater instead leaves the room still $0.67$ degrees too cold.
Step 4 — Write the clipped map in pieces. Clipping $u=1-x$ into $[0,2]$ is the same as clipping $v=-x$ into $[-1,1]$. So $v=1$ when $-x\ge1$ (i.e. $x\le-1$), $v=-x$ when $|x|\le1$, and $v=-1$ when $x\ge1$. Substituting each into $x_{k+1}=ax_k+bv_k$:
The pieces agree at the joins: at $x=-1$, $-a+b=(a-b)(-1)$; at $x=1$, $a-b=(a-b)(1)$. So $F$ is continuous.
Step 5 — Image of each piece. An affine function on an interval attains its extreme values at the endpoints; with positive slope the left endpoint gives the minimum, with negative slope the maximum. Using $b=4-4a$:
The outer pieces have slope $a\gt0$ and the middle piece has slope $a-b\lt0$, so
- $F([-2,-1])=[F(-2),F(-1)]=[4-6a,\,4-5a]\approx[-0.6728047,0.1059961]$.
- $F([-1,1])=[F(1),F(-1)]=[5a-4,\,4-5a]\approx[-0.1059961,0.1059961]$.
- $F([1,2])=[F(1),F(2)]=[5a-4,\,6a-4]\approx[-0.1059961,0.6728047]$.
Step 6 — Conclude invariance. All three images lie in $[4-6a,\,6a-4]$, and since $0\lt a\lt1$ we have $6a-4\lt2$ and $4-6a\gt-2$. Hence $x_k\in[-2,2]$ implies $x_{k+1}\in[-2,2]$, and by induction every sampled error stays in $[-2,2]$. Clipping itself enforces the heater limits, so no separate input check is needed.
Step 7 — Between readings. For a fixed held $v_k$, $x(k\Delta+s)=4v_k+(x_k-4v_k)e^{-0.05s}$ has derivative $-0.05(x_k-4v_k)e^{-0.05s}$, whose sign is constant during the hold (or which is zero throughout). The trajectory is therefore monotone on each hold and lies between its two sampled endpoints, both in $[-2,2]$. Hence the full temperature trajectory also stays within $[-2,2]$ error.
Check. $F(-2)=4-6a$ agrees with the actual $x_1$ of Step 3. The map is odd, $F(-x)=-F(x)$, matching the symmetric images of the outer pieces. In fact every image lies in $[-0.673,0.673]$, so after one reading the error is already well inside the interval.
Interpretation. The unclipped linear multiplier $5a-4$ only describes the loop where $|x|\le1$; outside it saturation changes the dynamics. The exact expressions define the guarantee; displayed decimals are approximations.
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. |