Search

Search papers and lessons

Switched Linear System

Level 4 · 9 min read

A switched linear system jumps between several linear rules over time, and each rule can be stable on its own while the switching sequence still makes the state blow up.

On this page

  • Colour = topic mix
  • Probability
  • Calculus
  • Linear algebra
  • Control systems
  • Discrete math
  • Sign in to see your progress

TL;DR

A switched linear system is a set of linear rules, xk+1=Aixk\mathbf{x}_{k+1} = \mathbf{A}_i \mathbf{x}_k for i=1,…,Ni = 1, \dots, N, together with a rule that says which one is active at each time. The state follows whichever matrix is active. A single linear system is stable when its matrix has all eigenvalues inside the unit circle. Two stable systems can still combine into an unstable one, because the order in which they are switched matters.

Where you'll see it: in power converters that turn switches on and off, in vehicles that change gear or drive mode, in networks whose communication links change over time, and in any controller that uses a different linear gain in each operating region.

Intuition

Same rule, different rules

Think of a car whose suspension has two settings, soft and firm. Each setting alone is a perfectly good linear spring-and-damper model. The car is a switched system because the driver, or a sensor, changes the setting over time. The question engineers ask is: whatever the sequence of settings, does the car settle down after a bump, or can the switching pump energy into the motion?

Switching is a different kind of thing from a single linear system. A single linear system's behaviour is fixed by one matrix, and its eigenvalues tell you everything about long-run growth or decay. With switching, there is no single matrix that tells the story. The state is pushed by one rule, then another, and the total effect depends on the whole sequence.

Why the order matters

Consider two rules that each shrink the state. Apply rule 1 then rule 2 and the state shrinks. Apply rule 2 then rule 1 and it also shrinks. But a clever choice of which rule runs when can stretch the state in directions the individual rules were not stretching. Each matrix here is non-normal: it shears the state, which can stretch it for a moment even though its eigenvalues are small. Alternating two shears in different directions makes that stretching accumulate instead of dying out. This is why switched systems are harder than the sum of their parts, and why the eigenvalues of each matrix alone do not settle stability.

The math

Definition

Definition: Switched linear system

Let A1,…,AN\mathbf{A}_1, \dots, \mathbf{A}_N be n×nn \times n matrices, and let σ(k)∈{1,…,N}\sigma(k) \in \{1, \dots, N\} be a switching signal that picks the active mode at each step. The discrete-time switched linear system is

xk+1=Aσ(k) xk.\mathbf{x}_{k+1} = \mathbf{A}_{\sigma(k)}\,\mathbf{x}_k.

Here xk∈Rn\mathbf{x}_k \in \mathbb{R}^n is the state at step kk. The continuous-time version is x˙(t)=Aσ(t)x(t)\dot{\mathbf{x}}(t) = \mathbf{A}_{\sigma(t)}\mathbf{x}(t).

If σ\sigma is constant, this reduces to a single linear system xk+1=Axk\mathbf{x}_{k+1} = \mathbf{A}\mathbf{x}_k. The switching signal is either chosen by a designer (a controller), imposed by the environment, or unknown. A stability guarantee has to hold for the switching signals you allow, so the first decision is which family to cover. Two common choices are arbitrary switching (any sequence) and switching under a dwell-time constraint (each mode stays active for at least some minimum time).

Stability for every switching sequence

We want the state to go to zero whatever σ\sigma does. Under arbitrary switching, the cleanest sufficient test is a common Lyapunov function: a single function VV that decreases along every mode.

For the discrete system, choose a quadratic V(x)=x⊤PxV(\mathbf{x}) = \mathbf{x}^\top \mathbf{P}\mathbf{x} with P\mathbf{P} symmetric and positive definite. Then

V(xk+1)=xk⊤Ai⊤PAi xk,i=σ(k).V(\mathbf{x}_{k+1}) = \mathbf{x}_k^\top \mathbf{A}_{i}^\top \mathbf{P}\mathbf{A}_{i}\,\mathbf{x}_k, \qquad i = \sigma(k).

If Ai⊤PAi−P≺0\mathbf{A}_i^\top \mathbf{P}\mathbf{A}_i - \mathbf{P} \prec 0 for every ii, then VV decreases at every step under any switching, and the state goes to zero. The conditions on P\mathbf{P} are linear matrix inequalities, which convex solvers handle well.

The simplest special case is P=I\mathbf{P} = \mathbf{I}. Then the test is that every mode has spectral norm less than one, ∥Ai∥2<1\|\mathbf{A}_i\|_2 \lt 1, because ∥Aix∥22≤λmax⁡(Ai⊤Ai) ∥x∥22\|\mathbf{A}_i\mathbf{x}\|_2^2 \le \lambda_{\max}(\mathbf{A}_i^\top\mathbf{A}_i)\,\|\mathbf{x}\|_2^2.

Why eigenvalues of each mode are not enough

Each mode can have all eigenvalues inside the unit circle and the switched system can still diverge. The example below shows it.

Worked examples

Example
Two stable modes that together blow up

Take

A1=(0.5200.5),A2=(0.5020.5).\mathbf{A}_1 = \begin{pmatrix} 0.5 & 2 \\ 0 & 0.5 \end{pmatrix}, \qquad \mathbf{A}_2 = \begin{pmatrix} 0.5 & 0 \\ 2 & 0.5 \end{pmatrix}.
  1. Each mode is triangular, so its eigenvalues are its diagonal entries: 0.50.5 and 0.50.5. Both modes are stable on their own.
  2. Switch alternately, A1\mathbf{A}_1 then A2\mathbf{A}_2, and look at two steps at once. The two-step matrix is M=A2A1=(0.25114.25).\mathbf{M} = \mathbf{A}_2\mathbf{A}_1 = \begin{pmatrix} 0.25 & 1 \\ 1 & 4.25 \end{pmatrix}. The entry (2,2)(2,2) is 2×2+0.5×0.5=4.252 \times 2 + 0.5 \times 0.5 = 4.25.
  3. The eigenvalues of M\mathbf{M} satisfy λ2−4.5λ+0.0625=0\lambda^2 - 4.5\lambda + 0.0625 = 0, since the trace is 4.54.5 and the determinant is 0.25×4.25−1=0.06250.25 \times 4.25 - 1 = 0.0625.
  4. The roots are λ=(4.5±20)/2\lambda = (4.5 \pm \sqrt{20})/2. The larger root is (4.5+4.4721)/2≈4.486(4.5 + 4.4721)/2 \approx 4.486.
  5. Since 4.486>14.486 \gt 1, the state grows by about 4.4864.486 every two steps under this switching sequence, although each mode alone has spectral radius 0.50.5 and its state decays to zero in the long run (like 0.5k0.5^k up to a small polynomial factor, after a possible short-lived bump from the off-diagonal term).
  6. Interpretation: the switching sequence pumps energy in a direction that neither mode alone can. Stability of each mode is not a stability guarantee for the switched system.
0123456020406080100number of steps ksize of the state
  • growth envelope under alternating switching
  • each mode alone, per step
Alternating the two stable modes grows the state about 4.49 times every two steps, while each mode alone decays at a rate of about one half per step in the long run. The curves show rates, not exact trajectories.
Example
A common quadratic Lyapunov function that works

Take two stable modes that do not cause trouble together:

A1=(0.50.200.5),A2=(0.500.20.5).\mathbf{A}_1 = \begin{pmatrix} 0.5 & 0.2 \\ 0 & 0.5 \end{pmatrix}, \qquad \mathbf{A}_2 = \begin{pmatrix} 0.5 & 0 \\ 0.2 & 0.5 \end{pmatrix}.
  1. Try P=I\mathbf{P} = \mathbf{I}, so V(x)=∥x∥22V(\mathbf{x}) = \|\mathbf{x}\|_2^2. We need the largest eigenvalue of Ai⊤Ai\mathbf{A}_i^\top\mathbf{A}_i for each mode.
  2. For A1\mathbf{A}_1: A1⊤A1=(0.250.10.10.29)\mathbf{A}_1^\top\mathbf{A}_1 = \begin{pmatrix} 0.25 & 0.1 \\ 0.1 & 0.29 \end{pmatrix}. Its trace is 0.540.54 and its determinant is 0.0725−0.01=0.06250.0725 - 0.01 = 0.0625. The largest root is 0.54+0.04162≈0.54+0.2042≈0.372\frac{0.54 + \sqrt{0.0416}}{2} \approx \frac{0.54 + 0.204}{2} \approx 0.372.
  3. For A2\mathbf{A}_2: A2⊤A2=(0.290.10.10.25)\mathbf{A}_2^\top\mathbf{A}_2 = \begin{pmatrix} 0.29 & 0.1 \\ 0.1 & 0.25 \end{pmatrix}. It has the same eigenvalues, so the largest is again 0.3720.372.
  4. Therefore, for any switching sequence, ∥xk+1∥22≤0.372 ∥xk∥22\|\mathbf{x}_{k+1}\|_2^2 \le 0.372\,\|\mathbf{x}_k\|_2^2.
  5. After kk steps, ∥xk∥2≤(0.372)k/2 ∥x0∥2≈0.61k ∥x0∥2\|\mathbf{x}_k\|_2 \le (0.372)^{k/2}\,\|\mathbf{x}_0\|_2 \approx 0.61^k\,\|\mathbf{x}_0\|_2, whatever the order of switching.
  6. Interpretation: this is a certificate, not a simulation. It holds for every switching sequence, so the designer does not need to know the future switch times.

Compare with the earlier example: the same test with P=I\mathbf{P} = \mathbf{I} would fail there, because A1⊤A1\mathbf{A}_1^\top\mathbf{A}_1 has largest eigenvalue about 4.494.49. The test is conservative: it can fail for a switched system that is in fact stable, so a failed test is inconclusive.

Tradeoffs and failure modes

Switched systems are useful, and their guarantees depend on what you assume about the switching.

SituationProblemBetter choice
Switching can be arbitrary and fastEach mode stable, but the switched system may divergeCommon Lyapunov function, checked as a linear matrix inequality
No common Lyapunov function existsQuadratic certificate fails even when the system is stableMultiple Lyapunov functions, one per mode, with a rule for when to switch
Modes stay active for a known minimum timeArbitrary-switching test is too pessimisticDwell-time analysis, which allows stability with slow switching
Switching is chosen by a designerYou can avoid bad sequences by designChoose the switching rule to keep one Lyapunov function decreasing
Only a simulation is availableA few simulated sequences give false confidenceUse a worst-case certificate, or test many sequences including adversarial ones

Practical warnings:

  • Stable modes are necessary, not sufficient. The example above is the standard reason this topic exists.
  • Quadratic certificates are conservative. A failed test does not prove instability.
  • Switching is often the hazard. Fast switching can excite modes that slow switching would never reach, so simulate the transitions as well as the modes.

History

Switched and hybrid systems grew from several fields at once: relay and sliding-mode control, power electronics, and automata-based models of computer control. Early work on stability under switching asked when a family of stable linear systems stays stable under arbitrary switching, and the common Lyapunov function became the central tool for the question. In the late 1990s, Michael Branicky and others introduced multiple Lyapunov functions, which allow one function per mode and a rule for changing between them. Daniel Liberzon's 2003 book organised the theory into the form most control courses now use.

The field matters because switching is everywhere in practice. Converters, gearboxes and mode-dependent controllers all switch, and the simple intuition that stable parts make a stable whole is wrong for them. The example with two stable triangular matrices is the classic demonstration of why the subject needs its own theory.

Check yourself

QuestionEach of two matrices has all eigenvalues inside the unit circle. Does that guarantee the switched system xk+1=Aσ(k)xk\mathbf{x}_{k+1} = \mathbf{A}_{\sigma(k)}\mathbf{x}_k is stable for every switching sequence? Explain with the example.Show answer

No. The example has two modes with eigenvalues 0.50.5, but alternating them gives a two-step matrix with eigenvalue about 4.4864.486, so the state grows under that switching sequence. Stability of each mode alone does not imply stability of the switched system.

QuestionFor A1=(0.5200.5)\mathbf{A}_1 = \begin{pmatrix} 0.5 & 2 \\ 0 & 0.5 \end{pmatrix} and A2=(0.5020.5)\mathbf{A}_2 = \begin{pmatrix} 0.5 & 0 \\ 2 & 0.5 \end{pmatrix}, compute the trace and determinant of A2A1\mathbf{A}_2\mathbf{A}_1.Show answer

A2A1=(0.25114.25)\mathbf{A}_2\mathbf{A}_1 = \begin{pmatrix} 0.25 & 1 \\ 1 & 4.25 \end{pmatrix}, so the trace is 0.25+4.25=4.50.25 + 4.25 = 4.5 and the determinant is 0.25×4.25−1×1=0.06250.25 \times 4.25 - 1 \times 1 = 0.0625.

QuestionWhy does the test ∥Ai∥2<1\|\mathbf{A}_i\|_2 \lt 1 for every mode guarantee stability under arbitrary switching?Show answer

With P=I\mathbf{P} = \mathbf{I}, ∥xk+1∥2=∥Aσ(k)xk∥2≤∥Aσ(k)∥2∥xk∥2≤ρ ∥xk∥2\|\mathbf{x}_{k+1}\|_2 = \|\mathbf{A}_{\sigma(k)}\mathbf{x}_k\|_2 \le \|\mathbf{A}_{\sigma(k)}\|_2 \|\mathbf{x}_k\|_2 \le \rho\,\|\mathbf{x}_k\|_2 with ρ=max⁡i∥Ai∥2<1\rho = \max_i \|\mathbf{A}_i\|_2 \lt 1. Whatever mode is active, the length of the state shrinks by at least the factor ρ\rho each step, so the length goes to zero. The argument uses only the bound, not the order of switching.

QuestionA converter has two modes, each stable, and the controller switches between them every few microseconds. A colleague says the switched system is stable because both modes are. What would you check before agreeing?Show answer

Check whether the two modes share a common Lyapunov function, for example with the quadratic test and a linear matrix inequality solver, or check the switching rule's dwell time against what the test needs. Also simulate the switching transitions, since fast switching can excite behaviour that each mode alone never shows. Stability of each mode is necessary, not sufficient.

Sources