Systems.Continuous — the general continuous-time system #
The most general continuous-time system the library considers,
ContinuousSystem E U Y—ẋ = F(t, x, u),y = h(t, x, u), witht ∈ ℝ,
with state space E, input space U and output space Y. The linear systems of
LinearSystems.Continuous are special cases. Its discrete-time counterpart is
DiscreteSystem in Systems.Discrete, which carries the same API under the same names.
Special cases #
Each special case is a constructor building the general object from the special data, together with a predicate recognising it inside a general system and a lemma relating the two:
- Time invariance —
tis dropped:timeInvariant f hbuildsF(t, x, u) = f(x, u), andIsTimeInvariantsaysFandhdo not depend on time. - Autonomy —
uis dropped:autonomous f hbuilds a system with input spaceUnit, andIsAutonomoussaysFandhdo not depend on the input.
The two combine: timeInvariant applied to input-free data gives ẋ = f(x).
"Autonomous" here means without input, the control-theory convention. Much of the dynamical-systems literature, including Khalil, uses it for time-invariant instead.
Trajectories #
A trajectory is a solution in the sense of Carathéodory. IsTrajectoryOn s u x I says that
for every segment [a, b] ⊆ I, τ ↦ F(τ, x(τ), u(τ)) is integrable on it and
x(b) - x(a) = ∫ₐᵇ F(τ, x(τ), u(τ)) dτ. It needs E complete but not x differentiable, so it
admits the solutions produced by piecewise-constant, sampled-data, bang-bang and merely measurable
inputs, which have corners where the input jumps. A trajectory is continuous on an interval and
has derivative F(t, x(t), u(t)) almost everywhere.
The classical notion is Mathlib's IsIntegralCurveOn x (s.vectorField u) I. A classical
solution along which the field is integrable on every segment of I is a trajectory
(isTrajectoryOn_of_isIntegralCurveOn), and on an interval a trajectory along which the field is
continuous is classical (IsTrajectoryOn.isIntegralCurveOn). On an interval the two notions
therefore agree when the field is continuous along x (isTrajectoryOn_iff_isIntegralCurveOn),
in particular when it is jointly continuous
(isTrajectoryOn_iff_isIntegralCurveOn_of_continuous). On a segment, a trajectory is exactly an
integral solution (isTrajectoryOn_Icc_iff_isIntegralSolution), so the integral-form tools of
Analysis.IntegralCurves and ODEs.ODE_properties (re-anchoring, time reflection, Grönwall) apply
to trajectories with no continuity assumption. Neither notion handles discontinuity in the
state, such as discontinuous feedback, which needs Filippov solutions.
A trajectory is absolutely continuous on the segments of its set
(IsTrajectoryOn.absolutelyContinuousOnInterval), and a function V(t, x) has derivative
s.lieDerivative V t (x t) (u t) along it at almost every time at which V is differentiable
(IsTrajectoryOn.ae_hasDerivAt_lieDerivative). The Lyapunov arguments built on this, for V
locally Lipschitz near the graph of the trajectory — integrated bound, monotonicity, level bound,
exponential decay — are IsTrajectoryOn.sub_le_integral_of_lieDerivative_le and its neighbours;
IsTrajectoryOn.sub_le_integral_of_fderiv_le and IsTrajectoryOn.antitoneOn_of_fderiv_nonpos are
the forms for a time-invariant V(x).
Why separate continuous- and discrete-time objects #
The same reasons as for ContinuousLTV and DiscreteLTV: the data is the same
shape, but its reading is not. A continuous trajectory is an integral curve and needs a normed
space; a discrete one is a recursion and needs nothing. A change of coordinates picks up a
time-derivative term in continuous time and none in discrete time. Separate files also keep the
analysis imports out of discrete-time developments, and leave room for further classes, such as
hybrid systems, as files of their own.
Conventions #
- The structure carries no typeclasses: structure on
E,U,Ygoes on the operations that need it. - The API lives in the namespace
ContinuousSystem, so dot notation resolves.
A continuous-time system: the data (F, h) of
ẋ(t) = F(t, x(t), u(t)), y(t) = h(t, x(t), u(t))
with states in E, inputs in U and outputs in Y. The structure is only the data.
Instances For
The time-invariant system ẋ = f(x, u), y = g(x, u).
Instances For
A system built by timeInvariant is time-invariant.
A time-invariant system is built by timeInvariant.
The autonomous (input-free) system ẋ = f(t, x), y = g(t, x), with input space Unit.
Equations
Instances For
The system is autonomous: its equations do not depend on the input.
Equations
Instances For
A system built by autonomous is autonomous.
An autonomous system is input-free data in disguise: its equations are those of some f and
g that do not take an input. It equals autonomous f g only up to the input space, which is
U rather than Unit.
Semantics #
The right-hand side of the state equation under the input signal u,
(t, x) ↦ F(t, x, u(t)): a time-dependent vector field on the state space, the shape the ODE
machinery consumes.
Equations
- s.vectorField u t x = s.F t x (u t)
Instances For
x is a trajectory of s under the input u on the set I: on every segment [a, b] ⊆ I,
the map τ ↦ F(τ, x(τ), u(τ)) is integrable and
x(b) - x(a) = ∫ₐᵇ F(τ, x(τ), u(τ)) dτ. This is the Carathéodory notion of solution.
It does not ask x to be differentiable, so it admits the solutions produced by discontinuous
inputs (piecewise-constant, sampled-data, bang-bang, or merely measurable and bounded), which have
corners where the input jumps. A trajectory is continuous on an interval
(IsTrajectoryOn.continuousOn) and has derivative F(t, x(t), u(t)) at almost every time
(IsTrajectoryOn.ae_hasDerivAt). When τ ↦ F(τ, x(τ), u(τ)) is continuous it is exactly a
classical solution, Mathlib's IsIntegralCurveOn (isTrajectoryOn_iff_isIntegralCurveOn).
Stated on a set rather than on all of ℝ, because a map can satisfy the equation on an interval
without being defined for all time. Only segments inside I are used, so the predicate depends
only on x on I: on an interval it links every two of its times, and on a set with gaps it says
that x is a trajectory on each piece separately, with no relation across a gap. The output is
s.outputMap u t (x t); it is not part of this predicate, because the output equation constrains
nothing about x.
Integrability is part of the definition, and E is complete: without completeness the Bochner
integral is 0 by convention, and the definition would silently say that x is constant.
Equations
- One or more equations did not get rendered due to their size.
Instances For
x is a trajectory of s under the input u for all time.
Equations
- s.IsTrajectory u x = s.IsTrajectoryOn u x Set.univ
Instances For
A trajectory on I is one on every subset of I.
On a set with at most one point every map is a trajectory: the equation only relates a time to
itself. In particular every map is a trajectory on [t, t].
On a segment, a trajectory is an integral solution, anchored at its own initial value:
the equation between any two times is the equation from the left end, re-anchored. No continuity
is needed, so the integral-form tools of Analysis.IntegralCurves (re-anchoring, time reflection,
continuous dependence) apply to trajectories directly.
A trajectory is continuous on an interval.
A trajectory has derivative F(t, x(t), u(t)) at almost every time of the interior of its
set. This is the sense in which a trajectory solves ẋ = F(t, x, u).
Trajectories are absolutely continuous on every segment of the set on which they are trajectories.
Trajectories are determined by their values on I: a map agreeing on I with a trajectory on
I is one.
A trajectory only sees the field along itself: if the field of s' under u' agrees with the
field of s under u along x on I, a trajectory of s under u on I is one of s' under
u'. The two systems may have different input and output spaces.
Gluing. Trajectories on [a, b] and on [b, c] make one on [a, c].
A trajectory on [t₀, ∞) is one on every segment [t₀, t], and conversely.
Time invariance. If the state equation does not depend on time, shifting a trajectory and
its input in time gives a trajectory on the shifted set. This holds in particular for a
time-invariant system (IsTimeInvariant), whose output equation is constrained as well.
Change of coordinates. An affine map x ↦ c + e x, with e linear and continuous, that
carries the field of s under u to the field of s' under u' carries the trajectories of s
to trajectories of s'.
An equilibrium is a constant trajectory: if F(t, p, u(t)) = 0 for all t, the constant
map at p is a trajectory on every set.
Bounded speed: along a trajectory whose field is bounded by B on [a, b], the state moves
at most B (b - a) between a and b.
Classical solutions #
Classical solutions are trajectories: an integral curve of
(t, x) ↦ F(t, x, u(t)) along which the field is integrable is a trajectory. Integrability holds
in particular when the field is continuous along x (isTrajectoryOn_iff_isIntegralCurveOn).
Trajectories with a continuous field are classical solutions: on an interval, if
τ ↦ F(τ, x(τ), u(τ)) is continuous, a trajectory is differentiable within the interval with
ẋ(t) = F(t, x(t), u(t)).
On an interval, trajectories and classical solutions agree when τ ↦ F(τ, x(τ), u(τ)) is
continuous there.
The interval may be closed, open, half-open, a ray, all of ℝ, or a single point.
Order-connectedness is what the proof needs: the integral form only sees segments inside I,
while the derivative form looks near each point, and on a set containing no segment, such as the
rationals, the integral form says nothing and the derivative form does not.
For a continuous field, trajectories on an interval are the classical solutions: if
(t, x) ↦ F(t, x, u(t)) is jointly continuous, the field is continuous along every trajectory and
along every classical solution, so isTrajectoryOn_iff_isIntegralCurveOn needs no hypothesis on
x.
The derivative of a function along the system #
The derivative of V(t, x) along the system at the input value u,
∂V/∂t + ∂V/∂x · F(t, x, u): the rate of change of V along a trajectory through x at time
t while the input takes the value u. It is the Lie derivative (_root_.lieDerivative) of
V along the field F(·, ·, u), so the lemmas of Analysis.LieDerivative apply to it
directly: where the field is continuous along it, a trajectory is an integral curve of
s.vectorField (IsTrajectoryOn.isIntegralCurveOn). Input-free notions such as
Lyapunov stability use u = (); input-to-state notions use a general u.
Equations
- s.lieDerivative V t x u = lieDerivative V (fun (t : ℝ) (x : E) => s.F t x u) t x
Instances For
Functions along trajectories #
A trajectory is absolutely continuous, so a function V(t, x) that is locally Lipschitz on a set
containing its graph is absolutely continuous along it, with derivative the derivative along the
system s.lieDerivative V t (x t) (u t) at almost every time where V is differentiable. The
consequences below are the Lyapunov arguments along trajectories: an almost-everywhere
bound on the derivative along the system integrates to a bound on the increment of V, to
monotonicity, to a level bound and to exponential decay. They hold with no continuity of the
field in time, so they cover discontinuous and merely measurable inputs.
Chain rule along a trajectory: at almost every time of the interior of I at which V
is differentiable along the trajectory, t ↦ V(t, x(t)) has derivative
s.lieDerivative V t (x t) (u t).
Derivative along a trajectory: on a segment, at almost every time at which V is
differentiable along the trajectory, the derivative of t ↦ V(t, x(t)) is
s.lieDerivative V t (x t) (u t). The form of the chain rule that the bounds below consume.
A function V(t, x) locally Lipschitz on a set containing the graph of a trajectory on
[a, b] is absolutely continuous along it.
Integrated Lyapunov inequality along a trajectory. If the derivative along the system is
at most h t at almost every time of (a, b), then V increases by at most ∫ₐᵇ h.
Nonpositive derivative along a trajectory: if the derivative along the system is
nonpositive at almost every time of (a, b), then V does not increase along the trajectory on
[a, b].
Level form: if the derivative along the system is nonpositive at almost every time of
(a, b) at which V exceeds the level η, then V never exceeds max (V a (x a)) η along the
trajectory on [a, b].
Exponential decay along a trajectory: if the derivative along the system is at most
-c V at almost every time of (a, b), then V(t, x(t)) ≤ V(a, x(a)) e^{-c(t - a)} on
[a, b]. With c < 0 this is a growth bound.
Integrated Lyapunov inequality, time-invariant form. For V : E → ℝ locally Lipschitz on
a set containing the trajectory, a bound DV(x(t)) F(t, x(t), u(t)) ≤ h t at almost every time of
(a, b) integrates to V(x(b)) - V(x(a)) ≤ ∫ₐᵇ h.
Nonpositive derivative along a trajectory, time-invariant form. For V : E → ℝ locally
Lipschitz on a set containing the trajectory, if DV(x(t)) F(t, x(t), u(t)) ≤ 0 at almost every
time of (a, b), then V does not increase along the trajectory on [a, b].
Well-posedness #
Solutions here are trajectories in the sense of Carathéodory (IsTrajectoryOn), so existence,
uniqueness and completeness are statements about absolutely continuous solutions, classical or
not.
Every solution segment starting at time t₀ in the set S extends to a solution on
[t₀, ∞): such solutions do not escape in finite time.
Forward completeness is kept apart from the notions that need it. Statements about limits as
t → ∞ quantify over solutions on [t₀, ∞), and without it a solution that escapes in finite
time would be silently left out of them.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every solution segment, from any initial time and state, extends to a solution on
[t₀, ∞).
Equations
- s.IsForwardComplete u = ∀ (t₀ : ℝ), s.IsForwardCompleteOn u t₀ Set.univ
Instances For
Solutions are unique forward in time: two solution segments on [t₀, t₁] that agree at
t₀ agree on the whole segment.
Kept apart from the stability notions, which quantify over every solution and so need no uniqueness: theorems that use it assume it. Uniqueness is among all trajectories, classical or not: for a continuous field, a classical solution is then unique among all trajectories.
Equations
- s.HasUniqueSolutions u = ∀ (t₀ t₁ : ℝ) (x y : ℝ → E), s.IsTrajectoryOn u x (Set.Icc t₀ t₁) → s.IsTrajectoryOn u y (Set.Icc t₀ t₁) → x t₀ = y t₀ → Set.EqOn x y (Set.Icc t₀ t₁)
Instances For
Grönwall separation of trajectories. If x ↦ F(t, x, u(t)) is K-Lipschitz for every
t ∈ (t₀, t₁), two trajectories on [t₀, t₁] separate at most exponentially:
‖x(t) - y(t)‖ ≤ ‖x(t₀) - y(t₀)‖ e^{K(t - t₀)}. No regularity in time is assumed.
Reference: Khalil, Nonlinear Systems (3rd ed.), continuous dependence on initial conditions, in the unperturbed case.
Lipschitz right-hand sides have unique solutions. If x ↦ F(t, x, u(t)) is
K-Lipschitz for every t, solutions are unique forward in time. No regularity in time is
assumed.
Globally Lipschitz systems are forward complete. If (t, x) ↦ F(t, x, u(t)) is
continuous and K-Lipschitz in x uniformly in t, every trajectory segment extends to
[t₀, ∞).
Global Lipschitz is what rules out escape in finite time here; a local Lipschitz condition
alone does not (ẋ = x²).
Exponential bounds on the distance of a trajectory to a point: if
‖F(t, x(t), u(t))‖ ≤ L ‖x(t) - x_c‖ at almost every time of a trajectory on [t₀, t₁], then
‖x(t₀) - x_c‖ e^{-L(t - t₀)} ≤ ‖x(t) - x_c‖ ≤ ‖x(t₀) - x_c‖ e^{L(t - t₀)} there. For a field
L-Lipschitz in the state with an equilibrium at x_c, the hypothesis holds everywhere.
The bound is only needed along the trajectory, and the state space is any Banach space.
Reference: Khalil, Nonlinear Systems (3rd ed.), the exercise on exponential bounds for the solutions of a system with a Lipschitz right-hand side.
The state transition map #
The existence interval of the trajectory from x₀ at time t₀: the times t ≥ t₀ up to
which a trajectory from x₀ exists, that is, the maximal interval of existence [t₀, T).
Equations
Instances For
The state transition map φ(t; t₀, x₀): the value at t of a trajectory from x₀ at
time t₀ that exists up to t, and x₀ outside the existence interval (before t₀, or past a
finite escape time).
It is meant for systems with unique solutions (HasUniqueSolutions), which the results about its
trajectories assume. Without uniqueness the trajectory is chosen separately for each t, so
t ↦ φ(t; t₀, x₀) may splice different solutions and need not be a trajectory; there the honest
object is the set of solutions from x₀, which is how the stability definitions are stated.
Equations
- s.stateTransitionMap u t t₀ x₀ = if h : t ∈ s.existenceInterval u t₀ x₀ then ⋯.choose t else x₀
Instances For
The initial time is in the existence interval: a trajectory on [t₀, t₀] is trivial.
The existence interval is an interval: with t, it contains every time between t₀ and
t.
φ(t₀; t₀, x₀) = x₀.
Forward completeness means global existence: if every trajectory extends to [t₀, ∞),
the existence interval is all of [t₀, ∞).
Every trajectory is given by the state transition map: with unique solutions, a
trajectory on [t₀, t₁] is t ↦ φ(t; t₀, x(t₀)) there.
The state transition map is a trajectory: with unique solutions,
t ↦ φ(t; t₀, x₀) is a trajectory on the existence interval.
With forward completeness and unique solutions, t ↦ φ(t; t₀, x₀) is a trajectory on
[t₀, ∞).
For a continuous field, the state transition map is a classical solution: with forward
completeness, unique solutions and (t, x) ↦ F(t, x, u(t)) jointly continuous,
t ↦ φ(t; t₀, x₀) is differentiable within [t₀, ∞) with derivative
F(t, φ(t; t₀, x₀), u(t)).
The semigroup property: φ(t; τ, φ(τ; t₀, x₀)) = φ(t; t₀, x₀) for t₀ ≤ τ ≤ t in the
existence interval. The state transition matrix satisfies the linear case,
Φ(t, τ) Φ(τ, t₀) = Φ(t, t₀).
An equilibrium stays put: if F(t, x_eq, u(t)) = 0 for all t, then
φ(t; t₀, x_eq) = x_eq for t ≥ t₀.
Solutions separate at most exponentially in the initial state: for a field L-Lipschitz
in the state, uniformly in time, ‖φ(t; t₀, x₀) - φ(t; t₀, y₀)‖ ≤ ‖x₀ - y₀‖ e^{L(t - t₀)}.
Reference: Khalil, Nonlinear Systems (3rd ed.), continuous dependence on initial conditions, without perturbation.
Solutions depend Lipschitz-continuously on the initial time and state: for a field
L-Lipschitz in the state and bounded by B, the solutions from (t₀, x₀) and (t₀', x₀'),
compared after the same elapsed time σ, differ by at most (2B + 1) e^{Lσ} times the distance
between the initial data. Run the earlier one to the later initial time (speed B), then apply
dist_stateTransitionMap_le.
Reference: Khalil, Nonlinear Systems (3rd ed.), continuous dependence on initial conditions and parameters.
Invariance #
S is forward invariant (positively invariant) under the input u: every trajectory
segment that starts in S stays in S for as long as it is defined. This is for the one input
signal u; robust and controlled invariance quantify over u.
Stated on segments [t₀, t₁] and for every initial time, so it constrains solutions that escape
in finite time up to their escape, and it makes sense for time-varying systems.
Equations
- s.IsForwardInvariant u S = ∀ (t₀ t₁ : ℝ) (x : ℝ → E), s.IsTrajectoryOn u x (Set.Icc t₀ t₁) → x t₀ ∈ S → ∀ t ∈ Set.Icc t₀ t₁, x t ∈ S
Instances For
Holding the input constant #
The system with its input held at u₀: the autonomous system ẋ = F(t, x, u₀),
y = h(t, x, u₀). With u₀ = 0 this is the unforced system (zeroInput); a general u₀ is
the operating point of a system whose equilibrium is not at the zero input.
Equations
- s.constInput u₀ = ContinuousSystem.autonomous (fun (t : ℝ) (x : E) => s.F t x u₀) fun (t : ℝ) (x : E) => s.h t x u₀
Instances For
The system with its input held constant is autonomous.
The trajectories of the system with its input held at u₀ are those of the system under the
constant input u₀.
The unforced system: the input held at 0 (constInput), as an autonomous system
ẋ = F(t, x, 0), y = h(t, x, 0). Stability of a system with input is stability of this system;
input–output notions such as input-to-state stability are stated on the system itself.
Equations
- s.zeroInput = s.constInput 0
Instances For
The unforced system is autonomous.
The trajectories of the unforced system are those of the system under the zero input.
Cascades #
The cascade of s₁, driven by the state of s₂, with s₂, driven by the external input:
ẋ₁ = F₁(t, x₁, x₂), ẋ₂ = F₂(t, x₂, w), with output (h₁(t, x₁, x₂), h₂(t, x₂, w)). With
W = Unit this is the cascade of s₁ with an autonomous system.
Equations
Instances For
A trajectory of the cascade is a pair of trajectories: of s₁ under the input x₂, and of
s₂ under the external input.