D. Dynamical Systems, Stability & Feedback Control

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

Before you start

This primer assumes:

Study route — Build control intuition from one-dimensional models

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

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

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

Readiness checks — a short prerequisite refresher

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

Exercise D.R1 — Readiness: Find a discrete equilibrium

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

Review if needed: functions and fixed points.

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

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

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

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

Review if needed: derivatives and the chain rule.

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

For $x(t)=3e^{-2t}$, the chain rule multiplies the exponential by the derivative of its exponent:

$$\dot x(t)=3e^{-2t}\frac{d(-2t)}{dt}=3e^{-2t}(-2)=-6e^{-2t}=-2x(t).$$

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
The eigenvalues are $1$ and $2$, and $V=x_1^2+2x_2^2$.
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

$$V=x^\top Px=(1,-2)(1,-4)^\top=1(1)+(-2)(-4)=1+8=9.$$

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

$$V(z)-\|z\|_2^2=z_2^2\ge0,\qquad 2\|z\|_2^2-V(z)=z_1^2\ge0.$$

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

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

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

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

1. State-Space Models, Trajectories & Equilibria

Start here — Turn a model into an actual trajectory

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

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

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

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

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

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

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

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

Existence, uniqueness and forward completeness

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

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

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

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

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

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

Equilibria and linearisation

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

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

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

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

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

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

Sampling, holding, saturating and switching

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

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

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

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

Practice — Turn a model into an actual trajectory

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

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

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

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

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

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

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

Show hint
Substitute the controller into the plant. The resulting multiplier is $0.5-0.25$.
Show worked solution

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$:

$$\begin{aligned}x_{t+1}&=0.5x_t+(-0.25x_t)\\&=(0.5-0.25)x_t=0.25x_t.\end{aligned}$$

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:

$$\begin{aligned}x_*-0.25x_*=0\ &\Longleftrightarrow\ 0.75x_*=0\\&\Longleftrightarrow\ x_*=0,\end{aligned}$$

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:

$$\begin{aligned}x_1&=0.25x_0,\\x_2&=0.25x_1=0.25^2x_0,\\x_3&=0.25x_2=0.25^3x_0.\end{aligned}$$

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$,

$$\begin{aligned}&x_t=4(0.25)^t:\\&x_0=4,\ x_1=1,\\&x_2=0.25,\ x_3=0.0625.\end{aligned}$$

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
Continuous equilibria satisfy $f(x_*)=0$. The linearised rate is $f'(x_*)$.
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:

$$f(0.1)=-0.1+(0.1)^2=-0.09,\qquad x_{\rm next}=0.1+0.2(-0.09)=0.082.$$

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

Start here — Separate continuous and discrete stability tests

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

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

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

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

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

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

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

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

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

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

Schur and Hurwitz stability

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

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

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

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

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

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

Where this is used

Practice — Separate continuous and discrete stability tests

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

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

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

Review if needed: this section and eigenvalues and eigenvectors.

Show hint
Discrete eigenvalues must have magnitude less than one; their sign alone is insufficient.
Show worked solution

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:

$$\begin{aligned}\begin{bmatrix}x_{1,t+1}\\x_{2,t+1}\end{bmatrix}&=\begin{bmatrix}0.5&0\\0&-1.2\end{bmatrix}\begin{bmatrix}x_{1,t}\\x_{2,t}\end{bmatrix}\\&=\begin{bmatrix}0.5\,x_{1,t}\\-1.2\,x_{2,t}\end{bmatrix}.\end{aligned}$$

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)$:

$$x_t=\big(2(0.5)^t,\ (-1.2)^t\big).$$

Step 2 — Compute the first two states.

$$\begin{aligned}x_1&=\big(0.5\cdot2,\ -1.2\cdot1\big)\\&=(1,\,-1.2),\\x_2&=\big(0.5\cdot1,\ -1.2\cdot(-1.2)\big)\\&=(0.5,\,1.44).\end{aligned}$$

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

$$|0.5|=0.5\lt1,\quad |-1.2|=1.2\gt1.$$

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
Each scalar equation $\dot z=az$ has solution $z(t)=e^{at}z(0)$.
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$:

$$x(t)=\big(3e^{-t},\ 4e^{-2t}\big).$$

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}$:

$$\begin{aligned}\|x(t)\|_2^2&=(3e^{-t})^2+(4e^{-2t})^2\\&=9e^{-2t}+16e^{-4t}.\end{aligned}$$

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:

$$\|x(t)\|_2^2\le9e^{-2t}+16e^{-2t}=25e^{-2t}.$$

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}$:

$$\|x(t)\|_2\le5e^{-t},\qquad t\ge0.$$

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
Write $A=0.5I+N$ where $N^2=0$, so only the first two binomial terms survive.
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$:

$$A^t=\left(\frac12\right)^t I+t\left(\frac12\right)^{t-1}N,\qquad t\ge1.$$

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

$$x_t=A^tx_0=\begin{bmatrix}10t(1/2)^{t-1}\\(1/2)^t\end{bmatrix},\qquad x_1=(10,0.5)^\top.$$

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

Start here — Use a scalar certificate along a trajectory

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Quadratic Lyapunov functions and the Lyapunov equation

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

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

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

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

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

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

Forward invariance, controlled invariance and Nagumo's condition

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

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

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

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

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

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

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

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

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

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

Where this is used

Practice — Use a scalar certificate along a trajectory

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

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

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

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

Show hint
The chain rule gives $\dot V=V'(x)\dot x$.
Show worked solution

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$:

$$\dot V=(2x)(-2x)=-4x^2=-4V,$$

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$:

$$V(t)=V(0)e^{-4t}=x_0^2e^{-4t}.$$

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}$:

$$|x(t)|=|x_0|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
For a quadratic certificate, $\dot V=x^\top(A^\top P+PA)x$. Compare the result with $-2V$.
Show worked solution

Here $P=I$ is positive definite and $A$ is diagonal, so $A^\top=A$. Multiplication gives

$$A^\top P+PA=A+A=\begin{bmatrix}-2&0\\0&-4\end{bmatrix}.$$

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

$$\dot V=x^\top(A^\top P+PA)x=-2x_1^2-4x_2^2\le-2(x_1^2+x_2^2)=-2V.$$

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
Inside the sublevel, $1-x^2\ge1-c\gt0$. Inspect the states $x=\pm1$.
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

$$\dot V\le-2(1-c)x^2=-2(1-c)V.$$

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

Start here — Translate differential inequalities into bounds

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

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

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

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

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

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

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

Proof sketch — the first-crossing argument

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

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

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

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

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

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

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

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

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

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

Practice — Translate differential inequalities into bounds

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

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

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

Review if needed: this section and monotonic functions.

Show hint
Class $\mathcal K$ means continuous, strictly increasing and zero at zero. Class $\mathcal K_\infty$ also requires unbounded growth.
Show worked solution

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$:

$$2s-2r=2(s-r)\gt0.$$
$$s^2-r^2=(s-r)(s+r)\gt0.$$
$$\frac{s}{1+s}-\frac{r}{1+r}=\frac{s-r}{(1+s)(1+r)}\gt0.$$

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
Compare with $\dot z=-3z$, then solve the resulting exponential inequality.
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:

$$4e^{-3t}\le0.2\ \Longleftrightarrow\ e^{-3t}\le\frac1{20}\ \Longleftrightarrow\ -3t\le-\ln20\ \Longleftrightarrow\ t\ge\frac{\ln20}{3}.$$

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
Because $h'(x)=-1$, $\dot h=-u$. Reversing an inequality changes its sign.
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

$$\frac{d}{dt}\big(e^{2t}h(x(t))\big)=e^{2t}(\dot h+2h)\ge0,\qquad h(x(t))\ge h(x_0)e^{-2t}\ge0.$$

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

Start here — Design feedback and then check its assumptions

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

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

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

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

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

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

The linear-quadratic regulator (LQR)

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

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

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

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

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

PID control and integral action

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

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

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

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

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

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

Where this is used

Practice — Design feedback and then check its assumptions

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

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

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

Review if needed: this section and minimisation and constraints.

Show hint
Substitute the feedback first. Continuous-time exponential decay requires a negative coefficient.
Show worked solution

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$:

$$\dot x=2x-kx=(2-k)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$):

$$x(t)=x_0e^{(2-k)t}.$$

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:

$$\begin{aligned}2-k\lt0\ (k\gt2)&:\ e^{(2-k)t}\to0,\\2-k=0\ (k=2)&:\ e^{0}=1\ \text{for all }t,\\2-k\gt0\ (k\lt2)&:\ e^{(2-k)t}\to\infty.\end{aligned}$$

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
Complete the square in $P$. LQR uses $u=-Px$ here because $B=R=1$.
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$:

$$x^2+u^2+V'(x)(x+u)=x^2+u^2+2Px(x+u)=(u+Px)^2+(1+2P-P^2)x^2.$$

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
Even the most negative admissible input gives $\dot x\ge2x-1$. For the feedback, impose $|-3x|\le1$.
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

$$x(t)\ge\frac12+\left(x_0-\frac12\right)e^{2t}.$$

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

Start here — Connect time responses to gains

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Return difference, gain and delay margins

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

Dissipativity: from a storage function to a gain

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

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

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

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

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

Practice — Connect time responses to gains

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

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

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

Review if needed: this section and geometric series.

Show hint
The equilibrium is $1/2$. The difference from equilibrium decays with rate $-2$.
Show worked solution

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

$$\begin{aligned}\dot e=-2x+1&=-2\left(e+\tfrac12\right)+1\\&=-2e-1+1=-2e.\end{aligned}$$

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:

$$x(t)=\frac12-\frac12e^{-2t}=\frac{1-e^{-2t}}{2}.$$

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):

$$G(0)=\frac{1}{0+2}=\frac12.$$

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
The modulus of $2+j\omega$ is $\sqrt{4+\omega^2}$.
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

$$|G(j\omega)|=\frac{1}{|2+j\omega|}=\frac{1}{\sqrt{4+\omega^2}}.$$

Step 3 — Evaluate at the two frequencies.

$$\begin{aligned}|G(j0)|&=\frac{1}{\sqrt{4}}=\frac12=0.5,\\|G(j2)|&=\frac{1}{\sqrt{4+4}}=\frac{1}{2\sqrt2}\approx0.353553.\end{aligned}$$

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$:

$$\|G\|_{H_\infty}=\frac12.$$

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
Sum the geometric series once for $h_t$ and once for $h_t^2$. A constant input attains the asymptotic positive-kernel gain.
Show worked solution

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$:

$$\begin{aligned}\|h\|_1&=\sum_{t=1}^\infty0.5^{t-1}=\sum_{j=0}^\infty0.5^j\\&=\frac{1}{1-0.5}=2.\end{aligned}$$

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}$:

$$\begin{aligned}\|h\|_2^2&=\sum_{j=0}^\infty0.25^j=\frac{1}{1-0.25}=\frac43,\\\|h\|_2&=\sqrt{\tfrac43}=\frac{2}{\sqrt3}\approx1.154701.\end{aligned}$$

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

$$\begin{aligned}|y_t|&\le\sum_{i=0}^{t}|h_i|\,|u_{t-i}|\le\|u\|_\infty\sum_{i=0}^{\infty}|h_i|\\&=\|h\|_1\|u\|_\infty=2\|u\|_\infty.\end{aligned}$$

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

Start here — Read a nonlinearity as a constraint

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Practice — Read a nonlinearity as a constraint

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

Exercise D.S19 — Easy: Check a saturation sector

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

Review if needed: this section and Lipschitz bounds.

Show hint
Treat $|v|\le1$ and $|v|\gt1$ separately.
Show worked solution

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))$:

$$\varphi(v)=\begin{cases}-1,&v\lt-1,\\v,&-1\le v\le1,\\1,&v\gt1.\end{cases}$$

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
The Lipschitz property gives $|\varphi(x)|\le|x|$, so $x\varphi(x)\le x^2$.
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

$$\dot V=2x[-x+0.8\varphi(x)]=-2x^2+1.6x\varphi(x)\le-2x^2+1.6x^2=-0.4V.$$

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
The negative feedback sign and the nonnegative sector product help the derivative of $x^2$.
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)$:

$$\begin{aligned}\dot V&=2x\big(-x-\varphi(x)\big)\\&=-2x^2-2x\varphi(x).\end{aligned}$$

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:

$$\dot V\le-2x^2=-2V.$$

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)$:

$$\begin{aligned}&x(t)^2=V(t)\le x_0^2e^{-2t}\\&\Longrightarrow\ |x(t)|\le|x_0|e^{-t}.\end{aligned}$$

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

Start here — Ask which states inputs can reach

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

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

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

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

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

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

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

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

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

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

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

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

Where this is used

Practice — Ask which states inputs can reach

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

Exercise D.S22 — Easy: An unreachable coordinate

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

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

Show hint
The second coordinate receives no input and has no coupling from the first.
Show worked solution

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:

$$\begin{aligned}AB&=\begin{bmatrix}0.5&0\\0&0.25\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}\\&=\begin{bmatrix}0.5\cdot1+0\cdot0\\0\cdot1+0.25\cdot0\end{bmatrix}=\begin{bmatrix}0.5\\0\end{bmatrix}.\end{aligned}$$

Step 2 — Form the controllability matrix. Place $B$ and $AB$ side by side as columns:

$$\mathcal C=[B\ \ AB]=\begin{bmatrix}1&0.5\\0&0\end{bmatrix}.$$

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
Here $e^{At}=1$ and $B=1$. Cauchy–Schwarz bounds the square of $\int_0^2u$.
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$:

$$W_2=\int_0^2 1\,d\tau=2.$$

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$:

$$\begin{aligned}x(2)&=x(0)+\int_0^2u\,dt=\int_0^2u\,dt,\\x(2)=1&\iff\int_0^2u\,dt=1.\end{aligned}$$

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$:

$$\begin{aligned}1&=\left(\int_0^2 1\cdot u\,dt\right)^2\\&\le\left(\int_0^2 1\,dt\right)\left(\int_0^2u^2dt\right)\\&=2\int_0^2u^2dt.\end{aligned}$$

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

$$\int_0^2\left(\tfrac12\right)^2dt=2\cdot\tfrac14=\tfrac12.$$

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
Use $A_z=TAT^{-1}$, $B_z=TB$, $C_z=CT^{-1}$.
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:

$$\begin{aligned}\dot z&=T\dot x=T(Ax+Bu)\\&=TAT^{-1}z+TBu,\\y&=Cx+Du=CT^{-1}z+Du.\end{aligned}$$

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,

$$\begin{aligned}B_z&=\begin{bmatrix}2&0\\0&1\end{bmatrix}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}2\\1\end{bmatrix},\\C_z&=\begin{bmatrix}1&1\end{bmatrix}\begin{bmatrix}\tfrac12&0\\0&1\end{bmatrix}=\begin{bmatrix}\tfrac12&1\end{bmatrix}.\end{aligned}$$

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)$:

$$\begin{aligned}G(s)&=\frac{1\cdot1}{s+1}+\frac{1\cdot1}{s+2}\\&=\frac{(s+2)+(s+1)}{(s+1)(s+2)}\\&=\frac{2s+3}{(s+1)(s+2)}.\end{aligned}$$

Step 4 — Transformed transfer function. The same formula with $C_z$ and $B_z$ (and the same $A_z=A$):

$$\begin{aligned}G_z(s)&=\frac{\tfrac12\cdot2}{s+1}+\frac{1\cdot1}{s+2}\\&=\frac{1}{s+1}+\frac{1}{s+2}=G(s).\end{aligned}$$

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

$$\begin{aligned}&C_z(sI-A_z)^{-1}B_z\\&\quad=CT^{-1}\,T(sI-A)^{-1}T^{-1}\,TB\\&\quad=C(sI-A)^{-1}B.\end{aligned}$$

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

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

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

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

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

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

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

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

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

Reachability and safety value functions

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

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

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

Model predictive control

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

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

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

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

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

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

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

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

Where this is used

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

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

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

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

Review if needed: this section and quadratic programs.

Show hint
Substitute the dynamics into the objective before differentiating.
Show worked solution

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$:

$$\begin{aligned}g(u)&=u^2+(2+u)^2\\&=u^2+4+4u+u^2\\&=2u^2+4u+4.\end{aligned}$$

Step 2 — Minimise. A differentiable function can only have an unconstrained minimum where its derivative vanishes:

$$g'(u)=4u+4=0\ \Longleftrightarrow\ u_*=-1.$$

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.

$$\begin{aligned}x_1&=2+(-1)=1,\\g(-1)&=(-1)^2+1^2=1+1=2.\end{aligned}$$

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
The final-step calculation gives $V_1(x)=x^2/2$. Use it as the terminal cost of the first minimisation.
Show worked solution

Solve the last decision first. At a state $x$ with one decision left,

$$u^2+(x+u)^2=2u^2+2xu+x^2=2\left(u+\frac x2\right)^2+\frac{x^2}{2}.$$

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:

$$u_0^2+V_1(3+u_0)=u_0^2+\frac{(3+u_0)^2}{2}=\frac32u_0^2+3u_0+\frac92=\frac32(u_0+1)^2+3.$$

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
Drop the executed first action, keep the remainder of the plan, and append one terminal-feedback action.
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

$$(u_1,\ldots,u_{N-1},-x_N).$$

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.

Phase Portraits & Lyapunov Ellipses

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

What to look for.

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

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

From the mathematics to a real decision

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

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

Choose states and units before tuning feedback

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

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

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

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

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

Worked example 1 — Tune a held-input temperature controller

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

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

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

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

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

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

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

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

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

Common wrong approach — Analyse a different clock

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

Worked example 2 — Decide whether a robot can still stop

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

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

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

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

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

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

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

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

Change a physical assumption and rebuild the argument

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

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

Review: discrete linear trajectories; the held temperature controller.

Show hint

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

Show worked solution

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:

$$|x_0|=2,\qquad |x_1|=2q\approx0.6728047,\qquad |x_2|=2q^2\approx0.2263331\quad({}^\circ\mathrm C).$$

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:

$$0.2q_k+0.1\le0.2\ \Longleftrightarrow\ q_k\le0.5\ \Longleftrightarrow\ a-bk\le0.5\ \Longleftrightarrow\ k\ge\frac{a-0.5}{b}.$$

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

$$k\in\left[\frac{e^{-1/4}-0.5}{4(1-e^{-1/4})},\,0.5\right]\quad\text{kW per degree Celsius}.$$

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,

$$1.1(0.2)+\frac{1.1^2}{2(1)}=0.22+0.605=0.825\ \mathrm m\gt0.72\ \mathrm m.$$

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:

$$1.1\tau+0.605\le0.72\ \Longleftrightarrow\ \tau\le\frac{0.115}{1.1}=\frac{23}{220}\ \mathrm s\approx0.10454545\ \mathrm s.$$

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

$$\begin{aligned}x_{k+1}&=ax_k+bv_k,\\a&=e^{-1/4}\approx0.7788007831,\\b&=4(1-a)\approx0.8847968677.\end{aligned}$$

Step 2 — Unclipped prediction. The law $u=1-x$ means $v=u-1=-x$. Substituting:

$$\begin{aligned}x_{k+1}&=ax_k-bx_k=(a-b)x_k,\\a-b&=a-4+4a=5a-4\\&\approx-0.1059960846.\end{aligned}$$

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

$$\begin{aligned}x_1&=a(-2)+b(1)=-2a+4-4a\\&=4-6a\approx-0.6728046984\ {}^\circ\mathrm C.\end{aligned}$$

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$:

$$F(x)=\begin{cases}ax+b,&-2\le x\le-1,\\(a-b)x,&-1\le x\le1,\\ax-b,&1\le x\le2.\end{cases}$$

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$:

$$\begin{aligned}F(-2)&=-2a+b=4-6a\approx-0.67280,\\F(-1)&=-a+b=4-5a\approx0.10600,\\F(1)&=a-b=5a-4\approx-0.10600,\\F(2)&=2a-b=6a-4\approx0.67280.\end{aligned}$$

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.

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

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

Show answer

(a) Equilibria. With $x_1=\theta$ and $x_2=\dot\theta$, the unforced equations are $\dot x_1=x_2$ and $\dot x_2=10\sin x_1-0.1x_2$. Zero rates require $x_2=0$ and $\sin x_1=0$. Thus $(\theta,\dot\theta)=(m\pi,0)$ for every integer $m$: modulo $2\pi$, these are upright $(0,0)$ and hanging $(\pi,0)$.

(b) Linearizations. Differentiating the vector field gives $A(\theta_*)=\begin{bmatrix}0&1\\10\cos\theta_*&-0.1\end{bmatrix}$. At $0$,

$$A_0=\begin{bmatrix}0&1\\10&-0.1\end{bmatrix},\qquad \det(\lambda I-A_0)=\lambda(\lambda+0.1)-10.$$

The roots are $\lambda=(-0.1\pm\sqrt{40.01})/2\approx3.112673,-3.212673$. One positive and one negative mode make a saddle; the positive eigenvalue proves the nonlinear upright equilibrium is unstable.

At $\pi$, $\cos\pi=-1$, so

$$A_\pi=\begin{bmatrix}0&1\\-10&-0.1\end{bmatrix},\qquad \det(\lambda I-A_\pi)=\lambda^2+0.1\lambda+10.$$

The discriminant is $0.01-40=-39.99$, yielding $\lambda=-0.05\pm j\sqrt{39.99}/2\approx-0.05\pm3.161882j$. Both real parts are negative, so the linearization is a stable focus. The smooth nonlinear model is consequently locally exponentially stable near the hanging equilibrium.

(c) Euler versus exact sampling. Deviations from the hanging equilibrium obey the Euler map $\xi_{k+1}=(I+0.1A_\pi)\xi_k$, whose matrix is $\begin{bmatrix}1&0.1\\-1&0.99\end{bmatrix}$. Each eigenvalue becomes $1+0.1\lambda=0.995\pm j\sqrt{39.99}/20$. Hence

$$|1+0.1\lambda|^2=0.995^2+\frac{39.99}{400}=0.990025+0.099975=1.09.$$

Its modulus is $\sqrt{1.09}\approx1.04403\gt1$, so this numerical model has growing oscillations. Exact sampling of the linear flow uses $e^{0.1A_\pi}$, whose eigenvalues are $e^{0.1\lambda}$ with modulus $e^{0.1(-0.05)}=e^{-0.005}\approx0.995012\lt1$. The continuous linear dynamics decay, while this Euler step is unstable. A continuous-time stability result must therefore be checked again for the chosen discrete approximation.

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

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

Show answer

(a) Trace adds the diagonal entries. The determinant subtracts the off-diagonal product:

$$\tau=2-c(K_P+K_I),\qquad \Delta=[1-c(K_P+K_I)](1)-(-cK_I)(1)=1-cK_P.$$

(b) With $K_P=0$, $\Delta=1$ and $\tau=2-cK_I$. The roots of $\lambda^2-\tau\lambda+1=0$ are complex exactly when $\tau^2\lt4$, or $-2\lt2-cK_I\lt2$, equivalently $0\lt cK_I\lt4$. Real matrices have conjugate roots; their product is then $\lambda\bar\lambda=|\lambda|^2=\Delta=1$. They lie on the unit circle and do not decay.

Write $\lambda=e^{\pm j\vartheta}$, so $2\cos\vartheta=\tau$. At $cK_I=1$, $\cos\vartheta=1/2$ and $\vartheta=\pi/3$. The distinct eigenvalues each satisfy $\lambda^6=1$ and no smaller positive power is $1$. The diagonalizable matrix therefore has $M^6=I$, and each nonzero real trajectory repeats after six steps. The boundary values $cK_I=0,4$ have repeated real roots and are outside the complex-root argument.

(c) The $2\times2$ Schur test requires $|\Delta|\lt1$ and $-1-\Delta\lt\tau\lt1+\Delta$. Substitute the actual trace and determinant and rearrange:

$$\begin{aligned}|1-cK_P|\lt1&\ \Longleftrightarrow\ 0\lt cK_P\lt2,\\2-c(K_P+K_I)\lt2-cK_P&\ \Longleftrightarrow\ cK_I\gt0,\\-2+c(K_P+K_I)\lt2-cK_P&\ \Longleftrightarrow\ c(2K_P+K_I)\lt4.\end{aligned}$$

These simultaneous strict inequalities give the exact stability region. Equality would admit a unit-modulus eigenvalue rather than asymptotic decay.

(d) For $c=1$ and $K_P=K_I=0.5$, $\tau=1$ and $\Delta=0.5$. The three checks are $0\lt0.5\lt2$, $0.5\gt0$, and $1.5\lt4$, so the loop is Schur. Solving $\lambda^2-\lambda+0.5=0$ gives $\lambda=0.5\pm0.5j$, modulus $\sqrt{0.5}\approx0.707107$ and angle $\pi/4$. There is a nominal eight-step oscillation cycle, but the full trajectory does not repeat: its envelope shrinks by $\sqrt{0.5}$ per step. The proportional term supplies damping to this integral loop.

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

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

Show answer

(a) Write the symmetric unknown as $P=\begin{bmatrix}p_1&p_2\\p_2&p_3\end{bmatrix}$. Multiplication by the given $A$ yields

$$A^\top P+PA=\begin{bmatrix}-2p_2&p_1-p_2-p_3\\p_1-p_2-p_3&2p_2-2p_3\end{bmatrix}=-I.$$

The upper-left equation gives $p_2=1/2$. The lower-right then gives $1-2p_3=-1$, hence $p_3=1$. The off-diagonal equation gives $p_1=p_2+p_3=3/2$. Thus $P=\begin{bmatrix}3/2&1/2\\1/2&1\end{bmatrix}$. Its first leading minor is $3/2\gt0$, and its determinant is $3/2-1/4=5/4\gt0$, so Sylvester's criterion proves $P\succ0$. As a direct check, $A^\top P=\begin{bmatrix}-1/2&-1\\1&-1/2\end{bmatrix}$, whose sum with its transpose is $-I$. Consequently $\dot V=-\|x\|_2^2$ for this linear system.

(b) For the scalar map $g(x)=x(1/2+x)$ and $V=x^2$,

$$\Delta V=V(g(x))-V(x)=x^2\big[(1/2+x)^2-1\big].$$

At $x=0$ the difference is zero. At nonzero $x$ it is negative exactly when $|1/2+x|\lt1$, or $-3/2\lt x\lt1/2$. A positive sublevel $V\le c$ is $[-\sqrt c,\sqrt c]$, which must have strict decrease at every nonzero point. Its positive endpoint imposes $\sqrt c\lt1/2$, hence $0\lt c\lt1/4$. Each such compact sublevel satisfies the theorem, since $g$ and $V$ are continuous and $g(0)=0$. Their union gives the certified region $(-1/2,1/2)$. At $c=1/4$ the included fixed point $1/2$ prevents strict decrease and convergence.

(c) The full basin is larger. Solving $g(x)=x$ gives fixed points $0,1/2$, and $g(-1)=1/2$. For $-1\lt x\lt1/2$, complete the square and factor relative to the upper endpoint:

$$g(x)=(x+1/4)^2-1/16\ge-1/16,\qquad g(x)-1/2=(x+1)(x-1/2)\lt0.$$

Thus after one step $y=g(x_0)$ lies in $[-1/16,1/2)$, with $r=|y|\lt1/2$. Whenever $|x_t|\le r$, $|g(x_t)|\le|x_t|(1/2+r)$, where $1/2+r\lt1$. Induction preserves this bound and gives geometric convergence to zero. This proves attraction for every $x_0\in(-1,1/2)$.

The boundary starts $x_0=-1$ and $x_0=1/2$ settle at the nonzero fixed point. If $x_0\gt1/2$, then $g(x)-x=x(x-1/2)\gt0$ throughout that region, so the iterates increase. A finite limit would have to be a fixed point greater than $1/2$, which does not exist; they diverge. If $x_0\lt-1$, the same factorization gives $g(x_0)\gt1/2$, reducing to that divergent case. Hence the true region of attraction is exactly $(-1,1/2)$. The symmetric sublevels of $x^2$ certify a conservative subset of this asymmetric basin.

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

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

Show answer

(a) Shift by the comparison equilibrium: $z=v-1/2$ satisfies $\dot z\le-2z$ and $z(0)=5/2$. The integrating factor gives $(e^{2t}z)'\le0$, hence

$$v(t)\le\frac12+\frac52e^{-2t}.$$

This is also the solution of the equality comparison equation $\dot w=-2w+1$, whose right-hand side is globally Lipschitz.

(b) Along $\dot x=u$, $\dot h=-u$. The CBF inequality is $-u+2(1-x)\ge0$, so $K_{\rm cbf}(x)=\{u:u\le2(1-x)\}$. Projecting a desired input onto this half-line gives $u=\min\{u_{\rm nom},2(1-x)\}$. At $x=0$ the cap is $2$, so $u=1$ passes unchanged. At $x=0.8$ the cap is $0.4$, so the filtered command is $0.4$.

(c) Starting at $x_0=0$, the desired speed $1$ is allowed while $2(1-x)\ge1$, equivalently $x\le1/2$. Then $\dot x=1$ gives $x(t)=t$, reaching the switch at $t=1/2$. After that the active cap gives $\dot x=2(1-x)$; its distance to the wall solves $\dot h=-2h$ with $h(1/2)=1/2$. Therefore

$$x(t)=\begin{cases}t,&0\le t\le1/2,\\1-\tfrac12e^{-2(t-1/2)},&t\ge1/2,\end{cases}\qquad h(x(t))=\begin{cases}1-t,&0\le t\le1/2,\\\tfrac12e^{-2(t-1/2)},&t\ge1/2.\end{cases}$$

To verify the requested lower bound, on the first interval set $d(t)=1-t-e^{-2t}$. Its second derivative is $-4e^{-2t}\lt0$, so it is concave; its endpoint values are $d(0)=0$ and $d(1/2)=1/2-e^{-1}\gt0$. It lies above the nonnegative chord between those endpoints. Thus $1-t\ge e^{-2t}$. On the second interval, $h=(e/2)e^{-2t}\ge e^{-2t}$ because $e/2\gt1$. Since $h(x_0)=1$, both pieces establish $h(x(t))\ge h(x_0)e^{-2t}\gt0$ for finite time. The controller approaches the wall without crossing it.

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

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

Show answer

(a) LQR and gain margin. With $a=1.2$ and $b=q=r=1$, the scalar DARE is $p=1+1.44p-1.44p^2/(1+p)$. The nonnegative stabilizing solution has $1+p\gt0$. Multiplying through gives

$$p+p^2=(1+p)+1.44p(1+p)-1.44p^2=1+2.44p,\qquad p^2-1.44p-1=0.$$

The positive root is $p=[1.44+\sqrt{1.44^2+4}]/2\approx1.952233744$. It gives $K=1.2p/(1+p)\approx0.793528120$ and closed-loop pole $1.2-K\approx0.406471880$, inside the unit disk. The negative root is incompatible with a nonnegative quadratic value for this positive cost. The plant is controllable and its positive state penalty detects the unstable mode, satisfying the LQR assumptions.

Scaling the input gain to $u=-\kappa Kx$ changes the pole to $1.2-\kappa K$. As $K\gt0$, discrete-time stability requires

$$-1\lt1.2-\kappa K\lt1\ \Longleftrightarrow\ 0.2\lt\kappa K\lt2.2\ \Longleftrightarrow\ \frac{0.2}{K}\lt\kappa\lt\frac{2.2}{K}.$$

The exact endpoints are approximately $0.252038957$ and $2.772428531$. The interval is open: its endpoints give poles $1$ and $-1$. Use the exact expressions to state the margin; rounded decimals are estimates. Because the open-loop plant is unstable, a sufficiently small positive feedback scale also fails to stabilize it.

(b) P and PI steady states. P-only feedback gives $x_{t+1}=0.8x_t+0.5(1-x_t)+0.5=0.3x_t+1$. The coefficient $0.3$ is Schur. Its equilibrium solves $x_*=0.3x_*+1$, giving $x_*=10/7$ and tracking error $1-x_*=-3/7$.

Use the page's PI timing: $e_t=1-x_t$, $I_t=I_{t-1}+e_t$ and $u_t=0.5e_t+0.2I_t=0.7e_t+0.2I_{t-1}$. Substitution into the plant and integrator yields

$$\begin{bmatrix}x_{t+1}\\I_t\end{bmatrix}=\begin{bmatrix}0.1&0.2\\-1&1\end{bmatrix}\begin{bmatrix}x_t\\I_{t-1}\end{bmatrix}+\begin{bmatrix}1.2\\1\end{bmatrix}.$$

Deviations from its equilibrium follow this matrix. Its trace is $1.1$ and determinant is $0.1+0.2=0.3$, so the characteristic polynomial is $\lambda^2-1.1\lambda+0.3=(\lambda-0.6)(\lambda-0.5)$. Both eigenvalues are inside the unit disk, proving convergence.

At equilibrium the integrator satisfies $I_t=I_{t-1}$, forcing $e_*=0$ and $x_*=1$. The plant balance is $1=0.8+u_*+0.5$, so $u_*=-0.3$. Since P contributes zero at zero error, $0.2I_*=-0.3$, giving $I_*=-1.5$. Integral action supplies the steady input needed to cancel the constant disturbance, with convergence separately verified.

Exercise D.6 — One system, four gains

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

Show answer

(a) With a unit impulse $w_0=1$ and later inputs zero, the zero initial state gives $x_1=1$, $x_2=0.8$, and so on. There is no direct feedthrough, so

$$h_0=0,\qquad h_k=0.6(0.8)^{k-1}\ (k\ge1),\qquad H(z)=\sum_{k=1}^{\infty}0.6(0.8)^{k-1}z^{-k}=\frac{0.6}{z-0.8}.$$

The geometric transform converges for $|z|\gt0.8$, including the unit circle, and the pole $0.8$ is stable.

(b) The impulse response is nonnegative. Summing its magnitudes gives $\|h\|_1=0.6/(1-0.8)=3$, which is the induced peak gain: convolution gives $|z_t|\le3\|w\|_\infty$, and a constant unit input has outputs tending to $3$.

For the energy gain, $|e^{j\omega}-0.8|^2=(\cos\omega-0.8)^2+\sin^2\omega=1.64-1.6\cos\omega$. This denominator is smallest at $\cos\omega=1$, where its square root is $0.2$. Therefore $\|H\|_\infty=0.6/0.2=3$, the zero-state induced $\ell_2$ gain by the stable-LTI theorem.

The impulse-response energy instead gives

$$\|H\|_2^2=\sum_{k=1}^{\infty}0.36(0.64)^{k-1}=\frac{0.36}{1-0.64}=1,\qquad \|H\|_2=1.$$

The controllability Gramian solves $W_c-0.64W_c=1$, hence $W_c=1/0.36=25/9$. Its output-energy formula gives $C^2W_c+D^2=(9/25)(25/9)=1$, exactly the same squared $\mathcal H_2$ norm. The displayed norms concern signals, not the norm of one state.

(c) The nonnegative storage $V=1.8x^2$ has zero initial value. Expand its difference against the gain-$3$ supply:

$$\begin{aligned}V(0.8x+w)-V(x)-9w^2+z^2&=1.8(0.64x^2+1.6xw+w^2)-1.8x^2-9w^2+0.36x^2\\&=-0.288x^2+2.88xw-7.2w^2\\&=-0.288(x-5w)^2\le0.\end{aligned}$$

Thus $V(x_{t+1})-V(x_t)\le9w_t^2-z_t^2$ at every step. Summing from $0$ to $T$ telescopes the storage terms:

$$\sum_{t=0}^{T}z_t^2\le9\sum_{t=0}^{T}w_t^2+V(x_0)-V(x_{T+1})\le9\sum_{t=0}^{T}w_t^2.$$

Taking square roots proves gain at most $3$ on every finite horizon. It equals the exact $\mathcal H_\infty$ norm from (b), so this storage certificate is tight.

Exercise D.7 — Small gain versus the circle criterion

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

Show answer

(a) Since $\tanh0=0$ and $|\tanh v|\le|v|$, the memoryless map $\phi(v)=\kappa\tanh v$ has signal gain at most $\kappa$ and is globally Lipschitz. Exercise D.6 gives stable linear-block gain $3$. The feedback has no algebraic feedthrough, so it is well posed. Small gain certifies $3\kappa\lt1$, namely $0\lt\kappa\lt1/3$. Equality supplies no strict small-gain certificate.

(b) Tanh has the sign of its argument and magnitude at most that argument's magnitude, so $\phi$ lies in sector $[0,\kappa]$. Apply the stated negative-feedback circle criterion to the stable transfer $H(z)=0.6/(z-0.8)$. The one-state realization has nonzero input and output coefficients, so it is controllable and observable. Rationalizing the denominator on the unit circle gives

$$\operatorname{Re}H(e^{j\omega})=\frac{0.6(\cos\omega-0.8)}{1.64-1.6\cos\omega}.$$

Set $r=\cos\omega\in[-1,1]$. The denominator is positive, and differentiation gives

$$\frac{d}{dr}\frac{0.6(r-0.8)}{1.64-1.6r}=\frac{0.6[1.64-1.6r+1.6(r-0.8)]}{(1.64-1.6r)^2}=\frac{0.216}{(1.64-1.6r)^2}\gt0.$$

The minimum is therefore at $r=-1$ ($\omega=\pi$), where it equals $0.6(-1.8)/3.24=-1/3$. Consequently the frequency margin is $\min_\omega[1+\kappa\operatorname{Re}H]=1-\kappa/3$. It is strictly positive exactly for $0\lt\kappa\lt3$. For such $\kappa$ choose $\varepsilon=1-\kappa/3$ in the theorem; it certifies the sector loop, including this tanh feedback. At $\kappa=3$ that margin is zero.

(c) For the constant law $\phi(v)=kv$, substitution gives $w=-0.6kx$ and $x_{t+1}=(0.8-0.6k)x_t$. Stability requires

$$-1\lt0.8-0.6k\lt1\ \Longleftrightarrow\ -\frac13\lt k\lt3.$$

For nonnegative sector gains, every constant $k\in[0,\kappa]$ is stable precisely when $\kappa\lt3$, matching the circle certificate here. Checking constants alone is not a general nonlinear stability theorem; the circle criterion uses the sector inequality itself. Small gain ignores the helpful negative-feedback sign and certifies only $\kappa\lt1/3$, one ninth of this positive range. Failure of a sufficient test is not a proof of instability.

Exercise D.8 — A viability kernel and a tube

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

Show answer

(a) Starting with $X^0=K=[-1,1]$, suppose the current interval is $[-c,c]$. The possible next states from $x$ form $[1.5x-0.3,1.5x+0.3]$. This interval meets $[-c,c]$ exactly when $|1.5x|\le c+0.3$, so

$$\operatorname{Pre}([-c,c])=\left[-\frac{c+0.3}{1.5},\frac{c+0.3}{1.5}\right],\qquad c_{k+1}=\min\left\{c_k,\frac{c_k+0.3}{1.5}\right\}.$$

The fixed radius is $c=0.6$. Since $c_0=1\gt0.6$, the predecessor radius is smaller than $c_k$ but remains above $0.6$, so that branch is selected at every finite iteration. Subtracting the fixed radius gives $c_{k+1}-0.6=(2/3)(c_k-0.6)$, hence

$$c_k=0.6+0.4(2/3)^k:\quad1,\ 0.8666667,\ 0.7777778,\ 0.7185185,\ 0.6790123,\ldots\to0.6.$$

Every controlled invariant subset of $K$ must be contained in each backward feasible set, hence in their intersection $[-0.6,0.6]$. Conversely, on that interval $u=-0.5x$ has magnitude at most $0.3$ and gives next state $1.5x-0.5x=x$. This proves controlled invariance and establishes the full viability kernel $[-0.6,0.6]$.

(b) Write the true and nominal states as $x_t=z_t+e_t$ and use $u_t=v_t+Ke_t$. Subtracting the nominal recursion $z_{t+1}=z_t+v_t$ from the true one gives $e_{t+1}=(1+K)e_t+w_t=0.4e_t+w_t$. With zero initial error and disturbance interval $W=[-0.2,0.2]$, the sum of scaled intervals has radius

$$r=0.2\sum_{j=0}^{\infty}0.4^j=\frac{0.2}{1-0.4}=\frac13,\qquad E=[-1/3,1/3].$$

It is robustly invariant: if $|e_t|\le1/3$, then $|e_{t+1}|\le0.4/3+0.2=1/3$. The same proof also permits any $e_0\in E$. The state constraint needs room for every error, giving $z_t\in X\ominus E=[-2+1/3,2-1/3]=[-5/3,5/3]$.

Since multiplying the symmetric error interval by $K=-0.6$ gives $KE=[-0.2,0.2]$, the nominal input constraint is $v_t\in U\ominus KE=[-0.8,0.8]$. These tightened bounds imply $|x_t|\le5/3+1/3=2$ and $|u_t|\le0.8+0.2=1$ for every admitted disturbance sequence. They concern a feasible nominal plan and the stated uniform disturbance bound; the tube alone does not construct that plan.

Further Reading

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

Flashcards