Advanced maths

Common quadratic Lyapunov certificate calculator for switched linear systems

Search for and exactly verify one rational quadratic Lyapunov function decreasing under every entered continuous-time mode.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Search for and exactly verify one rational quadratic Lyapunov function decreasing under every entered continuous-time mode.

THE FORMULAP ≻ 0; A_iᵀP + P A_i ≺ 0 for every mode i; trace(P)=1

A worked example

For A1=diag(−1,−2), A2=diag(−2,−1), take P=I/2. The two Lyapunov matrices are diag(−1,−2) and diag(−2,−1), so the same positive quadratic form decreases in either mode.

Good to know

Two to four rational2x2 continuous-time modes. Normalize trace(P)=1 and conduct bounded numerical convex spectral-margin search; rationalize the candidate P and verify its positivity and every negative Lyapunov matrix by exact rational2x2 principal-minor inequalities. Return a rigorous rational certificate only when all strict inequalities pass. Otherwise unresolved, never a claim that switching is unstable or no common P exists. Candidate verification can also be offered on the same page.

One function for every switching mode

A mode matrix describes the continuous-time equation x prime equals A times x while that mode is active. A common quadratic Lyapunov function uses the same positive-definite P for every supplied matrix. Its value x transpose P x must decrease along every nonzero trajectory segment, regardless of which allowed mode is currently selected.

This is stronger than checking that each matrix is stable in isolation. Switching among individually stable systems can behave differently from holding one mode forever. Conversely, failure to find a common quadratic function does not prove that a switched system is unstable, because a different Lyapunov function or a constrained switching rule may still establish stability.

Common quadratic Lyapunov certificate for switched linear systemsP = I / 2−Q1 = diag(1,2)−Q2 = diag(2,1)
Scroll across to see the full diagram.
For A1=diag(−1,−2), A2=diag(−2,−1), take P=I/2. The two Lyapunov matrices are diag(−1,−2) and diag(−2,−1), so the same positive quadratic form decreases in either mode.

Compare this with the Joint spectral radius bounds calculator for switching matrix products. Search for one positive-definite quadratic function decreasing for every supplied continuous-time mode. Existing JSR page computes finite products and norm bounds for discrete matrices and supplies no common Lyapunov function.

Reading the strict matrix inequalities

Positive definiteness of P makes the quadratic function positive away from the origin. Along mode i, its derivative is x transpose times the symmetric matrix A_i transpose P plus P A_i times x. Requiring that symmetric matrix to be strictly negative definite supplies a decrease in every nonzero direction.

The trace normalization removes the unimportant positive scaling of P. If P is a certificate, any positive multiple is also a certificate before normalization. This page searches on a trace-one slice so the numerical margin has a consistent scale. A matrix that is only semidefinite does not satisfy the strict certificate and must not be accepted by rounding a zero eigenvalue to a small signed number.

Search and proof are separate stages

The bounded numerical search proposes a small symmetric matrix that appears to satisfy the inequalities. That proposal is then rationalized, and the final verification uses the exact supplied rational mode matrices and rational candidate P. For a symmetric two-by-two matrix, signs of the leading principal minor and determinant establish strict positive definiteness exactly.

Apply that test to P and to the negatives of all Lyapunov matrices. Only the rational candidate that passes these checks is a certificate. A favorable numerical eigenvalue plot or an optimizer success flag alone is insufficient. Rationalization can spoil a narrow margin, so verification failure should remain unresolved or trigger another candidate search rather than inherit the numerical proposal’s status.

The two diagonal modes example

The default matrices have negative diagonal entries and no cross-coupling. With P equal to half the identity, the first Lyapunov matrix is diag(−1,−2), while the second is diag(−2,−1). Negating either gives positive leading entry and determinant two. P itself has leading entry one half and determinant one quarter.

All quantities are exact rationals, so no tolerance is needed to distinguish their signs. Both modes decrease the same circular quadratic level sets. The example therefore illustrates the full chain from candidate choice to rigorous algebraic verification, rather than relying on separate stability tests that happen to pass for each diagonal matrix.

Interpreting a successful certificate

Strict inequalities for a finite set of continuous-time matrices imply decrease under arbitrary switching among those modes under the usual solution assumptions. The level sets of the shared quadratic form give a common geometric picture. A state moving under either vector field crosses these level sets inward, rather than requiring a new energy function at each switch.

The certificate concerns the homogeneous linear dynamics that were entered. It does not include a disturbance input, switching delays, actuator saturation or resets unless those effects are explicitly modeled. In particular, do not convert the result into an arbitrary input-to-state or performance bound by reading a single eigenvalue margin without a corresponding derivation.

What an unresolved search means

A capped search can fail because its numerical iterations stall, the candidate is ill-conditioned, rationalization loses a strict margin, or a suitable common quadratic function is absent. These possibilities cannot all be distinguished by one failed proposal. The output must therefore separate a verified certificate from an unresolved search.

Supplying a candidate P directly is useful when another method has already suggested one. The same exact verifier can assess it without pretending to reproduce the original search. Reject nonsymmetric candidates and unsupported dimensions explicitly; symmetrizing or changing a user’s matrix without disclosure would alter the statement being certified.

Comparing with product-growth bounds

Joint spectral radius bounds study products of discrete transition matrices. They are not the same input model as continuous-time mode generators. Converting a generator to a transition matrix also introduces a sampling duration and switching assumptions. A common quadratic certificate here should not be described as a general exact joint spectral radius computation.

Use the displayed rational P, Lyapunov matrices and principal-minor signs as the primary evidence. Numerical plots help explain the geometry, but the algebra supplies the certificate. This distinction is especially valuable near a marginal case, where an attractive inward-arrow drawing could conceal the zero derivative that invalidates a strict decrease claim.

A few questions, answered

Does each stable mode imply stable switching?

No. Separate mode stability does not automatically establish arbitrary-switching stability.

Does search failure prove instability?

No. It means this bounded procedure did not produce a verified common quadratic certificate.

Why rationalize the candidate?

Exact rational principal-minor checks can rigorously verify the final two-dimensional certificate.

Is this a discrete-time test?

No. The inequalities are for continuous-time mode generators.

Find your calculator

Start typing to explore the library.