Overview of System Types

Using the @system Macro

A convenient way to create a new system is with the @system macro. For example, the ODE $x'(t) = -2x(t)$ is simply x' = -2x, where $x'(t) := dx/dt$ is the derivative of state $x(t)$ with respect to "time":

using MathematicalSystems

@system(x' = -2x)
LinearContinuousSystem{Float64, IdentityMultiple{Float64}}([-2.0;;])

We can also add state constraints, say $x(t) ≥ 0.5$,

using LazySets

H = HalfSpace([-1.0], -0.5) # x >= 0.5
@system(x' = -2x, x ∈ H)
ConstrainedLinearContinuousSystem{Float64, IdentityMultiple{Float64}, LazySets.HalfSpaceModule.HalfSpace{Float64, Vector{Float64}}}([-2.0;;], LazySets.HalfSpaceModule.HalfSpace{Float64, Vector{Float64}}([-1.0], -0.5))

Systems of ODEs can be defined using vector notation:

A = [1.0 0.0; -1.0 -2.0]
B = Ball2(zeros(2), 1.0)
c = [0.0, 5.0]
@system(z' = A*z + c, z ∈ B)
ConstrainedAffineContinuousSystem{Float64, Matrix{Float64}, Vector{Float64}, LazySets.Ball2Module.Ball2{Float64, Vector{Float64}}}([1.0 0.0; -1.0 -2.0], [0.0, 5.0], LazySets.Ball2Module.Ball2{Float64, Vector{Float64}}([0.0, 0.0], 1.0))

which defines the two-dimensional system $x' = y$, $y' = -x - 2y + 3$, with state constraints $z ∈ B = \{ \sqrt{x^2 + y^2} \leq 5\}$.

Initial-value problems can be specified with the @ivp macro. For instance, we can attach an initial condition $z(0) = (0.2, 0.2])$ to the previous example:

S0 = Singleton([0.2, 0.2])
@ivp(z' = A*z + c, z ∈ B, z(0) ∈ S0)
InitialValueProblem{ConstrainedAffineContinuousSystem{Float64, Matrix{Float64}, Vector{Float64}, LazySets.Ball2Module.Ball2{Float64, Vector{Float64}}}, LazySets.SingletonModule.Singleton{Float64, Vector{Float64}}}(ConstrainedAffineContinuousSystem{Float64, Matrix{Float64}, Vector{Float64}, LazySets.Ball2Module.Ball2{Float64, Vector{Float64}}}([1.0 0.0; -1.0 -2.0], [0.0, 5.0], LazySets.Ball2Module.Ball2{Float64, Vector{Float64}}([0.0, 0.0], 1.0)), LazySets.SingletonModule.Singleton{Float64, Vector{Float64}}([0.2, 0.2]))

Inputs

In the examples introduced so far, the macro has automatically created different system types given a defining equation, either in scalar or in vector form, and state constraints. It is possible to define systems with additive input terms or noise terms, with constraints on the state, inputs or combinations of these. Other specific classes of systems such as descriptor, polynomial or general nonlinear systems given by a standard Julia function are available as well (see the tables below).

Some applications require distinguishing between controlled inputs and uncontrolled or noise inputs. In this library we make such distinction by noting field names with $u$ and $w$ for (controlled) inputs and noise respectively. Please note that some systems are structurally equivalent, for example CLCCS and NCLCS being $x' = Ax + Bu$ and $x' = Ax + Dw$ respectively; the difference lies in the resulting value of getter functions such as inputset and noiseset.

Summary Tables

The following table summarizes the different system types in abbreviated form. The abbreviated names are included here only for reference and are not exported. See the Types section of this manual, or simply click on the system's name for details on each type.

Please note that for each continuous system there is a corresponding discrete system, e.g. there is ConstrainedAffineContinuousSystem and ConstrainedAffineDiscreteSystem, etc. However in this table we only included continuous system types for brevity.

AbbreviationSystem type
CISContinuousIdentitySystem
CCISConstrainedContinuousIdentitySystem
LCSLinearContinuousSystem
ACSAffineContinuousSystem
LCCSLinearControlContinuousSystem
ACCSAffineControlContinuousSystem
CLCSConstrainedLinearContinuousSystem
CACSConstrainedAffineContinuousSystem
CACCSConstrainedAffineControlContinuousSystem
CLCCSConstrainedLinearControlContinuousSystem
LACSLinearDescriptorContinuousSystem
CLACSConstrainedLinearDescriptorContinuousSystem
PCSPolynomialContinuousSystem
CPCSPolynomialContinuousSystem
BBCSBlackBoxContinuousSystem
CBBCSConstrainedBlackBoxContinuousSystem
BBCCSBlackBoxControlContinuousSystem
CBBCCSConstrainedBlackBoxControlContinuousSystem
NLCSNoisyLinearContinuousSystem
NCLCSNoisyConstrainedLinearContinuousSystem
NLCCSNoisyLinearControlContinuousSystem
NCLCCSNoisyConstrainedLinearControlContinuousSystem
NACCSNoisyAffineControlContinuousSystem
NCALCCSNoisyConstrainedAffineControlContinuousSystem
NBBCCSNoisyBlackBoxControlContinuousSystem
NCBBCCSNoisyConstrainedBlackBoxControlContinuousSystem
SOLCSSecondOrderLinearContinuousSystem
SOACSSecondOrderAffineContinuousSystem
SOCACCSSecondOrderConstrainedAffineControlContinuousSystem
SOCLCCSSecondOrderConstrainedLinearControlContinuousSystem

The following table summarizes the equation represented by each system type (the names are given in abbreviated form). Again, discrete systems are not included. The column Input constraints is yes if the structure can model input or noise constraints (or both).

EquationState constraintsInput constraintsSystem type (abbr.)
$x' = 0$nonoCIS
$x' = 0, x ∈ X$yesnoCCIS
$x' = Ax$nonoLCS
$x' = Ax + c$nonoACS
$x' = Ax + Bu$nonoLCCS
$x' = Ax + Bu + c$nonoACCS
$x' = Ax, x ∈ X$yesnoCLCS
$x' = Ax + c, x ∈ X$yesnoCACS
$x' = Ax + Bu + c, x ∈ X, u ∈ U$yesyesCACCS
$x' = Ax + Bu, x ∈ X, u ∈ U$yesyesCLCCS
$Ex' = Ax$nonoLACS
$Ex' = Ax, x ∈ X$yesnoCLACS
$x' = p(x)$nonoPCS
$x' = p(x), x ∈ X$yesnoCPCS
$x' = f(x)$nonoBBCS
$x' = f(x), x ∈ X$yesnoCBBCS
$x' = f(x, u)$nonoBBCCS
$x' = f(x, u), x ∈ X, u ∈ U$yesyesCBBCCS
$x' = Ax + Dw$nonoNLCS
$x' = Ax + Dw, x ∈ X, w ∈ W$yesyesNCLCS
$x' = Ax + Bu + Dw$nonoNLCCS
$x' = Ax + Bu + Dw, x ∈ X, u ∈ U, w ∈ W$yesyesNCLCCS
$x' = Ax + Bu + c + Dw$nonoNACCS
$x' = Ax + Bu + c + Dw, x ∈ X, u ∈ U, w ∈ W$yesyesNCALCCS
$x' = f(x, u, w)$nonoNBBCCS
$x' = f(x, u, w), x ∈ X, u ∈ U, w ∈ W$yesyesNCBBCCS
$Mx'' + Cx' + Kx = 0$nonoSOLCS
$Mx'' + Cx' + Kx = b$nonoSOACS
$Mx'' + Cx' + Kx = Bu + d, x ∈ X, u ∈ U$yesyesSOCACCS
$Mx'' + Cx' + Kx = Bu, x ∈ X, u ∈ U$yesyesSOCLCCS
$Mx'' + Cx' + f_i(x) = f_e$nonoSOCS
$Mx'' + Cx' + f_i(x) = f_e$, x ∈ X, u ∈ U``yesyesSOCCS