Methods
This section describes systems methods implemented in MathematicalSystems.jl
.
States
MathematicalSystems.statedim
— Function.statedim(s::AbstractSystem)
Returns the dimension of the state space of system s
.
MathematicalSystems.stateset
— Function.stateset(s::AbstractSystem)
Returns the set of allowed states of system s
.
Inputs
MathematicalSystems.inputdim
— Function.inputdim(s::AbstractSystem)
Returns the dimension of the input space of system s
.
MathematicalSystems.inputset
— Function.inputset(s::AbstractSystem)
Returns the set of allowed inputs of system s
.
MathematicalSystems.nextinput
— Function.nextinput(input::ConstantInput, n::Int=1)
Returns the first n
elements of this input.
Input
input
– a constant inputn
– (optional, default:1
) the number of desired elements
Output
A repeated iterator that generates n
equal samples of this input.
nextinput(input::VaryingInput, n::Int=1)
Returns the first n
elements of this input.
Input
input
– varying inputn
– (optional, default:1
) number of desired elements
Output
An iterator of type Base.Iterators.Take
that represents at most the first n
elements of this input.
Output
MathematicalSystems.outputdim
— Function.outputdim(m::AbstractMap)
Returns the dimension of the output space of the map m
.
MathematicalSystems.outputmap
— Function.outputmap(s::SystemWithOutput)
Returns the output map of a system with output.
Traits
MathematicalSystems.islinear
— Method.islinear(s::AbstractSystem)
Specifies if the dynamics of system s
is specified by linear equations.
Notes
We adopt the notion from [Section 2.7, 1]. For example, the system with inputs $x' = f(t, x, u) = A x + B u$ is linear, since the function $f(t, ⋅, ⋅)$ is linear in $(x, u)$ for each $t ∈ \mathbb{R}$. On the other hand, $x' = f(t, x, u) = A x + B u + c$ is affine but not linear, since it is not linear in $(x, u)$.
This function uses the information of the type, not the value. So, if a system type allows an instance that is not linear, it returns false
by default. For example, polynomial systems can be nonlinear; hence islinear
returns false
.
[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.
MathematicalSystems.islinear
— Method.islinear(m::AbstractMap)
Specifies if the map m
is linear or not.
Notes
A map is linear if it preserves the operations of scalar multiplication and vector addition.
MathematicalSystems.isaffine
— Method.isaffine(s::AbstractSystem)
Specifies if the dynamics of system s
is specified by affine equations.
Notes
An affine system is the composition of a linear system and a translation. See islinear(::AbstractSystem)
for the notion of linear system adopted in this library.
This function uses the information of the type, not the value. So, if a system type allows an instance that is not affine, it returns false
by default. For example, polynomial systems can be nonlinear; hence isaffine
is false
.
MathematicalSystems.isaffine
— Method.isaffine(m::AbstractMap)
Specifies if the map m
is affine or not.
Notes
An affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap)
.
Maps
MathematicalSystems.apply
— Function.apply(m::AbstractMap, args...)
Apply the rule specified by the map to the given arguments.