Types
This section describes systems types implemented in MathematicalSystems.jl.
Abstract Systems
MathematicalSystems.AbstractSystem — Type
AbstractSystemAbstract supertype for all system types.
MathematicalSystems.AbstractContinuousSystem — Type
AbstractContinuousSystemAbstract supertype for all continuous system types.
MathematicalSystems.AbstractDiscreteSystem — Type
AbstractDiscreteSystemAbstract supertype for all discrete system types.
Continuous Systems
MathematicalSystems.ContinuousIdentitySystem — Type
ContinuousIdentitySystem <: AbstractContinuousSystemTrivial identity continuous-time system of the form:
\[ x(t)' = 0 \; \forall t.\]
Fields
statedim– number of state variables
MathematicalSystems.ConstrainedContinuousIdentitySystem — Type
ConstrainedContinuousIdentitySystem <: AbstractContinuousSystemTrivial identity continuous-time system with domain constraints of the form:
\[ x(t)' = 0, \; x(t) ∈ \mathcal{X} \; \forall t.\]
Fields
statedim– number of state variablesX– state constraints
MathematicalSystems.LinearContinuousSystem — Type
LinearContinuousSystemContinuous-time linear system of the form:
\[ x(t)' = A x(t) \; \forall t.\]
Fields
A– state matrix
MathematicalSystems.AffineContinuousSystem — Type
AffineContinuousSystemContinuous-time affine system of the form:
\[ x(t)' = A x(t) + c \; \forall t.\]
Fields
A– state matrixc– affine term
MathematicalSystems.LinearControlContinuousSystem — Type
LinearControlContinuousSystemContinuous-time linear control system of the form:
\[ x(t)' = A x(t) + B u(t) \; \forall t.\]
Fields
A– state matrixB– input matrix
MathematicalSystems.AffineControlContinuousSystem — Type
AffineControlContinuousSystemContinuous-time affine control system of the form:
\[ x(t)' = A x(t) + B u(t) + c, \; \forall t.\]
Fields
A– state matrixB– input matrixc– affine term
MathematicalSystems.ConstrainedLinearContinuousSystem — Type
ConstrainedLinearContinuousSystemContinuous-time linear system with domain constraints of the form:
\[ x(t)' = A x(t), \; x(t) ∈ \mathcal{X} \; \forall t.\]
Fields
A– state matrixX– state constraints
MathematicalSystems.ConstrainedAffineContinuousSystem — Type
ConstrainedAffineContinuousSystemContinuous-time affine system with domain constraints of the form:
\[ x(t)' = A x(t) + c, \; x(t) ∈ \mathcal{X} \; \forall t.\]
Fields
A– state matrixc– affine termX– state constraints
MathematicalSystems.ConstrainedAffineControlContinuousSystem — Type
ConstrainedAffineControlContinuousSystemContinuous-time affine control system with domain constraints of the form:
\[ x(t)' = A x(t) + B u(t) + c, \; x(t) ∈ \mathcal{X}, \; u(t) ∈ \mathcal{U} \; \forall t.\]
Fields
A– state matrixB– input matrixc– affine termX– state constraintsU– input constraints
MathematicalSystems.ConstrainedLinearControlContinuousSystem — Type
ConstrainedLinearControlContinuousSystemContinuous-time linear control system with domain constraints of the form:
\[ x(t)' = A x(t) + B u(t), \; x(t) ∈ \mathcal{X}, \; u(t) ∈ \mathcal{U} \; \forall t.\]
Fields
A– state matrixB– input matrixX– state constraintsU– input constraints
MathematicalSystems.LinearDescriptorContinuousSystem — Type
LinearDescriptorContinuousSystemContinuous-time linear descriptor system of the form:
\[ E x(t)' = A x(t) \; \forall t.\]
Fields
A– state matrixE– matrix, same size asA
MathematicalSystems.ConstrainedLinearDescriptorContinuousSystem — Type
ConstrainedLinearDescriptorContinuousSystemContinuous-time linear system with domain constraints of the form:
\[ E x(t)' = A x(t), \; x(t) ∈ \mathcal{X} \; \forall t.\]
Fields
A– state matrixE– matrix, same size asAX– state constraints
MathematicalSystems.PolynomialContinuousSystem — Type
PolynomialContinuousSystemContinuous-time polynomial system of the form:
\[ x(t)' = p(x(t)) \; \forall t.\]
Fields
p– polynomial vector fieldstatedim– number of state variables
MathematicalSystems.ConstrainedPolynomialContinuousSystem — Type
ConstrainedPolynomialContinuousSystemContinuous-time polynomial system with domain constraints:
\[ x(t)' = p(x(t)), \; x(t) ∈ \mathcal{X} \; \forall t.\]
Fields
p– polynomial vector fieldX– constraint setstatedim– number of state variables
MathematicalSystems.BlackBoxContinuousSystem — Type
BlackBoxContinuousSystem <: AbstractContinuousSystemContinuous-time system defined by a right-hand side of the form:
\[ x(t)' = f(x(t)) \; \forall t.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variables
MathematicalSystems.ConstrainedBlackBoxContinuousSystem — Type
ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystemContinuous-time system defined by a right-hand side with domain constraints of the form:
\[ x(t)' = f(x(t)), \; x(t) ∈ \mathcal{X} \; \forall t.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variablesX– state constraints
MathematicalSystems.BlackBoxControlContinuousSystem — Type
BlackBoxControlContinuousSystem <: AbstractContinuousSystemContinuous-time control system defined by a right-hand side of the form:
\[ x(t)' = f(x(t), u(t)) \; \forall t.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variablesinputdim– number of input variables
MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem — Type
ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystemContinuous-time control system defined by a right-hand side with domain constraints of the form:
\[ x(t)' = f(x(t), u(t)), \; x(t) ∈ \mathcal{X}, \; u(t) ∈ \mathcal{U} \; \forall t.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variablesinputdim– number of input variablesX– state constraintsU– input constraints
MathematicalSystems.NoisyLinearContinuousSystem — Type
NoisyLinearContinuousSystemContinuous-time linear system with additive disturbance of the form:
\[ x(t)' = A x(t) + D w(t) \; \forall t.\]
Fields
A– state matrixD– noise matrix
MathematicalSystems.NoisyConstrainedLinearContinuousSystem — Type
NoisyConstrainedLinearContinuousSystemContinuous-time linear system with additive disturbance and domain constraints of the form:
\[ x(t)' = A x(t) + D w(t), \; x(t) ∈ \mathcal{X}, \; w(t) ∈ \mathcal{W} \; \forall t.\]
Fields
A– state matrixD– noise matrixX– state constraintsW– disturbance set
MathematicalSystems.NoisyLinearControlContinuousSystem — Type
NoisyLinearControlContinuousSystemContinuous-time linear control system with additive disturbance of the form:
\[ x(t)' = A x(t) + B u(t) + D w(t) \; \forall t.\]
Fields
A– state matrixB– input matrixD– noise matrix
MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem — Type
NoisyConstrainedLinearControlContinuousSystemContinuous-time linear control system with additive disturbance and domain constraints of the form:
\[ x(t)' = A x(t) + B u(t) + D w(t), \; x(t) ∈ \mathcal{X}, \; u(t) ∈ \mathcal{U}, \; w(t) ∈ \mathcal{W} \; \forall t.\]
Fields
A– state matrixB– input matrixD– noise matrixX– state constraintsU– input constraintsW– disturbance set
MathematicalSystems.NoisyAffineControlContinuousSystem — Type
NoisyAffineControlContinuousSystemContinuous-time affine control system with additive disturbance of the form:
\[ x(t)' = A x(t) + B u(t) + c + D w(t) \; \forall t.\]
Fields
A– state matrixB– input matrixc– affine termD– noise matrix
MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem — Type
NoisyConstrainedAffineControlContinuousSystemContinuous-time affine control system with additive disturbance and domain constraints of the form:
\[ x(t)' = A x(t) + B u(t) + c + D w(t), \; x(t) ∈ \mathcal{X}, \; u(t) ∈ \mathcal{U}, \; w(t) ∈ \mathcal{W} \; \forall t.\]
Fields
A– state matrixB– input matrixc– affine termD– noise matrixX– state constraintsU– input constraintsW– disturbance set
MathematicalSystems.NoisyBlackBoxControlContinuousSystem — Type
NoisyBlackBoxControlContinuousSystem <: AbstractContinuousSystemContinuous-time disturbance-affected control system defined by a right-hand side of the form:
\[ x(t)' = f(x(t), u(t), w(t)) \; \forall t.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variablesinputdim– number of input variablesnoisedim– number of noise variables
MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem — Type
NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystemContinuous-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:
\[ x(t)' = f(x(t), u(t), w(t)), \quad x(t) ∈ \mathcal{X}, \quad u(t) ∈ \mathcal{U}, \quad w(t) ∈ \mathcal{W} \quad \forall t.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variablesinputdim– number of input variablesnoisedim– number of noise variablesX– state constraintsU– input constraintsW– disturbance set
MathematicalSystems.SecondOrderLinearContinuousSystem — Type
SecondOrderLinearContinuousSystemContinuous-time second order linear system of the form:
\[ Mx''(t) + Cx'(t) + Kx(t) = 0\; \forall t.\]
Fields
M– mass matrixC– viscosity matrixK– stiffness matrix
MathematicalSystems.SecondOrderAffineContinuousSystem — Type
SecondOrderAffineContinuousSystemContinuous-time second order affine system of the form:
\[ Mx''(t) + Cx'(t) + Kx(t) = b\; \forall t.\]
Fields
M– mass matrixC– viscosity matrixK– stiffness matrixb– affine term
MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem — Type
SecondOrderConstrainedAffineControlContinuousSystemContinuous-time second order constrained affine control system of the form:
\[ Mx''(t) + Cx'(t) + Kx(t) = Bu(t) + d, \; x(t) ∈ \mathcal{X}, \; u(t) ∈ \mathcal{U} \; \forall t.\]
Fields
M– mass matrixC– viscosity matrixK– stiffness matrixB– input matrixd– affine termX– state constraintsU– input constraints
MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem — Type
SecondOrderConstrainedLinearControlContinuousSystemContinuous-time second order constrained linear control system of the form:
\[ Mx''(t) + Cx'(t) + Kx(t) = Bu(t), \; x(t) ∈ \mathcal{X}, \; u(t) ∈ \mathcal{U} \; \forall t.\]
Fields
M– mass matrixC– viscosity matrixK– stiffness matrixB– input matrixX– state constraintsU– input constraints
MathematicalSystems.SecondOrderContinuousSystem — Type
SecondOrderContinuousSystemContinuous-time second-order system of the form:
\[ Mx''(t) + Cx'(t) + f_i(x) = f_e(t) \forall t\]
Fields
M– mass matrixC– viscosity matrixfi– internal forcesfe– external forces
Notes
Typically fi(x) is a state-dependent function, and fe is a given vector. In this implementation, their respective types, FI and FE, are generic.
MathematicalSystems.SecondOrderConstrainedContinuousSystem — Type
SecondOrderConstrainedContinuousSystemContinuous-time constrained second-order system of the form:
\[ Mx''(t) + Cx'(t) + f_i(x) = f_e(t) \forall t, x ∈ X, f_e(t) ∈ U\]
Fields
M– mass matrixC– viscosity matrixfi– internal forcesfe– external forcesX– state setU– input set
MathematicalSystems.LinearParametricContinuousSystem — Type
LinearParametricContinuousSystemContinuous-time linear parametric system of the form:
\[ x(t)' = A(\theta) x(t), \theta ∈ \Theta \; \forall t\]
where $A(θ)$ belongs to a continuous set of matrices, e.g., an interval matrix, matrix zonotope, or other convex matrix sets.
Fields
A– parametric state matrix
MathematicalSystems.LinearControlParametricContinuousSystem — Type
LinearControlParametricContinuousSystemContinuous-time linear parametric control system of the form:
\[ x(t)' = A(θ) x(t) + B(θ) u(t), \theta ∈ \Theta \; \forall t\]
where $A(θ)$ and $B(θ)$ belong to continuous sets of matrices, e.g., an interval matrix, matrix zonotope, or other convex matrix sets.
Fields
A– parametric state matrixB– parametric input matrix
Discrete Systems
MathematicalSystems.DiscreteIdentitySystem — Type
DiscreteIdentitySystem <: AbstractDiscreteSystemTrivial identity discrete-time system of the form:
\[ x_{k+1} = x_k \; \forall k.\]
Fields
statedim– number of state variables
MathematicalSystems.ConstrainedDiscreteIdentitySystem — Type
ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystemTrivial identity discrete-time system with domain constraints of the form:
\[ x_{k+1} = x_k, \; x_k ∈ \mathcal{X} \; \forall k.\]
Fields
statedim– number of state variablesX– state constraints
MathematicalSystems.LinearDiscreteSystem — Type
LinearDiscreteSystemDiscrete-time linear system of the form:
\[ x_{k+1} = A x_k \; \forall k.\]
Fields
A– state matrix
MathematicalSystems.AffineDiscreteSystem — Type
AffineDiscreteSystemDiscrete-time affine system of the form:
\[ x_{k+1} = A x_k + c \; \forall k.\]
Fields
A– state matrixc– affine term
MathematicalSystems.LinearControlDiscreteSystem — Type
LinearControlDiscreteSystemDiscrete-time linear control system of the form:
\[ x_{k+1} = A x_k + B u_k \; \forall k.\]
Fields
A– state matrixB– input matrix
MathematicalSystems.AffineControlDiscreteSystem — Type
AffineControlDiscreteSystemContinuous-time affine control system of the form:
\[ x_{k+1} = A x_k + B u_k + c, \; \forall k.\]
Fields
A– state matrixB– input matrixc– affine term
MathematicalSystems.ConstrainedLinearDiscreteSystem — Type
ConstrainedLinearDiscreteSystemDiscrete-time linear system with domain constraints of the form:
\[ x_{k+1} = A x_k, \; x_k ∈ \mathcal{X} \; \forall k.\]
Fields
A– state matrixX– state constraints
MathematicalSystems.ConstrainedAffineDiscreteSystem — Type
ConstrainedAffineDiscreteSystemDiscrete-time affine system with domain constraints of the form:
\[ x_{k+1} = A x_k + c, \; x_k ∈ \mathcal{X} \; \forall k.\]
Fields
A– state matrixc– affine termX– state constraints
MathematicalSystems.ConstrainedLinearControlDiscreteSystem — Type
ConstrainedLinearControlDiscreteSystemDiscrete-time linear control system with domain constraints of the form:
\[ x_{k+1} = A x_k + B u_k, \; x_k ∈ \mathcal{X}, \; u_k ∈ \mathcal{U} \; \forall k.\]
Fields
A– state matrixB– input matrixX– state constraintsU– input constraints
MathematicalSystems.ConstrainedAffineControlDiscreteSystem — Type
ConstrainedAffineControlDiscreteSystemContinuous-time affine control system with domain constraints of the form:
\[ x_{k+1} = A x_k + B u_k + c, \; x_k ∈ \mathcal{X}, \; u_k ∈ \mathcal{U} \; \forall k.\]
Fields
A– state matrixB– input matrixc– affine termX– state constraintsU– input constraints
MathematicalSystems.LinearDescriptorDiscreteSystem — Type
LinearDescriptorDiscreteSystemDiscrete-time linear descriptor system of the form:
\[ E x_{k+1} = A x_k \; \forall k.\]
Fields
A– state matrixE– matrix, same size asA
MathematicalSystems.ConstrainedLinearDescriptorDiscreteSystem — Type
ConstrainedLinearDescriptorDiscreteSystemDiscrete-time linear system with domain constraints of the form:
\[ E x_{k+1} = A x_k, \; x_k ∈ \mathcal{X} \; \forall k.\]
Fields
A– state matrixE– matrix, same size asAX– state constraints
MathematicalSystems.PolynomialDiscreteSystem — Type
PolynomialDiscreteSystemDiscrete-time polynomial system of the form:
\[ x_{k+1} = p(x_k) \; \forall k.\]
Fields
p– polynomial vector fieldstatedim– number of state variables
MathematicalSystems.ConstrainedPolynomialDiscreteSystem — Type
ConstrainedPolynomialDiscreteSystemDiscrete-time polynomial system with domain constraints:
\[ x_{k+1} = p(x_k), \; x_k ∈ \mathcal{X} \; \forall k.\]
Fields
p– polynomialX– constraint setstatedim– number of state variables
MathematicalSystems.BlackBoxDiscreteSystem — Type
BlackBoxDiscreteSystem <: AbstractDiscreteSystemDiscrete-time system defined by a right-hand side of the form:
\[ x_{k+1} = f(x_k) \; \forall k.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variables
MathematicalSystems.ConstrainedBlackBoxDiscreteSystem — Type
ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystemDiscrete-time system defined by a right-hand side with domain constraints of the form:
\[ x_{k+1} = f(x_k), \; x_k ∈ \mathcal{X} \; \forall k.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variablesX– state constraints
MathematicalSystems.BlackBoxControlDiscreteSystem — Type
BlackBoxControlDiscreteSystem <: AbstractDiscreteSystemDiscrete-time control system defined by a right-hand side of the form:
\[ x_{k+1} = f(x_k, u_k) \; \forall k.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variablesinputdim– number of input variables
MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem — Type
ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystemDiscrete-time control system defined by a right-hand side with domain constraints of the form:
\[ x_{k+1} = f(x_k, u_k), \; x_k ∈ \mathcal{X}, \; u_k ∈ \mathcal{U} \; \forall k.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variablesinputdim– number of input variablesX– state constraintsU– input constraints
MathematicalSystems.NoisyLinearDiscreteSystem — Type
NoisyLinearDiscreteSystemDiscrete-time linear system with additive disturbance of the form:
\[ x_{k+1} = A x_k + D w_k \; \forall k.\]
Fields
A– state matrixD– noise matrix
MathematicalSystems.NoisyConstrainedLinearDiscreteSystem — Type
NoisyConstrainedLinearDiscreteSystemDiscrete-time linear system with additive disturbance and domain constraints of the form:
\[ x_{k+1} = A x_k + D w_k, \; x_k ∈ \mathcal{X}, \; w(t) ∈ \mathcal{W} \; \forall k.\]
Fields
A– state matrixD– noise matrixX– state constraintsW– disturbance set
MathematicalSystems.NoisyLinearControlDiscreteSystem — Type
NoisyLinearControlDiscreteSystemContinuous-time linear control system with additive disturbance of the form:
\[ x_{k+1} = A x_k + B u_k + D w_k \; \forall k.\]
Fields
A– state matrixB– input matrixD– noise matrix
MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem — Type
NoisyConstrainedLinearControlDiscreteSystemContinuous-time linear control system with additive disturbance and domain constraints of the form:
\[ x_{k+1} = A x_k + B u_k + D w_k, \; x_k ∈ \mathcal{X}, \; u_k ∈ \mathcal{U}, \; w_k ∈ \mathcal{W} \; \forall k.\]
Fields
A– state matrixB– input matrixD– noise matrixX– state constraintsU– input constraintsW– disturbance set
MathematicalSystems.NoisyAffineControlDiscreteSystem — Type
NoisyAffineControlDiscreteSystemContinuous-time affine control system with additive disturbance of the form:
\[ x_{k+1} = A x_k + B u_k + c + D w_k \; \forall k.\]
Fields
A– state matrixB– input matrixc– affine termD– noise matrix
MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem — Type
NoisyConstrainedAffineControlDiscreteSystemContinuous-time affine control system with additive disturbance and domain constraints of the form:
\[ x_{k+1} = A x_k + B u_k + c + D w_k, \; x_k ∈ \mathcal{X}, \; u_k ∈ \mathcal{U}, \; w_k ∈ \mathcal{W} \; \forall k.\]
Fields
A– state matrixB– input matrixc– affine termD– noise matrixX– state constraintsU– input constraintsW– disturbance set
MathematicalSystems.NoisyBlackBoxControlDiscreteSystem — Type
NoisyBlackBoxControlDiscreteSystem <: AbstractDiscreteSystemDiscrete-time disturbance-affected control system defined by a right-hand side of the form:
\[ x_{k+1} = f(x_k, u_k) \quad \forall k.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variablesinputdim– number of input variablesnoisedim– number of noise variables
MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem — Type
NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystemDiscrete-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:
\[ x_{k+1} = f(x_k, u_k), \quad x_k ∈ \mathcal{X}, \quad u_k ∈ \mathcal{U}, \quad w_k ∈ \mathcal{W} \quad \forall k.\]
Fields
f– function that holds the right-hand sidestatedim– number of state variablesinputdim– number of input variablesnoisedim– number of noise variablesX– state constraintsU– input constraintsW– disturbance set
MathematicalSystems.SecondOrderLinearDiscreteSystem — Type
SecondOrderLinearDiscreteSystemDiscrete-time second order linear system of the form:
\[ Mx_{k+2} + Cx_{k+1} + Kx_k = 0\; \forall k.\]
Fields
M– mass matrixC– viscosity matrixK– stiffness matrix
MathematicalSystems.SecondOrderAffineDiscreteSystem — Type
SecondOrderAffineDiscreteSystemDiscrete-time second order affine system of the form:
\[ Mx_{k+2} + Cx_{k+1} + Kx_k = b\; \forall k.\]
Fields
M– mass matrixC– viscosity matrixK– stiffness matrixb– affine term
MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem — Type
SecondOrderConstrainedAffineControlDiscreteSystemDiscrete-time second order constrained affine control system of the form:
\[ Mx_{k+2} + Cx_{k+1} + Kx_k = Bu_k + d, \; x_k ∈ \mathcal{X}, \; u_k ∈ \mathcal{U} \; \forall k.\]
Fields
M– mass matrixC– viscosity matrixK– stiffness matrixB– input matrixd– affine termX– state constraintsU– input constraints
MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem — Type
SecondOrderConstrainedLinearControlDiscreteSystemDiscrete-time second order constrained linear control system of the form:
\[ Mx_{k+2} + Cx_{k+1} + Kx_k = Bu_k, \; x_k ∈ \mathcal{X}, \; u_k ∈ \mathcal{U} \; \forall k.\]
Fields
M– mass matrixC– viscosity matrixK– stiffness matrixB– input matrixX– state constraintsU– input constraints
MathematicalSystems.SecondOrderDiscreteSystem — Type
SecondOrderDiscreteSystemDiscrete-time second-order system of the form:
\[ Mx_{k+2} + Cx_{k} + f_i(x_k) = f_e(t_k) \forall k.\]
Fields
M– mass matrixC– viscosity matrixfi– internal forcesfe– external forces
Notes
Typically fi(x_k) is a state-dependent function, and fe is a given vector. In this implementation, their respective types, FI and FE, are generic.
MathematicalSystems.SecondOrderConstrainedDiscreteSystem — Type
SecondOrderConstrainedDiscreteSystemDiscrete-time constrained second-order system of the form:
\[ Mx_{k+2} + Cx_{k} + f_i(x_k) = f_e(t_k) \forall k, x_k ∈ X, f_e(t_k) ∈ U\]
Fields
M– mass matrixC– viscosity matrixfi– internal forcesfe– external forcesX– state setU– input set
MathematicalSystems.LinearParametricDiscreteSystem — Type
LinearParametricDiscreteSystemDiscrete-time linear parametric system of the form:
\[ x_{k+1} = A(\theta) x_k, \theta ∈ \Theta \; \forall k\]
where $A(θ)$ belongs to a continuous set of matrices, e.g., an interval matrix, matrix zonotope, or other convex matrix sets.
Fields
AS– parametric state matrix
MathematicalSystems.LinearControlParametricDiscreteSystem — Type
LinearControlParametricDiscreteSystemDiscrete-time linear parametric control system of the form:
\[ x_{k+1} = A(θ) x_k + B(θ) u_k, \theta ∈ \Theta \; \forall k\]
where $A(θ)$ and $B(θ)$ belong to continuous sets of matrices, e.g., an interval matrix, matrix zonotope, or other convex matrix sets.
Fields
AS– parametric state matrixBS– parametric input matrix
Discretization Algorithms
MathematicalSystems.AbstractDiscretizationAlgorithm — Type
AbstractDiscretizationAlgorithmAbstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
_discretize(::NewDiscretizationAlgorithm, ΔT::Real,
A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)are required.
MathematicalSystems.ExactDiscretization — Type
ExactDiscretization <: AbstractDiscretizationAlgorithmExact discretization algorithm for affine systems.
Algorithm
This algorithm consists of integrating the continuous differential equation over a specified time interval to obtain an associated difference equation. The algorithm applies to any system of the form x' = Ax + Bu + c + Dw where the state matrix A is invertible, and other system types, e.g. linear systems x' = Ax which are included in the above formulation.
Without loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics $x' = Ax + Bu + c + Dw$.
The exact discretization is calculated by integrating on both sides of the continuous ODE over the time span [t, t + ΔT], for a fixed input u and fixed noise realization w at time t. The resulting discretization writes as $x^+ = A^d x + B^d u + c^d + D^d w$ where $A^d = \exp^{A ~ ΔT}$, $B^d = A^{-1}(A^d - I)B$, $c^d = A^{-1}(A^d - I)c$ and $D^d = A^{-1}(A^d - I)D$.
The algorithm described above is a well known result from the literature [1].
[1] Wikipedia
MathematicalSystems.EulerDiscretization — Type
EulerDiscretization <: AbstractDiscretizationAlgorithmEuler discretization algorithm for affine systems.
Algorithm
This algorithm consists of a first-order approximation to obtain an associated difference equation. The algorithm applies to any system of the form x' = Ax + Bu + c + Dw, and other system types, e.g. linear systems x' = Ax which are included in the above formulation.
Without loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics $x' = Ax + Bu + c + Dw$.
The Euler discretization is calculated by taking the first-order approximation of the exact discretization ExactDiscretization. The resulting discretization writes as $x^+ = A^d x + B^d u + c^d + D^d w$ where $A^d = I + ΔT ~ A$, $B^d = ΔT ~ B$, $c^d = ΔT ~ c$ and $D^d = ΔT ~ D$.
The algorithm described above is a well-known result from the literature [1].
[1] Wikipedia
Initial Value Problems
MathematicalSystems.InitialValueProblem — Type
InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystemParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type
Fields
s– systemx0– initial state
Examples
The linear system $x' = -x$ with initial condition $x₀ = [-1/2, 1/2]$:
julia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);
julia> x₀ = [-1/2, 1/2];
julia> p = InitialValueProblem(s, x₀);
julia> initial_state(p) # same as p.x0
2-element Vector{Float64}:
-0.5
0.5
julia> statedim(p)
2
julia> inputdim(p)
0MathematicalSystems.IVP — Type
IVPIVP is an alias for InitialValueProblem.
MathematicalSystems.initial_state — Function
initial_state(ivp::InitialValueProblem)Return the initial state of an initial-value problem.
Input
ivp– initial-value problem
Output
The initial state of an initial-value problem.
MathematicalSystems.system — Function
system(ivp::InitialValueProblem)Return the system wrapped by an initial-value problem.
Input
ivp– initial-value problem
Output
The system of the given initial-value problem.
Identity Operator
MathematicalSystems.IdentityMultiple — Type
IdentityMultiple{T} < AbstractMatrix{T} where TA scalar multiple of the identity matrix of given order and numeric type.
Fields
M– uniform scaling operator of typeTn– size of the identity matrix
Notes
This type can be used to create multiples of the identity of given size. Since only the multiple and the order are stored, the allocations are minimal.
Internally, the type wraps Julia's lazy multiple of the identity operator, UniformScaling. IdentityMultiple subtypes AbstractMatrix, hence it can be used in usual matrix arithmetic and for dispatch on AbstractMatrix.
The difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.
Examples
Only specifying the matrix size represents an identity matrix:
julia> using MathematicalSystems: IdentityMultiple
julia> I2 = Id(2)
IdentityMultiple{Float64} of value 1.0 and order 2
julia> I2 + I2
IdentityMultiple{Float64} of value 2.0 and order 2
julia> 4*I2
IdentityMultiple{Float64} of value 4.0 and order 2The scaling (default 1.0) can be passed as the second argument:
julia> I2r = Id(2, 1//1)
IdentityMultiple{Rational{Int64}} of value 1//1 and order 2
julia> I2r + I2r
IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
julia> 4*I2r
IdentityMultiple{Rational{Int64}} of value 4//1 and order 2Alternatively, use the constructor passing the UniformScaling (I):
julia> using LinearAlgebra
julia> I2 = IdentityMultiple(2.0*I, 2)
IdentityMultiple{Float64} of value 2.0 and order 2
julia> I2r = IdentityMultiple(2//1*I, 2)
IdentityMultiple{Rational{Int64}} of value 2//1 and order 2MathematicalSystems.Id — Function
Id(n::Int, [λ]::Number=1.0)Convenience constructor of an IdentityMultiple.
Input
n– dimensionλ– (optional; default:1.0) scaling factor
Output
An IdentityMultiple of the given size and scaling factor.
Input Types
MathematicalSystems.AbstractInput — Type
AbstractInputAbstract supertype for all input types.
Notes
The input types defined here implement an iterator interface, such that other methods can build upon the behavior of inputs which are either constant or varying.
Iteration is supported with an index number called iterator state. The iteration function Base.iterate takes and returns a tuple (input, state), where input represents the value of the input, and state is an index which counts the number of times this iterator was called.
A convenience function nextinput(input, n) is also provided and it returns the first n elements of input.
MathematicalSystems.ConstantInput — Type
ConstantInput{UT} <: AbstractInputType representing an input that remains constant in time.
Fields
U– input set
Examples
The constant input holds a single element and its length is infinite. To access the field U, you can use Base's iterate given a state, or the method nextinput given the number of desired input elements:
julia> c = ConstantInput(-1//2)
ConstantInput{Rational{Int64}}(-1//2)
julia> iterate(c, 1)
(-1//2, nothing)
julia> iterate(c, 2)
(-1//2, nothing)
julia> collect(nextinput(c, 4))
4-element Vector{Rational{Int64}}:
-1//2
-1//2
-1//2
-1//2The elements of this input are rational numbers:
julia> eltype(c)
Rational{Int64}To transform a constant input, you can use map as in:
julia> map(x->2*x, c)
ConstantInput{Rational{Int64}}(-1//1)MathematicalSystems.VaryingInput — Type
VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInputType representing an input that may vary with time.
Fields
U– vector of input sets
Examples
The varying input holds a vector and its length equals the number of elements in the vector. Consider an input given by a vector of rational numbers:
julia> v = VaryingInput([-1//2, 1//2])
VaryingInput{Rational{Int64}, Vector{Rational{Int64}}}(Rational{Int64}[-1//2, 1//2])
julia> length(v)
2
julia> eltype(v)
Rational{Int64}Base's iterate method receives the input and an integer state and returns the input element and the next iteration state:
julia> iterate(v, 1)
(-1//2, 2)
julia> iterate(v, 2)
(1//2, 3)The method nextinput receives a varying input and an integer n and returns an iterator over the first n elements of this input (where n=1 by default):
julia> typeof(nextinput(v))
Base.Iterators.Take{VaryingInput{Rational{Int64}, Vector{Rational{Int64}}}}
julia> collect(nextinput(v, 1))
1-element Vector{Rational{Int64}}:
-1//2
julia> collect(nextinput(v, 2))
2-element Vector{Rational{Int64}}:
-1//2
1//2You can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):
julia> collect(v)
2-element Vector{Rational{Int64}}:
-1//2
1//2
julia> [3*vi for vi in v]
2-element Vector{Rational{Int64}}:
-3//2
3//2Since this input type is finite, querying more elements than its length returns the full vector:
julia> collect(nextinput(v, 4))
2-element Vector{Rational{Int64}}:
-1//2
1//2To transform a varying input, you can use map as in:
julia> map(x->3*x, v)
VaryingInput{Rational{Int64}, Vector{Rational{Int64}}}(Rational{Int64}[-3//2, 3//2])Maps
MathematicalSystems.AbstractMap — Type
AbstractMapAbstract supertype for all map types.
MathematicalSystems.IdentityMap — Type
IdentityMapAn identity map
\[ x ↦ x.\]
Fields
dim– dimension
MathematicalSystems.ConstrainedIdentityMap — Type
ConstrainedIdentityMapAn identity map with state constraints of the form
\[ x ↦ x, x ∈ \mathcal{X}.\]
Fields
dim– dimensionX– state constraints
MathematicalSystems.LinearMap — Type
LinearMapA linear map
\[ x ↦ Ax\]
Fields
A– matrix
MathematicalSystems.ConstrainedLinearMap — Type
ConstrainedLinearMapA linear map with state constraints of the form
\[ x ↦ Ax, x ∈ \mathcal{X}.\]
Fields
A– matrixX– state constraints
MathematicalSystems.AffineMap — Type
AffineMapAn affine map
\[ x ↦ Ax + c.\]
Fields
A– matrixc– vector
MathematicalSystems.ConstrainedAffineMap — Type
ConstrainedAffineMapAn affine map with state constraints of the form
\[ x ↦ Ax + c, x ∈ \mathcal{X}.\]
Fields
A– matrixc– vectorX– state constraints
MathematicalSystems.LinearControlMap — Type
LinearControlMapA linear control map
\[ (x, u) ↦ Ax + Bu.\]
Fields
A– matrixB– matrix
MathematicalSystems.ConstrainedLinearControlMap — Type
ConstrainedLinearControlMapA linear control map with state and input constraints
\[ (x, u) ↦ Ax + Bu, x ∈ \mathcal{X}, u ∈ \mathcal{U}.\]
Fields
A– matrixB– matrixX– state constraintsU– input constraints
MathematicalSystems.AffineControlMap — Type
AffineControlMapAn affine control map
\[ (x, u) ↦ Ax + Bu + c.\]
Fields
A– matrixB– matrixc– vector
MathematicalSystems.ConstrainedAffineControlMap — Type
ConstrainedAffineControlMapAn affine control map with state and input constraints
\[ (x, u) ↦ Ax + Bu + c, x ∈ \mathcal{X}, u ∈ \mathcal{U}.\]
Fields
A– matrixB– matrixc– vectorX– state constraintsU– input constraints
MathematicalSystems.ResetMap — Type
ResetMapA reset map
\[ x ↦ R(x),\]
such that a subset of the variables is given a specified value, and the rest are unchanged.
Fields
dim– dimensiondict– dictionary whose keys are the indices of the variables that are reset, and whose values are the new values
MathematicalSystems.ConstrainedResetMap — Type
ConstrainedResetMapA reset map with state constraints of the form
\[ x ↦ R(x), x ∈ \mathcal{X},\]
such that the specified variables are assigned a given value, and the remaining variables are unchanged.
Fields
dim– dimensionX– state constraintsdict– dictionary whose keys are the indices of the variables that are reset, and whose values are the new values
MathematicalSystems.BlackBoxMap — Type
BlackBoxMapA black-box map of the form
\[ x ↦ h(x).\]
Fields
dim– state dimensionoutput_dim– output dimensionh– output function
MathematicalSystems.ConstrainedBlackBoxMap — Type
ConstrainedBlackBoxMapA constrained black-box map of the form
\[ x ↦ h(x), x ∈ \mathcal{X}.\]
Fields
dim– state dimensionoutput_dim– output dimensionh– output functionX– state constraints
MathematicalSystems.BlackBoxControlMap — Type
BlackBoxControlMapA black-box control map of the form
\[ (x, u) ↦ h(x, u).\]
Fields
dim– state dimensioninput_dim– input dimensionoutput_dim– output dimensionh– output function
MathematicalSystems.ConstrainedBlackBoxControlMap — Type
ConstrainedBlackBoxControlMapA constrained black-box control map of the form
\[ (x, u) ↦ h(x, u), x ∈ \mathcal{X}, u ∈ \mathcal{U}.\]
Fields
dim– state dimensioninput_dim– input dimensionoutput_dim– output dimensionh– output functionX– state constraintsU– input constraints
Systems with Output
MathematicalSystems.SystemWithOutput — Type
SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap} <: AbstractSystemParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).
Fields
s– system of typeSToutputmap– output map of typeMT
MathematicalSystems.LinearTimeInvariantSystem — Function
LinearTimeInvariantSystem(A, B, C, D)A linear time-invariant system with of the form
\[x' = Ax + Bu,\\ y = Cx + Du.\]
Input
A– matrixB– matrixC– matrixD– matrix
Output
A system with output such that the system is a linear control continuous system and the output map is a linear control map.
LinearTimeInvariantSystem(A, B, C, D, X, U)A linear time-invariant system with state and input constraints of the form
\[x' = Ax + Bu,\\ y = Cx + Du,\]
where $x(t) ∈ X$ and $u(t) ∈ U$ for all $t$.
Input
A– matrixB– matrixC– matrixD– matrixX– state constraintsU– input constraints
Output
A system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.
MathematicalSystems.LTISystem — Function
LTISystemLTISystem is an alias for LinearTimeInvariantSystem.
Vector Fields
MathematicalSystems.VectorField — Type
VectorField{T<:Function}Type that computes the vector field of an AbstractContinuousSystem.
Fields
field– function for calculating the vector field
Macros
MathematicalSystems.@system — Macro
system(expr...)Return an instance of the system type corresponding to the given expressions.
Input
expr– expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system
Output
A system that best matches the given expressions.
Notes
Terms. The expression expr contains one or more of the following sub-expressions:
- dynamic equation, either continuous, e.g.
x' = Ax, or discrete, e.g.x⁺ = Ax - set constraints, e.g.
x ∈ X - input constraints, e.g.
u ∈ U - dimensionality, e.g.
dim: (2,1)ordim = 1 - specification of the input variable, e.g.
input: uorinput = u - specification of the noise variable, e,g,
noise: wornoise = w
The macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:
@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)The different terms that compose the system's definition do not have to appear in any particular order. Moreover, the only mandatory term is the dynamic equation; the other terms are optional and default values may apply depending on the system type; this is explained next.
Dynamic equation. The time derivative in a continuous system is specified by using ', as in x' = A*x. A discrete system is specified using ⁺ (which can be written with the combination of keys \^+[TAB]), as in x⁺ = A*x. Moreover, the asterisk denoting matrix-vector products is optional. For instance, both x' = Ax and x' = A*x are parsed as the linear continuous system whose state matrix is A. The matrix is supposed to be defined at the call site.
Default values. When the dynamic equation is parsed, the variable on the left-hand side is interpreted as the state variable. The input variable is by default u and the noise variable is by default w. If we want to change the default name of the input variable, this can be done by adding the term input: var (or equivalently, input=var) where var corresponds to the new name of the input variable, eg. @system(x' = A*x + B*v, input:v). Similarly, a noise variable is specified with noise: var or noise=var.
Exceptions. The following exceptions and particular cases apply:
If the right-hand side has the form
A*x + B*foo,A*x + B*foo + corf(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with inputfoo. Note that in this case,inputvariable does not correspond to the default value ofu, butfoois parsed as being the input.If the left-hand side contains a multiplicative term in the form
E*x⁺orE*x', the equation is parsed as an algebraic equation and hence gives rise to a descriptor system. In this case, the asterisk*operator is mandatory.Systems of the form
x' = α*xwhereαis a scalar are parsed as linear systems. The default dimension is1andαis parsed asFloat64; if the system is higher-dimensional, usedim, as inx' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
julia> A = [1. 0; 0 1.];
julia> @system(x' = A*x)
LinearContinuousSystem{Float64, Matrix{Float64}}([1.0 0.0; 0.0 1.0])A discrete system is defined by using ⁺:
julia> @system(x⁺ = A*x)
LinearDiscreteSystem{Float64, Matrix{Float64}}([1.0 0.0; 0.0 1.0])Additionally, a set definition x ∈ X can be added to create a constrained system. For example, a discrete controlled affine system with constrained states and inputs writes as:
julia> using LazySets
julia> B = Matrix([1.0 0.5]');
julia> c = [1.0, 1.5];
julia> X = BallInf(zeros(2), 10.0);
julia> U = BallInf(zeros(1), 2.0);
julia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)
ConstrainedAffineControlContinuousSystem{Float64, Matrix{Float64}, Matrix{Float64}, Vector{Float64}, BallInf{Float64, Vector{Float64}}, BallInf{Float64, Vector{Float64}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5;;], [1.0, 1.5], BallInf{Float64, Vector{Float64}}([0.0, 0.0], 10.0), BallInf{Float64, Vector{Float64}}([0.0], 2.0))For the creation of a black-box system, the state, input and noise dimensions have to be defined separately. For a constrained controlled black-box system, the macro writes as
julia> f(x, u) = x + u;
julia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))
ConstrainedBlackBoxControlDiscreteSystem{typeof(f), BallInf{Float64, Vector{Float64}}, BallInf{Float64, Vector{Float64}}}(f, 2, 2, BallInf{Float64, Vector{Float64}}([0.0, 0.0], 10.0), BallInf{Float64, Vector{Float64}}([0.0], 2.0))MathematicalSystems.@ivp — Macro
ivp(expr...)Return an instance of the initial-value problem type corresponding to the given expressions.
Input
expr– expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system, and the set of initial states (required)
Output
An initial-value problem that best matches the given expressions.
Notes
This macro behaves like the @system macro, the sole difference being that in @ivp the constraint on the set of initial states is mandatory. For the technical details we refer to the documentation of @system.
The macro can also be called with a system argument of type AbstractSystem in the form @ivp(system, state(0) ∈ initial_set).
Examples
julia> p = @ivp(x' = -x, x(0) ∈ [1.0]);
julia> typeof(p)
InitialValueProblem{LinearContinuousSystem{Float64, IdentityMultiple{Float64}}, Vector{Float64}}
julia> initial_state(p)
1-element Vector{Float64}:
1.0
julia> sys = @system(x' = [1 0; 0 1] * x);
julia> @ivp(sys, x(0) ∈ [-1, 1])
InitialValueProblem{LinearContinuousSystem{Int64, Matrix{Int64}}, Vector{Int64}}(LinearContinuousSystem{Int64, Matrix{Int64}}([1 0; 0 1]), [-1, 1])MathematicalSystems.@map — Macro
map(ex, args)Return an instance of the map type corresponding to the given expression.
Input
ex– an expression defining the map, in the form of an anonymous functionargs– additional optional arguments
Output
A map that best matches the given expression.
Examples
Let us first create a linear map using this macro:
julia> @map x -> [1 0; 0 0]*x
LinearMap{Int64, Matrix{Int64}}([1 0; 0 0])We can create an affine system as well:
julia> @map x -> [1 0; 0 0]*x + [2, 0]
AffineMap{Int64, Matrix{Int64}, Vector{Int64}}([1 0; 0 0], [2, 0])Additional arguments can be passed to @map using the function-call form, i.e. separating the arguments by commas, and using parentheses around the macro call. For example, an identity map of dimension 5 can be defined as:
julia> @map(x -> x, dim=5)
IdentityMap(5)A state constraint on such map can be specified passing the additional argument x ∈ X.
An identity map can alternatively be created by giving a the size of the identity matrix as Id(n), for example:
julia> @map x -> Id(5)*x
IdentityMap(5)