Documentation

CslibFrontier.Foundations.Analysis.ODE.TransferFunction

Transfer functions of LTI systems #

For an LTISystem ẋ = A x + B u, y = C x + D u with real matrices, the transfer function is the complex matrix-valued function H s = C (s I - A)⁻¹ B + D (LTISystem.transferFunction), with A, B, C, D read over ℂ. It is defined algebraically, without the Laplace transform; the inverse is Matrix.inv, which is a genuine inverse exactly when s I - A is invertible, i.e. when s is not an eigenvalue of A (spectrum.notMem_iff), equivalently not a root of the characteristic polynomial (Matrix.isUnit_smul_one_sub_map_iff). At an eigenvalue Lean's junk value (s I - A)⁻¹ = 0 gives H s = D.

The converse fails: a pole of (s I - A)⁻¹ can cancel in C (s I - A)⁻¹ B, so H can be holomorphic on re s ≥ 0 although A has an unstable eigenvalue (a hidden mode); the tests check such an example. Internal stability is a property of A, not of H.

Main definitions #

Main results #

s I - A is invertible over ℂ iff s is not a root of the characteristic polynomial of the real matrix A.

noncomputable def LTISystem.transferFunction {n : Type u_1} {m : Type u_2} {p : Type u_3} [Fintype n] [DecidableEq n] (S : LTISystem n m p) (s : ℂ) :

The transfer function H s = C (s I - A)⁻¹ B + D of an LTI system, a complex p × m matrix for each s : ℂ, with the real system matrices read over ℂ. The inverse is a genuine inverse when s is not an eigenvalue of A; at an eigenvalue it is 0 and H s = D.

theorem LTISystem.differentiableAt_transferFunction {n : Type u_1} {m : Type u_2} {p : Type u_3} [Fintype n] [DecidableEq n] (S : LTISystem n m p) {s : ℂ} (hs : s ∉ spectrum ℂ (S.A.map ⇑(algebraMap ℝ ℂ))) (i : p) (j : m) :
DifferentiableAt ℂ (fun (z : ℂ) => S.transferFunction z i j) s

The transfer function is holomorphic off the spectrum. Every entry of H s = C (s I - A)⁻¹ B + D is complex differentiable at every s that is not an eigenvalue of A.

theorem LTISystem.differentiableOn_transferFunction_of_norm_le {n : Type u_1} {m : Type u_2} {p : Type u_3} [Fintype n] [DecidableEq n] (S : LTISystem n m p) {M α : ℝ} (h : ∀ (x : ℝ → EuclideanSpace ℝ n), (Matrix.toEuclideanCLM S.A).IsTrajectoryOn x (Set.Ici 0) → ∀ t ≥ 0, ‖x t‖ ≤ M * Real.exp (-(α * t)) * ‖x 0‖) (i : p) (j : m) :
DifferentiableOn ℂ (fun (s : ℂ) => S.transferFunction s i j) {s : ℂ | -α < s.re}

Holomorphy on a half-plane from a decay rate. If every trajectory of ẋ = A x on [0, ∞) satisfies ‖x t‖ ≤ M exp (-α t) ‖x 0‖ in the Euclidean norm, every entry of the transfer function is holomorphic on the open half-plane re s > -α.

theorem LTISystem.differentiableOn_transferFunction_of_isExponentiallyStable {n : Type u_1} {m : Type u_2} {p : Type u_3} [Fintype n] [DecidableEq n] (S : LTISystem n m p) (hA : (Matrix.toEuclideanCLM S.A).IsExponentiallyStable) :
∃ α > 0, ∀ (i : p) (j : m), DifferentiableOn ℂ (fun (s : ℂ) => S.transferFunction s i j) {s : ℂ | -α < s.re}

Stable systems have transfer functions holomorphic on the closed right half-plane. If ẋ = A x is exponentially stable in the Euclidean norm, for instance by Cslib.LinearAlgebra.LyapunovCert.isExponentiallyStable_of_check, then there is α > 0 such that every entry of the transfer function is holomorphic on re s > -α, an open half-plane containing re s ≥ 0.