If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with GitHub Actions such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to make all unit tests pass.
To run the unit tests locally, you can do:
julia> using Pkg
+
+julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
Return the system type whose field names match those in fields.
Input
AT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem
fields – tuple of field names
Output
The system type (either discrete or continuous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.
Extract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.
For the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list
(:A_user, :A)
(:B_user, :B)
(:c_user, :c)
(:D_user, :D)
(:f_user, :f)
(:statedim_user :statedim)
(:inputdim_user :inputdim)
(:noisedim_user :noisedim)
and for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.
Input
equation – dynamic equation
state – state variable
input – input variable
noise – noise variable
dim – dimensionality
AT – abstract system type
Output
Two arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.
Checks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.
Return true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.
Input
expr – expression
Output
A Bool indicating whether expr is an equation or not.
If an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.
If an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.
Similiarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.
Return the result of instantiating an AbstractSystem at the current state.
Input
system – AbstractSystem
x – state (it should be any vector type)
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x.
Notes
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Return the result of instantiating an AbstractSystem at the current state and applying one input.
Input
system – AbstractSystem
x – state (it should be any vector type)
u – input (it should be any vector type) or noise, if system is not controlled
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x and input u.
Notes
If the system is not controlled but noisy, the input u is interpreted as noise.
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Return the result of instantiating an AbstractSystem at the current state and applying two inputs to an AbstractSystem.
Input
system – AbstractSystem
x – state (it should be any vector type)
u – input (it should be any vector type)
w – noise (it should be any vector type)
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x, input u and noise w.
Notes
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.
Field
Description
Getter function
A
state matrix
state_matrix
B
input matrix
input_matrix
c
affine term
affine_term
D
noise matrix
noise_matrix
X
state constraints
stateset
U
input constraints
inputset
W
disturbance set
noiseset
Settings
This document was generated with Documenter.jl version 1.5.0 on Thursday 27 June 2024. Using Julia version 1.10.4.
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)$.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
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.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Specifies if the dynamics of system s is specified by polynomial equations.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.
Discretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.
Input
algorithm – discretization algorithm
ΔT – sampling time
A – state matrix
B – input or noise matrix
Output
Returns a vector containing the discretized input arguments A and B.
Notes
This method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).
Return the complementary type of a system type system_type.
Input
system_type – type of AbstractSystem
Output
The complementary type of system_type.
Notes
There are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.
To get the complementary type of system type, use _complementary_type(typename(system)).
Abstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
Exact 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].
Euler 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].
A scalar multiple of the identity matrix of given order and numeric type.
Fields
M – uniform scaling operator of type T
n – 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 2
The 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 2
Alternatively, 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 2
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.
Type 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:
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 + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.
If the left-hand side contains a multiplicative term in the form E*x⁺ or E*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' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
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))
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).
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:
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":
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:
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.
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.
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).
Equation
State constraints
Input constraints
System type (abbr.)
$x' = 0$
no
no
CIS
$x' = 0, x ∈ X$
yes
no
CCIS
$x' = Ax$
no
no
LCS
$x' = Ax + c$
no
no
ACS
$x' = Ax + Bu$
no
no
LCCS
$x' = Ax + Bu + c$
no
no
ACCS
$x' = Ax, x ∈ X$
yes
no
CLCS
$x' = Ax + c, x ∈ X$
yes
no
CACS
$x' = Ax + Bu + c, x ∈ X, u ∈ U$
yes
yes
CACCS
$x' = Ax + Bu, x ∈ X, u ∈ U$
yes
yes
CLCCS
$Ex' = Ax$
no
no
LACS
$Ex' = Ax, x ∈ X$
yes
no
CLACS
$x' = p(x)$
no
no
PCS
$x' = p(x), x ∈ X$
yes
no
CPCS
$x' = f(x)$
no
no
BBCS
$x' = f(x), x ∈ X$
yes
no
CBBCS
$x' = f(x, u)$
no
no
BBCCS
$x' = f(x, u), x ∈ X, u ∈ U$
yes
yes
CBBCCS
$x' = Ax + Dw$
no
no
NLCS
$x' = Ax + Dw, x ∈ X, w ∈ W$
yes
yes
NCLCS
$x' = Ax + Bu + Dw$
no
no
NLCCS
$x' = Ax + Bu + Dw, x ∈ X, u ∈ U, w ∈ W$
yes
yes
NCLCCS
$x' = Ax + Bu + c + Dw$
no
no
NACCS
$x' = Ax + Bu + c + Dw, x ∈ X, u ∈ U, w ∈ W$
yes
yes
NCALCCS
$x' = f(x, u, w)$
no
no
NBBCCS
$x' = f(x, u, w), x ∈ X, u ∈ U, w ∈ W$
yes
yes
NCBBCCS
$Mx'' + Cx' + Kx = 0$
no
no
SOLCS
$Mx'' + Cx' + Kx = b$
no
no
SOACS
$Mx'' + Cx' + Kx = Bu + d, x ∈ X, u ∈ U$
yes
yes
SOCACCS
$Mx'' + Cx' + Kx = Bu, x ∈ X, u ∈ U$
yes
yes
SOCLCCS
$Mx'' + Cx' + f_i(x) = f_e$
no
no
SOCS
$Mx'' + Cx' + f_i(x) = f_e$, x ∈ X, u ∈ U``
yes
yes
SOCCS
Settings
This document was generated with Documenter.jl version 1.5.0 on Thursday 27 June 2024. Using Julia version 1.10.4.
diff --git a/dev/objects.inv b/dev/objects.inv
new file mode 100644
index 00000000..bf183969
Binary files /dev/null and b/dev/objects.inv differ
diff --git a/dev/search_index.js b/dev/search_index.js
new file mode 100644
index 00000000..e5e7484d
--- /dev/null
+++ b/dev/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"lib/internals/#Internals","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"This section describes functions that are internal to the library.","category":"page"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]\nDepth = 3","category":"page"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/internals/#Expression-Handling","page":"Internals","title":"Expression Handling","text":"","category":"section"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"_corresponding_type\n_capture_dim\nextract_dyn_equation_parameters\nadd_asterisk\n_sort","category":"page"},{"location":"lib/internals/#MathematicalSystems._corresponding_type","page":"Internals","title":"MathematicalSystems._corresponding_type","text":"_corresponding_type(AT::Type{<:AbstractSystem}, fields::Tuple)\n\nReturn the system type whose field names match those in fields.\n\nInput\n\nAT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem\nfields – tuple of field names\n\nOutput\n\nThe system type (either discrete or continuous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.\n\nExamples\n\njulia> using MathematicalSystems: _corresponding_type\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A),))\nLinearContinuousSystem\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A), (:B), (:X), (:U)))\nConstrainedLinearControlContinuousSystem\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._capture_dim","page":"Internals","title":"MathematicalSystems._capture_dim","text":"_capture_dim(expr)\n\nReturn the tuple containing the dimension(s) in expr.\n\nInput\n\nexpr – symbolic expression that can be of any of the following forms:\n:x or :(x) – state dimension\n:(x, u) – state and input dimension\n:(x, u, w) – state, input and noise dimensions\n\nOutput\n\nThe scalar x if expr specifies the state dimension.\nThe vector [x, u] if expr specifies state and input dimension.\nThe vector [x, u, w] if expr specifies state, input and noise dimensions.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_dyn_equation_parameters","page":"Internals","title":"MathematicalSystems.extract_dyn_equation_parameters","text":"extract_dyn_equation_parameters(equation, state, input, noise, dim, AT)\n\nExtract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.\n\nFor the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list\n\n(:A_user, :A)\n(:B_user, :B)\n(:c_user, :c)\n(:D_user, :D)\n(:f_user, :f)\n(:statedim_user :statedim)\n(:inputdim_user :inputdim)\n(:noisedim_user :noisedim)\n\nand for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.\n\nInput\n\nequation – dynamic equation\nstate – state variable\ninput – input variable\nnoise – noise variable\ndim – dimensionality\nAT – abstract system type\n\nOutput\n\nTwo arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.add_asterisk","page":"Internals","title":"MathematicalSystems.add_asterisk","text":"add_asterisk(summand, state::Symbol, input::Symbol, noise::Symbol)\n\nChecks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.\n\nInput\n\nsummand – expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nMultiplication expression or symbol.\n\nExample\n\njulia> using MathematicalSystems: add_asterisk\n\njulia> add_asterisk(:(A1*x), :x, :u, :w)\n:(A1 * x)\n\njulia> add_asterisk(:(c1), :x, :u, :w)\n:c1\n\njulia> add_asterisk(:(Ax1), :x1, :u, :w)\n:(A * x1)\n\njulia> add_asterisk(:(Awb), :x1, :u, :wb)\n:(A * wb)\n\njulia> add_asterisk(:(A1u), :x, :u, :w)\n:(A1 * u)\n\njulia> add_asterisk(:(A1ub), :x, :u, :w)\n:A1ub\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._sort","page":"Internals","title":"MathematicalSystems._sort","text":"_sort(parameters::Vector, order::Tuple)\n\nFilter and sort the vector parameters according to order.\n\nInput\n\nparameters – vector of tuples\norder – tuple of symbols\n\nOutput\n\nA new vector of tuples corresponding to parameters filtered and sorted according to order.\n\nExamples\n\njulia> using MathematicalSystems: _sort\n\njulia> parameters= [(:U1, :U), (:X1, :X), (:W1, :W)];\n\njulia> _sort(parameters, (:X, :U, :W))\n3-element Vector{Tuple{Any, Symbol}}:\n (:X1, :X)\n (:U1, :U)\n (:W1, :W)\n\njulia> parameters = [(:const, :c), (:A, :A)];\n\njulia> _sort(parameters, (:A, :B, :c, :D))\n2-element Vector{Tuple{Any, Symbol}}:\n (:A, :A)\n (:const, :c)\n\nNotes\n\nparameters is a vector that contains tuples whose second element is considered for the sorting according to order.\n\nIf a value of order is not contained in parameters, the corresponding entry of order will be omitted.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Querying-Expressions","page":"Internals","title":"Querying Expressions","text":"","category":"section"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"is_equation\nextract_sum","category":"page"},{"location":"lib/internals/#MathematicalSystems.is_equation","page":"Internals","title":"MathematicalSystems.is_equation","text":"is_equation(expr)\n\nReturn true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.\n\nInput\n\nexpr – expression\n\nOutput\n\nA Bool indicating whether expr is an equation or not.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_sum","page":"Internals","title":"MathematicalSystems.extract_sum","text":"extract_sum(summands, state::Symbol, input::Symbol, noise::Symbol)\n\nExtract the variable name and field name for every element of summands which corresponds to the elements of the right-hand side of an affine system.\n\nInput\n\nsummands – array of expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nArray of tuples of symbols with variable name and field name.\n\nExample\n\njulia> using MathematicalSystems: extract_sum\n\njulia> extract_sum([:(A1*x)], :x, :u, :w)\n1-element Vector{Tuple{Any, Symbol}}:\n (:(hcat(A1)), :A)\n\njulia> extract_sum([:(A1*x), :(B1*u), :c], :x, :u, :w)\n3-element Vector{Tuple{Any, Symbol}}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(vcat(c)), :c)\n\njulia> extract_sum([:(A1*x7), :( B1*u7), :( B2*w7)], :x7, :u7, :w7)\n3-element Vector{Tuple{Any, Symbol}}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(hcat(B2)), :D)\n\nNotes\n\nIf an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.\n\nIf an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.\n\nSimiliarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Evaluation-of-AbstractSystem-at-Given-State","page":"Internals","title":"Evaluation of AbstractSystem at Given State","text":"","category":"section"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"_instantiate","category":"page"},{"location":"lib/internals/#MathematicalSystems._instantiate","page":"Internals","title":"MathematicalSystems._instantiate","text":"_instantiate(system::AbstractSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x.\n\nNotes\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n_instantiate(system::AbstractSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state and applying one input.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x and input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n_instantiate(system::AbstractSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state and applying two inputs to an AbstractSystem.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x, input u and noise w.\n\nNotes\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Naming-Convention-for-Systems'-Fields","page":"Internals","title":"Naming Convention for Systems' Fields","text":"","category":"section"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.","category":"page"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"Field Description Getter function\nA state matrix state_matrix\nB input matrix input_matrix\nc affine term affine_term\nD noise matrix noise_matrix\nX state constraints stateset\nU input constraints inputset\nW disturbance set noiseset","category":"page"},{"location":"about/#About","page":"About","title":"About","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"This page contains some general information about this project, and recommendations about contributing.","category":"page"},{"location":"about/","page":"About","title":"About","text":"Pages = [\"about.md\"]","category":"page"},{"location":"about/#Contributing","page":"About","title":"Contributing","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.","category":"page"},{"location":"about/","page":"About","title":"About","text":"Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.","category":"page"},{"location":"about/#Branches-and-pull-requests-(PR)","page":"About","title":"Branches and pull requests (PR)","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.","category":"page"},{"location":"about/","page":"About","title":"About","text":"Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.","category":"page"},{"location":"about/#Unit-testing-and-continuous-integration-(CI)","page":"About","title":"Unit testing and continuous integration (CI)","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"This project is synchronized with GitHub Actions such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to make all unit tests pass.","category":"page"},{"location":"about/","page":"About","title":"About","text":"To run the unit tests locally, you can do:","category":"page"},{"location":"about/","page":"About","title":"About","text":"julia> using Pkg\n\njulia> Pkg.test(\"MathematicalSystems\")","category":"page"},{"location":"about/","page":"About","title":"About","text":"We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.","category":"page"},{"location":"about/#Contributing-to-the-documentation","page":"About","title":"Contributing to the documentation","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"New functions and types should be documented according to our guidelines directly in the source code.","category":"page"},{"location":"about/","page":"About","title":"About","text":"You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:","category":"page"},{"location":"about/","page":"About","title":"About","text":"julia> ?LinearContinuousSystem","category":"page"},{"location":"about/","page":"About","title":"About","text":"This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).","category":"page"},{"location":"about/","page":"About","title":"About","text":"To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:","category":"page"},{"location":"about/","page":"About","title":"About","text":"$ julia --color=yes docs/make.jl","category":"page"},{"location":"about/","page":"About","title":"About","text":"Note that this also runs all doctests which will take some time.","category":"page"},{"location":"about/#Related-projects","page":"About","title":"Related projects","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.","category":"page"},{"location":"about/","page":"About","title":"About","text":"Below we list more related projects.","category":"page"},{"location":"about/","page":"About","title":"About","text":"Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia","category":"page"},{"location":"about/#Credits","page":"About","title":"Credits","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"These persons have contributed to MathematicalSystems.jl (in alphabetic order):","category":"page"},{"location":"about/","page":"About","title":"About","text":"Marcelo Forets\nBenoît Legat\nChristian Schilling\nUeli Wechsler","category":"page"},{"location":"man/systems/#Overview-of-System-Types","page":"Overview of System Types","title":"Overview of System Types","text":"","category":"section"},{"location":"man/systems/#Using-the-@system-Macro","page":"Overview of System Types","title":"Using the @system Macro","text":"","category":"section"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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) = dxdt is the derivative of state x(t) with respect to \"time\":","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"using MathematicalSystems\n\n@system(x' = -2x)","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"We can also add state constraints, say x(t) 05,","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"using LazySets\n\nH = HalfSpace([-1.0], -0.5) # x >= 0.5\n@system(x' = -2x, x ∈ H)","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"Systems of ODEs can be defined using vector notation:","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"A = [1.0 0.0; -1.0 -2.0]\nB = Ball2(zeros(2), 1.0)\nc = [0.0, 5.0]\n@system(z' = A*z + c, z ∈ B)","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"which defines the two-dimensional system x = y, y = -x - 2y + 3, with state constraints z B = sqrtx^2 + y^2 leq 5.","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"Initial-value problems can be specified with the @ivp macro. For instance, we can attach an initial condition z(0) = (02 02) to the previous example:","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"S0 = Singleton([0.2, 0.2])\n@ivp(z' = A*z + c, z ∈ B, z(0) ∈ S0)","category":"page"},{"location":"man/systems/#Inputs","page":"Overview of System Types","title":"Inputs","text":"","category":"section"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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).","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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.","category":"page"},{"location":"man/systems/#Summary-Tables","page":"Overview of System Types","title":"Summary Tables","text":"","category":"section"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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.","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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.","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"Abbreviation System type\nCIS ContinuousIdentitySystem\nCCIS ConstrainedContinuousIdentitySystem\nLCS LinearContinuousSystem\nACS AffineContinuousSystem\nLCCS LinearControlContinuousSystem\nACCS AffineControlContinuousSystem\nCLCS ConstrainedLinearContinuousSystem\nCACS ConstrainedAffineContinuousSystem\nCACCS ConstrainedAffineControlContinuousSystem\nCLCCS ConstrainedLinearControlContinuousSystem\nLACS LinearDescriptorContinuousSystem\nCLACS ConstrainedLinearDescriptorContinuousSystem\nPCS PolynomialContinuousSystem\nCPCS PolynomialContinuousSystem\nBBCS BlackBoxContinuousSystem\nCBBCS ConstrainedBlackBoxContinuousSystem\nBBCCS BlackBoxControlContinuousSystem\nCBBCCS ConstrainedBlackBoxControlContinuousSystem\nNLCS NoisyLinearContinuousSystem\nNCLCS NoisyConstrainedLinearContinuousSystem\nNLCCS NoisyLinearControlContinuousSystem\nNCLCCS NoisyConstrainedLinearControlContinuousSystem\nNACCS NoisyAffineControlContinuousSystem\nNCALCCS NoisyConstrainedAffineControlContinuousSystem\nNBBCCS NoisyBlackBoxControlContinuousSystem\nNCBBCCS NoisyConstrainedBlackBoxControlContinuousSystem\nSOLCS SecondOrderLinearContinuousSystem\nSOACS SecondOrderAffineContinuousSystem\nSOCACCS SecondOrderConstrainedAffineControlContinuousSystem\nSOCLCCS SecondOrderConstrainedLinearControlContinuousSystem","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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).","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"Equation State constraints Input constraints System type (abbr.)\nx = 0 no no CIS\nx = 0 x X yes no CCIS\nx = Ax no no LCS\nx = Ax + c no no ACS\nx = Ax + Bu no no LCCS\nx = Ax + Bu + c no no ACCS\nx = Ax x X yes no CLCS\nx = Ax + c x X yes no CACS\nx = Ax + Bu + c x X u U yes yes CACCS\nx = Ax + Bu x X u U yes yes CLCCS\nEx = Ax no no LACS\nEx = Ax x X yes no CLACS\nx = p(x) no no PCS\nx = p(x) x X yes no CPCS\nx = f(x) no no BBCS\nx = f(x) x X yes no CBBCS\nx = f(x u) no no BBCCS\nx = f(x u) x X u U yes yes CBBCCS\nx = Ax + Dw no no NLCS\nx = Ax + Dw x X w W yes yes NCLCS\nx = Ax + Bu + Dw no no NLCCS\nx = Ax + Bu + Dw x X u U w W yes yes NCLCCS\nx = Ax + Bu + c + Dw no no NACCS\nx = Ax + Bu + c + Dw x X u U w W yes yes NCALCCS\nx = f(x u w) no no NBBCCS\nx = f(x u w) x X u U w W yes yes NCBBCCS\nMx + Cx + Kx = 0 no no SOLCS\nMx + Cx + Kx = b no no SOACS\nMx + Cx + Kx = Bu + d x X u U yes yes SOCACCS\nMx + Cx + Kx = Bu x X u U yes yes SOCLCCS\nMx + Cx + f_i(x) = f_e no no SOCS\nMx + Cx + f_i(x) = f_e, x ∈ X, u ∈ U`` yes yes SOCCS","category":"page"},{"location":"lib/types/#Types","page":"Types","title":"Types","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"This section describes systems types implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/types/","page":"Types","title":"Types","text":"Pages = [\"types.md\"]\nDepth = 3","category":"page"},{"location":"lib/types/","page":"Types","title":"Types","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/types/#Abstract-Systems","page":"Types","title":"Abstract Systems","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractSystem","page":"Types","title":"MathematicalSystems.AbstractSystem","text":"AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractContinuousSystem","page":"Types","title":"MathematicalSystems.AbstractContinuousSystem","text":"AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractDiscreteSystem","page":"Types","title":"MathematicalSystems.AbstractDiscreteSystem","text":"AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Continuous-Systems","page":"Types","title":"Continuous Systems","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nAffineControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearDescriptorContinuousSystem\nConstrainedLinearDescriptorContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem\nBlackBoxContinuousSystem\nConstrainedBlackBoxContinuousSystem\nBlackBoxControlContinuousSystem\nConstrainedBlackBoxControlContinuousSystem\nNoisyLinearContinuousSystem\nNoisyConstrainedLinearContinuousSystem\nNoisyLinearControlContinuousSystem\nNoisyConstrainedLinearControlContinuousSystem\nNoisyAffineControlContinuousSystem\nNoisyConstrainedAffineControlContinuousSystem\nNoisyBlackBoxControlContinuousSystem\nNoisyConstrainedBlackBoxControlContinuousSystem\nSecondOrderLinearContinuousSystem\nSecondOrderAffineContinuousSystem\nSecondOrderConstrainedAffineControlContinuousSystem\nSecondOrderConstrainedLinearControlContinuousSystem\nSecondOrderContinuousSystem\nSecondOrderConstrainedContinuousSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.ContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ContinuousIdentitySystem","text":"ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form:\n\n x(t) = 0 forall t\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedContinuousIdentitySystem","text":"ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with domain constraints of the form:\n\n x(t) = 0 x(t) mathcalX forall t\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearContinuousSystem","page":"Types","title":"MathematicalSystems.LinearContinuousSystem","text":"LinearContinuousSystem\n\nContinuous-time linear system of the form:\n\n x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineContinuousSystem","page":"Types","title":"MathematicalSystems.AffineContinuousSystem","text":"AffineContinuousSystem\n\nContinuous-time affine system of the form:\n\n x(t) = A x(t) + c forall t\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.LinearControlContinuousSystem","text":"LinearControlContinuousSystem\n\nContinuous-time linear control system of the form:\n\n x(t) = A x(t) + B u(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.AffineControlContinuousSystem","text":"AffineControlContinuousSystem\n\nContinuous-time affine control system of the form:\n\n x(t) = A x(t) + B u(t) + c forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearContinuousSystem","text":"ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineContinuousSystem","text":"ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with domain constraints of the form:\n\n x(t) = A x(t) + c x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlContinuousSystem","text":"ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlContinuousSystem","text":"ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDescriptorContinuousSystem","page":"Types","title":"MathematicalSystems.LinearDescriptorContinuousSystem","text":"LinearDescriptorContinuousSystem\n\nContinuous-time linear descriptor system of the form:\n\n E x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDescriptorContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDescriptorContinuousSystem","text":"ConstrainedLinearDescriptorContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n E x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.PolynomialContinuousSystem","text":"PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form:\n\n x(t) = p(x(t)) forall t\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialContinuousSystem","text":"ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with domain constraints:\n\n x(t) = p(x(t)) x(t) mathcalX forall t\n\nFields\n\np – polynomial vector field\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxContinuousSystem","text":"BlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side of the form:\n\n x(t) = f(x(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxContinuousSystem","text":"ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t)) x(t) mathcalX forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlContinuousSystem","text":"BlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","text":"ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t)) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearContinuousSystem","text":"NoisyLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance of the form:\n\n x(t) = A x(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearContinuousSystem","text":"NoisyConstrainedLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + D w(t) x(t) mathcalX w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlContinuousSystem","text":"NoisyLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","text":"NoisyConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlContinuousSystem","text":"NoisyAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","text":"NoisyConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlContinuousSystem","text":"NoisyBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t) w(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","text":"NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t) w(t)) quad x(t) mathcalX quad u(t) mathcalU quad w(t) mathcalW quad forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderLinearContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderLinearContinuousSystem","text":"SecondOrderLinearContinuousSystem\n\nContinuous-time second order linear system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = 0 forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderAffineContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderAffineContinuousSystem","text":"SecondOrderAffineContinuousSystem\n\nContinuous-time second order affine system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = b forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nb – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem","text":"SecondOrderConstrainedAffineControlContinuousSystem\n\nContinuous-time second order constrained affine control system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = Bu(t) + d x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nd – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem","text":"SecondOrderConstrainedLinearControlContinuousSystem\n\nContinuous-time second order constrained linear control system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = Bu(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderContinuousSystem","text":"SecondOrderContinuousSystem\n\nContinuous-time second-order system of the form:\n\n Mx(t) + Cx(t) + f_i(x) = f_e(t) forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nfi – internal forces\nfe – external forces\n\nNotes\n\nTypically fi(x) is a state-dependent function, and fe is a given vector. In this implementation, their respective types, FI and FE, are generic.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedContinuousSystem","text":"SecondOrderConstrainedContinuousSystem\n\nContinuous-time constrained second-order system of the form:\n\n Mx(t) + Cx(t) + f_i(x) = f_e(t) forall t x X f_e(t) U\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nfi – internal forces\nfe – external forces\nX – state set\nU – input set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discrete-Systems","page":"Types","title":"Discrete Systems","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nAffineDiscreteSystem\nLinearControlDiscreteSystem\nAffineControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedAffineDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nConstrainedAffineControlDiscreteSystem\nLinearDescriptorDiscreteSystem\nConstrainedLinearDescriptorDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem\nBlackBoxDiscreteSystem\nConstrainedBlackBoxDiscreteSystem\nBlackBoxControlDiscreteSystem\nConstrainedBlackBoxControlDiscreteSystem\nNoisyLinearDiscreteSystem\nNoisyConstrainedLinearDiscreteSystem\nNoisyLinearControlDiscreteSystem\nNoisyConstrainedLinearControlDiscreteSystem\nNoisyAffineControlDiscreteSystem\nNoisyConstrainedAffineControlDiscreteSystem\nNoisyBlackBoxControlDiscreteSystem\nNoisyConstrainedBlackBoxControlDiscreteSystem\nSecondOrderLinearDiscreteSystem\nSecondOrderAffineDiscreteSystem\nSecondOrderConstrainedAffineControlDiscreteSystem\nSecondOrderConstrainedLinearControlDiscreteSystem\nSecondOrderDiscreteSystem\nSecondOrderConstrainedDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.DiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.DiscreteIdentitySystem","text":"DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form:\n\n x_k+1 = x_k forall k\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedDiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedDiscreteIdentitySystem","text":"ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with domain constraints of the form:\n\n x_k+1 = x_k x_k mathcalX forall k\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDiscreteSystem","text":"LinearDiscreteSystem\n\nDiscrete-time linear system of the form:\n\n x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineDiscreteSystem","text":"AffineDiscreteSystem\n\nDiscrete-time affine system of the form:\n\n x_k+1 = A x_k + c forall k\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearControlDiscreteSystem","text":"LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form:\n\n x_k+1 = A x_k + B u_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineControlDiscreteSystem","text":"AffineControlDiscreteSystem\n\nContinuous-time affine control system of the form:\n\n x_k+1 = A x_k + B u_k + c forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDiscreteSystem","text":"ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineDiscreteSystem","text":"ConstrainedAffineDiscreteSystem\n\nDiscrete-time affine system with domain constraints of the form:\n\n x_k+1 = A x_k + c x_k mathcalX forall k\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlDiscreteSystem","text":"ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlDiscreteSystem","text":"ConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDescriptorDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDescriptorDiscreteSystem","text":"LinearDescriptorDiscreteSystem\n\nDiscrete-time linear descriptor system of the form:\n\n E x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDescriptorDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDescriptorDiscreteSystem","text":"ConstrainedLinearDescriptorDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n E x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.PolynomialDiscreteSystem","text":"PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form:\n\n x_k+1 = p(x_k) forall k\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialDiscreteSystem","text":"ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with domain constraints:\n\n x_k+1 = p(x_k) x_k mathcalX forall k\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxDiscreteSystem","text":"BlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","text":"ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k) x_k mathcalX forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlDiscreteSystem","text":"BlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","text":"ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearDiscreteSystem","text":"NoisyLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance of the form:\n\n x_k+1 = A x_k + D w_k forall k\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","text":"NoisyConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + D w_k x_k mathcalX w(t) mathcalW forall k\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlDiscreteSystem","text":"NoisyLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","text":"NoisyConstrainedLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlDiscreteSystem","text":"NoisyAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","text":"NoisyConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","text":"NoisyBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","text":"NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) quad x_k mathcalX quad u_k mathcalU quad w_k mathcalW quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderLinearDiscreteSystem","text":"SecondOrderLinearDiscreteSystem\n\nDiscrete-time second order linear system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = 0 forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderAffineDiscreteSystem","text":"SecondOrderAffineDiscreteSystem\n\nDiscrete-time second order affine system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = b forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nb – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem","text":"SecondOrderConstrainedAffineControlDiscreteSystem\n\nDiscrete-time second order constrained affine control system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = Bu_k + d x_k mathcalX u_k mathcalU forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nd – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem","text":"SecondOrderConstrainedLinearControlDiscreteSystem\n\nDiscrete-time second order constrained linear control system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = Bu_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderDiscreteSystem","text":"SecondOrderDiscreteSystem\n\nDiscrete-time second-order system of the form:\n\n Mx_k+2 + Cx_k + f_i(x_k) = f_e(t_k) forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nfi – internal forces\nfe – external forces\n\nNotes\n\nTypically 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.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedDiscreteSystem","text":"SecondOrderConstrainedDiscreteSystem\n\nDiscrete-time constrained second-order system of the form:\n\n Mx_k+2 + Cx_k + f_i(x_k) = f_e(t_k) forall k x_k X f_e(t_k) U\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nfi – internal forces\nfe – external forces\nX – state set\nU – input set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discretization-Algorithms","page":"Types","title":"Discretization Algorithms","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"AbstractDiscretizationAlgorithm\nExactDiscretization\nEulerDiscretization","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractDiscretizationAlgorithm","page":"Types","title":"MathematicalSystems.AbstractDiscretizationAlgorithm","text":"AbstractDiscretizationAlgorithm\n\nAbstract supertype for all discretization algorithms.\n\nNote\n\nFor implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method\n\n_discretize(::NewDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nare required.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ExactDiscretization","page":"Types","title":"MathematicalSystems.ExactDiscretization","text":"ExactDiscretization <: AbstractDiscretizationAlgorithm\n\nExact discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] Wikipedia\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.EulerDiscretization","page":"Types","title":"MathematicalSystems.EulerDiscretization","text":"EulerDiscretization <: AbstractDiscretizationAlgorithm\n\nEuler discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well-known result from the literature [1].\n\n[1] Wikipedia\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Initial-Value-Problems","page":"Types","title":"Initial Value Problems","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"InitialValueProblem\nIVP\ninitial_state\nsystem","category":"page"},{"location":"lib/types/#MathematicalSystems.InitialValueProblem","page":"Types","title":"MathematicalSystems.InitialValueProblem","text":"InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystem\n\nParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x₀ = -12 12:\n\njulia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);\n\njulia> x₀ = [-1/2, 1/2];\n\njulia> p = InitialValueProblem(s, x₀);\n\njulia> initial_state(p) # same as p.x0\n2-element Vector{Float64}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IVP","page":"Types","title":"MathematicalSystems.IVP","text":"IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.initial_state","page":"Types","title":"MathematicalSystems.initial_state","text":"initial_state(ivp::InitialValueProblem)\n\nReturn the initial state of an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe initial state of an initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.system","page":"Types","title":"MathematicalSystems.system","text":"system(ivp::InitialValueProblem)\n\nReturn the system wrapped by an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe system of the given initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Identity-Operator","page":"Types","title":"Identity Operator","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"IdentityMultiple\nId","category":"page"},{"location":"lib/types/#MathematicalSystems.IdentityMultiple","page":"Types","title":"MathematicalSystems.IdentityMultiple","text":"IdentityMultiple{T} < AbstractMatrix{T} where T\n\nA scalar multiple of the identity matrix of given order and numeric type.\n\nFields\n\nM – uniform scaling operator of type T\nn – size of the identity matrix\n\nNotes\n\nThis 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.\n\nInternally, 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.\n\nThe difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.\n\nExamples\n\nOnly specifying the matrix size represents an identity matrix:\n\njulia> using MathematicalSystems: IdentityMultiple\n\njulia> I2 = Id(2)\nIdentityMultiple{Float64} of value 1.0 and order 2\n\njulia> I2 + I2\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> 4*I2\nIdentityMultiple{Float64} of value 4.0 and order 2\n\nThe scaling (default 1.0) can be passed as the second argument:\n\njulia> I2r = Id(2, 1//1)\nIdentityMultiple{Rational{Int64}} of value 1//1 and order 2\n\njulia> I2r + I2r\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\njulia> 4*I2r\nIdentityMultiple{Rational{Int64}} of value 4//1 and order 2\n\nAlternatively, use the constructor passing the UniformScaling (I):\n\njulia> using LinearAlgebra\n\njulia> I2 = IdentityMultiple(2.0*I, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = IdentityMultiple(2//1*I, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.Id","page":"Types","title":"MathematicalSystems.Id","text":"Id(n::Int, [λ]::Number=1.0)\n\nConvenience constructor of an IdentityMultiple.\n\nInput\n\nn – dimension\nλ – (optional; default: 1.0) scaling factor\n\nOutput\n\nAn IdentityMultiple of the given size and scaling factor.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Input-Types","page":"Types","title":"Input Types","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"AbstractInput\nConstantInput\nVaryingInput","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractInput","page":"Types","title":"MathematicalSystems.AbstractInput","text":"AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstantInput","page":"Types","title":"MathematicalSystems.ConstantInput","text":"ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Vector{Rational{Int64}}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.VaryingInput","page":"Types","title":"MathematicalSystems.VaryingInput","text":"VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64}, Vector{Rational{Int64}}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase's iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64}, Vector{Rational{Int64}}}}\n\njulia> collect(nextinput(v, 1))\n1-element Vector{Rational{Int64}}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Vector{Rational{Int64}}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Vector{Rational{Int64}}:\n -1//2\n 1//2\n\njulia> [3*vi for vi in v]\n2-element Vector{Rational{Int64}}:\n -3//2\n 3//2\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Vector{Rational{Int64}}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->3*x, v)\nVaryingInput{Rational{Int64}, Vector{Rational{Int64}}}(Rational{Int64}[-3//2, 3//2])\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Maps","page":"Types","title":"Maps","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"AbstractMap\nIdentityMap\nConstrainedIdentityMap\nLinearMap\nConstrainedLinearMap\nAffineMap\nConstrainedAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap\nResetMap\nConstrainedResetMap\nBlackBoxMap\nConstrainedBlackBoxMap\nBlackBoxControlMap\nConstrainedBlackBoxControlMap","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractMap","page":"Types","title":"MathematicalSystems.AbstractMap","text":"AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IdentityMap","page":"Types","title":"MathematicalSystems.IdentityMap","text":"IdentityMap\n\nAn identity map\n\n x x\n\nFields\n\ndim – dimension\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedIdentityMap","page":"Types","title":"MathematicalSystems.ConstrainedIdentityMap","text":"ConstrainedIdentityMap\n\nAn identity map with state constraints of the form\n\n x x x mathcalX\n\nFields\n\ndim – dimension\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearMap","page":"Types","title":"MathematicalSystems.LinearMap","text":"LinearMap\n\nA linear map\n\n x Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearMap","text":"ConstrainedLinearMap\n\nA linear map with state constraints of the form\n\n x Ax x mathcalX\n\nFields\n\nA – matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineMap","page":"Types","title":"MathematicalSystems.AffineMap","text":"AffineMap\n\nAn affine map\n\n x Ax + c\n\nFields\n\nA – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineMap","text":"ConstrainedAffineMap\n\nAn affine map with state constraints of the form\n\n x Ax + c x mathcalX\n\nFields\n\nA – matrix\nc – vector\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlMap","page":"Types","title":"MathematicalSystems.LinearControlMap","text":"LinearControlMap\n\nA linear control map\n\n (x u) Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlMap","text":"ConstrainedLinearControlMap\n\nA linear control map with state and input constraints\n\n (x u) Ax + Bu x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlMap","page":"Types","title":"MathematicalSystems.AffineControlMap","text":"AffineControlMap\n\nAn affine control map\n\n (x u) Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlMap","text":"ConstrainedAffineControlMap\n\nAn affine control map with state and input constraints\n\n (x u) Ax + Bu + c x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ResetMap","page":"Types","title":"MathematicalSystems.ResetMap","text":"ResetMap\n\nA reset map\n\n x R(x)\n\nsuch that a subset of the variables is given a specified value, and the rest are unchanged.\n\nFields\n\ndim – dimension\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedResetMap","page":"Types","title":"MathematicalSystems.ConstrainedResetMap","text":"ConstrainedResetMap\n\nA reset map with state constraints of the form\n\n x R(x) x mathcalX\n\nsuch that the specified variables are assigned a given value, and the remaining variables are unchanged.\n\nFields\n\ndim – dimension\nX – state constraints\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxMap","page":"Types","title":"MathematicalSystems.BlackBoxMap","text":"BlackBoxMap\n\nA black-box map of the form\n\n x h(x)\n\nFields\n\ndim – state dimension\noutput_dim – output dimension\nh – output function\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxMap","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxMap","text":"ConstrainedBlackBoxMap\n\nA constrained black-box map of the form\n\n x h(x) x mathcalX\n\nFields\n\ndim – state dimension\noutput_dim – output dimension\nh – output function\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlMap","page":"Types","title":"MathematicalSystems.BlackBoxControlMap","text":"BlackBoxControlMap\n\nA black-box control map of the form\n\n (x u) h(x u)\n\nFields\n\ndim – state dimension\ninput_dim – input dimension\noutput_dim – output dimension\nh – output function\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlMap","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlMap","text":"ConstrainedBlackBoxControlMap\n\nA constrained black-box control map of the form\n\n (x u) h(x u) x mathcalX u mathcalU\n\nFields\n\ndim – state dimension\ninput_dim – input dimension\noutput_dim – output dimension\nh – output function\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Systems-with-Output","page":"Types","title":"Systems with Output","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem","category":"page"},{"location":"lib/types/#MathematicalSystems.SystemWithOutput","page":"Types","title":"MathematicalSystems.SystemWithOutput","text":"SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap} <: AbstractSystem\n\nParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearTimeInvariantSystem","page":"Types","title":"MathematicalSystems.LinearTimeInvariantSystem","text":"LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.LTISystem","page":"Types","title":"MathematicalSystems.LTISystem","text":"LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Vector-Fields","page":"Types","title":"Vector Fields","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"VectorField","category":"page"},{"location":"lib/types/#MathematicalSystems.VectorField","page":"Types","title":"MathematicalSystems.VectorField","text":"VectorField{T<:Function}\n\nType that computes the vector field of an AbstractContinuousSystem.\n\nFields\n\nfield – function for calculating the vector field\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Macros","page":"Types","title":"Macros","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"@system\n@ivp\n@map","category":"page"},{"location":"lib/types/#MathematicalSystems.@system","page":"Types","title":"MathematicalSystems.@system","text":"system(expr...)\n\nReturn an instance of the system type corresponding to the given expressions.\n\nInput\n\nexpr – expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system\n\nOutput\n\nA system that best matches the given expressions.\n\nNotes\n\nTerms. The expression expr contains one or more of the following sub-expressions:\n\ndynamic equation, either continuous, e.g.x' = Ax, or discrete, e.g. x⁺ = Ax\nset constraints, e.g. x ∈ X\ninput constraints, e.g. u ∈ U\ndimensionality, e.g. dim: (2,1) or dim = 1\nspecification of the input variable, e.g. input: u or input = u\nspecification of the noise variable, e,g, noise: w or noise = w\n\nThe macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:\n\n@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)\n\nThe 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.\n\nDynamic 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.\n\nDefault 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.\n\nExceptions. The following exceptions and particular cases apply:\n\nIf the right-hand side has the form A*x + B*foo, A*x + B*foo + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.\nIf the left-hand side contains a multiplicative term in the form E*x⁺ or E*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.\nSystems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.\n\nExamples\n\nLet us first create a continuous linear system using this macro:\n\njulia> A = [1. 0; 0 1.];\n\njulia> @system(x' = A*x)\nLinearContinuousSystem{Float64, Matrix{Float64}}([1.0 0.0; 0.0 1.0])\n\nA discrete system is defined by using ⁺:\n\njulia> @system(x⁺ = A*x)\nLinearDiscreteSystem{Float64, Matrix{Float64}}([1.0 0.0; 0.0 1.0])\n\nAdditionally, 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:\n\njulia> using LazySets\n\njulia> B = Matrix([1.0 0.5]');\n\njulia> c = [1.0, 1.5];\n\njulia> X = BallInf(zeros(2), 10.0);\n\njulia> U = BallInf(zeros(1), 2.0);\n\njulia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)\nConstrainedAffineControlContinuousSystem{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))\n\nFor 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\n\njulia> f(x, u) = x + u;\n\njulia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))\nConstrainedBlackBoxControlDiscreteSystem{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))\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#MathematicalSystems.@ivp","page":"Types","title":"MathematicalSystems.@ivp","text":"ivp(expr...)\n\nReturn an instance of the initial-value problem type corresponding to the given expressions.\n\nInput\n\nexpr – 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)\n\nOutput\n\nAn initial-value problem that best matches the given expressions.\n\nNotes\n\nThis 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.\n\nThe macro can also be called with a system argument of type AbstractSystem in the form @ivp(system, state(0) ∈ initial_set).\n\nExamples\n\njulia> p = @ivp(x' = -x, x(0) ∈ [1.0]);\n\njulia> typeof(p)\nInitialValueProblem{LinearContinuousSystem{Float64, IdentityMultiple{Float64}}, Vector{Float64}}\n\njulia> initial_state(p)\n1-element Vector{Float64}:\n 1.0\n\njulia> sys = @system(x' = [1 0; 0 1] * x);\n\njulia> @ivp(sys, x(0) ∈ [-1, 1])\nInitialValueProblem{LinearContinuousSystem{Int64, Matrix{Int64}}, Vector{Int64}}(LinearContinuousSystem{Int64, Matrix{Int64}}([1 0; 0 1]), [-1, 1])\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#MathematicalSystems.@map","page":"Types","title":"MathematicalSystems.@map","text":"map(ex, args)\n\nReturn an instance of the map type corresponding to the given expression.\n\nInput\n\nex – an expression defining the map, in the form of an anonymous function\nargs – additional optional arguments\n\nOutput\n\nA map that best matches the given expression.\n\nExamples\n\nLet us first create a linear map using this macro:\n\njulia> @map x -> [1 0; 0 0]*x\nLinearMap{Int64, Matrix{Int64}}([1 0; 0 0])\n\nWe can create an affine system as well:\n\njulia> @map x -> [1 0; 0 0]*x + [2, 0]\nAffineMap{Int64, Matrix{Int64}, Vector{Int64}}([1 0; 0 0], [2, 0])\n\nAdditional 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:\n\njulia> @map(x -> x, dim=5)\nIdentityMap(5)\n\nA state constraint on such map can be specified passing the additional argument x ∈ X.\n\nAn identity map can alternatively be created by giving a the size of the identity matrix as Id(n), for example:\n\njulia> @map x -> Id(5)*x\nIdentityMap(5)\n\n\n\n\n\n","category":"macro"},{"location":"#MathematicalSystems.jl","page":"Home","title":"MathematicalSystems.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]","category":"page"},{"location":"","page":"Home","title":"Home","text":"MathematicalSystems is a Julia package for mathematical systems interfaces.","category":"page"},{"location":"#Features","page":"Home","title":"Features","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled, descriptor systems, etc.\nIterator interfaces to handle constant or time-varying inputs.","category":"page"},{"location":"#Ecosystem","page":"Home","title":"Ecosystem","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The following packages use MathematicalSystems.jl:","category":"page"},{"location":"","page":"Home","title":"Home","text":"Dionysos.jl – Optimal control of cyber-physical systems\nHybridSystems.jl – Hybrid Systems definitions in Julia\nReachabilityAnalysis.jl – Methods to compute sets of states reachable by dynamical systems\nSpaceExParser.jl – SpaceEx modeling language parser\nStructuralDynamicsODESolvers.jl – Numerical integration methods for structural dynamics problems\nSwitchOnSafety.jl – Computing controlled invariant sets of Hybrid Systems using Sum Of Squares Programming","category":"page"},{"location":"#Manual-Outline","page":"Home","title":"Manual Outline","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Pages = [\n \"man/systems.md\"\n]\nDepth = 2","category":"page"},{"location":"#Library-Outline","page":"Home","title":"Library Outline","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Pages = [\n \"lib/types.md\",\n \"lib/methods.md\",\n \"lib/internals.md\"\n]\nDepth = 2","category":"page"},{"location":"lib/methods/#Methods","page":"Methods","title":"Methods","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"This section describes systems methods implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"Pages = [\"methods.md\"]\nDepth = 3","category":"page"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/methods/#States","page":"Methods","title":"States","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"statedim\nstateset","category":"page"},{"location":"lib/methods/#MathematicalSystems.statedim","page":"Methods","title":"MathematicalSystems.statedim","text":"statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.stateset","page":"Methods","title":"MathematicalSystems.stateset","text":"stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Inputs","page":"Methods","title":"Inputs","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"inputdim\ninputset\nnextinput","category":"page"},{"location":"lib/methods/#MathematicalSystems.inputdim","page":"Methods","title":"MathematicalSystems.inputdim","text":"inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.inputset","page":"Methods","title":"MathematicalSystems.inputset","text":"inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.nextinput","page":"Methods","title":"MathematicalSystems.nextinput","text":"nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Noises","page":"Methods","title":"Noises","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"noisedim\nnoiseset","category":"page"},{"location":"lib/methods/#MathematicalSystems.noisedim","page":"Methods","title":"MathematicalSystems.noisedim","text":"noisedim(s::AbstractSystem)\n\nReturns the dimension of the noise space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.noiseset","page":"Methods","title":"MathematicalSystems.noiseset","text":"noiseset(s::AbstractSystem)\n\nReturns the set of allowed noises of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Output","page":"Methods","title":"Output","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"outputdim\noutputmap","category":"page"},{"location":"lib/methods/#MathematicalSystems.outputdim","page":"Methods","title":"MathematicalSystems.outputdim","text":"outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.outputmap","page":"Methods","title":"MathematicalSystems.outputmap","text":"outputmap(s::AbstractSystem)\n\nReturns the output map of a system with output.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Traits","page":"Methods","title":"Traits","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"islinear(::AbstractSystem)\nislinear(::AbstractMap)\nisaffine(::AbstractSystem)\nispolynomial(::AbstractSystem)\nisaffine(::AbstractMap)\nisblackbox(::AbstractSystem)\nisnoisy(::AbstractSystem)\niscontrolled(::AbstractSystem)\nisconstrained(::AbstractSystem)\nstate_matrix(::AbstractSystem)\ninput_matrix(::AbstractSystem)\nnoise_matrix(::AbstractSystem)\naffine_term(::AbstractSystem)","category":"page"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by linear equations.\n\nNotes\n\nWe 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 mathbbR. 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).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(m::AbstractMap)\n\nSpecifies if the map m is linear or not.\n\nNotes\n\nA map is linear if it preserves the operations of scalar multiplication and vector addition.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by affine equations.\n\nNotes\n\nAn 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.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.ispolynomial-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.ispolynomial","text":"ispolynomial(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by polynomial equations.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(m::AbstractMap)\n\nSpecifies if the map m is affine or not.\n\nNotes\n\nAn affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isblackbox-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isblackbox","text":"isblackbox(s::AbstractSystem)\n\nSpecifies if no specific structure is assumed for the dynamics of system s.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isnoisy-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isnoisy","text":"isnoisy(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a noise term w.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.iscontrolled-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.iscontrolled","text":"iscontrolled(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a control input u.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isconstrained-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isconstrained","text":"isconstrained(s::AbstractSystem)\n\nDetermines if the system s has constraints on the state, input and noise, respectively (those that are available).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.state_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.state_matrix","text":"state_matrix(s::AbstractSystem)\n\nReturn the state matrix of an affine system.\n\nNotes\n\nThe state matrix is the matrix proportional to the state, e.g. the matrix A in the linear continuous system x = Ax.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.input_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.input_matrix","text":"input_matrix(s::AbstractSystem)\n\nReturn the input matrix of a system with linear input.\n\nNotes\n\nThe input matrix is the matrix proportional to the input, e.g. the matrix B in the linear continuous system with input, x = Ax + Bu.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.noise_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.noise_matrix","text":"noise_matrix(s::AbstractSystem)\n\nReturn the noise matrix of a system with linear noise.\n\nNotes\n\nThe noise matrix is the matrix proportional to the noise, e.g. the matrix D in the linear system with noise, x = Ax + Dw.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.affine_term-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.affine_term","text":"affine_term(s::AbstractSystem)\n\nReturn the affine term in an affine system.\n\nNotes\n\nThe affine term is e.g. the vector c in the affine system x = Ax + c.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#Maps","page":"Methods","title":"Maps","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"apply","category":"page"},{"location":"lib/methods/#MathematicalSystems.apply","page":"Methods","title":"MathematicalSystems.apply","text":"apply(m::AbstractMap, args...)\n\nApply the rule specified by the map to the given arguments.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Successor","page":"Methods","title":"Successor","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"successor","category":"page"},{"location":"lib/methods/#MathematicalSystems.successor","page":"Methods","title":"MathematicalSystems.successor","text":"successor(system::DiscreteIdentitySystem, x::AbstractVector)\n\nReturn the successor state of a DiscreteIdentitySystem.\n\nInput\n\nsystem – DiscreteIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::ConstrainedDiscreteIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedDiscreteIdentitySystem.\n\nInput\n\nsystem – ConstrainedDiscreteIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x and input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x, input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Vector-Field","page":"Methods","title":"Vector Field","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"vector_field","category":"page"},{"location":"lib/methods/#MathematicalSystems.vector_field","page":"Methods","title":"MathematicalSystems.vector_field","text":"vector_field(system::ContinuousIdentitySystem, x::AbstractVector)\n\nReturn the vector field state of a ContinuousIdentitySystem.\n\nInput\n\nsystem – ContinuousIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nA zeros vector of dimension statedim.\n\n\n\n\n\nvector_field(system::ConstrainedContinuousIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of a ConstrainedContinuousIdentitySystem.\n\nInput\n\nsystem – ConstrainedContinuousIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nA zeros vector of dimension statedim.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x and applying input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x and applying input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Discretization","page":"Methods","title":"Discretization","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"discretize","category":"page"},{"location":"lib/methods/#MathematicalSystems.discretize","page":"Methods","title":"MathematicalSystems.discretize","text":"discretize(system::AbstractContinuousSystem, ΔT::Real,\n algorithm::AbstractDiscretizationAlgorithm=ExactDiscretization(),\n constructor=_default_complementary_constructor(system))\n\nDiscretization of a isaffine AbstractContinuousSystem to a AbstractDiscreteSystem with sampling time ΔT using the discretization method algorithm.\n\nInput\n\nsystem – an affine continuous system\nΔT – sampling time\nalgorithm – (optional, default: ExactDiscretization()) discretization algorithm\nconstructor – (optional, default: _default_complementary_constructor(system)) construction method\n\nOutput\n\nReturns a discretization of the input system system with discretization method algorithm and sampling time ΔT.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Internal-Methods","page":"Methods","title":"Internal Methods","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"_discretize\ntypename(::AbstractSystem)\n_complementary_type(::Type{<:AbstractSystem})","category":"page"},{"location":"lib/methods/#MathematicalSystems._discretize","page":"Methods","title":"MathematicalSystems._discretize","text":"_discretize(::AbstractDiscretizationAlgorithm, ΔT::Real\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nImplementation of the discretization algorithm defined by the first input argument with sampling time ΔT.\n\nInput\n\n`` – discretization algorithm, used for dispatch\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B, c and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(A::AbstractMatrix, ΔT::Real; algorithm=:exact)\n\nDiscretize the state matrix A with sampling time ΔT and discretization method algorithm.\n\nInput\n\nA – state matrix\nΔT – sampling time\nalgorithm – (optional, default: :exact) discretization algorithm\n\nOutput\n\nReturns a vector containing the discretized input argument A.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix)\n\nDiscretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input or noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A and B.\n\nNotes\n\nThis method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix,c::AbstractVector)\n\nDiscretize the state matrix A and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector)\n\nDiscretize the state matrix A, input matrix B and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, D::AbstractMatrix)\n\nDiscretize the state matrix A, input matrix B and noise matrix C with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.typename-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.typename","text":"typename(system::AbstractSystem)\n\nReturns the base type of system without parameter information.\n\nInput\n\nsystem – AbstractSystem\n\nOutput\n\nThe base type of system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems._complementary_type-Tuple{Type{<:AbstractSystem}}","page":"Methods","title":"MathematicalSystems._complementary_type","text":"_complementary_type(system_type::Type{<:AbstractSystem})\n\nReturn the complementary type of a system type system_type.\n\nInput\n\nsystem_type – type of AbstractSystem\n\nOutput\n\nThe complementary type of system_type.\n\nNotes\n\nThere are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.\n\nTo get the complementary type of system type, use _complementary_type(typename(system)).\n\n\n\n\n\n","category":"method"}]
+}
diff --git a/dev/siteinfo.js b/dev/siteinfo.js
new file mode 100644
index 00000000..33434919
--- /dev/null
+++ b/dev/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "dev";
diff --git a/index.html b/index.html
new file mode 100644
index 00000000..6a5afc30
--- /dev/null
+++ b/index.html
@@ -0,0 +1,2 @@
+
+
diff --git a/latest b/latest
new file mode 120000
index 00000000..90012116
--- /dev/null
+++ b/latest
@@ -0,0 +1 @@
+dev
\ No newline at end of file
diff --git a/previews/PR306/.documenter-siteinfo.json b/previews/PR306/.documenter-siteinfo.json
new file mode 100644
index 00000000..8107d4e3
--- /dev/null
+++ b/previews/PR306/.documenter-siteinfo.json
@@ -0,0 +1 @@
+{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-28T12:28:33","documenter_version":"1.5.0"}}
\ No newline at end of file
diff --git a/previews/PR306/about/index.html b/previews/PR306/about/index.html
new file mode 100644
index 00000000..85d6f5ad
--- /dev/null
+++ b/previews/PR306/about/index.html
@@ -0,0 +1,4 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with GitHub Actions such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to make all unit tests pass.
To run the unit tests locally, you can do:
julia> using Pkg
+
+julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
Return the system type whose field names match those in fields.
Input
AT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem
fields – tuple of field names
Output
The system type (either discrete or continuous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.
Extract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.
For the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list
(:A_user, :A)
(:B_user, :B)
(:c_user, :c)
(:D_user, :D)
(:f_user, :f)
(:statedim_user :statedim)
(:inputdim_user :inputdim)
(:noisedim_user :noisedim)
and for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.
Input
equation – dynamic equation
state – state variable
input – input variable
noise – noise variable
dim – dimensionality
AT – abstract system type
Output
Two arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.
Checks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.
Return true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.
Input
expr – expression
Output
A Bool indicating whether expr is an equation or not.
If an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.
If an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.
Similiarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.
Return the result of instantiating an AbstractSystem at the current state.
Input
system – AbstractSystem
x – state (it should be any vector type)
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x.
Notes
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Return the result of instantiating an AbstractSystem at the current state and applying one input.
Input
system – AbstractSystem
x – state (it should be any vector type)
u – input (it should be any vector type) or noise, if system is not controlled
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x and input u.
Notes
If the system is not controlled but noisy, the input u is interpreted as noise.
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Return the result of instantiating an AbstractSystem at the current state and applying two inputs to an AbstractSystem.
Input
system – AbstractSystem
x – state (it should be any vector type)
u – input (it should be any vector type)
w – noise (it should be any vector type)
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x, input u and noise w.
Notes
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.
Field
Description
Getter function
A
state matrix
state_matrix
B
input matrix
input_matrix
c
affine term
affine_term
D
noise matrix
noise_matrix
X
state constraints
stateset
U
input constraints
inputset
W
disturbance set
noiseset
Settings
This document was generated with Documenter.jl version 1.5.0 on Sunday 28 July 2024. Using Julia version 1.10.4.
Determines whether 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)$.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Determines whether 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.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Determines whether the dynamics of system s is specified by polynomial equations.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.
Discretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.
Input
algorithm – discretization algorithm
ΔT – sampling time
A – state matrix
B – input or noise matrix
Output
Returns a vector containing the discretized input arguments A and B.
Notes
This method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).
Return the complementary type of a system type system_type.
Input
system_type – type of AbstractSystem
Output
The complementary type of system_type.
Notes
There are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.
To get the complementary type of system type, use _complementary_type(typename(system)).
Abstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
Exact 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].
Euler 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].
A scalar multiple of the identity matrix of given order and numeric type.
Fields
M – uniform scaling operator of type T
n – 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 2
The 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 2
Alternatively, 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 2
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.
Type 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:
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 + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.
If the left-hand side contains a multiplicative term in the form E*x⁺ or E*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' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
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))
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).
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:
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":
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:
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.
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.
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).
Equation
State constraints
Input constraints
System type (abbr.)
$x' = 0$
no
no
CIS
$x' = 0, x ∈ X$
yes
no
CCIS
$x' = Ax$
no
no
LCS
$x' = Ax + c$
no
no
ACS
$x' = Ax + Bu$
no
no
LCCS
$x' = Ax + Bu + c$
no
no
ACCS
$x' = Ax, x ∈ X$
yes
no
CLCS
$x' = Ax + c, x ∈ X$
yes
no
CACS
$x' = Ax + Bu + c, x ∈ X, u ∈ U$
yes
yes
CACCS
$x' = Ax + Bu, x ∈ X, u ∈ U$
yes
yes
CLCCS
$Ex' = Ax$
no
no
LACS
$Ex' = Ax, x ∈ X$
yes
no
CLACS
$x' = p(x)$
no
no
PCS
$x' = p(x), x ∈ X$
yes
no
CPCS
$x' = f(x)$
no
no
BBCS
$x' = f(x), x ∈ X$
yes
no
CBBCS
$x' = f(x, u)$
no
no
BBCCS
$x' = f(x, u), x ∈ X, u ∈ U$
yes
yes
CBBCCS
$x' = Ax + Dw$
no
no
NLCS
$x' = Ax + Dw, x ∈ X, w ∈ W$
yes
yes
NCLCS
$x' = Ax + Bu + Dw$
no
no
NLCCS
$x' = Ax + Bu + Dw, x ∈ X, u ∈ U, w ∈ W$
yes
yes
NCLCCS
$x' = Ax + Bu + c + Dw$
no
no
NACCS
$x' = Ax + Bu + c + Dw, x ∈ X, u ∈ U, w ∈ W$
yes
yes
NCALCCS
$x' = f(x, u, w)$
no
no
NBBCCS
$x' = f(x, u, w), x ∈ X, u ∈ U, w ∈ W$
yes
yes
NCBBCCS
$Mx'' + Cx' + Kx = 0$
no
no
SOLCS
$Mx'' + Cx' + Kx = b$
no
no
SOACS
$Mx'' + Cx' + Kx = Bu + d, x ∈ X, u ∈ U$
yes
yes
SOCACCS
$Mx'' + Cx' + Kx = Bu, x ∈ X, u ∈ U$
yes
yes
SOCLCCS
$Mx'' + Cx' + f_i(x) = f_e$
no
no
SOCS
$Mx'' + Cx' + f_i(x) = f_e$, x ∈ X, u ∈ U``
yes
yes
SOCCS
Settings
This document was generated with Documenter.jl version 1.5.0 on Sunday 28 July 2024. Using Julia version 1.10.4.
diff --git a/previews/PR306/objects.inv b/previews/PR306/objects.inv
new file mode 100644
index 00000000..96f0dd4a
Binary files /dev/null and b/previews/PR306/objects.inv differ
diff --git a/previews/PR306/search_index.js b/previews/PR306/search_index.js
new file mode 100644
index 00000000..463655a9
--- /dev/null
+++ b/previews/PR306/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"lib/internals/#Internals","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"This section describes functions that are internal to the library.","category":"page"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]\nDepth = 3","category":"page"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/internals/#Expression-Handling","page":"Internals","title":"Expression Handling","text":"","category":"section"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"_corresponding_type\n_capture_dim\nextract_dyn_equation_parameters\nadd_asterisk\n_sort","category":"page"},{"location":"lib/internals/#MathematicalSystems._corresponding_type","page":"Internals","title":"MathematicalSystems._corresponding_type","text":"_corresponding_type(AT::Type{<:AbstractSystem}, fields::Tuple)\n\nReturn the system type whose field names match those in fields.\n\nInput\n\nAT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem\nfields – tuple of field names\n\nOutput\n\nThe system type (either discrete or continuous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.\n\nExamples\n\njulia> using MathematicalSystems: _corresponding_type\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A),))\nLinearContinuousSystem\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A), (:B), (:X), (:U)))\nConstrainedLinearControlContinuousSystem\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._capture_dim","page":"Internals","title":"MathematicalSystems._capture_dim","text":"_capture_dim(expr)\n\nReturn the tuple containing the dimension(s) in expr.\n\nInput\n\nexpr – symbolic expression that can be of any of the following forms:\n:x or :(x) – state dimension\n:(x, u) – state and input dimension\n:(x, u, w) – state, input and noise dimensions\n\nOutput\n\nThe scalar x if expr specifies the state dimension.\nThe vector [x, u] if expr specifies state and input dimension.\nThe vector [x, u, w] if expr specifies state, input and noise dimensions.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_dyn_equation_parameters","page":"Internals","title":"MathematicalSystems.extract_dyn_equation_parameters","text":"extract_dyn_equation_parameters(equation, state, input, noise, dim, AT)\n\nExtract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.\n\nFor the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list\n\n(:A_user, :A)\n(:B_user, :B)\n(:c_user, :c)\n(:D_user, :D)\n(:f_user, :f)\n(:statedim_user :statedim)\n(:inputdim_user :inputdim)\n(:noisedim_user :noisedim)\n\nand for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.\n\nInput\n\nequation – dynamic equation\nstate – state variable\ninput – input variable\nnoise – noise variable\ndim – dimensionality\nAT – abstract system type\n\nOutput\n\nTwo arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.add_asterisk","page":"Internals","title":"MathematicalSystems.add_asterisk","text":"add_asterisk(summand, state::Symbol, input::Symbol, noise::Symbol)\n\nChecks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.\n\nInput\n\nsummand – expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nMultiplication expression or symbol.\n\nExample\n\njulia> using MathematicalSystems: add_asterisk\n\njulia> add_asterisk(:(A1*x), :x, :u, :w)\n:(A1 * x)\n\njulia> add_asterisk(:(c1), :x, :u, :w)\n:c1\n\njulia> add_asterisk(:(Ax1), :x1, :u, :w)\n:(A * x1)\n\njulia> add_asterisk(:(Awb), :x1, :u, :wb)\n:(A * wb)\n\njulia> add_asterisk(:(A1u), :x, :u, :w)\n:(A1 * u)\n\njulia> add_asterisk(:(A1ub), :x, :u, :w)\n:A1ub\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._sort","page":"Internals","title":"MathematicalSystems._sort","text":"_sort(parameters::Vector, order::Tuple)\n\nFilter and sort the vector parameters according to order.\n\nInput\n\nparameters – vector of tuples\norder – tuple of symbols\n\nOutput\n\nA new vector of tuples corresponding to parameters filtered and sorted according to order.\n\nExamples\n\njulia> using MathematicalSystems: _sort\n\njulia> parameters= [(:U1, :U), (:X1, :X), (:W1, :W)];\n\njulia> _sort(parameters, (:X, :U, :W))\n3-element Vector{Tuple{Any, Symbol}}:\n (:X1, :X)\n (:U1, :U)\n (:W1, :W)\n\njulia> parameters = [(:const, :c), (:A, :A)];\n\njulia> _sort(parameters, (:A, :B, :c, :D))\n2-element Vector{Tuple{Any, Symbol}}:\n (:A, :A)\n (:const, :c)\n\nNotes\n\nparameters is a vector that contains tuples whose second element is considered for the sorting according to order.\n\nIf a value of order is not contained in parameters, the corresponding entry of order will be omitted.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Querying-Expressions","page":"Internals","title":"Querying Expressions","text":"","category":"section"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"is_equation\nextract_sum","category":"page"},{"location":"lib/internals/#MathematicalSystems.is_equation","page":"Internals","title":"MathematicalSystems.is_equation","text":"is_equation(expr)\n\nReturn true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.\n\nInput\n\nexpr – expression\n\nOutput\n\nA Bool indicating whether expr is an equation or not.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_sum","page":"Internals","title":"MathematicalSystems.extract_sum","text":"extract_sum(summands, state::Symbol, input::Symbol, noise::Symbol)\n\nExtract the variable name and field name for every element of summands which corresponds to the elements of the right-hand side of an affine system.\n\nInput\n\nsummands – array of expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nArray of tuples of symbols with variable name and field name.\n\nExample\n\njulia> using MathematicalSystems: extract_sum\n\njulia> extract_sum([:(A1*x)], :x, :u, :w)\n1-element Vector{Tuple{Any, Symbol}}:\n (:(hcat(A1)), :A)\n\njulia> extract_sum([:(A1*x), :(B1*u), :c], :x, :u, :w)\n3-element Vector{Tuple{Any, Symbol}}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(vcat(c)), :c)\n\njulia> extract_sum([:(A1*x7), :( B1*u7), :( B2*w7)], :x7, :u7, :w7)\n3-element Vector{Tuple{Any, Symbol}}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(hcat(B2)), :D)\n\nNotes\n\nIf an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.\n\nIf an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.\n\nSimiliarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Evaluation-of-AbstractSystem-at-Given-State","page":"Internals","title":"Evaluation of AbstractSystem at Given State","text":"","category":"section"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"_instantiate","category":"page"},{"location":"lib/internals/#MathematicalSystems._instantiate","page":"Internals","title":"MathematicalSystems._instantiate","text":"_instantiate(system::AbstractSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x.\n\nNotes\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n_instantiate(system::AbstractSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state and applying one input.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x and input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n_instantiate(system::AbstractSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state and applying two inputs to an AbstractSystem.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x, input u and noise w.\n\nNotes\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Naming-Convention-for-Systems'-Fields","page":"Internals","title":"Naming Convention for Systems' Fields","text":"","category":"section"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.","category":"page"},{"location":"lib/internals/","page":"Internals","title":"Internals","text":"Field Description Getter function\nA state matrix state_matrix\nB input matrix input_matrix\nc affine term affine_term\nD noise matrix noise_matrix\nX state constraints stateset\nU input constraints inputset\nW disturbance set noiseset","category":"page"},{"location":"about/#About","page":"About","title":"About","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"This page contains some general information about this project, and recommendations about contributing.","category":"page"},{"location":"about/","page":"About","title":"About","text":"Pages = [\"about.md\"]","category":"page"},{"location":"about/#Contributing","page":"About","title":"Contributing","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.","category":"page"},{"location":"about/","page":"About","title":"About","text":"Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.","category":"page"},{"location":"about/#Branches-and-pull-requests-(PR)","page":"About","title":"Branches and pull requests (PR)","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.","category":"page"},{"location":"about/","page":"About","title":"About","text":"Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.","category":"page"},{"location":"about/#Unit-testing-and-continuous-integration-(CI)","page":"About","title":"Unit testing and continuous integration (CI)","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"This project is synchronized with GitHub Actions such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to make all unit tests pass.","category":"page"},{"location":"about/","page":"About","title":"About","text":"To run the unit tests locally, you can do:","category":"page"},{"location":"about/","page":"About","title":"About","text":"julia> using Pkg\n\njulia> Pkg.test(\"MathematicalSystems\")","category":"page"},{"location":"about/","page":"About","title":"About","text":"We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.","category":"page"},{"location":"about/#Contributing-to-the-documentation","page":"About","title":"Contributing to the documentation","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"New functions and types should be documented according to our guidelines directly in the source code.","category":"page"},{"location":"about/","page":"About","title":"About","text":"You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:","category":"page"},{"location":"about/","page":"About","title":"About","text":"julia> ?LinearContinuousSystem","category":"page"},{"location":"about/","page":"About","title":"About","text":"This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).","category":"page"},{"location":"about/","page":"About","title":"About","text":"To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:","category":"page"},{"location":"about/","page":"About","title":"About","text":"$ julia --color=yes docs/make.jl","category":"page"},{"location":"about/","page":"About","title":"About","text":"Note that this also runs all doctests which will take some time.","category":"page"},{"location":"about/#Related-projects","page":"About","title":"Related projects","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.","category":"page"},{"location":"about/","page":"About","title":"About","text":"Below we list more related projects.","category":"page"},{"location":"about/","page":"About","title":"About","text":"Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia","category":"page"},{"location":"about/#Credits","page":"About","title":"Credits","text":"","category":"section"},{"location":"about/","page":"About","title":"About","text":"These persons have contributed to MathematicalSystems.jl (in alphabetic order):","category":"page"},{"location":"about/","page":"About","title":"About","text":"Marcelo Forets\nBenoît Legat\nChristian Schilling\nUeli Wechsler","category":"page"},{"location":"man/systems/#Overview-of-System-Types","page":"Overview of System Types","title":"Overview of System Types","text":"","category":"section"},{"location":"man/systems/#Using-the-@system-Macro","page":"Overview of System Types","title":"Using the @system Macro","text":"","category":"section"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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) = dxdt is the derivative of state x(t) with respect to \"time\":","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"using MathematicalSystems\n\n@system(x' = -2x)","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"We can also add state constraints, say x(t) 05,","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"using LazySets\n\nH = HalfSpace([-1.0], -0.5) # x >= 0.5\n@system(x' = -2x, x ∈ H)","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"Systems of ODEs can be defined using vector notation:","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"A = [1.0 0.0; -1.0 -2.0]\nB = Ball2(zeros(2), 1.0)\nc = [0.0, 5.0]\n@system(z' = A*z + c, z ∈ B)","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"which defines the two-dimensional system x = y, y = -x - 2y + 3, with state constraints z B = sqrtx^2 + y^2 leq 5.","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"Initial-value problems can be specified with the @ivp macro. For instance, we can attach an initial condition z(0) = (02 02) to the previous example:","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"S0 = Singleton([0.2, 0.2])\n@ivp(z' = A*z + c, z ∈ B, z(0) ∈ S0)","category":"page"},{"location":"man/systems/#Inputs","page":"Overview of System Types","title":"Inputs","text":"","category":"section"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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).","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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.","category":"page"},{"location":"man/systems/#Summary-Tables","page":"Overview of System Types","title":"Summary Tables","text":"","category":"section"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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.","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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.","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"Abbreviation System type\nCIS ContinuousIdentitySystem\nCCIS ConstrainedContinuousIdentitySystem\nLCS LinearContinuousSystem\nACS AffineContinuousSystem\nLCCS LinearControlContinuousSystem\nACCS AffineControlContinuousSystem\nCLCS ConstrainedLinearContinuousSystem\nCACS ConstrainedAffineContinuousSystem\nCACCS ConstrainedAffineControlContinuousSystem\nCLCCS ConstrainedLinearControlContinuousSystem\nLACS LinearDescriptorContinuousSystem\nCLACS ConstrainedLinearDescriptorContinuousSystem\nPCS PolynomialContinuousSystem\nCPCS PolynomialContinuousSystem\nBBCS BlackBoxContinuousSystem\nCBBCS ConstrainedBlackBoxContinuousSystem\nBBCCS BlackBoxControlContinuousSystem\nCBBCCS ConstrainedBlackBoxControlContinuousSystem\nNLCS NoisyLinearContinuousSystem\nNCLCS NoisyConstrainedLinearContinuousSystem\nNLCCS NoisyLinearControlContinuousSystem\nNCLCCS NoisyConstrainedLinearControlContinuousSystem\nNACCS NoisyAffineControlContinuousSystem\nNCALCCS NoisyConstrainedAffineControlContinuousSystem\nNBBCCS NoisyBlackBoxControlContinuousSystem\nNCBBCCS NoisyConstrainedBlackBoxControlContinuousSystem\nSOLCS SecondOrderLinearContinuousSystem\nSOACS SecondOrderAffineContinuousSystem\nSOCACCS SecondOrderConstrainedAffineControlContinuousSystem\nSOCLCCS SecondOrderConstrainedLinearControlContinuousSystem","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"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).","category":"page"},{"location":"man/systems/","page":"Overview of System Types","title":"Overview of System Types","text":"Equation State constraints Input constraints System type (abbr.)\nx = 0 no no CIS\nx = 0 x X yes no CCIS\nx = Ax no no LCS\nx = Ax + c no no ACS\nx = Ax + Bu no no LCCS\nx = Ax + Bu + c no no ACCS\nx = Ax x X yes no CLCS\nx = Ax + c x X yes no CACS\nx = Ax + Bu + c x X u U yes yes CACCS\nx = Ax + Bu x X u U yes yes CLCCS\nEx = Ax no no LACS\nEx = Ax x X yes no CLACS\nx = p(x) no no PCS\nx = p(x) x X yes no CPCS\nx = f(x) no no BBCS\nx = f(x) x X yes no CBBCS\nx = f(x u) no no BBCCS\nx = f(x u) x X u U yes yes CBBCCS\nx = Ax + Dw no no NLCS\nx = Ax + Dw x X w W yes yes NCLCS\nx = Ax + Bu + Dw no no NLCCS\nx = Ax + Bu + Dw x X u U w W yes yes NCLCCS\nx = Ax + Bu + c + Dw no no NACCS\nx = Ax + Bu + c + Dw x X u U w W yes yes NCALCCS\nx = f(x u w) no no NBBCCS\nx = f(x u w) x X u U w W yes yes NCBBCCS\nMx + Cx + Kx = 0 no no SOLCS\nMx + Cx + Kx = b no no SOACS\nMx + Cx + Kx = Bu + d x X u U yes yes SOCACCS\nMx + Cx + Kx = Bu x X u U yes yes SOCLCCS\nMx + Cx + f_i(x) = f_e no no SOCS\nMx + Cx + f_i(x) = f_e, x ∈ X, u ∈ U`` yes yes SOCCS","category":"page"},{"location":"lib/types/#Types","page":"Types","title":"Types","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"This section describes systems types implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/types/","page":"Types","title":"Types","text":"Pages = [\"types.md\"]\nDepth = 3","category":"page"},{"location":"lib/types/","page":"Types","title":"Types","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/types/#Abstract-Systems","page":"Types","title":"Abstract Systems","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractSystem","page":"Types","title":"MathematicalSystems.AbstractSystem","text":"AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractContinuousSystem","page":"Types","title":"MathematicalSystems.AbstractContinuousSystem","text":"AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractDiscreteSystem","page":"Types","title":"MathematicalSystems.AbstractDiscreteSystem","text":"AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Continuous-Systems","page":"Types","title":"Continuous Systems","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nAffineControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearDescriptorContinuousSystem\nConstrainedLinearDescriptorContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem\nBlackBoxContinuousSystem\nConstrainedBlackBoxContinuousSystem\nBlackBoxControlContinuousSystem\nConstrainedBlackBoxControlContinuousSystem\nNoisyLinearContinuousSystem\nNoisyConstrainedLinearContinuousSystem\nNoisyLinearControlContinuousSystem\nNoisyConstrainedLinearControlContinuousSystem\nNoisyAffineControlContinuousSystem\nNoisyConstrainedAffineControlContinuousSystem\nNoisyBlackBoxControlContinuousSystem\nNoisyConstrainedBlackBoxControlContinuousSystem\nSecondOrderLinearContinuousSystem\nSecondOrderAffineContinuousSystem\nSecondOrderConstrainedAffineControlContinuousSystem\nSecondOrderConstrainedLinearControlContinuousSystem\nSecondOrderContinuousSystem\nSecondOrderConstrainedContinuousSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.ContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ContinuousIdentitySystem","text":"ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form:\n\n x(t) = 0 forall t\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedContinuousIdentitySystem","text":"ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with domain constraints of the form:\n\n x(t) = 0 x(t) mathcalX forall t\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearContinuousSystem","page":"Types","title":"MathematicalSystems.LinearContinuousSystem","text":"LinearContinuousSystem\n\nContinuous-time linear system of the form:\n\n x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineContinuousSystem","page":"Types","title":"MathematicalSystems.AffineContinuousSystem","text":"AffineContinuousSystem\n\nContinuous-time affine system of the form:\n\n x(t) = A x(t) + c forall t\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.LinearControlContinuousSystem","text":"LinearControlContinuousSystem\n\nContinuous-time linear control system of the form:\n\n x(t) = A x(t) + B u(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.AffineControlContinuousSystem","text":"AffineControlContinuousSystem\n\nContinuous-time affine control system of the form:\n\n x(t) = A x(t) + B u(t) + c forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearContinuousSystem","text":"ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineContinuousSystem","text":"ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with domain constraints of the form:\n\n x(t) = A x(t) + c x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlContinuousSystem","text":"ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlContinuousSystem","text":"ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDescriptorContinuousSystem","page":"Types","title":"MathematicalSystems.LinearDescriptorContinuousSystem","text":"LinearDescriptorContinuousSystem\n\nContinuous-time linear descriptor system of the form:\n\n E x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDescriptorContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDescriptorContinuousSystem","text":"ConstrainedLinearDescriptorContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n E x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.PolynomialContinuousSystem","text":"PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form:\n\n x(t) = p(x(t)) forall t\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialContinuousSystem","text":"ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with domain constraints:\n\n x(t) = p(x(t)) x(t) mathcalX forall t\n\nFields\n\np – polynomial vector field\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxContinuousSystem","text":"BlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side of the form:\n\n x(t) = f(x(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxContinuousSystem","text":"ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t)) x(t) mathcalX forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlContinuousSystem","text":"BlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","text":"ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t)) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearContinuousSystem","text":"NoisyLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance of the form:\n\n x(t) = A x(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearContinuousSystem","text":"NoisyConstrainedLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + D w(t) x(t) mathcalX w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlContinuousSystem","text":"NoisyLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","text":"NoisyConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlContinuousSystem","text":"NoisyAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","text":"NoisyConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlContinuousSystem","text":"NoisyBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t) w(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","text":"NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t) w(t)) quad x(t) mathcalX quad u(t) mathcalU quad w(t) mathcalW quad forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderLinearContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderLinearContinuousSystem","text":"SecondOrderLinearContinuousSystem\n\nContinuous-time second order linear system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = 0 forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderAffineContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderAffineContinuousSystem","text":"SecondOrderAffineContinuousSystem\n\nContinuous-time second order affine system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = b forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nb – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem","text":"SecondOrderConstrainedAffineControlContinuousSystem\n\nContinuous-time second order constrained affine control system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = Bu(t) + d x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nd – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem","text":"SecondOrderConstrainedLinearControlContinuousSystem\n\nContinuous-time second order constrained linear control system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = Bu(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderContinuousSystem","text":"SecondOrderContinuousSystem\n\nContinuous-time second-order system of the form:\n\n Mx(t) + Cx(t) + f_i(x) = f_e(t) forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nfi – internal forces\nfe – external forces\n\nNotes\n\nTypically fi(x) is a state-dependent function, and fe is a given vector. In this implementation, their respective types, FI and FE, are generic.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedContinuousSystem","text":"SecondOrderConstrainedContinuousSystem\n\nContinuous-time constrained second-order system of the form:\n\n Mx(t) + Cx(t) + f_i(x) = f_e(t) forall t x X f_e(t) U\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nfi – internal forces\nfe – external forces\nX – state set\nU – input set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discrete-Systems","page":"Types","title":"Discrete Systems","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nAffineDiscreteSystem\nLinearControlDiscreteSystem\nAffineControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedAffineDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nConstrainedAffineControlDiscreteSystem\nLinearDescriptorDiscreteSystem\nConstrainedLinearDescriptorDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem\nBlackBoxDiscreteSystem\nConstrainedBlackBoxDiscreteSystem\nBlackBoxControlDiscreteSystem\nConstrainedBlackBoxControlDiscreteSystem\nNoisyLinearDiscreteSystem\nNoisyConstrainedLinearDiscreteSystem\nNoisyLinearControlDiscreteSystem\nNoisyConstrainedLinearControlDiscreteSystem\nNoisyAffineControlDiscreteSystem\nNoisyConstrainedAffineControlDiscreteSystem\nNoisyBlackBoxControlDiscreteSystem\nNoisyConstrainedBlackBoxControlDiscreteSystem\nSecondOrderLinearDiscreteSystem\nSecondOrderAffineDiscreteSystem\nSecondOrderConstrainedAffineControlDiscreteSystem\nSecondOrderConstrainedLinearControlDiscreteSystem\nSecondOrderDiscreteSystem\nSecondOrderConstrainedDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.DiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.DiscreteIdentitySystem","text":"DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form:\n\n x_k+1 = x_k forall k\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedDiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedDiscreteIdentitySystem","text":"ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with domain constraints of the form:\n\n x_k+1 = x_k x_k mathcalX forall k\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDiscreteSystem","text":"LinearDiscreteSystem\n\nDiscrete-time linear system of the form:\n\n x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineDiscreteSystem","text":"AffineDiscreteSystem\n\nDiscrete-time affine system of the form:\n\n x_k+1 = A x_k + c forall k\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearControlDiscreteSystem","text":"LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form:\n\n x_k+1 = A x_k + B u_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineControlDiscreteSystem","text":"AffineControlDiscreteSystem\n\nContinuous-time affine control system of the form:\n\n x_k+1 = A x_k + B u_k + c forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDiscreteSystem","text":"ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineDiscreteSystem","text":"ConstrainedAffineDiscreteSystem\n\nDiscrete-time affine system with domain constraints of the form:\n\n x_k+1 = A x_k + c x_k mathcalX forall k\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlDiscreteSystem","text":"ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlDiscreteSystem","text":"ConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDescriptorDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDescriptorDiscreteSystem","text":"LinearDescriptorDiscreteSystem\n\nDiscrete-time linear descriptor system of the form:\n\n E x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDescriptorDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDescriptorDiscreteSystem","text":"ConstrainedLinearDescriptorDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n E x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.PolynomialDiscreteSystem","text":"PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form:\n\n x_k+1 = p(x_k) forall k\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialDiscreteSystem","text":"ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with domain constraints:\n\n x_k+1 = p(x_k) x_k mathcalX forall k\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxDiscreteSystem","text":"BlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","text":"ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k) x_k mathcalX forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlDiscreteSystem","text":"BlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","text":"ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearDiscreteSystem","text":"NoisyLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance of the form:\n\n x_k+1 = A x_k + D w_k forall k\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","text":"NoisyConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + D w_k x_k mathcalX w(t) mathcalW forall k\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlDiscreteSystem","text":"NoisyLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","text":"NoisyConstrainedLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlDiscreteSystem","text":"NoisyAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","text":"NoisyConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","text":"NoisyBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","text":"NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) quad x_k mathcalX quad u_k mathcalU quad w_k mathcalW quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderLinearDiscreteSystem","text":"SecondOrderLinearDiscreteSystem\n\nDiscrete-time second order linear system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = 0 forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderAffineDiscreteSystem","text":"SecondOrderAffineDiscreteSystem\n\nDiscrete-time second order affine system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = b forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nb – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem","text":"SecondOrderConstrainedAffineControlDiscreteSystem\n\nDiscrete-time second order constrained affine control system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = Bu_k + d x_k mathcalX u_k mathcalU forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nd – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem","text":"SecondOrderConstrainedLinearControlDiscreteSystem\n\nDiscrete-time second order constrained linear control system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = Bu_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderDiscreteSystem","text":"SecondOrderDiscreteSystem\n\nDiscrete-time second-order system of the form:\n\n Mx_k+2 + Cx_k + f_i(x_k) = f_e(t_k) forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nfi – internal forces\nfe – external forces\n\nNotes\n\nTypically 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.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedDiscreteSystem","text":"SecondOrderConstrainedDiscreteSystem\n\nDiscrete-time constrained second-order system of the form:\n\n Mx_k+2 + Cx_k + f_i(x_k) = f_e(t_k) forall k x_k X f_e(t_k) U\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nfi – internal forces\nfe – external forces\nX – state set\nU – input set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discretization-Algorithms","page":"Types","title":"Discretization Algorithms","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"AbstractDiscretizationAlgorithm\nExactDiscretization\nEulerDiscretization","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractDiscretizationAlgorithm","page":"Types","title":"MathematicalSystems.AbstractDiscretizationAlgorithm","text":"AbstractDiscretizationAlgorithm\n\nAbstract supertype for all discretization algorithms.\n\nNote\n\nFor implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method\n\n_discretize(::NewDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nare required.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ExactDiscretization","page":"Types","title":"MathematicalSystems.ExactDiscretization","text":"ExactDiscretization <: AbstractDiscretizationAlgorithm\n\nExact discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] Wikipedia\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.EulerDiscretization","page":"Types","title":"MathematicalSystems.EulerDiscretization","text":"EulerDiscretization <: AbstractDiscretizationAlgorithm\n\nEuler discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well-known result from the literature [1].\n\n[1] Wikipedia\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Initial-Value-Problems","page":"Types","title":"Initial Value Problems","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"InitialValueProblem\nIVP\ninitial_state\nsystem","category":"page"},{"location":"lib/types/#MathematicalSystems.InitialValueProblem","page":"Types","title":"MathematicalSystems.InitialValueProblem","text":"InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystem\n\nParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x₀ = -12 12:\n\njulia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);\n\njulia> x₀ = [-1/2, 1/2];\n\njulia> p = InitialValueProblem(s, x₀);\n\njulia> initial_state(p) # same as p.x0\n2-element Vector{Float64}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IVP","page":"Types","title":"MathematicalSystems.IVP","text":"IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.initial_state","page":"Types","title":"MathematicalSystems.initial_state","text":"initial_state(ivp::InitialValueProblem)\n\nReturn the initial state of an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe initial state of an initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.system","page":"Types","title":"MathematicalSystems.system","text":"system(ivp::InitialValueProblem)\n\nReturn the system wrapped by an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe system of the given initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Identity-Operator","page":"Types","title":"Identity Operator","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"IdentityMultiple\nId","category":"page"},{"location":"lib/types/#MathematicalSystems.IdentityMultiple","page":"Types","title":"MathematicalSystems.IdentityMultiple","text":"IdentityMultiple{T} < AbstractMatrix{T} where T\n\nA scalar multiple of the identity matrix of given order and numeric type.\n\nFields\n\nM – uniform scaling operator of type T\nn – size of the identity matrix\n\nNotes\n\nThis 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.\n\nInternally, 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.\n\nThe difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.\n\nExamples\n\nOnly specifying the matrix size represents an identity matrix:\n\njulia> using MathematicalSystems: IdentityMultiple\n\njulia> I2 = Id(2)\nIdentityMultiple{Float64} of value 1.0 and order 2\n\njulia> I2 + I2\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> 4*I2\nIdentityMultiple{Float64} of value 4.0 and order 2\n\nThe scaling (default 1.0) can be passed as the second argument:\n\njulia> I2r = Id(2, 1//1)\nIdentityMultiple{Rational{Int64}} of value 1//1 and order 2\n\njulia> I2r + I2r\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\njulia> 4*I2r\nIdentityMultiple{Rational{Int64}} of value 4//1 and order 2\n\nAlternatively, use the constructor passing the UniformScaling (I):\n\njulia> using LinearAlgebra\n\njulia> I2 = IdentityMultiple(2.0*I, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = IdentityMultiple(2//1*I, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.Id","page":"Types","title":"MathematicalSystems.Id","text":"Id(n::Int, [λ]::Number=1.0)\n\nConvenience constructor of an IdentityMultiple.\n\nInput\n\nn – dimension\nλ – (optional; default: 1.0) scaling factor\n\nOutput\n\nAn IdentityMultiple of the given size and scaling factor.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Input-Types","page":"Types","title":"Input Types","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"AbstractInput\nConstantInput\nVaryingInput","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractInput","page":"Types","title":"MathematicalSystems.AbstractInput","text":"AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstantInput","page":"Types","title":"MathematicalSystems.ConstantInput","text":"ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Vector{Rational{Int64}}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.VaryingInput","page":"Types","title":"MathematicalSystems.VaryingInput","text":"VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64}, Vector{Rational{Int64}}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase's iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64}, Vector{Rational{Int64}}}}\n\njulia> collect(nextinput(v, 1))\n1-element Vector{Rational{Int64}}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Vector{Rational{Int64}}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Vector{Rational{Int64}}:\n -1//2\n 1//2\n\njulia> [3*vi for vi in v]\n2-element Vector{Rational{Int64}}:\n -3//2\n 3//2\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Vector{Rational{Int64}}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->3*x, v)\nVaryingInput{Rational{Int64}, Vector{Rational{Int64}}}(Rational{Int64}[-3//2, 3//2])\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Maps","page":"Types","title":"Maps","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"AbstractMap\nIdentityMap\nConstrainedIdentityMap\nLinearMap\nConstrainedLinearMap\nAffineMap\nConstrainedAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap\nResetMap\nConstrainedResetMap\nBlackBoxMap\nConstrainedBlackBoxMap\nBlackBoxControlMap\nConstrainedBlackBoxControlMap","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractMap","page":"Types","title":"MathematicalSystems.AbstractMap","text":"AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IdentityMap","page":"Types","title":"MathematicalSystems.IdentityMap","text":"IdentityMap\n\nAn identity map\n\n x x\n\nFields\n\ndim – dimension\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedIdentityMap","page":"Types","title":"MathematicalSystems.ConstrainedIdentityMap","text":"ConstrainedIdentityMap\n\nAn identity map with state constraints of the form\n\n x x x mathcalX\n\nFields\n\ndim – dimension\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearMap","page":"Types","title":"MathematicalSystems.LinearMap","text":"LinearMap\n\nA linear map\n\n x Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearMap","text":"ConstrainedLinearMap\n\nA linear map with state constraints of the form\n\n x Ax x mathcalX\n\nFields\n\nA – matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineMap","page":"Types","title":"MathematicalSystems.AffineMap","text":"AffineMap\n\nAn affine map\n\n x Ax + c\n\nFields\n\nA – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineMap","text":"ConstrainedAffineMap\n\nAn affine map with state constraints of the form\n\n x Ax + c x mathcalX\n\nFields\n\nA – matrix\nc – vector\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlMap","page":"Types","title":"MathematicalSystems.LinearControlMap","text":"LinearControlMap\n\nA linear control map\n\n (x u) Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlMap","text":"ConstrainedLinearControlMap\n\nA linear control map with state and input constraints\n\n (x u) Ax + Bu x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlMap","page":"Types","title":"MathematicalSystems.AffineControlMap","text":"AffineControlMap\n\nAn affine control map\n\n (x u) Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlMap","text":"ConstrainedAffineControlMap\n\nAn affine control map with state and input constraints\n\n (x u) Ax + Bu + c x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ResetMap","page":"Types","title":"MathematicalSystems.ResetMap","text":"ResetMap\n\nA reset map\n\n x R(x)\n\nsuch that a subset of the variables is given a specified value, and the rest are unchanged.\n\nFields\n\ndim – dimension\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedResetMap","page":"Types","title":"MathematicalSystems.ConstrainedResetMap","text":"ConstrainedResetMap\n\nA reset map with state constraints of the form\n\n x R(x) x mathcalX\n\nsuch that the specified variables are assigned a given value, and the remaining variables are unchanged.\n\nFields\n\ndim – dimension\nX – state constraints\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxMap","page":"Types","title":"MathematicalSystems.BlackBoxMap","text":"BlackBoxMap\n\nA black-box map of the form\n\n x h(x)\n\nFields\n\ndim – state dimension\noutput_dim – output dimension\nh – output function\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxMap","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxMap","text":"ConstrainedBlackBoxMap\n\nA constrained black-box map of the form\n\n x h(x) x mathcalX\n\nFields\n\ndim – state dimension\noutput_dim – output dimension\nh – output function\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlMap","page":"Types","title":"MathematicalSystems.BlackBoxControlMap","text":"BlackBoxControlMap\n\nA black-box control map of the form\n\n (x u) h(x u)\n\nFields\n\ndim – state dimension\ninput_dim – input dimension\noutput_dim – output dimension\nh – output function\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlMap","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlMap","text":"ConstrainedBlackBoxControlMap\n\nA constrained black-box control map of the form\n\n (x u) h(x u) x mathcalX u mathcalU\n\nFields\n\ndim – state dimension\ninput_dim – input dimension\noutput_dim – output dimension\nh – output function\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Systems-with-Output","page":"Types","title":"Systems with Output","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem","category":"page"},{"location":"lib/types/#MathematicalSystems.SystemWithOutput","page":"Types","title":"MathematicalSystems.SystemWithOutput","text":"SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap} <: AbstractSystem\n\nParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearTimeInvariantSystem","page":"Types","title":"MathematicalSystems.LinearTimeInvariantSystem","text":"LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.LTISystem","page":"Types","title":"MathematicalSystems.LTISystem","text":"LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Vector-Fields","page":"Types","title":"Vector Fields","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"VectorField","category":"page"},{"location":"lib/types/#MathematicalSystems.VectorField","page":"Types","title":"MathematicalSystems.VectorField","text":"VectorField{T<:Function}\n\nType that computes the vector field of an AbstractContinuousSystem.\n\nFields\n\nfield – function for calculating the vector field\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Macros","page":"Types","title":"Macros","text":"","category":"section"},{"location":"lib/types/","page":"Types","title":"Types","text":"@system\n@ivp\n@map","category":"page"},{"location":"lib/types/#MathematicalSystems.@system","page":"Types","title":"MathematicalSystems.@system","text":"system(expr...)\n\nReturn an instance of the system type corresponding to the given expressions.\n\nInput\n\nexpr – expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system\n\nOutput\n\nA system that best matches the given expressions.\n\nNotes\n\nTerms. The expression expr contains one or more of the following sub-expressions:\n\ndynamic equation, either continuous, e.g.x' = Ax, or discrete, e.g. x⁺ = Ax\nset constraints, e.g. x ∈ X\ninput constraints, e.g. u ∈ U\ndimensionality, e.g. dim: (2,1) or dim = 1\nspecification of the input variable, e.g. input: u or input = u\nspecification of the noise variable, e,g, noise: w or noise = w\n\nThe macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:\n\n@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)\n\nThe 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.\n\nDynamic 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.\n\nDefault 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.\n\nExceptions. The following exceptions and particular cases apply:\n\nIf the right-hand side has the form A*x + B*foo, A*x + B*foo + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.\nIf the left-hand side contains a multiplicative term in the form E*x⁺ or E*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.\nSystems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.\n\nExamples\n\nLet us first create a continuous linear system using this macro:\n\njulia> A = [1. 0; 0 1.];\n\njulia> @system(x' = A*x)\nLinearContinuousSystem{Float64, Matrix{Float64}}([1.0 0.0; 0.0 1.0])\n\nA discrete system is defined by using ⁺:\n\njulia> @system(x⁺ = A*x)\nLinearDiscreteSystem{Float64, Matrix{Float64}}([1.0 0.0; 0.0 1.0])\n\nAdditionally, 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:\n\njulia> using LazySets\n\njulia> B = Matrix([1.0 0.5]');\n\njulia> c = [1.0, 1.5];\n\njulia> X = BallInf(zeros(2), 10.0);\n\njulia> U = BallInf(zeros(1), 2.0);\n\njulia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)\nConstrainedAffineControlContinuousSystem{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))\n\nFor 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\n\njulia> f(x, u) = x + u;\n\njulia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))\nConstrainedBlackBoxControlDiscreteSystem{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))\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#MathematicalSystems.@ivp","page":"Types","title":"MathematicalSystems.@ivp","text":"ivp(expr...)\n\nReturn an instance of the initial-value problem type corresponding to the given expressions.\n\nInput\n\nexpr – 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)\n\nOutput\n\nAn initial-value problem that best matches the given expressions.\n\nNotes\n\nThis 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.\n\nThe macro can also be called with a system argument of type AbstractSystem in the form @ivp(system, state(0) ∈ initial_set).\n\nExamples\n\njulia> p = @ivp(x' = -x, x(0) ∈ [1.0]);\n\njulia> typeof(p)\nInitialValueProblem{LinearContinuousSystem{Float64, IdentityMultiple{Float64}}, Vector{Float64}}\n\njulia> initial_state(p)\n1-element Vector{Float64}:\n 1.0\n\njulia> sys = @system(x' = [1 0; 0 1] * x);\n\njulia> @ivp(sys, x(0) ∈ [-1, 1])\nInitialValueProblem{LinearContinuousSystem{Int64, Matrix{Int64}}, Vector{Int64}}(LinearContinuousSystem{Int64, Matrix{Int64}}([1 0; 0 1]), [-1, 1])\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#MathematicalSystems.@map","page":"Types","title":"MathematicalSystems.@map","text":"map(ex, args)\n\nReturn an instance of the map type corresponding to the given expression.\n\nInput\n\nex – an expression defining the map, in the form of an anonymous function\nargs – additional optional arguments\n\nOutput\n\nA map that best matches the given expression.\n\nExamples\n\nLet us first create a linear map using this macro:\n\njulia> @map x -> [1 0; 0 0]*x\nLinearMap{Int64, Matrix{Int64}}([1 0; 0 0])\n\nWe can create an affine system as well:\n\njulia> @map x -> [1 0; 0 0]*x + [2, 0]\nAffineMap{Int64, Matrix{Int64}, Vector{Int64}}([1 0; 0 0], [2, 0])\n\nAdditional 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:\n\njulia> @map(x -> x, dim=5)\nIdentityMap(5)\n\nA state constraint on such map can be specified passing the additional argument x ∈ X.\n\nAn identity map can alternatively be created by giving a the size of the identity matrix as Id(n), for example:\n\njulia> @map x -> Id(5)*x\nIdentityMap(5)\n\n\n\n\n\n","category":"macro"},{"location":"#MathematicalSystems.jl","page":"Home","title":"MathematicalSystems.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]","category":"page"},{"location":"","page":"Home","title":"Home","text":"MathematicalSystems is a Julia package for mathematical systems interfaces.","category":"page"},{"location":"#Features","page":"Home","title":"Features","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled, descriptor systems, etc.\nIterator interfaces to handle constant or time-varying inputs.","category":"page"},{"location":"#Ecosystem","page":"Home","title":"Ecosystem","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The following packages use MathematicalSystems.jl:","category":"page"},{"location":"","page":"Home","title":"Home","text":"Dionysos.jl – Optimal control of cyber-physical systems\nHybridSystems.jl – Hybrid Systems definitions in Julia\nReachabilityAnalysis.jl – Methods to compute sets of states reachable by dynamical systems\nSpaceExParser.jl – SpaceEx modeling language parser\nStructuralDynamicsODESolvers.jl – Numerical integration methods for structural dynamics problems\nSwitchOnSafety.jl – Computing controlled invariant sets of Hybrid Systems using Sum Of Squares Programming","category":"page"},{"location":"#Manual-Outline","page":"Home","title":"Manual Outline","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Pages = [\n \"man/systems.md\"\n]\nDepth = 2","category":"page"},{"location":"#Library-Outline","page":"Home","title":"Library Outline","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Pages = [\n \"lib/types.md\",\n \"lib/methods.md\",\n \"lib/internals.md\"\n]\nDepth = 2","category":"page"},{"location":"lib/methods/#Methods","page":"Methods","title":"Methods","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"This section describes systems methods implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"Pages = [\"methods.md\"]\nDepth = 3","category":"page"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/methods/#States","page":"Methods","title":"States","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"statedim\nstateset","category":"page"},{"location":"lib/methods/#MathematicalSystems.statedim","page":"Methods","title":"MathematicalSystems.statedim","text":"statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.stateset","page":"Methods","title":"MathematicalSystems.stateset","text":"stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Inputs","page":"Methods","title":"Inputs","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"inputdim\ninputset\nnextinput","category":"page"},{"location":"lib/methods/#MathematicalSystems.inputdim","page":"Methods","title":"MathematicalSystems.inputdim","text":"inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.inputset","page":"Methods","title":"MathematicalSystems.inputset","text":"inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.nextinput","page":"Methods","title":"MathematicalSystems.nextinput","text":"nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Noises","page":"Methods","title":"Noises","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"noisedim\nnoiseset","category":"page"},{"location":"lib/methods/#MathematicalSystems.noisedim","page":"Methods","title":"MathematicalSystems.noisedim","text":"noisedim(s::AbstractSystem)\n\nReturns the dimension of the noise space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.noiseset","page":"Methods","title":"MathematicalSystems.noiseset","text":"noiseset(s::AbstractSystem)\n\nReturns the set of allowed noises of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Output","page":"Methods","title":"Output","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"outputdim\noutputmap","category":"page"},{"location":"lib/methods/#MathematicalSystems.outputdim","page":"Methods","title":"MathematicalSystems.outputdim","text":"outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.outputmap","page":"Methods","title":"MathematicalSystems.outputmap","text":"outputmap(s::AbstractSystem)\n\nReturns the output map of a system with output.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Traits","page":"Methods","title":"Traits","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"islinear(::AbstractSystem)\nislinear(::AbstractMap)\nisaffine(::AbstractSystem)\nisaffine(::AbstractMap)\nispolynomial(::AbstractSystem)\nisblackbox(::AbstractSystem)\nisnoisy(::AbstractSystem)\niscontrolled(::AbstractSystem)\nisconstrained(::AbstractSystem)\nstate_matrix(::AbstractSystem)\ninput_matrix(::AbstractSystem)\nnoise_matrix(::AbstractSystem)\naffine_term(::AbstractSystem)\nmapping(::AbstractSystem)","category":"page"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(s::AbstractSystem)\n\nDetermines whether the dynamics of system s is specified by linear equations.\n\nNotes\n\nWe 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 mathbbR. 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).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(m::AbstractMap)\n\nDetermines whether the map m is linear or not.\n\nNotes\n\nA map is linear if it preserves the operations of scalar multiplication and vector addition.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(s::AbstractSystem)\n\nDetermines whether the dynamics of system s is specified by affine equations.\n\nNotes\n\nAn 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.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(m::AbstractMap)\n\nDetermines whether the map m is affine or not.\n\nNotes\n\nAn affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.ispolynomial-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.ispolynomial","text":"ispolynomial(s::AbstractSystem)\n\nDetermines whether the dynamics of system s is specified by polynomial equations.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isblackbox-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isblackbox","text":"isblackbox(s::AbstractSystem)\n\nDetermines whether no specific structure is assumed for the dynamics of system s.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isnoisy-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isnoisy","text":"isnoisy(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a noise term w.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.iscontrolled-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.iscontrolled","text":"iscontrolled(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a control input u.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isconstrained-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isconstrained","text":"isconstrained(s::AbstractSystem)\n\nDetermines if the system s has constraints on the state, input and noise, respectively (those that are available).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.state_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.state_matrix","text":"state_matrix(s::AbstractSystem)\n\nReturns the state matrix of an affine system.\n\nNotes\n\nThe state matrix is the matrix proportional to the state, e.g. the matrix A in the linear continuous system x = Ax.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.input_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.input_matrix","text":"input_matrix(s::AbstractSystem)\n\nReturns the input matrix of a system with linear input.\n\nNotes\n\nThe input matrix is the matrix proportional to the input, e.g. the matrix B in the linear continuous system with input, x = Ax + Bu.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.noise_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.noise_matrix","text":"noise_matrix(s::AbstractSystem)\n\nReturns the noise matrix of a system with linear noise.\n\nNotes\n\nThe noise matrix is the matrix proportional to the noise, e.g. the matrix D in the linear system with noise, x = Ax + Dw.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.affine_term-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.affine_term","text":"affine_term(s::AbstractSystem)\n\nReturns the affine term in an affine system.\n\nNotes\n\nThe affine term is e.g. the vector c in the affine system x = Ax + c.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.mapping-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.mapping","text":"mapping(s::AbstractSystem)\n\nReturns the mapping of a black-box system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#Maps","page":"Methods","title":"Maps","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"apply","category":"page"},{"location":"lib/methods/#MathematicalSystems.apply","page":"Methods","title":"MathematicalSystems.apply","text":"apply(m::AbstractMap, args...)\n\nApply the rule specified by the map to the given arguments.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Successor","page":"Methods","title":"Successor","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"successor","category":"page"},{"location":"lib/methods/#MathematicalSystems.successor","page":"Methods","title":"MathematicalSystems.successor","text":"successor(system::DiscreteIdentitySystem, x::AbstractVector)\n\nReturn the successor state of a DiscreteIdentitySystem.\n\nInput\n\nsystem – DiscreteIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::ConstrainedDiscreteIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedDiscreteIdentitySystem.\n\nInput\n\nsystem – ConstrainedDiscreteIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x and input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x, input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Vector-Field","page":"Methods","title":"Vector Field","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"vector_field","category":"page"},{"location":"lib/methods/#MathematicalSystems.vector_field","page":"Methods","title":"MathematicalSystems.vector_field","text":"vector_field(system::ContinuousIdentitySystem, x::AbstractVector)\n\nReturn the vector field state of a ContinuousIdentitySystem.\n\nInput\n\nsystem – ContinuousIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nA zeros vector of dimension statedim.\n\n\n\n\n\nvector_field(system::ConstrainedContinuousIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of a ConstrainedContinuousIdentitySystem.\n\nInput\n\nsystem – ConstrainedContinuousIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nA zeros vector of dimension statedim.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x and applying input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x and applying input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Discretization","page":"Methods","title":"Discretization","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"discretize","category":"page"},{"location":"lib/methods/#MathematicalSystems.discretize","page":"Methods","title":"MathematicalSystems.discretize","text":"discretize(system::AbstractContinuousSystem, ΔT::Real,\n algorithm::AbstractDiscretizationAlgorithm=ExactDiscretization(),\n constructor=_default_complementary_constructor(system))\n\nDiscretization of a isaffine AbstractContinuousSystem to a AbstractDiscreteSystem with sampling time ΔT using the discretization method algorithm.\n\nInput\n\nsystem – an affine continuous system\nΔT – sampling time\nalgorithm – (optional, default: ExactDiscretization()) discretization algorithm\nconstructor – (optional, default: _default_complementary_constructor(system)) construction method\n\nOutput\n\nReturns a discretization of the input system system with discretization method algorithm and sampling time ΔT.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Internal-Methods","page":"Methods","title":"Internal Methods","text":"","category":"section"},{"location":"lib/methods/","page":"Methods","title":"Methods","text":"_discretize\ntypename(::AbstractSystem)\n_complementary_type(::Type{<:AbstractSystem})","category":"page"},{"location":"lib/methods/#MathematicalSystems._discretize","page":"Methods","title":"MathematicalSystems._discretize","text":"_discretize(::AbstractDiscretizationAlgorithm, ΔT::Real\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nImplementation of the discretization algorithm defined by the first input argument with sampling time ΔT.\n\nInput\n\n`` – discretization algorithm, used for dispatch\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B, c and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(A::AbstractMatrix, ΔT::Real; algorithm=:exact)\n\nDiscretize the state matrix A with sampling time ΔT and discretization method algorithm.\n\nInput\n\nA – state matrix\nΔT – sampling time\nalgorithm – (optional, default: :exact) discretization algorithm\n\nOutput\n\nReturns a vector containing the discretized input argument A.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix)\n\nDiscretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input or noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A and B.\n\nNotes\n\nThis method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix,c::AbstractVector)\n\nDiscretize the state matrix A and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector)\n\nDiscretize the state matrix A, input matrix B and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, D::AbstractMatrix)\n\nDiscretize the state matrix A, input matrix B and noise matrix C with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.typename-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.typename","text":"typename(system::AbstractSystem)\n\nReturns the base type of system without parameter information.\n\nInput\n\nsystem – AbstractSystem\n\nOutput\n\nThe base type of system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems._complementary_type-Tuple{Type{<:AbstractSystem}}","page":"Methods","title":"MathematicalSystems._complementary_type","text":"_complementary_type(system_type::Type{<:AbstractSystem})\n\nReturn the complementary type of a system type system_type.\n\nInput\n\nsystem_type – type of AbstractSystem\n\nOutput\n\nThe complementary type of system_type.\n\nNotes\n\nThere are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.\n\nTo get the complementary type of system type, use _complementary_type(typename(system)).\n\n\n\n\n\n","category":"method"}]
+}
diff --git a/previews/PR306/siteinfo.js b/previews/PR306/siteinfo.js
new file mode 100644
index 00000000..f7add337
--- /dev/null
+++ b/previews/PR306/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "previews/PR306";
diff --git a/release-0.1/about.html b/release-0.1/about.html
new file mode 100644
index 00000000..d4843f0d
--- /dev/null
+++ b/release-0.1/about.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
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.next 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.
Type 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 next given a state, or the method nextinput given the number of desired input elements:
diff --git a/release-0.1/search_index.js b/release-0.1/search_index.js
new file mode 100644
index 00000000..ff2b3698
--- /dev/null
+++ b/release-0.1/search_index.js
@@ -0,0 +1,419 @@
+var documenterSearchIndex = {"docs": [
+
+{
+ "location": "index.html#",
+ "page": "Home",
+ "title": "Home",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "index.html#MathematicalSystems.jl-1",
+ "page": "Home",
+ "title": "MathematicalSystems.jl",
+ "category": "section",
+ "text": "DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]MathematicalSystems is a Julia package for mathematical systems interfaces."
+},
+
+{
+ "location": "index.html#Features-1",
+ "page": "Home",
+ "title": "Features",
+ "category": "section",
+ "text": "Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled,linear algebraic, etc.Iterator interfaces to handle constant or time-varying inputs."
+},
+
+{
+ "location": "index.html#Library-Outline-1",
+ "page": "Home",
+ "title": "Library Outline",
+ "category": "section",
+ "text": "Pages = [\n \"lib/types.md\",\n \"lib/methods.md\"\n]\nDepth = 2"
+},
+
+{
+ "location": "lib/types.html#",
+ "page": "Types",
+ "title": "Types",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/types.html#Types-1",
+ "page": "Types",
+ "title": "Types",
+ "category": "section",
+ "text": "This section describes systems types implemented in MathematicalSystems.jl.Pages = [\"types.md\"]\nDepth = 3CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractSystem",
+ "category": "type",
+ "text": "AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractContinuousSystem",
+ "category": "type",
+ "text": "AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractDiscreteSystem",
+ "category": "type",
+ "text": "AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Abstract-Systems-1",
+ "page": "Types",
+ "title": "Abstract Systems",
+ "category": "section",
+ "text": "AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ContinuousIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ContinuousIdentitySystem",
+ "category": "type",
+ "text": "ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form\n\nx = 0\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedContinuousIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedContinuousIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with state constraints of the form\n\nx = 0x(t) mathcalX\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearContinuousSystem",
+ "category": "type",
+ "text": "LinearContinuousSystem\n\nContinuous-time linear system of the form\n\nx = A x\n\nFields\n\nA – square matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearControlContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearControlContinuousSystem",
+ "category": "type",
+ "text": "LinearControlContinuousSystem\n\nContinuous-time linear control system of the form\n\nx = A x + B u\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nx = A xx(t) mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearControlContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearControlContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with state constraints of the form\n\nx = A x + B ux(t) mathcalXu(t) mathcalU text for all t\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form\n\nE x = A x\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nE x = A xx(t) mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Continuous-Systems-1",
+ "page": "Types",
+ "title": "Continuous Systems",
+ "category": "section",
+ "text": "ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.DiscreteIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.DiscreteIdentitySystem",
+ "category": "type",
+ "text": "DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form\n\nx_k+1 = x_k\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedDiscreteIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedDiscreteIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with state constraints of the form\n\nx_k+1 = x_kx_k mathcalX\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearDiscreteSystem",
+ "category": "type",
+ "text": "LinearDiscreteSystem\n\nDiscrete-time linear system of the form\n\nx_k+1 = A x_k\n\nFields\n\nA – square matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearControlDiscreteSystem",
+ "category": "type",
+ "text": "LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form\n\nx_k+1 = A x_k + B u_k\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nx_k+1 = A x_kx_k mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearControlDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with state constraints of the form\n\nx_k+1 = A x_k + B u_kx_k mathcalXu_k mathcalU text for all k\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form\n\nE x_k+1 = A x_k\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nE x_k+1 = A x_kx_k mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Discrete-Systems-1",
+ "page": "Types",
+ "title": "Discrete Systems",
+ "category": "section",
+ "text": "DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.InitialValueProblem",
+ "page": "Types",
+ "title": "MathematicalSystems.InitialValueProblem",
+ "category": "type",
+ "text": "InitialValueProblem\n\nParametric composite type for initial value problems. It is parameterized in the system\'s type.\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x_0 = -12 12:\n\njulia> p = InitialValueProblem(LinearContinuousSystem(-eye(2)), [-1/2., 1/2]);\n\njulia> p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\njulia> statedim(p)\n 2\njulia> inputdim(p)\n 0\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.IVP",
+ "page": "Types",
+ "title": "MathematicalSystems.IVP",
+ "category": "type",
+ "text": "IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Initial-Value-Problems-1",
+ "page": "Types",
+ "title": "Initial Value Problems",
+ "category": "section",
+ "text": "InitialValueProblem\nIVP"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractInput",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractInput",
+ "category": "type",
+ "text": "AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration is supported with an index number called iterator state. The iteration function Base.next 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstantInput",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstantInput",
+ "category": "type",
+ "text": "ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe constant input holds a single element and its length is infinite. To access the field U, you can use Base\'s next given a state, or the method nextinput given the number of desired input elements:\n\njulia> c = ConstantInput(-1//2)\nMathematicalSystems.ConstantInput{Rational{Int64}}(-1//2)\n\njulia> next(c, 1)\n(-1//2, nothing)\n\njulia> next(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nMathematicalSystems.ConstantInput{Rational{Int64}}(-1//1)\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.VaryingInput",
+ "page": "Types",
+ "title": "MathematicalSystems.VaryingInput",
+ "category": "type",
+ "text": "VaryingInput{UT} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nMathematicalSystems.VaryingInput{Rational{Int64}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase\'s next method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> next(v, 1)\n(-1//2, 2)\n\njulia> next(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{MathematicalSystems.VaryingInput{Rational{Int64}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nMathematicalSystems.VaryingInput{Rational{Int64}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Input-Types-1",
+ "page": "Types",
+ "title": "Input Types",
+ "category": "section",
+ "text": "AbstractInput\nConstantInput\nVaryingInput"
+},
+
+{
+ "location": "lib/methods.html#",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/methods.html#Methods-1",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "section",
+ "text": "This section describes systems methods implemented in MathematicalSystems.jl.Pages = [\"methods.md\"]\nDepth = 3CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.statedim",
+ "page": "Methods",
+ "title": "MathematicalSystems.statedim",
+ "category": "function",
+ "text": "statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.stateset",
+ "page": "Methods",
+ "title": "MathematicalSystems.stateset",
+ "category": "function",
+ "text": "stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#States-1",
+ "page": "Methods",
+ "title": "States",
+ "category": "section",
+ "text": "statedim\nstateset"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.inputdim",
+ "page": "Methods",
+ "title": "MathematicalSystems.inputdim",
+ "category": "function",
+ "text": "inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.inputset",
+ "page": "Methods",
+ "title": "MathematicalSystems.inputset",
+ "category": "function",
+ "text": "inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.nextinput",
+ "page": "Methods",
+ "title": "MathematicalSystems.nextinput",
+ "category": "function",
+ "text": "nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Inputs-1",
+ "page": "Methods",
+ "title": "Inputs",
+ "category": "section",
+ "text": "inputdim\ninputset\nnextinput"
+},
+
+{
+ "location": "about.html#",
+ "page": "About",
+ "title": "About",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "about.html#About-1",
+ "page": "About",
+ "title": "About",
+ "category": "section",
+ "text": "This page contains some general information about this project, and recommendations about contributing.Pages = [\"about.md\"]"
+},
+
+{
+ "location": "about.html#Contributing-1",
+ "page": "About",
+ "title": "Contributing",
+ "category": "section",
+ "text": "If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki."
+},
+
+{
+ "location": "about.html#Branches-and-pull-requests-(PR)-1",
+ "page": "About",
+ "title": "Branches and pull requests (PR)",
+ "category": "section",
+ "text": "We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7."
+},
+
+{
+ "location": "about.html#Unit-testing-and-continuous-integration-(CI)-1",
+ "page": "About",
+ "title": "Unit testing and continuous integration (CI)",
+ "category": "section",
+ "text": "This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:$ julia --color=yes test/runtests.jlAlternatively, you can achieve the same from inside the REPL using the following command:julia> Pkg.test(\"MathematicalSystems\")We also advise adding new unit tests when adding new features to ensure long-term support of your contributions."
+},
+
+{
+ "location": "about.html#Contributing-to-the-documentation-1",
+ "page": "About",
+ "title": "Contributing to the documentation",
+ "category": "section",
+ "text": "New functions and types should be documented according to our guidelines directly in the source code.You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:julia> ?LinearContinuousSystemThis documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:$ julia --color=yes docs/make.jlNote that this also runs all doctests which will take some time."
+},
+
+{
+ "location": "about.html#Related-projects-1",
+ "page": "About",
+ "title": "Related projects",
+ "category": "section",
+ "text": "This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.Below we list more related projects.Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia"
+},
+
+{
+ "location": "about.html#Credits-1",
+ "page": "About",
+ "title": "Credits",
+ "category": "section",
+ "text": "These persons have contributed to MathematicalSystems.jl (in alphabetic order):Marcelo Forets\nBenoît Legat\nChristian Schilling"
+},
+
+]}
diff --git a/release-0.1/siteinfo.js b/release-0.1/siteinfo.js
new file mode 100644
index 00000000..7ae6d02d
--- /dev/null
+++ b/release-0.1/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "release-0.1";
diff --git a/release-0.2/about.html b/release-0.2/about.html
new file mode 100644
index 00000000..d4843f0d
--- /dev/null
+++ b/release-0.2/about.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
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.next 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.
Type 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 next given a state, or the method nextinput given the number of desired input elements:
diff --git a/release-0.2/search_index.js b/release-0.2/search_index.js
new file mode 100644
index 00000000..b41f165d
--- /dev/null
+++ b/release-0.2/search_index.js
@@ -0,0 +1,451 @@
+var documenterSearchIndex = {"docs": [
+
+{
+ "location": "index.html#",
+ "page": "Home",
+ "title": "Home",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "index.html#MathematicalSystems.jl-1",
+ "page": "Home",
+ "title": "MathematicalSystems.jl",
+ "category": "section",
+ "text": "DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]MathematicalSystems is a Julia package for mathematical systems interfaces."
+},
+
+{
+ "location": "index.html#Features-1",
+ "page": "Home",
+ "title": "Features",
+ "category": "section",
+ "text": "Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled,linear algebraic, etc.Iterator interfaces to handle constant or time-varying inputs."
+},
+
+{
+ "location": "index.html#Library-Outline-1",
+ "page": "Home",
+ "title": "Library Outline",
+ "category": "section",
+ "text": "Pages = [\n \"lib/types.md\",\n \"lib/methods.md\"\n]\nDepth = 2"
+},
+
+{
+ "location": "lib/types.html#",
+ "page": "Types",
+ "title": "Types",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/types.html#Types-1",
+ "page": "Types",
+ "title": "Types",
+ "category": "section",
+ "text": "This section describes systems types implemented in MathematicalSystems.jl.Pages = [\"types.md\"]\nDepth = 3CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractSystem",
+ "category": "type",
+ "text": "AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractContinuousSystem",
+ "category": "type",
+ "text": "AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractDiscreteSystem",
+ "category": "type",
+ "text": "AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Abstract-Systems-1",
+ "page": "Types",
+ "title": "Abstract Systems",
+ "category": "section",
+ "text": "AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ContinuousIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ContinuousIdentitySystem",
+ "category": "type",
+ "text": "ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form\n\nx = 0\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedContinuousIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedContinuousIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with state constraints of the form\n\nx = 0x(t) mathcalX\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearContinuousSystem",
+ "category": "type",
+ "text": "LinearContinuousSystem\n\nContinuous-time linear system of the form\n\nx = A x\n\nFields\n\nA – square matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearControlContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearControlContinuousSystem",
+ "category": "type",
+ "text": "LinearControlContinuousSystem\n\nContinuous-time linear control system of the form\n\nx = A x + B u\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nx = A xx(t) mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearControlContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearControlContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with state constraints of the form\n\nx = A x + B ux(t) mathcalXu(t) mathcalU text for all t\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form\n\nE x = A x\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nE x = A xx(t) mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.PolynomialContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.PolynomialContinuousSystem",
+ "category": "type",
+ "text": "PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form\n\nx = p(x)\n\nFields\n\np – polynomial\nstatedim – number of state variables\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedPolynomialContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedPolynomialContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with state constraints,\n\nx = p(x) x(t) mathcalX\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Continuous-Systems-1",
+ "page": "Types",
+ "title": "Continuous Systems",
+ "category": "section",
+ "text": "ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.DiscreteIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.DiscreteIdentitySystem",
+ "category": "type",
+ "text": "DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form\n\nx_k+1 = x_k\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedDiscreteIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedDiscreteIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with state constraints of the form\n\nx_k+1 = x_kx_k mathcalX\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearDiscreteSystem",
+ "category": "type",
+ "text": "LinearDiscreteSystem\n\nDiscrete-time linear system of the form\n\nx_k+1 = A x_k\n\nFields\n\nA – square matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearControlDiscreteSystem",
+ "category": "type",
+ "text": "LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form\n\nx_k+1 = A x_k + B u_k\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nx_k+1 = A x_kx_k mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearControlDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with state constraints of the form\n\nx_k+1 = A x_k + B u_kx_k mathcalXu_k mathcalU text for all k\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form\n\nE x_k+1 = A x_k\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nE x_k+1 = A x_kx_k mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.PolynomialDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.PolynomialDiscreteSystem",
+ "category": "type",
+ "text": "PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form\n\nx_k+1 = p(x_k)x_k mathcalX\n\nFields\n\np – polynomial\nstatedim – number of state variables\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedPolynomialDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedPolynomialDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with state constraints,\n\nx_k+1 = p(x_k)x_k mathcalX\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Discrete-Systems-1",
+ "page": "Types",
+ "title": "Discrete Systems",
+ "category": "section",
+ "text": "DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.InitialValueProblem",
+ "page": "Types",
+ "title": "MathematicalSystems.InitialValueProblem",
+ "category": "type",
+ "text": "InitialValueProblem\n\nParametric composite type for initial value problems. It is parameterized in the system\'s type.\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x_0 = -12 12:\n\njulia> p = InitialValueProblem(LinearContinuousSystem(-eye(2)), [-1/2., 1/2]);\n\njulia> p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.IVP",
+ "page": "Types",
+ "title": "MathematicalSystems.IVP",
+ "category": "type",
+ "text": "IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Initial-Value-Problems-1",
+ "page": "Types",
+ "title": "Initial Value Problems",
+ "category": "section",
+ "text": "InitialValueProblem\nIVP"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractInput",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractInput",
+ "category": "type",
+ "text": "AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration is supported with an index number called iterator state. The iteration function Base.next 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstantInput",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstantInput",
+ "category": "type",
+ "text": "ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe constant input holds a single element and its length is infinite. To access the field U, you can use Base\'s next given a state, or the method nextinput given the number of desired input elements:\n\njulia> c = ConstantInput(-1//2)\nMathematicalSystems.ConstantInput{Rational{Int64}}(-1//2)\n\njulia> next(c, 1)\n(-1//2, nothing)\n\njulia> next(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nMathematicalSystems.ConstantInput{Rational{Int64}}(-1//1)\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.VaryingInput",
+ "page": "Types",
+ "title": "MathematicalSystems.VaryingInput",
+ "category": "type",
+ "text": "VaryingInput{UT} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nMathematicalSystems.VaryingInput{Rational{Int64}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase\'s next method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> next(v, 1)\n(-1//2, 2)\n\njulia> next(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{MathematicalSystems.VaryingInput{Rational{Int64}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nMathematicalSystems.VaryingInput{Rational{Int64}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Input-Types-1",
+ "page": "Types",
+ "title": "Input Types",
+ "category": "section",
+ "text": "AbstractInput\nConstantInput\nVaryingInput"
+},
+
+{
+ "location": "lib/methods.html#",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/methods.html#Methods-1",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "section",
+ "text": "This section describes systems methods implemented in MathematicalSystems.jl.Pages = [\"methods.md\"]\nDepth = 3CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.statedim",
+ "page": "Methods",
+ "title": "MathematicalSystems.statedim",
+ "category": "function",
+ "text": "statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.stateset",
+ "page": "Methods",
+ "title": "MathematicalSystems.stateset",
+ "category": "function",
+ "text": "stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#States-1",
+ "page": "Methods",
+ "title": "States",
+ "category": "section",
+ "text": "statedim\nstateset"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.inputdim",
+ "page": "Methods",
+ "title": "MathematicalSystems.inputdim",
+ "category": "function",
+ "text": "inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.inputset",
+ "page": "Methods",
+ "title": "MathematicalSystems.inputset",
+ "category": "function",
+ "text": "inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.nextinput",
+ "page": "Methods",
+ "title": "MathematicalSystems.nextinput",
+ "category": "function",
+ "text": "nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Inputs-1",
+ "page": "Methods",
+ "title": "Inputs",
+ "category": "section",
+ "text": "inputdim\ninputset\nnextinput"
+},
+
+{
+ "location": "about.html#",
+ "page": "About",
+ "title": "About",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "about.html#About-1",
+ "page": "About",
+ "title": "About",
+ "category": "section",
+ "text": "This page contains some general information about this project, and recommendations about contributing.Pages = [\"about.md\"]"
+},
+
+{
+ "location": "about.html#Contributing-1",
+ "page": "About",
+ "title": "Contributing",
+ "category": "section",
+ "text": "If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki."
+},
+
+{
+ "location": "about.html#Branches-and-pull-requests-(PR)-1",
+ "page": "About",
+ "title": "Branches and pull requests (PR)",
+ "category": "section",
+ "text": "We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7."
+},
+
+{
+ "location": "about.html#Unit-testing-and-continuous-integration-(CI)-1",
+ "page": "About",
+ "title": "Unit testing and continuous integration (CI)",
+ "category": "section",
+ "text": "This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:$ julia --color=yes test/runtests.jlAlternatively, you can achieve the same from inside the REPL using the following command:julia> Pkg.test(\"MathematicalSystems\")We also advise adding new unit tests when adding new features to ensure long-term support of your contributions."
+},
+
+{
+ "location": "about.html#Contributing-to-the-documentation-1",
+ "page": "About",
+ "title": "Contributing to the documentation",
+ "category": "section",
+ "text": "New functions and types should be documented according to our guidelines directly in the source code.You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:julia> ?LinearContinuousSystemThis documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:$ julia --color=yes docs/make.jlNote that this also runs all doctests which will take some time."
+},
+
+{
+ "location": "about.html#Related-projects-1",
+ "page": "About",
+ "title": "Related projects",
+ "category": "section",
+ "text": "This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.Below we list more related projects.Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia"
+},
+
+{
+ "location": "about.html#Credits-1",
+ "page": "About",
+ "title": "Credits",
+ "category": "section",
+ "text": "These persons have contributed to MathematicalSystems.jl (in alphabetic order):Marcelo Forets\nBenoît Legat\nChristian Schilling"
+},
+
+]}
diff --git a/release-0.2/siteinfo.js b/release-0.2/siteinfo.js
new file mode 100644
index 00000000..f0336ba3
--- /dev/null
+++ b/release-0.2/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "release-0.2";
diff --git a/release-0.3/about.html b/release-0.3/about.html
new file mode 100644
index 00000000..899a2e2d
--- /dev/null
+++ b/release-0.3/about.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
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.
Type 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:
diff --git a/release-0.3/search_index.js b/release-0.3/search_index.js
new file mode 100644
index 00000000..cfc32ec3
--- /dev/null
+++ b/release-0.3/search_index.js
@@ -0,0 +1,595 @@
+var documenterSearchIndex = {"docs": [
+
+{
+ "location": "index.html#",
+ "page": "Home",
+ "title": "Home",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "index.html#MathematicalSystems.jl-1",
+ "page": "Home",
+ "title": "MathematicalSystems.jl",
+ "category": "section",
+ "text": "DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]MathematicalSystems is a Julia package for mathematical systems interfaces."
+},
+
+{
+ "location": "index.html#Features-1",
+ "page": "Home",
+ "title": "Features",
+ "category": "section",
+ "text": "Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled,linear algebraic, etc.Iterator interfaces to handle constant or time-varying inputs."
+},
+
+{
+ "location": "index.html#Library-Outline-1",
+ "page": "Home",
+ "title": "Library Outline",
+ "category": "section",
+ "text": "Pages = [\n \"lib/types.md\",\n \"lib/methods.md\"\n]\nDepth = 2"
+},
+
+{
+ "location": "lib/types.html#",
+ "page": "Types",
+ "title": "Types",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/types.html#Types-1",
+ "page": "Types",
+ "title": "Types",
+ "category": "section",
+ "text": "This section describes systems types implemented in MathematicalSystems.jl.Pages = [\"types.md\"]\nDepth = 3CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractSystem",
+ "category": "type",
+ "text": "AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractContinuousSystem",
+ "category": "type",
+ "text": "AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractDiscreteSystem",
+ "category": "type",
+ "text": "AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Abstract-Systems-1",
+ "page": "Types",
+ "title": "Abstract Systems",
+ "category": "section",
+ "text": "AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ContinuousIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ContinuousIdentitySystem",
+ "category": "type",
+ "text": "ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form\n\nx = 0\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedContinuousIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedContinuousIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with state constraints of the form\n\nx = 0 x(t) mathcalX\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearContinuousSystem",
+ "category": "type",
+ "text": "LinearContinuousSystem\n\nContinuous-time linear system of the form\n\nx = A x\n\nFields\n\nA – square matrix\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AffineContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AffineContinuousSystem",
+ "category": "type",
+ "text": "AffineContinuousSystem\n\nContinuous-time affine system of the form\n\nx = A x + b\n\nFields\n\nA – square matrix\nb – vector\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearControlContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearControlContinuousSystem",
+ "category": "type",
+ "text": "LinearControlContinuousSystem\n\nContinuous-time linear control system of the form\n\nx = A x + B u\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nx = A x x(t) mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedAffineContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedAffineContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with state constraints of the form\n\nx = A x + b x(t) mathcalX\n\nFields\n\nA – square matrix\nb – vector\nX – state constraints\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedAffineControlContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedAffineControlContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with state constraints of the form\n\nx = A x + B u + c x(t) mathcalX u(t) mathcalU text for all t\n\nand c a vector.\n\nFields\n\nA – square matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearControlContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearControlContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with state constraints of the form\n\nx = A x + B u x(t) mathcalX u(t) mathcalU text for all t\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form\n\nE x = A x\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nE x = A x x(t) mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.PolynomialContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.PolynomialContinuousSystem",
+ "category": "type",
+ "text": "PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form\n\nx = p(x)\n\nFields\n\np – polynomial\nstatedim – number of state variables\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedPolynomialContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedPolynomialContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with state constraints,\n\nx = p(x) x(t) mathcalX\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Continuous-Systems-1",
+ "page": "Types",
+ "title": "Continuous Systems",
+ "category": "section",
+ "text": "ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.DiscreteIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.DiscreteIdentitySystem",
+ "category": "type",
+ "text": "DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form\n\nx_k+1 = x_k\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedDiscreteIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedDiscreteIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with state constraints of the form\n\nx_k+1 = x_k x_k mathcalX\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearDiscreteSystem",
+ "category": "type",
+ "text": "LinearDiscreteSystem\n\nDiscrete-time linear system of the form\n\nx_k+1 = A x_k\n\nFields\n\nA – square matrix\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearControlDiscreteSystem",
+ "category": "type",
+ "text": "LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form\n\nx_k+1 = A x_k + B u_k\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nx_k+1 = A x_k x_k mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearControlDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with state constraints of the form\n\nx_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU text for all k\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form\n\nE x_k+1 = A x_k\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nE x_k+1 = A x_k x_k mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.PolynomialDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.PolynomialDiscreteSystem",
+ "category": "type",
+ "text": "PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form\n\nx_k+1 = p(x_k) x_k mathcalX\n\nFields\n\np – polynomial\nstatedim – number of state variables\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedPolynomialDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedPolynomialDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with state constraints,\n\nx_k+1 = p(x_k) x_k mathcalX\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Discrete-Systems-1",
+ "page": "Types",
+ "title": "Discrete Systems",
+ "category": "section",
+ "text": "DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.InitialValueProblem",
+ "page": "Types",
+ "title": "MathematicalSystems.InitialValueProblem",
+ "category": "type",
+ "text": "InitialValueProblem\n\nParametric composite type for initial value problems. It is parameterized in the system\'s type.\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x_0 = -12 12:\n\njulia> p = InitialValueProblem(LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]), [-1/2, 1/2]);\n\njulia> p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.IVP",
+ "page": "Types",
+ "title": "MathematicalSystems.IVP",
+ "category": "type",
+ "text": "IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Initial-Value-Problems-1",
+ "page": "Types",
+ "title": "Initial Value Problems",
+ "category": "section",
+ "text": "InitialValueProblem\nIVP"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractInput",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractInput",
+ "category": "type",
+ "text": "AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstantInput",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstantInput",
+ "category": "type",
+ "text": "ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.VaryingInput",
+ "page": "Types",
+ "title": "MathematicalSystems.VaryingInput",
+ "category": "type",
+ "text": "VaryingInput{UT} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase\'s iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nVaryingInput{Rational{Int64}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Input-Types-1",
+ "page": "Types",
+ "title": "Input Types",
+ "category": "section",
+ "text": "AbstractInput\nConstantInput\nVaryingInput"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractMap",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractMap",
+ "category": "type",
+ "text": "AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearMap",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearMap",
+ "category": "type",
+ "text": "LinearMap\n\nA linear map\n\nx Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AffineMap",
+ "page": "Types",
+ "title": "MathematicalSystems.AffineMap",
+ "category": "type",
+ "text": "AffineMap\n\nAn affine map\n\nx Ax + b\n\nFields\n\nA – matrix\nb – vector\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearControlMap",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearControlMap",
+ "category": "type",
+ "text": "LinearControlMap\n\nA linear control map\n\nx Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearControlMap",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearControlMap",
+ "category": "type",
+ "text": "ConstrainedLinearControlMap\n\nA linear control map with input constraints,\n\nx Ax + Bu u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nU – input constraints\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AffineControlMap",
+ "page": "Types",
+ "title": "MathematicalSystems.AffineControlMap",
+ "category": "type",
+ "text": "AffineControlMap\n\nAn affine control map\n\nx Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedAffineControlMap",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedAffineControlMap",
+ "category": "type",
+ "text": "ConstrainedAffineControlMap\n\nAn affine control map with input constraints,\n\nx Ax + Bu + c u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nU – input constraints\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Maps-1",
+ "page": "Types",
+ "title": "Maps",
+ "category": "section",
+ "text": "AbstractMap\nLinearMap\nAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.SystemWithOutput",
+ "page": "Types",
+ "title": "MathematicalSystems.SystemWithOutput",
+ "category": "type",
+ "text": "SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap}\n\nParametric composite type for systems with outputs. It is parameterized in the system\'s type (ST) and in the map\'s type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearTimeInvariantSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearTimeInvariantSystem",
+ "category": "function",
+ "text": "LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LTISystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LTISystem",
+ "category": "function",
+ "text": "LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems-with-output-1",
+ "page": "Types",
+ "title": "Systems with output",
+ "category": "section",
+ "text": "SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem"
+},
+
+{
+ "location": "lib/methods.html#",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/methods.html#Methods-1",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "section",
+ "text": "This section describes systems methods implemented in MathematicalSystems.jl.Pages = [\"methods.md\"]\nDepth = 3CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.statedim",
+ "page": "Methods",
+ "title": "MathematicalSystems.statedim",
+ "category": "function",
+ "text": "statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.stateset",
+ "page": "Methods",
+ "title": "MathematicalSystems.stateset",
+ "category": "function",
+ "text": "stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#States-1",
+ "page": "Methods",
+ "title": "States",
+ "category": "section",
+ "text": "statedim\nstateset"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.inputdim",
+ "page": "Methods",
+ "title": "MathematicalSystems.inputdim",
+ "category": "function",
+ "text": "inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.inputset",
+ "page": "Methods",
+ "title": "MathematicalSystems.inputset",
+ "category": "function",
+ "text": "inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.nextinput",
+ "page": "Methods",
+ "title": "MathematicalSystems.nextinput",
+ "category": "function",
+ "text": "nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Inputs-1",
+ "page": "Methods",
+ "title": "Inputs",
+ "category": "section",
+ "text": "inputdim\ninputset\nnextinput"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.outputdim",
+ "page": "Methods",
+ "title": "MathematicalSystems.outputdim",
+ "category": "function",
+ "text": "outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.outputmap",
+ "page": "Methods",
+ "title": "MathematicalSystems.outputmap",
+ "category": "function",
+ "text": "outputmap(s::SystemWithOutput)\n\nReturns the output map of a system with output.\n\n\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Output-1",
+ "page": "Methods",
+ "title": "Output",
+ "category": "section",
+ "text": "outputdim\noutputmap"
+},
+
+{
+ "location": "about.html#",
+ "page": "About",
+ "title": "About",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "about.html#About-1",
+ "page": "About",
+ "title": "About",
+ "category": "section",
+ "text": "This page contains some general information about this project, and recommendations about contributing.Pages = [\"about.md\"]"
+},
+
+{
+ "location": "about.html#Contributing-1",
+ "page": "About",
+ "title": "Contributing",
+ "category": "section",
+ "text": "If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki."
+},
+
+{
+ "location": "about.html#Branches-and-pull-requests-(PR)-1",
+ "page": "About",
+ "title": "Branches and pull requests (PR)",
+ "category": "section",
+ "text": "We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7."
+},
+
+{
+ "location": "about.html#Unit-testing-and-continuous-integration-(CI)-1",
+ "page": "About",
+ "title": "Unit testing and continuous integration (CI)",
+ "category": "section",
+ "text": "This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:$ julia --color=yes test/runtests.jlAlternatively, you can achieve the same from inside the REPL using the following command:julia> Pkg.test(\"MathematicalSystems\")We also advise adding new unit tests when adding new features to ensure long-term support of your contributions."
+},
+
+{
+ "location": "about.html#Contributing-to-the-documentation-1",
+ "page": "About",
+ "title": "Contributing to the documentation",
+ "category": "section",
+ "text": "New functions and types should be documented according to our guidelines directly in the source code.You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:julia> ?LinearContinuousSystemThis documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:$ julia --color=yes docs/make.jlNote that this also runs all doctests which will take some time."
+},
+
+{
+ "location": "about.html#Related-projects-1",
+ "page": "About",
+ "title": "Related projects",
+ "category": "section",
+ "text": "This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.Below we list more related projects.Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia"
+},
+
+{
+ "location": "about.html#Credits-1",
+ "page": "About",
+ "title": "Credits",
+ "category": "section",
+ "text": "These persons have contributed to MathematicalSystems.jl (in alphabetic order):Marcelo Forets\nBenoît Legat\nChristian Schilling"
+},
+
+]}
diff --git a/release-0.3/siteinfo.js b/release-0.3/siteinfo.js
new file mode 100644
index 00000000..b331d985
--- /dev/null
+++ b/release-0.3/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "release-0.3";
diff --git a/stable b/stable
new file mode 120000
index 00000000..8ba78f8a
--- /dev/null
+++ b/stable
@@ -0,0 +1 @@
+v0.11.9
\ No newline at end of file
diff --git a/v0.1 b/v0.1
new file mode 120000
index 00000000..f4caccce
--- /dev/null
+++ b/v0.1
@@ -0,0 +1 @@
+v0.1.2
\ No newline at end of file
diff --git a/v0.1.0/about.html b/v0.1.0/about.html
new file mode 100644
index 00000000..369484a7
--- /dev/null
+++ b/v0.1.0/about.html
@@ -0,0 +1,2 @@
+
+About · Systems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("Systems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
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.next 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.
Type 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 next given a state, or the method nextinput given the number of desired input elements:
diff --git a/v0.1.0/search_index.js b/v0.1.0/search_index.js
new file mode 100644
index 00000000..bf0f7a22
--- /dev/null
+++ b/v0.1.0/search_index.js
@@ -0,0 +1,419 @@
+var documenterSearchIndex = {"docs": [
+
+{
+ "location": "index.html#",
+ "page": "Home",
+ "title": "Home",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "index.html#Systems.jl-1",
+ "page": "Home",
+ "title": "Systems.jl",
+ "category": "section",
+ "text": "DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]Systems is a Julia package for mathematical systems interfaces."
+},
+
+{
+ "location": "index.html#Features-1",
+ "page": "Home",
+ "title": "Features",
+ "category": "section",
+ "text": "Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled,linear algebraic, etc.Iterator interfaces to handle constant or time-varying inputs."
+},
+
+{
+ "location": "index.html#Library-Outline-1",
+ "page": "Home",
+ "title": "Library Outline",
+ "category": "section",
+ "text": "Pages = [\n \"lib/types.md\",\n \"lib/methods.md\"\n]\nDepth = 2"
+},
+
+{
+ "location": "lib/types.html#",
+ "page": "Types",
+ "title": "Types",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/types.html#Types-1",
+ "page": "Types",
+ "title": "Types",
+ "category": "section",
+ "text": "This section describes systems types implemented in Systems.jl.Pages = [\"types.md\"]\nDepth = 3CurrentModule = Systems\nDocTestSetup = quote\n using Systems\nend"
+},
+
+{
+ "location": "lib/types.html#Systems.AbstractSystem",
+ "page": "Types",
+ "title": "Systems.AbstractSystem",
+ "category": "type",
+ "text": "AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.AbstractContinuousSystem",
+ "page": "Types",
+ "title": "Systems.AbstractContinuousSystem",
+ "category": "type",
+ "text": "AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.AbstractDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.AbstractDiscreteSystem",
+ "category": "type",
+ "text": "AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Abstract-Systems-1",
+ "page": "Types",
+ "title": "Abstract Systems",
+ "category": "section",
+ "text": "AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#Systems.ContinuousIdentitySystem",
+ "page": "Types",
+ "title": "Systems.ContinuousIdentitySystem",
+ "category": "type",
+ "text": "ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form\n\nx = 0\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedContinuousIdentitySystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedContinuousIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with state constraints of the form\n\nx = 0x(t) mathcalX\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearContinuousSystem",
+ "page": "Types",
+ "title": "Systems.LinearContinuousSystem",
+ "category": "type",
+ "text": "LinearContinuousSystem\n\nContinuous-time linear system of the form\n\nx = A x\n\nFields\n\nA – square matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearControlContinuousSystem",
+ "page": "Types",
+ "title": "Systems.LinearControlContinuousSystem",
+ "category": "type",
+ "text": "LinearControlContinuousSystem\n\nContinuous-time linear control system of the form\n\nx = A x + B u\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearContinuousSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nx = A xx(t) mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearControlContinuousSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearControlContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with state constraints of the form\n\nx = A x + B ux(t) mathcalXu(t) mathcalU text for all t\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "Systems.LinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form\n\nE x = A x\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nE x = A xx(t) mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Continuous-Systems-1",
+ "page": "Types",
+ "title": "Continuous Systems",
+ "category": "section",
+ "text": "ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem"
+},
+
+{
+ "location": "lib/types.html#Systems.DiscreteIdentitySystem",
+ "page": "Types",
+ "title": "Systems.DiscreteIdentitySystem",
+ "category": "type",
+ "text": "DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form\n\nx_k+1 = x_k\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedDiscreteIdentitySystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedDiscreteIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with state constraints of the form\n\nx_k+1 = x_kx_k mathcalX\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.LinearDiscreteSystem",
+ "category": "type",
+ "text": "LinearDiscreteSystem\n\nDiscrete-time linear system of the form\n\nx_k+1 = A x_k\n\nFields\n\nA – square matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.LinearControlDiscreteSystem",
+ "category": "type",
+ "text": "LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form\n\nx_k+1 = A x_k + B u_k\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nx_k+1 = A x_kx_k mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearControlDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with state constraints of the form\n\nx_k+1 = A x_k + B u_kx_k mathcalXu_k mathcalU text for all k\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.LinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form\n\nE x_k+1 = A x_k\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nE x_k+1 = A x_kx_k mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Discrete-Systems-1",
+ "page": "Types",
+ "title": "Discrete Systems",
+ "category": "section",
+ "text": "DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#Systems.InitialValueProblem",
+ "page": "Types",
+ "title": "Systems.InitialValueProblem",
+ "category": "type",
+ "text": "InitialValueProblem\n\nParametric composite type for initial value problems. It is parameterized in the system\'s type.\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x_0 = -12 12:\n\njulia> p = InitialValueProblem(LinearContinuousSystem(-eye(2)), [-1/2., 1/2]);\n\njulia> p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\njulia> statedim(p)\n 2\njulia> inputdim(p)\n 0\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.IVP",
+ "page": "Types",
+ "title": "Systems.IVP",
+ "category": "type",
+ "text": "IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Initial-Value-Problems-1",
+ "page": "Types",
+ "title": "Initial Value Problems",
+ "category": "section",
+ "text": "InitialValueProblem\nIVP"
+},
+
+{
+ "location": "lib/types.html#Systems.AbstractInput",
+ "page": "Types",
+ "title": "Systems.AbstractInput",
+ "category": "type",
+ "text": "AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration is supported with an index number called iterator state. The iteration function Base.next 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstantInput",
+ "page": "Types",
+ "title": "Systems.ConstantInput",
+ "category": "type",
+ "text": "ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe constant input holds a single element and its length is infinite. To access the field U, you can use Base\'s next given a state, or the method nextinput given the number of desired input elements:\n\njulia> c = ConstantInput(-1//2)\nSystems.ConstantInput{Rational{Int64}}(-1//2)\n\njulia> next(c, 1)\n(-1//2, nothing)\n\njulia> next(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nSystems.ConstantInput{Rational{Int64}}(-1//1)\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.VaryingInput",
+ "page": "Types",
+ "title": "Systems.VaryingInput",
+ "category": "type",
+ "text": "VaryingInput{UT} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nSystems.VaryingInput{Rational{Int64}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase\'s next method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> next(v, 1)\n(-1//2, 2)\n\njulia> next(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{Systems.VaryingInput{Rational{Int64}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nSystems.VaryingInput{Rational{Int64}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Input-Types-1",
+ "page": "Types",
+ "title": "Input Types",
+ "category": "section",
+ "text": "AbstractInput\nConstantInput\nVaryingInput"
+},
+
+{
+ "location": "lib/methods.html#",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/methods.html#Methods-1",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "section",
+ "text": "This section describes systems methods implemented in Systems.jl.Pages = [\"methods.md\"]\nDepth = 3CurrentModule = Systems\nDocTestSetup = quote\n using Systems\nend"
+},
+
+{
+ "location": "lib/methods.html#Systems.statedim",
+ "page": "Methods",
+ "title": "Systems.statedim",
+ "category": "function",
+ "text": "statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Systems.stateset",
+ "page": "Methods",
+ "title": "Systems.stateset",
+ "category": "function",
+ "text": "stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#States-1",
+ "page": "Methods",
+ "title": "States",
+ "category": "section",
+ "text": "statedim\nstateset"
+},
+
+{
+ "location": "lib/methods.html#Systems.inputdim",
+ "page": "Methods",
+ "title": "Systems.inputdim",
+ "category": "function",
+ "text": "inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Systems.inputset",
+ "page": "Methods",
+ "title": "Systems.inputset",
+ "category": "function",
+ "text": "inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Systems.nextinput",
+ "page": "Methods",
+ "title": "Systems.nextinput",
+ "category": "function",
+ "text": "nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Inputs-1",
+ "page": "Methods",
+ "title": "Inputs",
+ "category": "section",
+ "text": "inputdim\ninputset\nnextinput"
+},
+
+{
+ "location": "about.html#",
+ "page": "About",
+ "title": "About",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "about.html#About-1",
+ "page": "About",
+ "title": "About",
+ "category": "section",
+ "text": "This page contains some general information about this project, and recommendations about contributing.Pages = [\"about.md\"]"
+},
+
+{
+ "location": "about.html#Contributing-1",
+ "page": "About",
+ "title": "Contributing",
+ "category": "section",
+ "text": "If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki."
+},
+
+{
+ "location": "about.html#Branches-and-pull-requests-(PR)-1",
+ "page": "About",
+ "title": "Branches and pull requests (PR)",
+ "category": "section",
+ "text": "We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7."
+},
+
+{
+ "location": "about.html#Unit-testing-and-continuous-integration-(CI)-1",
+ "page": "About",
+ "title": "Unit testing and continuous integration (CI)",
+ "category": "section",
+ "text": "This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:$ julia --color=yes test/runtests.jlAlternatively, you can achieve the same from inside the REPL using the following command:julia> Pkg.test(\"Systems\")We also advise adding new unit tests when adding new features to ensure long-term support of your contributions."
+},
+
+{
+ "location": "about.html#Contributing-to-the-documentation-1",
+ "page": "About",
+ "title": "Contributing to the documentation",
+ "category": "section",
+ "text": "New functions and types should be documented according to our guidelines directly in the source code.You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:julia> ?LinearContinuousSystemThis documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:$ julia --color=yes docs/make.jlNote that this also runs all doctests which will take some time."
+},
+
+{
+ "location": "about.html#Related-projects-1",
+ "page": "About",
+ "title": "Related projects",
+ "category": "section",
+ "text": "This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.Below we list more related projects.Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia"
+},
+
+{
+ "location": "about.html#Credits-1",
+ "page": "About",
+ "title": "Credits",
+ "category": "section",
+ "text": "These persons have contributed to Systems.jl (in alphabetic order):Marcelo Forets\nBenoît Legat\nChristian Schilling"
+},
+
+]}
diff --git a/v0.1.0/siteinfo.js b/v0.1.0/siteinfo.js
new file mode 100644
index 00000000..a7a85ce6
--- /dev/null
+++ b/v0.1.0/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.1.0";
diff --git a/v0.1.1/about.html b/v0.1.1/about.html
new file mode 100644
index 00000000..df8362ad
--- /dev/null
+++ b/v0.1.1/about.html
@@ -0,0 +1,2 @@
+
+About · Systems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("Systems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
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.next 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.
Type 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 next given a state, or the method nextinput given the number of desired input elements:
diff --git a/v0.1.1/search_index.js b/v0.1.1/search_index.js
new file mode 100644
index 00000000..dff6e14a
--- /dev/null
+++ b/v0.1.1/search_index.js
@@ -0,0 +1,419 @@
+var documenterSearchIndex = {"docs": [
+
+{
+ "location": "index.html#",
+ "page": "Home",
+ "title": "Home",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "index.html#Systems.jl-1",
+ "page": "Home",
+ "title": "Systems.jl",
+ "category": "section",
+ "text": "DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]Systems is a Julia package for mathematical systems interfaces."
+},
+
+{
+ "location": "index.html#Features-1",
+ "page": "Home",
+ "title": "Features",
+ "category": "section",
+ "text": "Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled,linear algebraic, etc.Iterator interfaces to handle constant or time-varying inputs."
+},
+
+{
+ "location": "index.html#Library-Outline-1",
+ "page": "Home",
+ "title": "Library Outline",
+ "category": "section",
+ "text": "Pages = [\n \"lib/types.md\",\n \"lib/methods.md\"\n]\nDepth = 2"
+},
+
+{
+ "location": "lib/types.html#",
+ "page": "Types",
+ "title": "Types",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/types.html#Types-1",
+ "page": "Types",
+ "title": "Types",
+ "category": "section",
+ "text": "This section describes systems types implemented in Systems.jl.Pages = [\"types.md\"]\nDepth = 3CurrentModule = Systems\nDocTestSetup = quote\n using Systems\nend"
+},
+
+{
+ "location": "lib/types.html#Systems.AbstractSystem",
+ "page": "Types",
+ "title": "Systems.AbstractSystem",
+ "category": "type",
+ "text": "AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.AbstractContinuousSystem",
+ "page": "Types",
+ "title": "Systems.AbstractContinuousSystem",
+ "category": "type",
+ "text": "AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.AbstractDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.AbstractDiscreteSystem",
+ "category": "type",
+ "text": "AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Abstract-Systems-1",
+ "page": "Types",
+ "title": "Abstract Systems",
+ "category": "section",
+ "text": "AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#Systems.ContinuousIdentitySystem",
+ "page": "Types",
+ "title": "Systems.ContinuousIdentitySystem",
+ "category": "type",
+ "text": "ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form\n\nx = 0\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedContinuousIdentitySystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedContinuousIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with state constraints of the form\n\nx = 0x(t) mathcalX\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearContinuousSystem",
+ "page": "Types",
+ "title": "Systems.LinearContinuousSystem",
+ "category": "type",
+ "text": "LinearContinuousSystem\n\nContinuous-time linear system of the form\n\nx = A x\n\nFields\n\nA – square matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearControlContinuousSystem",
+ "page": "Types",
+ "title": "Systems.LinearControlContinuousSystem",
+ "category": "type",
+ "text": "LinearControlContinuousSystem\n\nContinuous-time linear control system of the form\n\nx = A x + B u\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearContinuousSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nx = A xx(t) mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearControlContinuousSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearControlContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with state constraints of the form\n\nx = A x + B ux(t) mathcalXu(t) mathcalU text for all t\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "Systems.LinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form\n\nE x = A x\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nE x = A xx(t) mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Continuous-Systems-1",
+ "page": "Types",
+ "title": "Continuous Systems",
+ "category": "section",
+ "text": "ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem"
+},
+
+{
+ "location": "lib/types.html#Systems.DiscreteIdentitySystem",
+ "page": "Types",
+ "title": "Systems.DiscreteIdentitySystem",
+ "category": "type",
+ "text": "DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form\n\nx_k+1 = x_k\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedDiscreteIdentitySystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedDiscreteIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with state constraints of the form\n\nx_k+1 = x_kx_k mathcalX\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.LinearDiscreteSystem",
+ "category": "type",
+ "text": "LinearDiscreteSystem\n\nDiscrete-time linear system of the form\n\nx_k+1 = A x_k\n\nFields\n\nA – square matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.LinearControlDiscreteSystem",
+ "category": "type",
+ "text": "LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form\n\nx_k+1 = A x_k + B u_k\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nx_k+1 = A x_kx_k mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearControlDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with state constraints of the form\n\nx_k+1 = A x_k + B u_kx_k mathcalXu_k mathcalU text for all k\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.LinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.LinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form\n\nE x_k+1 = A x_k\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "Systems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nE x_k+1 = A x_kx_k mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Discrete-Systems-1",
+ "page": "Types",
+ "title": "Discrete Systems",
+ "category": "section",
+ "text": "DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#Systems.InitialValueProblem",
+ "page": "Types",
+ "title": "Systems.InitialValueProblem",
+ "category": "type",
+ "text": "InitialValueProblem\n\nParametric composite type for initial value problems. It is parameterized in the system\'s type.\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x_0 = -12 12:\n\njulia> p = InitialValueProblem(LinearContinuousSystem(-eye(2)), [-1/2., 1/2]);\n\njulia> p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\njulia> statedim(p)\n 2\njulia> inputdim(p)\n 0\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.IVP",
+ "page": "Types",
+ "title": "Systems.IVP",
+ "category": "type",
+ "text": "IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Initial-Value-Problems-1",
+ "page": "Types",
+ "title": "Initial Value Problems",
+ "category": "section",
+ "text": "InitialValueProblem\nIVP"
+},
+
+{
+ "location": "lib/types.html#Systems.AbstractInput",
+ "page": "Types",
+ "title": "Systems.AbstractInput",
+ "category": "type",
+ "text": "AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration is supported with an index number called iterator state. The iteration function Base.next 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.ConstantInput",
+ "page": "Types",
+ "title": "Systems.ConstantInput",
+ "category": "type",
+ "text": "ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe constant input holds a single element and its length is infinite. To access the field U, you can use Base\'s next given a state, or the method nextinput given the number of desired input elements:\n\njulia> c = ConstantInput(-1//2)\nSystems.ConstantInput{Rational{Int64}}(-1//2)\n\njulia> next(c, 1)\n(-1//2, nothing)\n\njulia> next(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nSystems.ConstantInput{Rational{Int64}}(-1//1)\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Systems.VaryingInput",
+ "page": "Types",
+ "title": "Systems.VaryingInput",
+ "category": "type",
+ "text": "VaryingInput{UT} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nSystems.VaryingInput{Rational{Int64}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase\'s next method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> next(v, 1)\n(-1//2, 2)\n\njulia> next(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{Systems.VaryingInput{Rational{Int64}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nSystems.VaryingInput{Rational{Int64}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Input-Types-1",
+ "page": "Types",
+ "title": "Input Types",
+ "category": "section",
+ "text": "AbstractInput\nConstantInput\nVaryingInput"
+},
+
+{
+ "location": "lib/methods.html#",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/methods.html#Methods-1",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "section",
+ "text": "This section describes systems methods implemented in Systems.jl.Pages = [\"methods.md\"]\nDepth = 3CurrentModule = Systems\nDocTestSetup = quote\n using Systems\nend"
+},
+
+{
+ "location": "lib/methods.html#Systems.statedim",
+ "page": "Methods",
+ "title": "Systems.statedim",
+ "category": "function",
+ "text": "statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Systems.stateset",
+ "page": "Methods",
+ "title": "Systems.stateset",
+ "category": "function",
+ "text": "stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#States-1",
+ "page": "Methods",
+ "title": "States",
+ "category": "section",
+ "text": "statedim\nstateset"
+},
+
+{
+ "location": "lib/methods.html#Systems.inputdim",
+ "page": "Methods",
+ "title": "Systems.inputdim",
+ "category": "function",
+ "text": "inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Systems.inputset",
+ "page": "Methods",
+ "title": "Systems.inputset",
+ "category": "function",
+ "text": "inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Systems.nextinput",
+ "page": "Methods",
+ "title": "Systems.nextinput",
+ "category": "function",
+ "text": "nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Inputs-1",
+ "page": "Methods",
+ "title": "Inputs",
+ "category": "section",
+ "text": "inputdim\ninputset\nnextinput"
+},
+
+{
+ "location": "about.html#",
+ "page": "About",
+ "title": "About",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "about.html#About-1",
+ "page": "About",
+ "title": "About",
+ "category": "section",
+ "text": "This page contains some general information about this project, and recommendations about contributing.Pages = [\"about.md\"]"
+},
+
+{
+ "location": "about.html#Contributing-1",
+ "page": "About",
+ "title": "Contributing",
+ "category": "section",
+ "text": "If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki."
+},
+
+{
+ "location": "about.html#Branches-and-pull-requests-(PR)-1",
+ "page": "About",
+ "title": "Branches and pull requests (PR)",
+ "category": "section",
+ "text": "We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7."
+},
+
+{
+ "location": "about.html#Unit-testing-and-continuous-integration-(CI)-1",
+ "page": "About",
+ "title": "Unit testing and continuous integration (CI)",
+ "category": "section",
+ "text": "This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:$ julia --color=yes test/runtests.jlAlternatively, you can achieve the same from inside the REPL using the following command:julia> Pkg.test(\"Systems\")We also advise adding new unit tests when adding new features to ensure long-term support of your contributions."
+},
+
+{
+ "location": "about.html#Contributing-to-the-documentation-1",
+ "page": "About",
+ "title": "Contributing to the documentation",
+ "category": "section",
+ "text": "New functions and types should be documented according to our guidelines directly in the source code.You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:julia> ?LinearContinuousSystemThis documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:$ julia --color=yes docs/make.jlNote that this also runs all doctests which will take some time."
+},
+
+{
+ "location": "about.html#Related-projects-1",
+ "page": "About",
+ "title": "Related projects",
+ "category": "section",
+ "text": "This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.Below we list more related projects.Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia"
+},
+
+{
+ "location": "about.html#Credits-1",
+ "page": "About",
+ "title": "Credits",
+ "category": "section",
+ "text": "These persons have contributed to Systems.jl (in alphabetic order):Marcelo Forets\nBenoît Legat\nChristian Schilling"
+},
+
+]}
diff --git a/v0.1.1/siteinfo.js b/v0.1.1/siteinfo.js
new file mode 100644
index 00000000..20089fd7
--- /dev/null
+++ b/v0.1.1/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.1.1";
diff --git a/v0.1.2/about.html b/v0.1.2/about.html
new file mode 100644
index 00000000..d4843f0d
--- /dev/null
+++ b/v0.1.2/about.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
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.next 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.
Type 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 next given a state, or the method nextinput given the number of desired input elements:
diff --git a/v0.1.2/search_index.js b/v0.1.2/search_index.js
new file mode 100644
index 00000000..ff2b3698
--- /dev/null
+++ b/v0.1.2/search_index.js
@@ -0,0 +1,419 @@
+var documenterSearchIndex = {"docs": [
+
+{
+ "location": "index.html#",
+ "page": "Home",
+ "title": "Home",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "index.html#MathematicalSystems.jl-1",
+ "page": "Home",
+ "title": "MathematicalSystems.jl",
+ "category": "section",
+ "text": "DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]MathematicalSystems is a Julia package for mathematical systems interfaces."
+},
+
+{
+ "location": "index.html#Features-1",
+ "page": "Home",
+ "title": "Features",
+ "category": "section",
+ "text": "Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled,linear algebraic, etc.Iterator interfaces to handle constant or time-varying inputs."
+},
+
+{
+ "location": "index.html#Library-Outline-1",
+ "page": "Home",
+ "title": "Library Outline",
+ "category": "section",
+ "text": "Pages = [\n \"lib/types.md\",\n \"lib/methods.md\"\n]\nDepth = 2"
+},
+
+{
+ "location": "lib/types.html#",
+ "page": "Types",
+ "title": "Types",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/types.html#Types-1",
+ "page": "Types",
+ "title": "Types",
+ "category": "section",
+ "text": "This section describes systems types implemented in MathematicalSystems.jl.Pages = [\"types.md\"]\nDepth = 3CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractSystem",
+ "category": "type",
+ "text": "AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractContinuousSystem",
+ "category": "type",
+ "text": "AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractDiscreteSystem",
+ "category": "type",
+ "text": "AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Abstract-Systems-1",
+ "page": "Types",
+ "title": "Abstract Systems",
+ "category": "section",
+ "text": "AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ContinuousIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ContinuousIdentitySystem",
+ "category": "type",
+ "text": "ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form\n\nx = 0\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedContinuousIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedContinuousIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with state constraints of the form\n\nx = 0x(t) mathcalX\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearContinuousSystem",
+ "category": "type",
+ "text": "LinearContinuousSystem\n\nContinuous-time linear system of the form\n\nx = A x\n\nFields\n\nA – square matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearControlContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearControlContinuousSystem",
+ "category": "type",
+ "text": "LinearControlContinuousSystem\n\nContinuous-time linear control system of the form\n\nx = A x + B u\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nx = A xx(t) mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearControlContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearControlContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with state constraints of the form\n\nx = A x + B ux(t) mathcalXu(t) mathcalU text for all t\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form\n\nE x = A x\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with state constraints of the form\n\nE x = A xx(t) mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Continuous-Systems-1",
+ "page": "Types",
+ "title": "Continuous Systems",
+ "category": "section",
+ "text": "ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.DiscreteIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.DiscreteIdentitySystem",
+ "category": "type",
+ "text": "DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form\n\nx_k+1 = x_k\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedDiscreteIdentitySystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedDiscreteIdentitySystem",
+ "category": "type",
+ "text": "ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with state constraints of the form\n\nx_k+1 = x_kx_k mathcalX\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearDiscreteSystem",
+ "category": "type",
+ "text": "LinearDiscreteSystem\n\nDiscrete-time linear system of the form\n\nx_k+1 = A x_k\n\nFields\n\nA – square matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearControlDiscreteSystem",
+ "category": "type",
+ "text": "LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form\n\nx_k+1 = A x_k + B u_k\n\nFields\n\nA – square matrix\nB – matrix\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nx_k+1 = A x_kx_k mathcalX\n\nFields\n\nA – square matrix\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearControlDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearControlDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with state constraints of the form\n\nx_k+1 = A x_k + B u_kx_k mathcalXu_k mathcalU text for all k\n\nFields\n\nA – square matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.LinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.LinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form\n\nE x_k+1 = A x_k\n\nFields\n\nA – matrix\nE – matrix, same size as A\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem",
+ "category": "type",
+ "text": "ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form\n\nE x_k+1 = A x_kx_k mathcalX\n\nFields\n\nA – matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Discrete-Systems-1",
+ "page": "Types",
+ "title": "Discrete Systems",
+ "category": "section",
+ "text": "DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.InitialValueProblem",
+ "page": "Types",
+ "title": "MathematicalSystems.InitialValueProblem",
+ "category": "type",
+ "text": "InitialValueProblem\n\nParametric composite type for initial value problems. It is parameterized in the system\'s type.\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x_0 = -12 12:\n\njulia> p = InitialValueProblem(LinearContinuousSystem(-eye(2)), [-1/2., 1/2]);\n\njulia> p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\njulia> statedim(p)\n 2\njulia> inputdim(p)\n 0\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.IVP",
+ "page": "Types",
+ "title": "MathematicalSystems.IVP",
+ "category": "type",
+ "text": "IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Initial-Value-Problems-1",
+ "page": "Types",
+ "title": "Initial Value Problems",
+ "category": "section",
+ "text": "InitialValueProblem\nIVP"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.AbstractInput",
+ "page": "Types",
+ "title": "MathematicalSystems.AbstractInput",
+ "category": "type",
+ "text": "AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration is supported with an index number called iterator state. The iteration function Base.next 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.ConstantInput",
+ "page": "Types",
+ "title": "MathematicalSystems.ConstantInput",
+ "category": "type",
+ "text": "ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe constant input holds a single element and its length is infinite. To access the field U, you can use Base\'s next given a state, or the method nextinput given the number of desired input elements:\n\njulia> c = ConstantInput(-1//2)\nMathematicalSystems.ConstantInput{Rational{Int64}}(-1//2)\n\njulia> next(c, 1)\n(-1//2, nothing)\n\njulia> next(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nMathematicalSystems.ConstantInput{Rational{Int64}}(-1//1)\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#MathematicalSystems.VaryingInput",
+ "page": "Types",
+ "title": "MathematicalSystems.VaryingInput",
+ "category": "type",
+ "text": "VaryingInput{UT} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nMathematicalSystems.VaryingInput{Rational{Int64}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase\'s next method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> next(v, 1)\n(-1//2, 2)\n\njulia> next(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{MathematicalSystems.VaryingInput{Rational{Int64}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nMathematicalSystems.VaryingInput{Rational{Int64}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n"
+},
+
+{
+ "location": "lib/types.html#Input-Types-1",
+ "page": "Types",
+ "title": "Input Types",
+ "category": "section",
+ "text": "AbstractInput\nConstantInput\nVaryingInput"
+},
+
+{
+ "location": "lib/methods.html#",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "lib/methods.html#Methods-1",
+ "page": "Methods",
+ "title": "Methods",
+ "category": "section",
+ "text": "This section describes systems methods implemented in MathematicalSystems.jl.Pages = [\"methods.md\"]\nDepth = 3CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.statedim",
+ "page": "Methods",
+ "title": "MathematicalSystems.statedim",
+ "category": "function",
+ "text": "statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.stateset",
+ "page": "Methods",
+ "title": "MathematicalSystems.stateset",
+ "category": "function",
+ "text": "stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#States-1",
+ "page": "Methods",
+ "title": "States",
+ "category": "section",
+ "text": "statedim\nstateset"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.inputdim",
+ "page": "Methods",
+ "title": "MathematicalSystems.inputdim",
+ "category": "function",
+ "text": "inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.inputset",
+ "page": "Methods",
+ "title": "MathematicalSystems.inputset",
+ "category": "function",
+ "text": "inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#MathematicalSystems.nextinput",
+ "page": "Methods",
+ "title": "MathematicalSystems.nextinput",
+ "category": "function",
+ "text": "nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n"
+},
+
+{
+ "location": "lib/methods.html#Inputs-1",
+ "page": "Methods",
+ "title": "Inputs",
+ "category": "section",
+ "text": "inputdim\ninputset\nnextinput"
+},
+
+{
+ "location": "about.html#",
+ "page": "About",
+ "title": "About",
+ "category": "page",
+ "text": ""
+},
+
+{
+ "location": "about.html#About-1",
+ "page": "About",
+ "title": "About",
+ "category": "section",
+ "text": "This page contains some general information about this project, and recommendations about contributing.Pages = [\"about.md\"]"
+},
+
+{
+ "location": "about.html#Contributing-1",
+ "page": "About",
+ "title": "Contributing",
+ "category": "section",
+ "text": "If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki."
+},
+
+{
+ "location": "about.html#Branches-and-pull-requests-(PR)-1",
+ "page": "About",
+ "title": "Branches and pull requests (PR)",
+ "category": "section",
+ "text": "We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7."
+},
+
+{
+ "location": "about.html#Unit-testing-and-continuous-integration-(CI)-1",
+ "page": "About",
+ "title": "Unit testing and continuous integration (CI)",
+ "category": "section",
+ "text": "This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:$ julia --color=yes test/runtests.jlAlternatively, you can achieve the same from inside the REPL using the following command:julia> Pkg.test(\"MathematicalSystems\")We also advise adding new unit tests when adding new features to ensure long-term support of your contributions."
+},
+
+{
+ "location": "about.html#Contributing-to-the-documentation-1",
+ "page": "About",
+ "title": "Contributing to the documentation",
+ "category": "section",
+ "text": "New functions and types should be documented according to our guidelines directly in the source code.You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:julia> ?LinearContinuousSystemThis documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:$ julia --color=yes docs/make.jlNote that this also runs all doctests which will take some time."
+},
+
+{
+ "location": "about.html#Related-projects-1",
+ "page": "About",
+ "title": "Related projects",
+ "category": "section",
+ "text": "This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.Below we list more related projects.Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia"
+},
+
+{
+ "location": "about.html#Credits-1",
+ "page": "About",
+ "title": "Credits",
+ "category": "section",
+ "text": "These persons have contributed to MathematicalSystems.jl (in alphabetic order):Marcelo Forets\nBenoît Legat\nChristian Schilling"
+},
+
+]}
diff --git a/v0.1.2/siteinfo.js b/v0.1.2/siteinfo.js
new file mode 100644
index 00000000..9cdef155
--- /dev/null
+++ b/v0.1.2/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.1.2";
diff --git a/v0.11 b/v0.11
new file mode 120000
index 00000000..8ba78f8a
--- /dev/null
+++ b/v0.11
@@ -0,0 +1 @@
+v0.11.9
\ No newline at end of file
diff --git a/v0.11.0/about/index.html b/v0.11.0/about/index.html
new file mode 100644
index 00000000..42b1260a
--- /dev/null
+++ b/v0.11.0/about/index.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
Return the system type whose field names match those in fields.
Input
AT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem
fields – tuple of field names
Output
The system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.
Extract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.
For the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list
(:A_user, :A)
(:B_user, :B)
(:c_user, :c)
(:D_user, :D)
(:f_user, :f)
(:statedim_user :statedim)
(:inputdim_user :inputdim)
(:noisedim_user :noisedim)
and for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.
Input
equation – dynamic equation
state – state variable
input – input variable
noise – noise variable
dim – dimensionality
AT – abstract system type
Output
Two arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.
Checks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.
Return true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.
Input
expr – expression
Output
A Bool indicating whether expr is an equation or not.
If an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.
If an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.
Similiarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.
Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.
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)$.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
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.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Specifies if the dynamics of system s is specified by polynomial equations.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.
Discretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.
Input
algorithm – discretization algorithm
ΔT – sampling time
A – state matrix
B – input or noise matrix
Output
Returns a vector containing the discretized input arguments A and B.
Notes
This method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).
Return the complementary type of a system type system_type.
Input
system_type – type of AbstractSystem
Ouput
Return complementary type of system_type.
Notes
There are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.
To get the complementary type of system type, use _complementary_type(typename(system)).
Abstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
Exact 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].
Euler 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].
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 + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.
If the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.
Systems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
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.5]');
+
+julia> c = [1., 1.5];
+
+julia> X = BallInf(zeros(2), 10.);
+
+julia> U = BallInf(zeros(1), 2.);
+
+julia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)
+ConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64},BallInf{Float64}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64}([0.0, 0.0], 10.0), BallInf{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},BallInf{Float64}}(f, 2, 2, BallInf{Float64}([0.0, 0.0], 10.0), BallInf{Float64}([0.0], 2.0))
A scalar multiple of the identity matrix of given order and numeric type.
Fields
M – uniform scaling operator of type T
n – 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 AbstractMatix, 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
The easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:
julia> using MathematicalSystems: IdentityMultiple
+
+julia> I2 = I(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 2
The numeric type (default Float64) can be passed as a second argument:
julia> I2r = I(2, Rational{Int})
+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 2
To create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:
julia> I2 = I(2.0, 2)
+IdentityMultiple{Float64} of value 2.0 and order 2
+
+julia> I2r = I(2//1, 2)
+IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
Or use the constructor passing the UniformScaling (I):
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 2
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.
Type 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:
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)
An identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:
diff --git a/v0.11.0/search_index.js b/v0.11.0/search_index.js
new file mode 100644
index 00000000..5a7cb723
--- /dev/null
+++ b/v0.11.0/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"lib/internals/#Internals-1","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"This section describes functions that are internal to the library.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]\nDepth = 3","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/internals/#Expression-handling-1","page":"Internals","title":"Expression handling","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"_corresponding_type\n_capture_dim\nextract_dyn_equation_parameters\nadd_asterisk","category":"page"},{"location":"lib/internals/#MathematicalSystems._corresponding_type","page":"Internals","title":"MathematicalSystems._corresponding_type","text":"_corresponding_type(AT::Type{<:AbstractSystem}, fields::Tuple)\n\nReturn the system type whose field names match those in fields.\n\nInput\n\nAT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem\nfields – tuple of field names\n\nOutput\n\nThe system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.\n\nExamples\n\njulia> using MathematicalSystems: _corresponding_type\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A),))\nLinearContinuousSystem\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A), (:B), (:X), (:U)))\nConstrainedLinearControlContinuousSystem\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._capture_dim","page":"Internals","title":"MathematicalSystems._capture_dim","text":"_capture_dim(expr)\n\nReturn the tuple containing the dimension(s) in expr.\n\nInput\n\nexpr – symbolic expression that can be of any of the following forms:\n:x or :(x) – state dimension\n:(x, u) – state and input dimension\n:(x, u, w) – state, input and noise dimensions\n\nOutput\n\nThe scalar x if expr specifies the state dimension.\nThe vector [x, u] if expr specifies state and input dimension.\nThe vector [x, u, w] if expr specifies state, input and noise dimensions.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_dyn_equation_parameters","page":"Internals","title":"MathematicalSystems.extract_dyn_equation_parameters","text":"extract_dyn_equation_parameters(equation, state, input, noise, dim, AT)\n\nExtract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.\n\nFor the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list\n\n(:A_user, :A)\n(:B_user, :B)\n(:c_user, :c)\n(:D_user, :D)\n(:f_user, :f)\n(:statedim_user :statedim)\n(:inputdim_user :inputdim)\n(:noisedim_user :noisedim)\n\nand for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.\n\nInput\n\nequation – dynamic equation\nstate – state variable\ninput – input variable\nnoise – noise variable\ndim – dimensionality\nAT – abstract system type\n\nOutput\n\nTwo arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.add_asterisk","page":"Internals","title":"MathematicalSystems.add_asterisk","text":"add_asterisk(summand, state::Symbol, input::Symbol, noise::Symbol)\n\nChecks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.\n\nInput\n\nsummand – expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nMultiplication expression or symbol.\n\nExample\n\njulia> using MathematicalSystems: add_asterisk\n\njulia> add_asterisk(:(A1*x), :x, :u, :w)\n:(A1 * x)\n\njulia> add_asterisk(:(c1), :x, :u, :w)\n:c1\n\njulia> add_asterisk(:(Ax1), :x1, :u, :w)\n:(A * x1)\n\njulia> add_asterisk(:(Awb), :x1, :u, :wb)\n:(A * wb)\n\njulia> add_asterisk(:(A1u), :x, :u, :w)\n:(A1 * u)\n\njulia> add_asterisk(:(A1ub), :x, :u, :w)\n:A1ub\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Querying-expressions-1","page":"Internals","title":"Querying expressions","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"is_equation\nextract_sum","category":"page"},{"location":"lib/internals/#MathematicalSystems.is_equation","page":"Internals","title":"MathematicalSystems.is_equation","text":"is_equation(expr)\n\nReturn true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.\n\nInput\n\nexpr – expression\n\nOutput\n\nA Bool indicating whether expr is an equation or not.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_sum","page":"Internals","title":"MathematicalSystems.extract_sum","text":"extract_sum(summands, state::Symbol, input::Symbol, noise::Symbol)\n\nExtract the variable name and field name for every element of summands which corresponds to the elements of the right-hand side of an affine system.\n\nInput\n\nsummands – array of expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nArray of tuples of symbols with variable name and field name.\n\nExample\n\njulia> using MathematicalSystems: extract_sum\n\njulia> extract_sum([:(A1*x)], :x, :u, :w)\n1-element Array{Tuple{Any,Symbol},1}:\n (:A1, :A)\n\njulia> extract_sum([:(A1*x), :(B1*u), :c], :x, :u, :w)\n3-element Array{Tuple{Any,Symbol},1}:\n (:A1, :A)\n (:B1, :B)\n (:c, :c)\n\njulia> extract_sum([:(A1*x7), :( B1*u7), :( B2*w7)], :x7, :u7, :w7)\n3-element Array{Tuple{Any,Symbol},1}:\n (:A1, :A)\n (:B1, :B)\n (:B2, :D)\n\nNotes\n\nIf an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.\n\nIf an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.\n\nSimiliarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Naming-convention-for-systems'-fields-1","page":"Internals","title":"Naming convention for systems' fields","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Field Description Getter function\nA state matrix state_matrix\nB input matrix input_matrix\nc affine term affine_term\nD noise matrix noise_matrix\nX state constraints stateset\nU input constraints inputset\nW disturbance set noiseset","category":"page"},{"location":"about/#About-1","page":"About","title":"About","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This page contains some general information about this project, and recommendations about contributing.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Pages = [\"about.md\"]","category":"page"},{"location":"about/#Contributing-1","page":"About","title":"Contributing","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.","category":"page"},{"location":"about/#Branches-and-pull-requests-(PR)-1","page":"About","title":"Branches and pull requests (PR)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.","category":"page"},{"location":"about/#Unit-testing-and-continuous-integration-(CI)-1","page":"About","title":"Unit testing and continuous integration (CI)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes test/runtests.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Alternatively, you can achieve the same from inside the REPL using the following command:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> Pkg.test(\"MathematicalSystems\")","category":"page"},{"location":"about/#","page":"About","title":"About","text":"We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.","category":"page"},{"location":"about/#Contributing-to-the-documentation-1","page":"About","title":"Contributing to the documentation","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"New functions and types should be documented according to our guidelines directly in the source code.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> ?LinearContinuousSystem","category":"page"},{"location":"about/#","page":"About","title":"About","text":"This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).","category":"page"},{"location":"about/#","page":"About","title":"About","text":"To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes docs/make.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Note that this also runs all doctests which will take some time.","category":"page"},{"location":"about/#Related-projects-1","page":"About","title":"Related projects","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below we list more related projects.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia","category":"page"},{"location":"about/#Credits-1","page":"About","title":"Credits","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"These persons have contributed to MathematicalSystems.jl (in alphabetic order):","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Marcelo Forets\nBenoît Legat\nChristian Schilling","category":"page"},{"location":"lib/types/#Types-1","page":"Types","title":"Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"This section describes systems types implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"Pages = [\"types.md\"]\nDepth = 3","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/types/#Abstract-Systems-1","page":"Types","title":"Abstract Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractSystem","page":"Types","title":"MathematicalSystems.AbstractSystem","text":"AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractContinuousSystem","page":"Types","title":"MathematicalSystems.AbstractContinuousSystem","text":"AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractDiscreteSystem","page":"Types","title":"MathematicalSystems.AbstractDiscreteSystem","text":"AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Continuous-Systems-1","page":"Types","title":"Continuous Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem\nBlackBoxContinuousSystem\nConstrainedBlackBoxContinuousSystem\nConstrainedBlackBoxControlContinuousSystem\nNoisyConstrainedLinearContinuousSystem\nNoisyConstrainedLinearControlContinuousSystem\nNoisyConstrainedAffineControlContinuousSystem\nNoisyConstrainedBlackBoxControlContinuousSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.ContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ContinuousIdentitySystem","text":"ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form:\n\n x = 0\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedContinuousIdentitySystem","text":"ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with state constraints of the form:\n\n x = 0 x(t) mathcalX\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearContinuousSystem","page":"Types","title":"MathematicalSystems.LinearContinuousSystem","text":"LinearContinuousSystem\n\nContinuous-time linear system of the form:\n\n x = A x\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineContinuousSystem","page":"Types","title":"MathematicalSystems.AffineContinuousSystem","text":"AffineContinuousSystem\n\nContinuous-time affine system of the form:\n\n x = A x + c\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.LinearControlContinuousSystem","text":"LinearControlContinuousSystem\n\nContinuous-time linear control system of the form:\n\n x = A x + B u\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearContinuousSystem","text":"ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with state constraints of the form:\n\n x = A x x(t) mathcalX\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineContinuousSystem","text":"ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with state constraints of the form:\n\n x = A x + c x(t) mathcalX\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlContinuousSystem","text":"ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with state constraints of the form:\n\n x = A x + B u + c x(t) mathcalX u(t) mathcalU text for all t\n\nand c a vector.\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlContinuousSystem","text":"ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with state constraints of the form:\n\n x = A x + B u x(t) mathcalX u(t) mathcalU text for all t\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicContinuousSystem","text":"LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form:\n\n E x = A x\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","text":"ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with state constraints of the form:\n\n E x = A x x(t) mathcalX\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.PolynomialContinuousSystem","text":"PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form:\n\n x = p(x)\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialContinuousSystem","text":"ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with state constraints:\n\n x = p(x) x(t) mathcalX\n\nFields\n\np – polynomial vector field\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxContinuousSystem","text":"BlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side of the form:\n\n x = f(x(t))\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxContinuousSystem","text":"ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side with state constraints of the form:\n\n x = f(x(t)) x(t) mathcalX\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","text":"ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with state and input constraints of the form:\n\n x = f(x(t) u(t)) x(t) mathcalX u(t) mathcalU\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearContinuousSystem","text":"NoisyConstrainedLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance and state constraints of the form:\n\n x = A x + D w x(t) mathcalX w(t) mathcalW\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","text":"NoisyConstrainedLinearControlContinuousSystem\n\nContinuous-time affine control system with state constraints of the form:\n\n x = A x + B u + Dw x(t) mathcalX u(t) mathcalU w(t) mathcalW text for all t\n\nand c a vector.\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","text":"NoisyConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with state constraints of the form:\n\n x = A x + B u + c + Dw x(t) mathcalX u(t) mathcalU w(t) mathcalW text for all t\n\nand c a vector.\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","text":"NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with state constraints of the form:\n\n x = f(x(t) u(t) w(t)) x(t) mathcalX u(t) mathcalU w(t) mathcalW\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discrete-Systems-1","page":"Types","title":"Discrete Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nAffineDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedAffineDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nConstrainedAffineControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem\nBlackBoxDiscreteSystem\nConstrainedBlackBoxDiscreteSystem\nConstrainedBlackBoxControlDiscreteSystem\nNoisyConstrainedLinearDiscreteSystem\nNoisyConstrainedLinearControlDiscreteSystem\nNoisyConstrainedAffineControlDiscreteSystem\nNoisyConstrainedBlackBoxControlDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.DiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.DiscreteIdentitySystem","text":"DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form:\n\n x_k+1 = x_k\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedDiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedDiscreteIdentitySystem","text":"ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with state constraints of the form:\n\n x_k+1 = x_k x_k mathcalX\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDiscreteSystem","text":"LinearDiscreteSystem\n\nDiscrete-time linear system of the form:\n\n x_k+1 = A x_k\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineDiscreteSystem","text":"AffineDiscreteSystem\n\nDiscrete-time affine system of the form:\n\n x_k+1 = A x_k + c\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearControlDiscreteSystem","text":"LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form:\n\n x_k+1 = A x_k + B u_k\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDiscreteSystem","text":"ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form:\n\n x_k+1 = A x_k x_k mathcalX\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineDiscreteSystem","text":"ConstrainedAffineDiscreteSystem\n\nDiscrete-time affine system with state constraints of the form:\n\n x_k+1 = A x_k + c x_k mathcalX text for all k\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlDiscreteSystem","text":"ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with state constraints of the form:\n\n x_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU text for all k\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlDiscreteSystem","text":"ConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with state constraints of the form:\n\n x_k+1 = A x_k + B u_k + c x_k mathcalX u_k mathcalU text for all k\n\nand c a vector.\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicDiscreteSystem","text":"LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form:\n\n E x_k+1 = A x_k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","text":"ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with state constraints of the form:\n\n E x_k+1 = A x_k x_k mathcalX\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.PolynomialDiscreteSystem","text":"PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form:\n\n x_k+1 = p(x_k) x_k mathcalX\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialDiscreteSystem","text":"ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with state constraints:\n\n x_k+1 = p(x_k) x_k mathcalX\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxDiscreteSystem","text":"BlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k)\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","text":"ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side with state constraints of the form:\n\n x_k+1 = f(x_k) x_k mathcalX\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","text":"ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with state and input constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","text":"NoisyConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance and state constraints of the form:\n\n x_k+1 = A x_k + D w_k x_k mathcalX w(t) mathcalW \n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","text":"NoisyConstrainedLinearControlDiscreteSystem\n\nContinuous-time affine control system with state constraints of the form:\n\n x_k+1 = A x_k + B u_k + D w_k x_k mathcalX u_k mathcalU w_k mathcalW text for all k\n\nand c a vector.\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","text":"NoisyConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with state constraints of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k x_k mathcalX u_k mathcalU w_k mathcalW text for all k\n\nand c a vector.\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","text":"NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with state constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU w_k mathcalW\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discretization-Algorithms-1","page":"Types","title":"Discretization Algorithms","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractDiscretizationAlgorithm\nExactDiscretization\nEulerDiscretization","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractDiscretizationAlgorithm","page":"Types","title":"MathematicalSystems.AbstractDiscretizationAlgorithm","text":"AbstractDiscretizationAlgorithm\n\nAbstract supertype for all discretization algorithms.\n\nNote\n\nFor implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method\n\n_discretize(::NewDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nare required.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ExactDiscretization","page":"Types","title":"MathematicalSystems.ExactDiscretization","text":"ExactDiscretization <: AbstractDiscretizationAlgorithm\n\nExact discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Discretizationoflinearstatespace_models\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.EulerDiscretization","page":"Types","title":"MathematicalSystems.EulerDiscretization","text":"EulerDiscretization <: AbstractDiscretizationAlgorithm\n\nEuler discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Approximations\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#System-macro-1","page":"Types","title":"System macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@system","category":"page"},{"location":"lib/types/#MathematicalSystems.@system","page":"Types","title":"MathematicalSystems.@system","text":"system(expr...)\n\nReturn an instance of the system type corresponding to the given expressions.\n\nInput\n\nexpr – expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system\n\nOutput\n\nA system that best matches the given expressions.\n\nNotes\n\nTerms. The expression expr contains one or more of the following sub-expressions:\n\ndynamic equation, either continuous, e.g.x' = Ax, or discrete, e.g. x⁺ = Ax\nset constraints, e.g. x ∈ X\ninput constraints, e.g. u ∈ U\ndimensionality, e.g. dim: (2,1) or dim = 1\nspecification of the input variable, e.g. input: u or input = u\nspecification of the noise variable, e,g, noise: w or noise = w\n\nThe macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:\n\n@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)\n\nThe 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.\n\nDynamic 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.\n\nDefault 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.\n\nExceptions. The following exceptions and particular cases apply:\n\nIf the right-hand side has the form A*x + B*foo, A*x + B*foo + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.\nIf the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.\nSystems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.\n\nExamples\n\nLet us first create a continuous linear system using this macro:\n\njulia> A = [1. 0; 0 1.];\n\njulia> @system(x' = A*x)\nLinearContinuousSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nA discrete system is defined by using ⁺:\n\njulia> @system(x⁺ = A*x)\nLinearDiscreteSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nAdditionally, 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:\n\njulia> using LazySets\n\njulia> B = Matrix([1. 0.5]');\n\njulia> c = [1., 1.5];\n\njulia> X = BallInf(zeros(2), 10.);\n\njulia> U = BallInf(zeros(1), 2.);\n\njulia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)\nConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64},BallInf{Float64}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64}([0.0, 0.0], 10.0), BallInf{Float64}([0.0], 2.0))\n\nFor 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\n\njulia> f(x, u) = x + u;\n\njulia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))\nConstrainedBlackBoxControlDiscreteSystem{typeof(f),BallInf{Float64},BallInf{Float64}}(f, 2, 2, BallInf{Float64}([0.0, 0.0], 10.0), BallInf{Float64}([0.0], 2.0))\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Identity-operator-1","page":"Types","title":"Identity operator","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"IdentityMultiple","category":"page"},{"location":"lib/types/#MathematicalSystems.IdentityMultiple","page":"Types","title":"MathematicalSystems.IdentityMultiple","text":"IdentityMultiple{T} < AbstractMatrix{T} where T\n\nA scalar multiple of the identity matrix of given order and numeric type.\n\nFields\n\nM – uniform scaling operator of type T\nn – size of the identity matrix\n\nNotes\n\nThis 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.\n\nInternally, the type wraps Julia's lazy multiple of the identity operator, UniformScaling. IdentityMultiple subtypes AbstractMatix, hence it can be used in usual matrix arithmetic and for dispatch on AbstractMatrix.\n\nThe difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.\n\nExamples\n\nThe easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:\n\njulia> using MathematicalSystems: IdentityMultiple\n\njulia> I2 = I(2)\nIdentityMultiple{Float64} of value 1.0 and order 2\n\njulia> I2 + I2\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> 4*I2\nIdentityMultiple{Float64} of value 4.0 and order 2\n\nThe numeric type (default Float64) can be passed as a second argument:\n\njulia> I2r = I(2, Rational{Int})\nIdentityMultiple{Rational{Int64}} of value 1//1 and order 2\n\njulia> I2r + I2r\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\njulia> 4*I2r\nIdentityMultiple{Rational{Int64}} of value 4//1 and order 2\n\nTo create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:\n\njulia> I2 = I(2.0, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = I(2//1, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\nOr use the constructor passing the UniformScaling (I):\n\njulia> I2 = IdentityMultiple(2.0*I, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = IdentityMultiple(2//1*I, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Initial-Value-Problems-1","page":"Types","title":"Initial Value Problems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"InitialValueProblem\nIVP\ninitial_state","category":"page"},{"location":"lib/types/#MathematicalSystems.InitialValueProblem","page":"Types","title":"MathematicalSystems.InitialValueProblem","text":"InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystem\n\nParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x₀ = -12 12:\n\njulia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);\n\njulia> x₀ = [-1/2, 1/2];\n\njulia> p = InitialValueProblem(s, x₀);\n\njulia> initial_state(p) # same as p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IVP","page":"Types","title":"MathematicalSystems.IVP","text":"IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.initial_state","page":"Types","title":"MathematicalSystems.initial_state","text":"initial_state(ivp::InitialValueProblem)\n\nReturn the initial state of an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe initial state of an initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Input-Types-1","page":"Types","title":"Input Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractInput\nConstantInput\nVaryingInput","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractInput","page":"Types","title":"MathematicalSystems.AbstractInput","text":"AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstantInput","page":"Types","title":"MathematicalSystems.ConstantInput","text":"ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.VaryingInput","page":"Types","title":"MathematicalSystems.VaryingInput","text":"VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase's iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64},Array{Rational{Int64},1}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Maps-1","page":"Types","title":"Maps","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractMap\nIdentityMap\nConstrainedIdentityMap\nLinearMap\nConstrainedLinearMap\nAffineMap\nConstrainedAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap\nResetMap\nConstrainedResetMap","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractMap","page":"Types","title":"MathematicalSystems.AbstractMap","text":"AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IdentityMap","page":"Types","title":"MathematicalSystems.IdentityMap","text":"IdentityMap\n\nAn identity map,\n\n x x\n\nFields\n\ndim – dimension\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedIdentityMap","page":"Types","title":"MathematicalSystems.ConstrainedIdentityMap","text":"ConstrainedIdentityMap\n\nAn identity map with state constraints of the form:\n\n x x x(t) mathcalX\n\nFields\n\ndim – dimension\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearMap","page":"Types","title":"MathematicalSystems.LinearMap","text":"LinearMap\n\nA linear map,\n\n x Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearMap","text":"ConstrainedLinearMap\n\nA linear map with state constraints of the form:\n\n x Ax x(t) mathcalX\n\nFields\n\nA – matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineMap","page":"Types","title":"MathematicalSystems.AffineMap","text":"AffineMap\n\nAn affine map,\n\n x Ax + c\n\nFields\n\nA – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineMap","text":"ConstrainedAffineMap\n\nAn affine map with state constraints of the form:\n\n x Ax + c x(t) mathcalX\n\nFields\n\nA – matrix\nc – vector\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlMap","page":"Types","title":"MathematicalSystems.LinearControlMap","text":"LinearControlMap\n\nA linear control map,\n\n (x u) Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlMap","text":"ConstrainedLinearControlMap\n\nA linear control map with state and input constraints,\n\n (x u) Ax + Bu x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlMap","page":"Types","title":"MathematicalSystems.AffineControlMap","text":"AffineControlMap\n\nAn affine control map,\n\n (x u) Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlMap","text":"ConstrainedAffineControlMap\n\nAn affine control map with state and input constraints,\n\n (x u) Ax + Bu + c x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ResetMap","page":"Types","title":"MathematicalSystems.ResetMap","text":"ResetMap\n\nA reset map,\n\n x R(x)\n\nsuch that a subset of the variables is given a specified value, and the rest are unchanged.\n\nFields\n\ndim – dimension\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedResetMap","page":"Types","title":"MathematicalSystems.ConstrainedResetMap","text":"ConstrainedResetMap\n\nA reset map with state constraints of the form:\n\n x R(x) x mathcalX\n\nsuch that the specified variables are assigned a given value, and the remaining variables are unchanged.\n\nFields\n\ndim – dimension\nX – state constraints\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Macros-1","page":"Types","title":"Macros","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@map","category":"page"},{"location":"lib/types/#MathematicalSystems.@map","page":"Types","title":"MathematicalSystems.@map","text":"map(ex, args)\n\nReturn an instance of the map type corresponding to the given expression.\n\nInput\n\nex – an expression defining the map, in the form of an anonymous function\nargs – additional optional arguments\n\nOutput\n\nA map that best matches the given expression.\n\nExamples\n\nLet us first create a linear map using this macro:\n\njulia> @map x -> [1 0; 0 0]*x\nLinearMap{Int64,Array{Int64,2}}([1 0; 0 0])\n\nWe can create an affine system as well:\n\njulia> @map x -> [1 0; 0 0]*x + [2, 0]\nAffineMap{Int64,Array{Int64,2},Array{Int64,1}}([1 0; 0 0], [2, 0])\n\nAdditional 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:\n\njulia> @map(x -> x, dim=5)\nIdentityMap(5)\n\nAn identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:\n\njulia> @map x -> I(5)*x\nIdentityMap(5)\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Systems-with-output-1","page":"Types","title":"Systems with output","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem","category":"page"},{"location":"lib/types/#MathematicalSystems.SystemWithOutput","page":"Types","title":"MathematicalSystems.SystemWithOutput","text":"SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap}\n\nParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearTimeInvariantSystem","page":"Types","title":"MathematicalSystems.LinearTimeInvariantSystem","text":"LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.LTISystem","page":"Types","title":"MathematicalSystems.LTISystem","text":"LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n","category":"function"},{"location":"#MathematicalSystems.jl-1","page":"Home","title":"MathematicalSystems.jl","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]","category":"page"},{"location":"#","page":"Home","title":"Home","text":"MathematicalSystems is a Julia package for mathematical systems interfaces.","category":"page"},{"location":"#Features-1","page":"Home","title":"Features","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled, linear algebraic, etc.\nIterator interfaces to handle constant or time-varying inputs.","category":"page"},{"location":"#Library-Outline-1","page":"Home","title":"Library Outline","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Pages = [\n \"lib/types.md\",\n \"lib/methods.md\",\n \"lib/internals.md\"\n]\nDepth = 2","category":"page"},{"location":"lib/methods/#Methods-1","page":"Methods","title":"Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"This section describes systems methods implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"Pages = [\"methods.md\"]\nDepth = 3","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/methods/#States-1","page":"Methods","title":"States","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"statedim\nstateset","category":"page"},{"location":"lib/methods/#MathematicalSystems.statedim","page":"Methods","title":"MathematicalSystems.statedim","text":"statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.stateset","page":"Methods","title":"MathematicalSystems.stateset","text":"stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Inputs-1","page":"Methods","title":"Inputs","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"inputdim\ninputset\nnextinput","category":"page"},{"location":"lib/methods/#MathematicalSystems.inputdim","page":"Methods","title":"MathematicalSystems.inputdim","text":"inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.inputset","page":"Methods","title":"MathematicalSystems.inputset","text":"inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.nextinput","page":"Methods","title":"MathematicalSystems.nextinput","text":"nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Output-1","page":"Methods","title":"Output","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"outputdim\noutputmap","category":"page"},{"location":"lib/methods/#MathematicalSystems.outputdim","page":"Methods","title":"MathematicalSystems.outputdim","text":"outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.outputmap","page":"Methods","title":"MathematicalSystems.outputmap","text":"outputmap(s::SystemWithOutput)\n\nReturns the output map of a system with output.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Traits-1","page":"Methods","title":"Traits","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"islinear(::AbstractSystem)\nislinear(::AbstractMap)\nisaffine(::AbstractSystem)\nispolynomial(::AbstractSystem)\nisaffine(::AbstractMap)\nisnoisy(::AbstractSystem)\niscontrolled(::AbstractSystem)\nisconstrained(::AbstractSystem)\nstate_matrix(::AbstractSystem)\ninput_matrix(::AbstractSystem)\nnoise_matrix(::AbstractSystem)\naffine_term(::AbstractSystem)","category":"page"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by linear equations.\n\nNotes\n\nWe 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 mathbbR. 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).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(m::AbstractMap)\n\nSpecifies if the map m is linear or not.\n\nNotes\n\nA map is linear if it preserves the operations of scalar multiplication and vector addition.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by affine equations.\n\nNotes\n\nAn 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.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.ispolynomial-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.ispolynomial","text":"ispolynomial(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by polynomial equations.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(m::AbstractMap)\n\nSpecifies if the map m is affine or not.\n\nNotes\n\nAn affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isnoisy-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isnoisy","text":"isnoisy(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a noise term w.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.iscontrolled-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.iscontrolled","text":"iscontrolled(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a control input u.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isconstrained-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isconstrained","text":"isconstrained(s::AbstractSystem)\n\nDetermines if the system s has constraints on the state, input and noise, respectively (those that are available).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.state_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.state_matrix","text":"state_matrix(::AbstractSystem)\n\nReturn the state matrix of an affine system.\n\nNotes\n\nThe state matrix is the matrix proportional to the state, e.g. the matrix A in the linear continuous system x = Ax.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.input_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.input_matrix","text":"input_matrix(::AbstractSystem)\n\nReturn the input matrix of a system with linear input.\n\nNotes\n\nThe input matrix is the matrix proportional to the input, e.g. the matrix B in the linear continuous system with input, x = Ax + Bu.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.noise_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.noise_matrix","text":"noise_matrix(::AbstractSystem)\n\nReturn the noise matrix of a system with linear noise.\n\nNotes\n\nThe noise matrix is the matrix proportional to the noise, e.g. the matrix D in the linear system with noise, x = Ax + Dw.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.affine_term-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.affine_term","text":"affine_term(::AbstractSystem)\n\nReturn the affine term in an affine system.\n\nNotes\n\nThe affine term is e.g. the vector c in the affine system x = Ax + c.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#Maps-1","page":"Methods","title":"Maps","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"apply","category":"page"},{"location":"lib/methods/#MathematicalSystems.apply","page":"Methods","title":"MathematicalSystems.apply","text":"apply(m::AbstractMap, args...)\n\nApply the rule specified by the map to the given arguments.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Successor-1","page":"Methods","title":"Successor","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"successor","category":"page"},{"location":"lib/methods/#MathematicalSystems.successor","page":"Methods","title":"MathematicalSystems.successor","text":"successor(system::DiscreteIdentitySystem, x::AbstractVector)\n\nReturn the successor state of a DiscreteIdentitySystem.\n\nInput\n\nsystem – DiscreteIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::ConstrainedDiscreteIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedDiscreteIdentitySystem.\n\nInput\n\nsystem – ConstrainedDiscreteIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::LinearDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a LinearDiscreteSystem.\n\nInput\n\nsystem – LinearDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::AffineDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a AffineDiscreteSystem.\n\nInput\n\nsystem – AffineDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::LinearControlDiscreteSystem, x::AbstractVector, u::AbstractVector)\n\nReturn the successor state of a LinearControlDiscreteSystem.\n\nInput\n\nsystem – LinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineDiscreteSystem, x::AbstractVector;\n [check_constraints])\n\nReturn the successor state of a ConstrainedAffineDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::BlackBoxDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a BlackBoxDiscreteSystem.\n\nInput\n\nsystem – BlackBoxDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearDiscreteSystem, x::AbstractVector,\n w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearControlDiscreteSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Discretization-1","page":"Methods","title":"Discretization","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"discretize","category":"page"},{"location":"lib/methods/#MathematicalSystems.discretize","page":"Methods","title":"MathematicalSystems.discretize","text":"discretize(system::AbstractContinuousSystem, ΔT::Real,\n algorithm::AbstractDiscretizationAlgorithm=ExactDiscretization(),\n constructor=_default_complementary_constructor(system))\n\nDiscretization of a isaffine AbstractContinuousSystem to a AbstractDiscreteSystem with sampling time ΔT using the discretization method algorithm.\n\nInput\n\nsystem – an affine continuous system\nΔT – sampling time\nalgorithm – (optional, default: ExactDiscretization()) discretization algorithm\nconstructor – (optional, default: _default_complementary_constructor(system)) construction method\n\nOutput\n\nReturns a discretization of the input system system with discretization method algorithm and sampling time ΔT.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Internal-Methods-1","page":"Methods","title":"Internal Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"_discretize\ntypename(::AbstractSystem)\n_complementary_type(::Type{<:AbstractSystem})","category":"page"},{"location":"lib/methods/#MathematicalSystems._discretize","page":"Methods","title":"MathematicalSystems._discretize","text":"_discretize(::AbstractDiscretizationAlgorithm, ΔT::Real\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nImplementation of the discretization algorithm defined by the first input argument with sampling time ΔT.\n\nInput\n\n`` – discretization algorithm, used for dispatch\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B, c and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(A::AbstractMatrix, ΔT::Real; algorithm=:exact)\n\nDiscretize the state matrix A with sampling time ΔT and discretization method algorithm.\n\nInput\n\nA – state matrix\nΔT – sampling time\nalgorithm – (optional, default: :exact) discretization algorithm\n\nOutput\n\nReturns a vector containing the discretized input argument A.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix)\n\nDiscretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input or noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A and B.\n\nNotes\n\nThis method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix,c::AbstractVector)\n\nDiscretize the state matrix A and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector)\n\nDiscretize the state matrix A, input matrix B and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, D::AbstractMatrix)\n\nDiscretize the state matrix A, input matrix B and noise matrix C with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.typename-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.typename","text":"typename(system::AbstractSystem)\n\nReturns the base type of system without parameter information.\n\nInput\n\nsystem – AbstractSystem\n\nOutput\n\nThe base type of system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems._complementary_type-Tuple{Type{#s3} where #s3<:AbstractSystem}","page":"Methods","title":"MathematicalSystems._complementary_type","text":"_complementary_type(system_type::Type{<:AbstractSystem})\n\nReturn the complementary type of a system type system_type.\n\nInput\n\nsystem_type – type of AbstractSystem\n\nOuput\n\nReturn complementary type of system_type.\n\nNotes\n\nThere are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.\n\nTo get the complementary type of system type, use _complementary_type(typename(system)).\n\n\n\n\n\n","category":"method"}]
+}
diff --git a/v0.11.0/siteinfo.js b/v0.11.0/siteinfo.js
new file mode 100644
index 00000000..4a96494e
--- /dev/null
+++ b/v0.11.0/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.11.0";
diff --git a/v0.11.1/about/index.html b/v0.11.1/about/index.html
new file mode 100644
index 00000000..53f1576e
--- /dev/null
+++ b/v0.11.1/about/index.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
Return the system type whose field names match those in fields.
Input
AT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem
fields – tuple of field names
Output
The system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.
Extract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.
For the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list
(:A_user, :A)
(:B_user, :B)
(:c_user, :c)
(:D_user, :D)
(:f_user, :f)
(:statedim_user :statedim)
(:inputdim_user :inputdim)
(:noisedim_user :noisedim)
and for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.
Input
equation – dynamic equation
state – state variable
input – input variable
noise – noise variable
dim – dimensionality
AT – abstract system type
Output
Two arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.
Checks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.
Return true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.
Input
expr – expression
Output
A Bool indicating whether expr is an equation or not.
If an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.
If an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.
Similiarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.
Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.
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)$.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
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.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Specifies if the dynamics of system s is specified by polynomial equations.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.
Discretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.
Input
algorithm – discretization algorithm
ΔT – sampling time
A – state matrix
B – input or noise matrix
Output
Returns a vector containing the discretized input arguments A and B.
Notes
This method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).
Return the complementary type of a system type system_type.
Input
system_type – type of AbstractSystem
Ouput
Return complementary type of system_type.
Notes
There are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.
To get the complementary type of system type, use _complementary_type(typename(system)).
Abstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
Exact 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].
Euler 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].
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 + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.
If the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.
Systems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
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.5]');
+
+julia> c = [1., 1.5];
+
+julia> X = BallInf(zeros(2), 10.);
+
+julia> U = BallInf(zeros(1), 2.);
+
+julia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)
+ConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([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,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))
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.
A scalar multiple of the identity matrix of given order and numeric type.
Fields
M – uniform scaling operator of type T
n – 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 AbstractMatix, 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
The easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:
julia> using MathematicalSystems: IdentityMultiple
+
+julia> I2 = I(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 2
The numeric type (default Float64) can be passed as a second argument:
julia> I2r = I(2, Rational{Int})
+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 2
To create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:
julia> I2 = I(2.0, 2)
+IdentityMultiple{Float64} of value 2.0 and order 2
+
+julia> I2r = I(2//1, 2)
+IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
Or use the constructor passing the UniformScaling (I):
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 2
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.
Type 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:
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)
An identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:
diff --git a/v0.11.1/search_index.js b/v0.11.1/search_index.js
new file mode 100644
index 00000000..ec99e837
--- /dev/null
+++ b/v0.11.1/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"lib/internals/#Internals-1","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"This section describes functions that are internal to the library.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]\nDepth = 3","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/internals/#Expression-handling-1","page":"Internals","title":"Expression handling","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"_corresponding_type\n_capture_dim\nextract_dyn_equation_parameters\nadd_asterisk\nsort","category":"page"},{"location":"lib/internals/#MathematicalSystems._corresponding_type","page":"Internals","title":"MathematicalSystems._corresponding_type","text":"_corresponding_type(AT::Type{<:AbstractSystem}, fields::Tuple)\n\nReturn the system type whose field names match those in fields.\n\nInput\n\nAT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem\nfields – tuple of field names\n\nOutput\n\nThe system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.\n\nExamples\n\njulia> using MathematicalSystems: _corresponding_type\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A),))\nLinearContinuousSystem\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A), (:B), (:X), (:U)))\nConstrainedLinearControlContinuousSystem\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._capture_dim","page":"Internals","title":"MathematicalSystems._capture_dim","text":"_capture_dim(expr)\n\nReturn the tuple containing the dimension(s) in expr.\n\nInput\n\nexpr – symbolic expression that can be of any of the following forms:\n:x or :(x) – state dimension\n:(x, u) – state and input dimension\n:(x, u, w) – state, input and noise dimensions\n\nOutput\n\nThe scalar x if expr specifies the state dimension.\nThe vector [x, u] if expr specifies state and input dimension.\nThe vector [x, u, w] if expr specifies state, input and noise dimensions.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_dyn_equation_parameters","page":"Internals","title":"MathematicalSystems.extract_dyn_equation_parameters","text":"extract_dyn_equation_parameters(equation, state, input, noise, dim, AT)\n\nExtract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.\n\nFor the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list\n\n(:A_user, :A)\n(:B_user, :B)\n(:c_user, :c)\n(:D_user, :D)\n(:f_user, :f)\n(:statedim_user :statedim)\n(:inputdim_user :inputdim)\n(:noisedim_user :noisedim)\n\nand for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.\n\nInput\n\nequation – dynamic equation\nstate – state variable\ninput – input variable\nnoise – noise variable\ndim – dimensionality\nAT – abstract system type\n\nOutput\n\nTwo arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.add_asterisk","page":"Internals","title":"MathematicalSystems.add_asterisk","text":"add_asterisk(summand, state::Symbol, input::Symbol, noise::Symbol)\n\nChecks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.\n\nInput\n\nsummand – expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nMultiplication expression or symbol.\n\nExample\n\njulia> using MathematicalSystems: add_asterisk\n\njulia> add_asterisk(:(A1*x), :x, :u, :w)\n:(A1 * x)\n\njulia> add_asterisk(:(c1), :x, :u, :w)\n:c1\n\njulia> add_asterisk(:(Ax1), :x1, :u, :w)\n:(A * x1)\n\njulia> add_asterisk(:(Awb), :x1, :u, :wb)\n:(A * wb)\n\njulia> add_asterisk(:(A1u), :x, :u, :w)\n:(A1 * u)\n\njulia> add_asterisk(:(A1ub), :x, :u, :w)\n:A1ub\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Base.sort","page":"Internals","title":"Base.sort","text":"sort(parameters::Vector, order::Tuple)\n\nFilter and sort the vector parameters according to order.\n\nInput\n\nparameters – vector of tuples\norder – tuple of symbols\n\nOutput\n\nA new vector of tuples corresponding to parameters filtered and sorted according to order.\n\nExamples\n\njulia> parameters= [(:U1, :U), (:X1, :X), (:W1, :W)];\n\njulia> sort(parameters, (:X, :U, :W))\n3-element Array{Tuple{Any,Symbol},1}:\n (:X1, :X)\n (:U1, :U)\n (:W1, :W)\n\njulia> parameters = [(:const, :c), (:A, :A)];\n\njulia> sort(parameters, (:A, :B, :c, :D))\n2-element Array{Tuple{Any,Symbol},1}:\n (:A, :A)\n (:const, :c)\n\nNotes\n\nparameters is a vector that contains tuples whose second element is considered for the sorting according to order.\n\nIf a value of order is not contained in parameters, the corresponding entry of order will be omitted.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Querying-expressions-1","page":"Internals","title":"Querying expressions","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"is_equation\nextract_sum","category":"page"},{"location":"lib/internals/#MathematicalSystems.is_equation","page":"Internals","title":"MathematicalSystems.is_equation","text":"is_equation(expr)\n\nReturn true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.\n\nInput\n\nexpr – expression\n\nOutput\n\nA Bool indicating whether expr is an equation or not.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_sum","page":"Internals","title":"MathematicalSystems.extract_sum","text":"extract_sum(summands, state::Symbol, input::Symbol, noise::Symbol)\n\nExtract the variable name and field name for every element of summands which corresponds to the elements of the right-hand side of an affine system.\n\nInput\n\nsummands – array of expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nArray of tuples of symbols with variable name and field name.\n\nExample\n\njulia> using MathematicalSystems: extract_sum\n\njulia> extract_sum([:(A1*x)], :x, :u, :w)\n1-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n\njulia> extract_sum([:(A1*x), :(B1*u), :c], :x, :u, :w)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(vcat(c)), :c)\n\njulia> extract_sum([:(A1*x7), :( B1*u7), :( B2*w7)], :x7, :u7, :w7)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(hcat(B2)), :D)\n\nNotes\n\nIf an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.\n\nIf an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.\n\nSimiliarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Naming-convention-for-systems'-fields-1","page":"Internals","title":"Naming convention for systems' fields","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Field Description Getter function\nA state matrix state_matrix\nB input matrix input_matrix\nc affine term affine_term\nD noise matrix noise_matrix\nX state constraints stateset\nU input constraints inputset\nW disturbance set noiseset","category":"page"},{"location":"about/#About-1","page":"About","title":"About","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This page contains some general information about this project, and recommendations about contributing.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Pages = [\"about.md\"]","category":"page"},{"location":"about/#Contributing-1","page":"About","title":"Contributing","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.","category":"page"},{"location":"about/#Branches-and-pull-requests-(PR)-1","page":"About","title":"Branches and pull requests (PR)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.","category":"page"},{"location":"about/#Unit-testing-and-continuous-integration-(CI)-1","page":"About","title":"Unit testing and continuous integration (CI)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes test/runtests.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Alternatively, you can achieve the same from inside the REPL using the following command:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> Pkg.test(\"MathematicalSystems\")","category":"page"},{"location":"about/#","page":"About","title":"About","text":"We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.","category":"page"},{"location":"about/#Contributing-to-the-documentation-1","page":"About","title":"Contributing to the documentation","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"New functions and types should be documented according to our guidelines directly in the source code.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> ?LinearContinuousSystem","category":"page"},{"location":"about/#","page":"About","title":"About","text":"This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).","category":"page"},{"location":"about/#","page":"About","title":"About","text":"To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes docs/make.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Note that this also runs all doctests which will take some time.","category":"page"},{"location":"about/#Related-projects-1","page":"About","title":"Related projects","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below we list more related projects.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia","category":"page"},{"location":"about/#Credits-1","page":"About","title":"Credits","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"These persons have contributed to MathematicalSystems.jl (in alphabetic order):","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Marcelo Forets\nBenoît Legat\nChristian Schilling\nUeli Wechsler","category":"page"},{"location":"lib/types/#Types-1","page":"Types","title":"Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"This section describes systems types implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"Pages = [\"types.md\"]\nDepth = 3","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/types/#Abstract-Systems-1","page":"Types","title":"Abstract Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractSystem","page":"Types","title":"MathematicalSystems.AbstractSystem","text":"AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractContinuousSystem","page":"Types","title":"MathematicalSystems.AbstractContinuousSystem","text":"AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractDiscreteSystem","page":"Types","title":"MathematicalSystems.AbstractDiscreteSystem","text":"AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Continuous-Systems-1","page":"Types","title":"Continuous Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem\nBlackBoxContinuousSystem\nConstrainedBlackBoxContinuousSystem\nBlackBoxControlContinuousSystem\nConstrainedBlackBoxControlContinuousSystem\nNoisyLinearContinuousSystem\nNoisyConstrainedLinearContinuousSystem\nNoisyLinearControlContinuousSystem\nNoisyConstrainedLinearControlContinuousSystem\nNoisyAffineControlContinuousSystem\nNoisyConstrainedAffineControlContinuousSystem\nNoisyBlackBoxControlContinuousSystem\nNoisyConstrainedBlackBoxControlContinuousSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.ContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ContinuousIdentitySystem","text":"ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form:\n\n x(t) = 0 forall t\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedContinuousIdentitySystem","text":"ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with domain constraints of the form:\n\n x(t) = 0 x(t) mathcalX forall t\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearContinuousSystem","page":"Types","title":"MathematicalSystems.LinearContinuousSystem","text":"LinearContinuousSystem\n\nContinuous-time linear system of the form:\n\n x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineContinuousSystem","page":"Types","title":"MathematicalSystems.AffineContinuousSystem","text":"AffineContinuousSystem\n\nContinuous-time affine system of the form:\n\n x(t) = A x(t) + c forall t\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.LinearControlContinuousSystem","text":"LinearControlContinuousSystem\n\nContinuous-time linear control system of the form:\n\n x(t) = A x(t) + B u(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearContinuousSystem","text":"ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineContinuousSystem","text":"ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with domain constraints of the form:\n\n x(t) = A x(t) + c x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlContinuousSystem","text":"ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlContinuousSystem","text":"ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicContinuousSystem","text":"LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form:\n\n E x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","text":"ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n E x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.PolynomialContinuousSystem","text":"PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form:\n\n x(t) = p(x(t)) forall t\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialContinuousSystem","text":"ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with domain constraints:\n\n x(t) = p(x(t)) x(t) mathcalX forall t\n\nFields\n\np – polynomial vector field\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxContinuousSystem","text":"BlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side of the form:\n\n x(t) = f(x(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxContinuousSystem","text":"ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t)) x(t) mathcalX forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlContinuousSystem","text":"BlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","text":"ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t)) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearContinuousSystem","text":"NoisyLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance of the form:\n\n x(t) = A x(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearContinuousSystem","text":"NoisyConstrainedLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + D w(t) x(t) mathcalX w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlContinuousSystem","text":"NoisyLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","text":"NoisyConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlContinuousSystem","text":"NoisyAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","text":"NoisyConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlContinuousSystem","text":"NoisyBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t) w(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","text":"NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t) w(t)) quad x(t) mathcalX quad u(t) mathcalU quad w(t) mathcalW quad forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discrete-Systems-1","page":"Types","title":"Discrete Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nAffineDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedAffineDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nConstrainedAffineControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem\nBlackBoxDiscreteSystem\nConstrainedBlackBoxDiscreteSystem\nBlackBoxControlDiscreteSystem\nConstrainedBlackBoxControlDiscreteSystem\nNoisyLinearDiscreteSystem\nNoisyConstrainedLinearDiscreteSystem\nNoisyLinearControlDiscreteSystem\nNoisyConstrainedLinearControlDiscreteSystem\nNoisyAffineControlDiscreteSystem\nNoisyConstrainedAffineControlDiscreteSystem\nNoisyBlackBoxControlDiscreteSystem\nNoisyConstrainedBlackBoxControlDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.DiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.DiscreteIdentitySystem","text":"DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form:\n\n x_k+1 = x_k forall k\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedDiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedDiscreteIdentitySystem","text":"ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with domain constraints of the form:\n\n x_k+1 = x_k x_k mathcalX forall k\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDiscreteSystem","text":"LinearDiscreteSystem\n\nDiscrete-time linear system of the form:\n\n x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineDiscreteSystem","text":"AffineDiscreteSystem\n\nDiscrete-time affine system of the form:\n\n x_k+1 = A x_k + c forall k\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearControlDiscreteSystem","text":"LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form:\n\n x_k+1 = A x_k + B u_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDiscreteSystem","text":"ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineDiscreteSystem","text":"ConstrainedAffineDiscreteSystem\n\nDiscrete-time affine system with domain constraints of the form:\n\n x_k+1 = A x_k + c x_k mathcalX forall k\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlDiscreteSystem","text":"ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlDiscreteSystem","text":"ConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicDiscreteSystem","text":"LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form:\n\n E x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","text":"ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n E x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.PolynomialDiscreteSystem","text":"PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form:\n\n x_k+1 = p(x_k) forall k\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialDiscreteSystem","text":"ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with domain constraints:\n\n x_k+1 = p(x_k) x_k mathcalX forall k\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxDiscreteSystem","text":"BlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","text":"ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k) x_k mathcalX forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlDiscreteSystem","text":"BlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","text":"ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearDiscreteSystem","text":"NoisyLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance of the form:\n\n x_k+1 = A x_k + D w_k forall k\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","text":"NoisyConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + D w_k x_k mathcalX w(t) mathcalW forall k\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlDiscreteSystem","text":"NoisyLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","text":"NoisyConstrainedLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlDiscreteSystem","text":"NoisyAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","text":"NoisyConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","text":"NoisyBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","text":"NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) quad x_k mathcalX quad u_k mathcalU quad w_k mathcalW quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discretization-Algorithms-1","page":"Types","title":"Discretization Algorithms","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractDiscretizationAlgorithm\nExactDiscretization\nEulerDiscretization","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractDiscretizationAlgorithm","page":"Types","title":"MathematicalSystems.AbstractDiscretizationAlgorithm","text":"AbstractDiscretizationAlgorithm\n\nAbstract supertype for all discretization algorithms.\n\nNote\n\nFor implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method\n\n_discretize(::NewDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nare required.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ExactDiscretization","page":"Types","title":"MathematicalSystems.ExactDiscretization","text":"ExactDiscretization <: AbstractDiscretizationAlgorithm\n\nExact discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Discretizationoflinearstatespace_models\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.EulerDiscretization","page":"Types","title":"MathematicalSystems.EulerDiscretization","text":"EulerDiscretization <: AbstractDiscretizationAlgorithm\n\nEuler discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Approximations\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#System-macro-1","page":"Types","title":"System macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@system","category":"page"},{"location":"lib/types/#MathematicalSystems.@system","page":"Types","title":"MathematicalSystems.@system","text":"system(expr...)\n\nReturn an instance of the system type corresponding to the given expressions.\n\nInput\n\nexpr – expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system\n\nOutput\n\nA system that best matches the given expressions.\n\nNotes\n\nTerms. The expression expr contains one or more of the following sub-expressions:\n\ndynamic equation, either continuous, e.g.x' = Ax, or discrete, e.g. x⁺ = Ax\nset constraints, e.g. x ∈ X\ninput constraints, e.g. u ∈ U\ndimensionality, e.g. dim: (2,1) or dim = 1\nspecification of the input variable, e.g. input: u or input = u\nspecification of the noise variable, e,g, noise: w or noise = w\n\nThe macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:\n\n@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)\n\nThe 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.\n\nDynamic 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.\n\nDefault 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.\n\nExceptions. The following exceptions and particular cases apply:\n\nIf the right-hand side has the form A*x + B*foo, A*x + B*foo + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.\nIf the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.\nSystems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.\n\nExamples\n\nLet us first create a continuous linear system using this macro:\n\njulia> A = [1. 0; 0 1.];\n\njulia> @system(x' = A*x)\nLinearContinuousSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nA discrete system is defined by using ⁺:\n\njulia> @system(x⁺ = A*x)\nLinearDiscreteSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nAdditionally, 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:\n\njulia> using LazySets\n\njulia> B = Matrix([1. 0.5]');\n\njulia> c = [1., 1.5];\n\njulia> X = BallInf(zeros(2), 10.);\n\njulia> U = BallInf(zeros(1), 2.);\n\njulia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)\nConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\nFor 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\n\njulia> f(x, u) = x + u;\n\njulia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))\nConstrainedBlackBoxControlDiscreteSystem{typeof(f),BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Initial-value-problem-macro-1","page":"Types","title":"Initial-value problem macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@ivp","category":"page"},{"location":"lib/types/#MathematicalSystems.@ivp","page":"Types","title":"MathematicalSystems.@ivp","text":"ivp(expr...)\n\nReturn an instance of the initial-value problem type corresponding to the given expressions.\n\nInput\n\nexpr – 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)\n\nOutput\n\nAn initial-value problem that best matches the given expressions.\n\nNotes\n\nThis 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.\n\nExamples\n\njulia> p = @ivp(x' = -x, x(0) ∈ [1.0]);\n\njulia> typeof(p)\nInitialValueProblem{LinearContinuousSystem{Float64,IdentityMultiple{Float64}},Array{Float64,1}}\n\njulia> initial_state(p)\n1-element Array{Float64,1}:\n 1.0\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Identity-operator-1","page":"Types","title":"Identity operator","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"IdentityMultiple","category":"page"},{"location":"lib/types/#MathematicalSystems.IdentityMultiple","page":"Types","title":"MathematicalSystems.IdentityMultiple","text":"IdentityMultiple{T} < AbstractMatrix{T} where T\n\nA scalar multiple of the identity matrix of given order and numeric type.\n\nFields\n\nM – uniform scaling operator of type T\nn – size of the identity matrix\n\nNotes\n\nThis 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.\n\nInternally, the type wraps Julia's lazy multiple of the identity operator, UniformScaling. IdentityMultiple subtypes AbstractMatix, hence it can be used in usual matrix arithmetic and for dispatch on AbstractMatrix.\n\nThe difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.\n\nExamples\n\nThe easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:\n\njulia> using MathematicalSystems: IdentityMultiple\n\njulia> I2 = I(2)\nIdentityMultiple{Float64} of value 1.0 and order 2\n\njulia> I2 + I2\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> 4*I2\nIdentityMultiple{Float64} of value 4.0 and order 2\n\nThe numeric type (default Float64) can be passed as a second argument:\n\njulia> I2r = I(2, Rational{Int})\nIdentityMultiple{Rational{Int64}} of value 1//1 and order 2\n\njulia> I2r + I2r\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\njulia> 4*I2r\nIdentityMultiple{Rational{Int64}} of value 4//1 and order 2\n\nTo create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:\n\njulia> I2 = I(2.0, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = I(2//1, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\nOr use the constructor passing the UniformScaling (I):\n\njulia> I2 = IdentityMultiple(2.0*I, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = IdentityMultiple(2//1*I, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Initial-Value-Problems-1","page":"Types","title":"Initial Value Problems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"InitialValueProblem\nIVP\ninitial_state\nsystem","category":"page"},{"location":"lib/types/#MathematicalSystems.InitialValueProblem","page":"Types","title":"MathematicalSystems.InitialValueProblem","text":"InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystem\n\nParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x₀ = -12 12:\n\njulia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);\n\njulia> x₀ = [-1/2, 1/2];\n\njulia> p = InitialValueProblem(s, x₀);\n\njulia> initial_state(p) # same as p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IVP","page":"Types","title":"MathematicalSystems.IVP","text":"IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.initial_state","page":"Types","title":"MathematicalSystems.initial_state","text":"initial_state(ivp::InitialValueProblem)\n\nReturn the initial state of an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe initial state of an initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.system","page":"Types","title":"MathematicalSystems.system","text":"system(ivp::InitialValueProblem)\n\nReturn the system wrapped by an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe system of the given initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Input-Types-1","page":"Types","title":"Input Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractInput\nConstantInput\nVaryingInput","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractInput","page":"Types","title":"MathematicalSystems.AbstractInput","text":"AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstantInput","page":"Types","title":"MathematicalSystems.ConstantInput","text":"ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.VaryingInput","page":"Types","title":"MathematicalSystems.VaryingInput","text":"VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase's iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64},Array{Rational{Int64},1}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Maps-1","page":"Types","title":"Maps","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractMap\nIdentityMap\nConstrainedIdentityMap\nLinearMap\nConstrainedLinearMap\nAffineMap\nConstrainedAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap\nResetMap\nConstrainedResetMap","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractMap","page":"Types","title":"MathematicalSystems.AbstractMap","text":"AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IdentityMap","page":"Types","title":"MathematicalSystems.IdentityMap","text":"IdentityMap\n\nAn identity map,\n\n x x\n\nFields\n\ndim – dimension\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedIdentityMap","page":"Types","title":"MathematicalSystems.ConstrainedIdentityMap","text":"ConstrainedIdentityMap\n\nAn identity map with state constraints of the form:\n\n x x x(t) mathcalX\n\nFields\n\ndim – dimension\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearMap","page":"Types","title":"MathematicalSystems.LinearMap","text":"LinearMap\n\nA linear map,\n\n x Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearMap","text":"ConstrainedLinearMap\n\nA linear map with state constraints of the form:\n\n x Ax x(t) mathcalX\n\nFields\n\nA – matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineMap","page":"Types","title":"MathematicalSystems.AffineMap","text":"AffineMap\n\nAn affine map,\n\n x Ax + c\n\nFields\n\nA – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineMap","text":"ConstrainedAffineMap\n\nAn affine map with state constraints of the form:\n\n x Ax + c x(t) mathcalX\n\nFields\n\nA – matrix\nc – vector\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlMap","page":"Types","title":"MathematicalSystems.LinearControlMap","text":"LinearControlMap\n\nA linear control map,\n\n (x u) Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlMap","text":"ConstrainedLinearControlMap\n\nA linear control map with state and input constraints,\n\n (x u) Ax + Bu x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlMap","page":"Types","title":"MathematicalSystems.AffineControlMap","text":"AffineControlMap\n\nAn affine control map,\n\n (x u) Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlMap","text":"ConstrainedAffineControlMap\n\nAn affine control map with state and input constraints,\n\n (x u) Ax + Bu + c x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ResetMap","page":"Types","title":"MathematicalSystems.ResetMap","text":"ResetMap\n\nA reset map,\n\n x R(x)\n\nsuch that a subset of the variables is given a specified value, and the rest are unchanged.\n\nFields\n\ndim – dimension\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedResetMap","page":"Types","title":"MathematicalSystems.ConstrainedResetMap","text":"ConstrainedResetMap\n\nA reset map with state constraints of the form:\n\n x R(x) x mathcalX\n\nsuch that the specified variables are assigned a given value, and the remaining variables are unchanged.\n\nFields\n\ndim – dimension\nX – state constraints\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Macros-1","page":"Types","title":"Macros","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@map","category":"page"},{"location":"lib/types/#MathematicalSystems.@map","page":"Types","title":"MathematicalSystems.@map","text":"map(ex, args)\n\nReturn an instance of the map type corresponding to the given expression.\n\nInput\n\nex – an expression defining the map, in the form of an anonymous function\nargs – additional optional arguments\n\nOutput\n\nA map that best matches the given expression.\n\nExamples\n\nLet us first create a linear map using this macro:\n\njulia> @map x -> [1 0; 0 0]*x\nLinearMap{Int64,Array{Int64,2}}([1 0; 0 0])\n\nWe can create an affine system as well:\n\njulia> @map x -> [1 0; 0 0]*x + [2, 0]\nAffineMap{Int64,Array{Int64,2},Array{Int64,1}}([1 0; 0 0], [2, 0])\n\nAdditional 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:\n\njulia> @map(x -> x, dim=5)\nIdentityMap(5)\n\nAn identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:\n\njulia> @map x -> I(5)*x\nIdentityMap(5)\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Systems-with-output-1","page":"Types","title":"Systems with output","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem","category":"page"},{"location":"lib/types/#MathematicalSystems.SystemWithOutput","page":"Types","title":"MathematicalSystems.SystemWithOutput","text":"SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap}\n\nParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearTimeInvariantSystem","page":"Types","title":"MathematicalSystems.LinearTimeInvariantSystem","text":"LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.LTISystem","page":"Types","title":"MathematicalSystems.LTISystem","text":"LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n","category":"function"},{"location":"#MathematicalSystems.jl-1","page":"Home","title":"MathematicalSystems.jl","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]","category":"page"},{"location":"#","page":"Home","title":"Home","text":"MathematicalSystems is a Julia package for mathematical systems interfaces.","category":"page"},{"location":"#Features-1","page":"Home","title":"Features","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled, linear algebraic, etc.\nIterator interfaces to handle constant or time-varying inputs.","category":"page"},{"location":"#Library-Outline-1","page":"Home","title":"Library Outline","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Pages = [\n \"lib/types.md\",\n \"lib/methods.md\",\n \"lib/internals.md\"\n]\nDepth = 2","category":"page"},{"location":"lib/methods/#Methods-1","page":"Methods","title":"Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"This section describes systems methods implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"Pages = [\"methods.md\"]\nDepth = 3","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/methods/#States-1","page":"Methods","title":"States","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"statedim\nstateset","category":"page"},{"location":"lib/methods/#MathematicalSystems.statedim","page":"Methods","title":"MathematicalSystems.statedim","text":"statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.stateset","page":"Methods","title":"MathematicalSystems.stateset","text":"stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Inputs-1","page":"Methods","title":"Inputs","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"inputdim\ninputset\nnextinput","category":"page"},{"location":"lib/methods/#MathematicalSystems.inputdim","page":"Methods","title":"MathematicalSystems.inputdim","text":"inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.inputset","page":"Methods","title":"MathematicalSystems.inputset","text":"inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.nextinput","page":"Methods","title":"MathematicalSystems.nextinput","text":"nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Output-1","page":"Methods","title":"Output","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"outputdim\noutputmap","category":"page"},{"location":"lib/methods/#MathematicalSystems.outputdim","page":"Methods","title":"MathematicalSystems.outputdim","text":"outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.outputmap","page":"Methods","title":"MathematicalSystems.outputmap","text":"outputmap(s::SystemWithOutput)\n\nReturns the output map of a system with output.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Traits-1","page":"Methods","title":"Traits","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"islinear(::AbstractSystem)\nislinear(::AbstractMap)\nisaffine(::AbstractSystem)\nispolynomial(::AbstractSystem)\nisaffine(::AbstractMap)\nisnoisy(::AbstractSystem)\niscontrolled(::AbstractSystem)\nisconstrained(::AbstractSystem)\nstate_matrix(::AbstractSystem)\ninput_matrix(::AbstractSystem)\nnoise_matrix(::AbstractSystem)\naffine_term(::AbstractSystem)","category":"page"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by linear equations.\n\nNotes\n\nWe 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 mathbbR. 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).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(m::AbstractMap)\n\nSpecifies if the map m is linear or not.\n\nNotes\n\nA map is linear if it preserves the operations of scalar multiplication and vector addition.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by affine equations.\n\nNotes\n\nAn 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.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.ispolynomial-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.ispolynomial","text":"ispolynomial(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by polynomial equations.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(m::AbstractMap)\n\nSpecifies if the map m is affine or not.\n\nNotes\n\nAn affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isnoisy-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isnoisy","text":"isnoisy(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a noise term w.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.iscontrolled-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.iscontrolled","text":"iscontrolled(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a control input u.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isconstrained-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isconstrained","text":"isconstrained(s::AbstractSystem)\n\nDetermines if the system s has constraints on the state, input and noise, respectively (those that are available).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.state_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.state_matrix","text":"state_matrix(::AbstractSystem)\n\nReturn the state matrix of an affine system.\n\nNotes\n\nThe state matrix is the matrix proportional to the state, e.g. the matrix A in the linear continuous system x = Ax.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.input_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.input_matrix","text":"input_matrix(::AbstractSystem)\n\nReturn the input matrix of a system with linear input.\n\nNotes\n\nThe input matrix is the matrix proportional to the input, e.g. the matrix B in the linear continuous system with input, x = Ax + Bu.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.noise_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.noise_matrix","text":"noise_matrix(::AbstractSystem)\n\nReturn the noise matrix of a system with linear noise.\n\nNotes\n\nThe noise matrix is the matrix proportional to the noise, e.g. the matrix D in the linear system with noise, x = Ax + Dw.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.affine_term-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.affine_term","text":"affine_term(::AbstractSystem)\n\nReturn the affine term in an affine system.\n\nNotes\n\nThe affine term is e.g. the vector c in the affine system x = Ax + c.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#Maps-1","page":"Methods","title":"Maps","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"apply","category":"page"},{"location":"lib/methods/#MathematicalSystems.apply","page":"Methods","title":"MathematicalSystems.apply","text":"apply(m::AbstractMap, args...)\n\nApply the rule specified by the map to the given arguments.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Successor-1","page":"Methods","title":"Successor","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"successor","category":"page"},{"location":"lib/methods/#MathematicalSystems.successor","page":"Methods","title":"MathematicalSystems.successor","text":"successor(system::DiscreteIdentitySystem, x::AbstractVector)\n\nReturn the successor state of a DiscreteIdentitySystem.\n\nInput\n\nsystem – DiscreteIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::ConstrainedDiscreteIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedDiscreteIdentitySystem.\n\nInput\n\nsystem – ConstrainedDiscreteIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::LinearDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a LinearDiscreteSystem.\n\nInput\n\nsystem – LinearDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::AffineDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a AffineDiscreteSystem.\n\nInput\n\nsystem – AffineDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::LinearControlDiscreteSystem, x::AbstractVector, u::AbstractVector)\n\nReturn the successor state of a LinearControlDiscreteSystem.\n\nInput\n\nsystem – LinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineDiscreteSystem, x::AbstractVector;\n [check_constraints])\n\nReturn the successor state of a ConstrainedAffineDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::BlackBoxDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a BlackBoxDiscreteSystem.\n\nInput\n\nsystem – BlackBoxDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearDiscreteSystem, x::AbstractVector,\n w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearControlDiscreteSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Discretization-1","page":"Methods","title":"Discretization","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"discretize","category":"page"},{"location":"lib/methods/#MathematicalSystems.discretize","page":"Methods","title":"MathematicalSystems.discretize","text":"discretize(system::AbstractContinuousSystem, ΔT::Real,\n algorithm::AbstractDiscretizationAlgorithm=ExactDiscretization(),\n constructor=_default_complementary_constructor(system))\n\nDiscretization of a isaffine AbstractContinuousSystem to a AbstractDiscreteSystem with sampling time ΔT using the discretization method algorithm.\n\nInput\n\nsystem – an affine continuous system\nΔT – sampling time\nalgorithm – (optional, default: ExactDiscretization()) discretization algorithm\nconstructor – (optional, default: _default_complementary_constructor(system)) construction method\n\nOutput\n\nReturns a discretization of the input system system with discretization method algorithm and sampling time ΔT.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Internal-Methods-1","page":"Methods","title":"Internal Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"_discretize\ntypename(::AbstractSystem)\n_complementary_type(::Type{<:AbstractSystem})","category":"page"},{"location":"lib/methods/#MathematicalSystems._discretize","page":"Methods","title":"MathematicalSystems._discretize","text":"_discretize(::AbstractDiscretizationAlgorithm, ΔT::Real\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nImplementation of the discretization algorithm defined by the first input argument with sampling time ΔT.\n\nInput\n\n`` – discretization algorithm, used for dispatch\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B, c and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(A::AbstractMatrix, ΔT::Real; algorithm=:exact)\n\nDiscretize the state matrix A with sampling time ΔT and discretization method algorithm.\n\nInput\n\nA – state matrix\nΔT – sampling time\nalgorithm – (optional, default: :exact) discretization algorithm\n\nOutput\n\nReturns a vector containing the discretized input argument A.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix)\n\nDiscretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input or noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A and B.\n\nNotes\n\nThis method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix,c::AbstractVector)\n\nDiscretize the state matrix A and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector)\n\nDiscretize the state matrix A, input matrix B and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, D::AbstractMatrix)\n\nDiscretize the state matrix A, input matrix B and noise matrix C with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.typename-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.typename","text":"typename(system::AbstractSystem)\n\nReturns the base type of system without parameter information.\n\nInput\n\nsystem – AbstractSystem\n\nOutput\n\nThe base type of system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems._complementary_type-Tuple{Type{#s3} where #s3<:AbstractSystem}","page":"Methods","title":"MathematicalSystems._complementary_type","text":"_complementary_type(system_type::Type{<:AbstractSystem})\n\nReturn the complementary type of a system type system_type.\n\nInput\n\nsystem_type – type of AbstractSystem\n\nOuput\n\nReturn complementary type of system_type.\n\nNotes\n\nThere are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.\n\nTo get the complementary type of system type, use _complementary_type(typename(system)).\n\n\n\n\n\n","category":"method"}]
+}
diff --git a/v0.11.1/siteinfo.js b/v0.11.1/siteinfo.js
new file mode 100644
index 00000000..245fb016
--- /dev/null
+++ b/v0.11.1/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.11.1";
diff --git a/v0.11.2/about/index.html b/v0.11.2/about/index.html
new file mode 100644
index 00000000..53f1576e
--- /dev/null
+++ b/v0.11.2/about/index.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
Return the system type whose field names match those in fields.
Input
AT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem
fields – tuple of field names
Output
The system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.
Extract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.
For the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list
(:A_user, :A)
(:B_user, :B)
(:c_user, :c)
(:D_user, :D)
(:f_user, :f)
(:statedim_user :statedim)
(:inputdim_user :inputdim)
(:noisedim_user :noisedim)
and for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.
Input
equation – dynamic equation
state – state variable
input – input variable
noise – noise variable
dim – dimensionality
AT – abstract system type
Output
Two arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.
Checks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.
Return true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.
Input
expr – expression
Output
A Bool indicating whether expr is an equation or not.
If an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.
If an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.
Similiarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.
Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.
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)$.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
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.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Specifies if the dynamics of system s is specified by polynomial equations.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.
Discretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.
Input
algorithm – discretization algorithm
ΔT – sampling time
A – state matrix
B – input or noise matrix
Output
Returns a vector containing the discretized input arguments A and B.
Notes
This method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).
Return the complementary type of a system type system_type.
Input
system_type – type of AbstractSystem
Ouput
Return complementary type of system_type.
Notes
There are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.
To get the complementary type of system type, use _complementary_type(typename(system)).
Abstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
Exact 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].
Euler 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].
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 + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.
If the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.
Systems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
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.5]');
+
+julia> c = [1., 1.5];
+
+julia> X = BallInf(zeros(2), 10.);
+
+julia> U = BallInf(zeros(1), 2.);
+
+julia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)
+ConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([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,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))
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.
A scalar multiple of the identity matrix of given order and numeric type.
Fields
M – uniform scaling operator of type T
n – 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 AbstractMatix, 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
The easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:
julia> using MathematicalSystems: IdentityMultiple
+
+julia> I2 = I(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 2
The numeric type (default Float64) can be passed as a second argument:
julia> I2r = I(2, Rational{Int})
+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 2
To create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:
julia> I2 = I(2.0, 2)
+IdentityMultiple{Float64} of value 2.0 and order 2
+
+julia> I2r = I(2//1, 2)
+IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
Or use the constructor passing the UniformScaling (I):
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 2
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.
Type 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:
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)
An identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:
diff --git a/v0.11.2/search_index.js b/v0.11.2/search_index.js
new file mode 100644
index 00000000..ec99e837
--- /dev/null
+++ b/v0.11.2/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"lib/internals/#Internals-1","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"This section describes functions that are internal to the library.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]\nDepth = 3","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/internals/#Expression-handling-1","page":"Internals","title":"Expression handling","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"_corresponding_type\n_capture_dim\nextract_dyn_equation_parameters\nadd_asterisk\nsort","category":"page"},{"location":"lib/internals/#MathematicalSystems._corresponding_type","page":"Internals","title":"MathematicalSystems._corresponding_type","text":"_corresponding_type(AT::Type{<:AbstractSystem}, fields::Tuple)\n\nReturn the system type whose field names match those in fields.\n\nInput\n\nAT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem\nfields – tuple of field names\n\nOutput\n\nThe system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.\n\nExamples\n\njulia> using MathematicalSystems: _corresponding_type\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A),))\nLinearContinuousSystem\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A), (:B), (:X), (:U)))\nConstrainedLinearControlContinuousSystem\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._capture_dim","page":"Internals","title":"MathematicalSystems._capture_dim","text":"_capture_dim(expr)\n\nReturn the tuple containing the dimension(s) in expr.\n\nInput\n\nexpr – symbolic expression that can be of any of the following forms:\n:x or :(x) – state dimension\n:(x, u) – state and input dimension\n:(x, u, w) – state, input and noise dimensions\n\nOutput\n\nThe scalar x if expr specifies the state dimension.\nThe vector [x, u] if expr specifies state and input dimension.\nThe vector [x, u, w] if expr specifies state, input and noise dimensions.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_dyn_equation_parameters","page":"Internals","title":"MathematicalSystems.extract_dyn_equation_parameters","text":"extract_dyn_equation_parameters(equation, state, input, noise, dim, AT)\n\nExtract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.\n\nFor the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list\n\n(:A_user, :A)\n(:B_user, :B)\n(:c_user, :c)\n(:D_user, :D)\n(:f_user, :f)\n(:statedim_user :statedim)\n(:inputdim_user :inputdim)\n(:noisedim_user :noisedim)\n\nand for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.\n\nInput\n\nequation – dynamic equation\nstate – state variable\ninput – input variable\nnoise – noise variable\ndim – dimensionality\nAT – abstract system type\n\nOutput\n\nTwo arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.add_asterisk","page":"Internals","title":"MathematicalSystems.add_asterisk","text":"add_asterisk(summand, state::Symbol, input::Symbol, noise::Symbol)\n\nChecks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.\n\nInput\n\nsummand – expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nMultiplication expression or symbol.\n\nExample\n\njulia> using MathematicalSystems: add_asterisk\n\njulia> add_asterisk(:(A1*x), :x, :u, :w)\n:(A1 * x)\n\njulia> add_asterisk(:(c1), :x, :u, :w)\n:c1\n\njulia> add_asterisk(:(Ax1), :x1, :u, :w)\n:(A * x1)\n\njulia> add_asterisk(:(Awb), :x1, :u, :wb)\n:(A * wb)\n\njulia> add_asterisk(:(A1u), :x, :u, :w)\n:(A1 * u)\n\njulia> add_asterisk(:(A1ub), :x, :u, :w)\n:A1ub\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Base.sort","page":"Internals","title":"Base.sort","text":"sort(parameters::Vector, order::Tuple)\n\nFilter and sort the vector parameters according to order.\n\nInput\n\nparameters – vector of tuples\norder – tuple of symbols\n\nOutput\n\nA new vector of tuples corresponding to parameters filtered and sorted according to order.\n\nExamples\n\njulia> parameters= [(:U1, :U), (:X1, :X), (:W1, :W)];\n\njulia> sort(parameters, (:X, :U, :W))\n3-element Array{Tuple{Any,Symbol},1}:\n (:X1, :X)\n (:U1, :U)\n (:W1, :W)\n\njulia> parameters = [(:const, :c), (:A, :A)];\n\njulia> sort(parameters, (:A, :B, :c, :D))\n2-element Array{Tuple{Any,Symbol},1}:\n (:A, :A)\n (:const, :c)\n\nNotes\n\nparameters is a vector that contains tuples whose second element is considered for the sorting according to order.\n\nIf a value of order is not contained in parameters, the corresponding entry of order will be omitted.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Querying-expressions-1","page":"Internals","title":"Querying expressions","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"is_equation\nextract_sum","category":"page"},{"location":"lib/internals/#MathematicalSystems.is_equation","page":"Internals","title":"MathematicalSystems.is_equation","text":"is_equation(expr)\n\nReturn true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.\n\nInput\n\nexpr – expression\n\nOutput\n\nA Bool indicating whether expr is an equation or not.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_sum","page":"Internals","title":"MathematicalSystems.extract_sum","text":"extract_sum(summands, state::Symbol, input::Symbol, noise::Symbol)\n\nExtract the variable name and field name for every element of summands which corresponds to the elements of the right-hand side of an affine system.\n\nInput\n\nsummands – array of expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nArray of tuples of symbols with variable name and field name.\n\nExample\n\njulia> using MathematicalSystems: extract_sum\n\njulia> extract_sum([:(A1*x)], :x, :u, :w)\n1-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n\njulia> extract_sum([:(A1*x), :(B1*u), :c], :x, :u, :w)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(vcat(c)), :c)\n\njulia> extract_sum([:(A1*x7), :( B1*u7), :( B2*w7)], :x7, :u7, :w7)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(hcat(B2)), :D)\n\nNotes\n\nIf an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.\n\nIf an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.\n\nSimiliarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Naming-convention-for-systems'-fields-1","page":"Internals","title":"Naming convention for systems' fields","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Field Description Getter function\nA state matrix state_matrix\nB input matrix input_matrix\nc affine term affine_term\nD noise matrix noise_matrix\nX state constraints stateset\nU input constraints inputset\nW disturbance set noiseset","category":"page"},{"location":"about/#About-1","page":"About","title":"About","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This page contains some general information about this project, and recommendations about contributing.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Pages = [\"about.md\"]","category":"page"},{"location":"about/#Contributing-1","page":"About","title":"Contributing","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.","category":"page"},{"location":"about/#Branches-and-pull-requests-(PR)-1","page":"About","title":"Branches and pull requests (PR)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.","category":"page"},{"location":"about/#Unit-testing-and-continuous-integration-(CI)-1","page":"About","title":"Unit testing and continuous integration (CI)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes test/runtests.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Alternatively, you can achieve the same from inside the REPL using the following command:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> Pkg.test(\"MathematicalSystems\")","category":"page"},{"location":"about/#","page":"About","title":"About","text":"We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.","category":"page"},{"location":"about/#Contributing-to-the-documentation-1","page":"About","title":"Contributing to the documentation","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"New functions and types should be documented according to our guidelines directly in the source code.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> ?LinearContinuousSystem","category":"page"},{"location":"about/#","page":"About","title":"About","text":"This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).","category":"page"},{"location":"about/#","page":"About","title":"About","text":"To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes docs/make.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Note that this also runs all doctests which will take some time.","category":"page"},{"location":"about/#Related-projects-1","page":"About","title":"Related projects","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below we list more related projects.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia","category":"page"},{"location":"about/#Credits-1","page":"About","title":"Credits","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"These persons have contributed to MathematicalSystems.jl (in alphabetic order):","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Marcelo Forets\nBenoît Legat\nChristian Schilling\nUeli Wechsler","category":"page"},{"location":"lib/types/#Types-1","page":"Types","title":"Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"This section describes systems types implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"Pages = [\"types.md\"]\nDepth = 3","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/types/#Abstract-Systems-1","page":"Types","title":"Abstract Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractSystem","page":"Types","title":"MathematicalSystems.AbstractSystem","text":"AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractContinuousSystem","page":"Types","title":"MathematicalSystems.AbstractContinuousSystem","text":"AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractDiscreteSystem","page":"Types","title":"MathematicalSystems.AbstractDiscreteSystem","text":"AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Continuous-Systems-1","page":"Types","title":"Continuous Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem\nBlackBoxContinuousSystem\nConstrainedBlackBoxContinuousSystem\nBlackBoxControlContinuousSystem\nConstrainedBlackBoxControlContinuousSystem\nNoisyLinearContinuousSystem\nNoisyConstrainedLinearContinuousSystem\nNoisyLinearControlContinuousSystem\nNoisyConstrainedLinearControlContinuousSystem\nNoisyAffineControlContinuousSystem\nNoisyConstrainedAffineControlContinuousSystem\nNoisyBlackBoxControlContinuousSystem\nNoisyConstrainedBlackBoxControlContinuousSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.ContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ContinuousIdentitySystem","text":"ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form:\n\n x(t) = 0 forall t\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedContinuousIdentitySystem","text":"ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with domain constraints of the form:\n\n x(t) = 0 x(t) mathcalX forall t\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearContinuousSystem","page":"Types","title":"MathematicalSystems.LinearContinuousSystem","text":"LinearContinuousSystem\n\nContinuous-time linear system of the form:\n\n x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineContinuousSystem","page":"Types","title":"MathematicalSystems.AffineContinuousSystem","text":"AffineContinuousSystem\n\nContinuous-time affine system of the form:\n\n x(t) = A x(t) + c forall t\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.LinearControlContinuousSystem","text":"LinearControlContinuousSystem\n\nContinuous-time linear control system of the form:\n\n x(t) = A x(t) + B u(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearContinuousSystem","text":"ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineContinuousSystem","text":"ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with domain constraints of the form:\n\n x(t) = A x(t) + c x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlContinuousSystem","text":"ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlContinuousSystem","text":"ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicContinuousSystem","text":"LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form:\n\n E x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","text":"ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n E x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.PolynomialContinuousSystem","text":"PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form:\n\n x(t) = p(x(t)) forall t\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialContinuousSystem","text":"ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with domain constraints:\n\n x(t) = p(x(t)) x(t) mathcalX forall t\n\nFields\n\np – polynomial vector field\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxContinuousSystem","text":"BlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side of the form:\n\n x(t) = f(x(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxContinuousSystem","text":"ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t)) x(t) mathcalX forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlContinuousSystem","text":"BlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","text":"ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t)) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearContinuousSystem","text":"NoisyLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance of the form:\n\n x(t) = A x(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearContinuousSystem","text":"NoisyConstrainedLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + D w(t) x(t) mathcalX w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlContinuousSystem","text":"NoisyLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","text":"NoisyConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlContinuousSystem","text":"NoisyAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","text":"NoisyConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlContinuousSystem","text":"NoisyBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t) w(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","text":"NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t) w(t)) quad x(t) mathcalX quad u(t) mathcalU quad w(t) mathcalW quad forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discrete-Systems-1","page":"Types","title":"Discrete Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nAffineDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedAffineDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nConstrainedAffineControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem\nBlackBoxDiscreteSystem\nConstrainedBlackBoxDiscreteSystem\nBlackBoxControlDiscreteSystem\nConstrainedBlackBoxControlDiscreteSystem\nNoisyLinearDiscreteSystem\nNoisyConstrainedLinearDiscreteSystem\nNoisyLinearControlDiscreteSystem\nNoisyConstrainedLinearControlDiscreteSystem\nNoisyAffineControlDiscreteSystem\nNoisyConstrainedAffineControlDiscreteSystem\nNoisyBlackBoxControlDiscreteSystem\nNoisyConstrainedBlackBoxControlDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.DiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.DiscreteIdentitySystem","text":"DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form:\n\n x_k+1 = x_k forall k\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedDiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedDiscreteIdentitySystem","text":"ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with domain constraints of the form:\n\n x_k+1 = x_k x_k mathcalX forall k\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDiscreteSystem","text":"LinearDiscreteSystem\n\nDiscrete-time linear system of the form:\n\n x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineDiscreteSystem","text":"AffineDiscreteSystem\n\nDiscrete-time affine system of the form:\n\n x_k+1 = A x_k + c forall k\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearControlDiscreteSystem","text":"LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form:\n\n x_k+1 = A x_k + B u_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDiscreteSystem","text":"ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineDiscreteSystem","text":"ConstrainedAffineDiscreteSystem\n\nDiscrete-time affine system with domain constraints of the form:\n\n x_k+1 = A x_k + c x_k mathcalX forall k\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlDiscreteSystem","text":"ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlDiscreteSystem","text":"ConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicDiscreteSystem","text":"LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form:\n\n E x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","text":"ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n E x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.PolynomialDiscreteSystem","text":"PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form:\n\n x_k+1 = p(x_k) forall k\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialDiscreteSystem","text":"ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with domain constraints:\n\n x_k+1 = p(x_k) x_k mathcalX forall k\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxDiscreteSystem","text":"BlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","text":"ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k) x_k mathcalX forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlDiscreteSystem","text":"BlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","text":"ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearDiscreteSystem","text":"NoisyLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance of the form:\n\n x_k+1 = A x_k + D w_k forall k\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","text":"NoisyConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + D w_k x_k mathcalX w(t) mathcalW forall k\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlDiscreteSystem","text":"NoisyLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","text":"NoisyConstrainedLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlDiscreteSystem","text":"NoisyAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","text":"NoisyConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","text":"NoisyBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","text":"NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) quad x_k mathcalX quad u_k mathcalU quad w_k mathcalW quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discretization-Algorithms-1","page":"Types","title":"Discretization Algorithms","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractDiscretizationAlgorithm\nExactDiscretization\nEulerDiscretization","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractDiscretizationAlgorithm","page":"Types","title":"MathematicalSystems.AbstractDiscretizationAlgorithm","text":"AbstractDiscretizationAlgorithm\n\nAbstract supertype for all discretization algorithms.\n\nNote\n\nFor implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method\n\n_discretize(::NewDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nare required.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ExactDiscretization","page":"Types","title":"MathematicalSystems.ExactDiscretization","text":"ExactDiscretization <: AbstractDiscretizationAlgorithm\n\nExact discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Discretizationoflinearstatespace_models\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.EulerDiscretization","page":"Types","title":"MathematicalSystems.EulerDiscretization","text":"EulerDiscretization <: AbstractDiscretizationAlgorithm\n\nEuler discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Approximations\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#System-macro-1","page":"Types","title":"System macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@system","category":"page"},{"location":"lib/types/#MathematicalSystems.@system","page":"Types","title":"MathematicalSystems.@system","text":"system(expr...)\n\nReturn an instance of the system type corresponding to the given expressions.\n\nInput\n\nexpr – expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system\n\nOutput\n\nA system that best matches the given expressions.\n\nNotes\n\nTerms. The expression expr contains one or more of the following sub-expressions:\n\ndynamic equation, either continuous, e.g.x' = Ax, or discrete, e.g. x⁺ = Ax\nset constraints, e.g. x ∈ X\ninput constraints, e.g. u ∈ U\ndimensionality, e.g. dim: (2,1) or dim = 1\nspecification of the input variable, e.g. input: u or input = u\nspecification of the noise variable, e,g, noise: w or noise = w\n\nThe macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:\n\n@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)\n\nThe 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.\n\nDynamic 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.\n\nDefault 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.\n\nExceptions. The following exceptions and particular cases apply:\n\nIf the right-hand side has the form A*x + B*foo, A*x + B*foo + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.\nIf the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.\nSystems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.\n\nExamples\n\nLet us first create a continuous linear system using this macro:\n\njulia> A = [1. 0; 0 1.];\n\njulia> @system(x' = A*x)\nLinearContinuousSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nA discrete system is defined by using ⁺:\n\njulia> @system(x⁺ = A*x)\nLinearDiscreteSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nAdditionally, 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:\n\njulia> using LazySets\n\njulia> B = Matrix([1. 0.5]');\n\njulia> c = [1., 1.5];\n\njulia> X = BallInf(zeros(2), 10.);\n\njulia> U = BallInf(zeros(1), 2.);\n\njulia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)\nConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\nFor 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\n\njulia> f(x, u) = x + u;\n\njulia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))\nConstrainedBlackBoxControlDiscreteSystem{typeof(f),BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Initial-value-problem-macro-1","page":"Types","title":"Initial-value problem macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@ivp","category":"page"},{"location":"lib/types/#MathematicalSystems.@ivp","page":"Types","title":"MathematicalSystems.@ivp","text":"ivp(expr...)\n\nReturn an instance of the initial-value problem type corresponding to the given expressions.\n\nInput\n\nexpr – 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)\n\nOutput\n\nAn initial-value problem that best matches the given expressions.\n\nNotes\n\nThis 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.\n\nExamples\n\njulia> p = @ivp(x' = -x, x(0) ∈ [1.0]);\n\njulia> typeof(p)\nInitialValueProblem{LinearContinuousSystem{Float64,IdentityMultiple{Float64}},Array{Float64,1}}\n\njulia> initial_state(p)\n1-element Array{Float64,1}:\n 1.0\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Identity-operator-1","page":"Types","title":"Identity operator","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"IdentityMultiple","category":"page"},{"location":"lib/types/#MathematicalSystems.IdentityMultiple","page":"Types","title":"MathematicalSystems.IdentityMultiple","text":"IdentityMultiple{T} < AbstractMatrix{T} where T\n\nA scalar multiple of the identity matrix of given order and numeric type.\n\nFields\n\nM – uniform scaling operator of type T\nn – size of the identity matrix\n\nNotes\n\nThis 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.\n\nInternally, the type wraps Julia's lazy multiple of the identity operator, UniformScaling. IdentityMultiple subtypes AbstractMatix, hence it can be used in usual matrix arithmetic and for dispatch on AbstractMatrix.\n\nThe difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.\n\nExamples\n\nThe easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:\n\njulia> using MathematicalSystems: IdentityMultiple\n\njulia> I2 = I(2)\nIdentityMultiple{Float64} of value 1.0 and order 2\n\njulia> I2 + I2\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> 4*I2\nIdentityMultiple{Float64} of value 4.0 and order 2\n\nThe numeric type (default Float64) can be passed as a second argument:\n\njulia> I2r = I(2, Rational{Int})\nIdentityMultiple{Rational{Int64}} of value 1//1 and order 2\n\njulia> I2r + I2r\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\njulia> 4*I2r\nIdentityMultiple{Rational{Int64}} of value 4//1 and order 2\n\nTo create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:\n\njulia> I2 = I(2.0, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = I(2//1, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\nOr use the constructor passing the UniformScaling (I):\n\njulia> I2 = IdentityMultiple(2.0*I, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = IdentityMultiple(2//1*I, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Initial-Value-Problems-1","page":"Types","title":"Initial Value Problems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"InitialValueProblem\nIVP\ninitial_state\nsystem","category":"page"},{"location":"lib/types/#MathematicalSystems.InitialValueProblem","page":"Types","title":"MathematicalSystems.InitialValueProblem","text":"InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystem\n\nParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x₀ = -12 12:\n\njulia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);\n\njulia> x₀ = [-1/2, 1/2];\n\njulia> p = InitialValueProblem(s, x₀);\n\njulia> initial_state(p) # same as p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IVP","page":"Types","title":"MathematicalSystems.IVP","text":"IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.initial_state","page":"Types","title":"MathematicalSystems.initial_state","text":"initial_state(ivp::InitialValueProblem)\n\nReturn the initial state of an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe initial state of an initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.system","page":"Types","title":"MathematicalSystems.system","text":"system(ivp::InitialValueProblem)\n\nReturn the system wrapped by an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe system of the given initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Input-Types-1","page":"Types","title":"Input Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractInput\nConstantInput\nVaryingInput","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractInput","page":"Types","title":"MathematicalSystems.AbstractInput","text":"AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstantInput","page":"Types","title":"MathematicalSystems.ConstantInput","text":"ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.VaryingInput","page":"Types","title":"MathematicalSystems.VaryingInput","text":"VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase's iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64},Array{Rational{Int64},1}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Maps-1","page":"Types","title":"Maps","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractMap\nIdentityMap\nConstrainedIdentityMap\nLinearMap\nConstrainedLinearMap\nAffineMap\nConstrainedAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap\nResetMap\nConstrainedResetMap","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractMap","page":"Types","title":"MathematicalSystems.AbstractMap","text":"AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IdentityMap","page":"Types","title":"MathematicalSystems.IdentityMap","text":"IdentityMap\n\nAn identity map,\n\n x x\n\nFields\n\ndim – dimension\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedIdentityMap","page":"Types","title":"MathematicalSystems.ConstrainedIdentityMap","text":"ConstrainedIdentityMap\n\nAn identity map with state constraints of the form:\n\n x x x(t) mathcalX\n\nFields\n\ndim – dimension\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearMap","page":"Types","title":"MathematicalSystems.LinearMap","text":"LinearMap\n\nA linear map,\n\n x Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearMap","text":"ConstrainedLinearMap\n\nA linear map with state constraints of the form:\n\n x Ax x(t) mathcalX\n\nFields\n\nA – matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineMap","page":"Types","title":"MathematicalSystems.AffineMap","text":"AffineMap\n\nAn affine map,\n\n x Ax + c\n\nFields\n\nA – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineMap","text":"ConstrainedAffineMap\n\nAn affine map with state constraints of the form:\n\n x Ax + c x(t) mathcalX\n\nFields\n\nA – matrix\nc – vector\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlMap","page":"Types","title":"MathematicalSystems.LinearControlMap","text":"LinearControlMap\n\nA linear control map,\n\n (x u) Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlMap","text":"ConstrainedLinearControlMap\n\nA linear control map with state and input constraints,\n\n (x u) Ax + Bu x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlMap","page":"Types","title":"MathematicalSystems.AffineControlMap","text":"AffineControlMap\n\nAn affine control map,\n\n (x u) Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlMap","text":"ConstrainedAffineControlMap\n\nAn affine control map with state and input constraints,\n\n (x u) Ax + Bu + c x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ResetMap","page":"Types","title":"MathematicalSystems.ResetMap","text":"ResetMap\n\nA reset map,\n\n x R(x)\n\nsuch that a subset of the variables is given a specified value, and the rest are unchanged.\n\nFields\n\ndim – dimension\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedResetMap","page":"Types","title":"MathematicalSystems.ConstrainedResetMap","text":"ConstrainedResetMap\n\nA reset map with state constraints of the form:\n\n x R(x) x mathcalX\n\nsuch that the specified variables are assigned a given value, and the remaining variables are unchanged.\n\nFields\n\ndim – dimension\nX – state constraints\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Macros-1","page":"Types","title":"Macros","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@map","category":"page"},{"location":"lib/types/#MathematicalSystems.@map","page":"Types","title":"MathematicalSystems.@map","text":"map(ex, args)\n\nReturn an instance of the map type corresponding to the given expression.\n\nInput\n\nex – an expression defining the map, in the form of an anonymous function\nargs – additional optional arguments\n\nOutput\n\nA map that best matches the given expression.\n\nExamples\n\nLet us first create a linear map using this macro:\n\njulia> @map x -> [1 0; 0 0]*x\nLinearMap{Int64,Array{Int64,2}}([1 0; 0 0])\n\nWe can create an affine system as well:\n\njulia> @map x -> [1 0; 0 0]*x + [2, 0]\nAffineMap{Int64,Array{Int64,2},Array{Int64,1}}([1 0; 0 0], [2, 0])\n\nAdditional 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:\n\njulia> @map(x -> x, dim=5)\nIdentityMap(5)\n\nAn identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:\n\njulia> @map x -> I(5)*x\nIdentityMap(5)\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Systems-with-output-1","page":"Types","title":"Systems with output","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem","category":"page"},{"location":"lib/types/#MathematicalSystems.SystemWithOutput","page":"Types","title":"MathematicalSystems.SystemWithOutput","text":"SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap}\n\nParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearTimeInvariantSystem","page":"Types","title":"MathematicalSystems.LinearTimeInvariantSystem","text":"LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.LTISystem","page":"Types","title":"MathematicalSystems.LTISystem","text":"LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n","category":"function"},{"location":"#MathematicalSystems.jl-1","page":"Home","title":"MathematicalSystems.jl","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]","category":"page"},{"location":"#","page":"Home","title":"Home","text":"MathematicalSystems is a Julia package for mathematical systems interfaces.","category":"page"},{"location":"#Features-1","page":"Home","title":"Features","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled, linear algebraic, etc.\nIterator interfaces to handle constant or time-varying inputs.","category":"page"},{"location":"#Library-Outline-1","page":"Home","title":"Library Outline","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Pages = [\n \"lib/types.md\",\n \"lib/methods.md\",\n \"lib/internals.md\"\n]\nDepth = 2","category":"page"},{"location":"lib/methods/#Methods-1","page":"Methods","title":"Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"This section describes systems methods implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"Pages = [\"methods.md\"]\nDepth = 3","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/methods/#States-1","page":"Methods","title":"States","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"statedim\nstateset","category":"page"},{"location":"lib/methods/#MathematicalSystems.statedim","page":"Methods","title":"MathematicalSystems.statedim","text":"statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.stateset","page":"Methods","title":"MathematicalSystems.stateset","text":"stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Inputs-1","page":"Methods","title":"Inputs","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"inputdim\ninputset\nnextinput","category":"page"},{"location":"lib/methods/#MathematicalSystems.inputdim","page":"Methods","title":"MathematicalSystems.inputdim","text":"inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.inputset","page":"Methods","title":"MathematicalSystems.inputset","text":"inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.nextinput","page":"Methods","title":"MathematicalSystems.nextinput","text":"nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Output-1","page":"Methods","title":"Output","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"outputdim\noutputmap","category":"page"},{"location":"lib/methods/#MathematicalSystems.outputdim","page":"Methods","title":"MathematicalSystems.outputdim","text":"outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.outputmap","page":"Methods","title":"MathematicalSystems.outputmap","text":"outputmap(s::SystemWithOutput)\n\nReturns the output map of a system with output.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Traits-1","page":"Methods","title":"Traits","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"islinear(::AbstractSystem)\nislinear(::AbstractMap)\nisaffine(::AbstractSystem)\nispolynomial(::AbstractSystem)\nisaffine(::AbstractMap)\nisnoisy(::AbstractSystem)\niscontrolled(::AbstractSystem)\nisconstrained(::AbstractSystem)\nstate_matrix(::AbstractSystem)\ninput_matrix(::AbstractSystem)\nnoise_matrix(::AbstractSystem)\naffine_term(::AbstractSystem)","category":"page"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by linear equations.\n\nNotes\n\nWe 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 mathbbR. 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).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(m::AbstractMap)\n\nSpecifies if the map m is linear or not.\n\nNotes\n\nA map is linear if it preserves the operations of scalar multiplication and vector addition.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by affine equations.\n\nNotes\n\nAn 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.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.ispolynomial-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.ispolynomial","text":"ispolynomial(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by polynomial equations.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(m::AbstractMap)\n\nSpecifies if the map m is affine or not.\n\nNotes\n\nAn affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isnoisy-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isnoisy","text":"isnoisy(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a noise term w.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.iscontrolled-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.iscontrolled","text":"iscontrolled(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a control input u.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isconstrained-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isconstrained","text":"isconstrained(s::AbstractSystem)\n\nDetermines if the system s has constraints on the state, input and noise, respectively (those that are available).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.state_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.state_matrix","text":"state_matrix(::AbstractSystem)\n\nReturn the state matrix of an affine system.\n\nNotes\n\nThe state matrix is the matrix proportional to the state, e.g. the matrix A in the linear continuous system x = Ax.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.input_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.input_matrix","text":"input_matrix(::AbstractSystem)\n\nReturn the input matrix of a system with linear input.\n\nNotes\n\nThe input matrix is the matrix proportional to the input, e.g. the matrix B in the linear continuous system with input, x = Ax + Bu.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.noise_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.noise_matrix","text":"noise_matrix(::AbstractSystem)\n\nReturn the noise matrix of a system with linear noise.\n\nNotes\n\nThe noise matrix is the matrix proportional to the noise, e.g. the matrix D in the linear system with noise, x = Ax + Dw.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.affine_term-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.affine_term","text":"affine_term(::AbstractSystem)\n\nReturn the affine term in an affine system.\n\nNotes\n\nThe affine term is e.g. the vector c in the affine system x = Ax + c.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#Maps-1","page":"Methods","title":"Maps","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"apply","category":"page"},{"location":"lib/methods/#MathematicalSystems.apply","page":"Methods","title":"MathematicalSystems.apply","text":"apply(m::AbstractMap, args...)\n\nApply the rule specified by the map to the given arguments.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Successor-1","page":"Methods","title":"Successor","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"successor","category":"page"},{"location":"lib/methods/#MathematicalSystems.successor","page":"Methods","title":"MathematicalSystems.successor","text":"successor(system::DiscreteIdentitySystem, x::AbstractVector)\n\nReturn the successor state of a DiscreteIdentitySystem.\n\nInput\n\nsystem – DiscreteIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::ConstrainedDiscreteIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedDiscreteIdentitySystem.\n\nInput\n\nsystem – ConstrainedDiscreteIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::LinearDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a LinearDiscreteSystem.\n\nInput\n\nsystem – LinearDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::AffineDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a AffineDiscreteSystem.\n\nInput\n\nsystem – AffineDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::LinearControlDiscreteSystem, x::AbstractVector, u::AbstractVector)\n\nReturn the successor state of a LinearControlDiscreteSystem.\n\nInput\n\nsystem – LinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineDiscreteSystem, x::AbstractVector;\n [check_constraints])\n\nReturn the successor state of a ConstrainedAffineDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::BlackBoxDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a BlackBoxDiscreteSystem.\n\nInput\n\nsystem – BlackBoxDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearDiscreteSystem, x::AbstractVector,\n w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearControlDiscreteSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Discretization-1","page":"Methods","title":"Discretization","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"discretize","category":"page"},{"location":"lib/methods/#MathematicalSystems.discretize","page":"Methods","title":"MathematicalSystems.discretize","text":"discretize(system::AbstractContinuousSystem, ΔT::Real,\n algorithm::AbstractDiscretizationAlgorithm=ExactDiscretization(),\n constructor=_default_complementary_constructor(system))\n\nDiscretization of a isaffine AbstractContinuousSystem to a AbstractDiscreteSystem with sampling time ΔT using the discretization method algorithm.\n\nInput\n\nsystem – an affine continuous system\nΔT – sampling time\nalgorithm – (optional, default: ExactDiscretization()) discretization algorithm\nconstructor – (optional, default: _default_complementary_constructor(system)) construction method\n\nOutput\n\nReturns a discretization of the input system system with discretization method algorithm and sampling time ΔT.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Internal-Methods-1","page":"Methods","title":"Internal Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"_discretize\ntypename(::AbstractSystem)\n_complementary_type(::Type{<:AbstractSystem})","category":"page"},{"location":"lib/methods/#MathematicalSystems._discretize","page":"Methods","title":"MathematicalSystems._discretize","text":"_discretize(::AbstractDiscretizationAlgorithm, ΔT::Real\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nImplementation of the discretization algorithm defined by the first input argument with sampling time ΔT.\n\nInput\n\n`` – discretization algorithm, used for dispatch\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B, c and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(A::AbstractMatrix, ΔT::Real; algorithm=:exact)\n\nDiscretize the state matrix A with sampling time ΔT and discretization method algorithm.\n\nInput\n\nA – state matrix\nΔT – sampling time\nalgorithm – (optional, default: :exact) discretization algorithm\n\nOutput\n\nReturns a vector containing the discretized input argument A.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix)\n\nDiscretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input or noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A and B.\n\nNotes\n\nThis method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix,c::AbstractVector)\n\nDiscretize the state matrix A and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector)\n\nDiscretize the state matrix A, input matrix B and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, D::AbstractMatrix)\n\nDiscretize the state matrix A, input matrix B and noise matrix C with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.typename-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.typename","text":"typename(system::AbstractSystem)\n\nReturns the base type of system without parameter information.\n\nInput\n\nsystem – AbstractSystem\n\nOutput\n\nThe base type of system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems._complementary_type-Tuple{Type{#s3} where #s3<:AbstractSystem}","page":"Methods","title":"MathematicalSystems._complementary_type","text":"_complementary_type(system_type::Type{<:AbstractSystem})\n\nReturn the complementary type of a system type system_type.\n\nInput\n\nsystem_type – type of AbstractSystem\n\nOuput\n\nReturn complementary type of system_type.\n\nNotes\n\nThere are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.\n\nTo get the complementary type of system type, use _complementary_type(typename(system)).\n\n\n\n\n\n","category":"method"}]
+}
diff --git a/v0.11.2/siteinfo.js b/v0.11.2/siteinfo.js
new file mode 100644
index 00000000..006f9529
--- /dev/null
+++ b/v0.11.2/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.11.2";
diff --git a/v0.11.3/about/index.html b/v0.11.3/about/index.html
new file mode 100644
index 00000000..53f1576e
--- /dev/null
+++ b/v0.11.3/about/index.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
Return the system type whose field names match those in fields.
Input
AT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem
fields – tuple of field names
Output
The system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.
Extract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.
For the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list
(:A_user, :A)
(:B_user, :B)
(:c_user, :c)
(:D_user, :D)
(:f_user, :f)
(:statedim_user :statedim)
(:inputdim_user :inputdim)
(:noisedim_user :noisedim)
and for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.
Input
equation – dynamic equation
state – state variable
input – input variable
noise – noise variable
dim – dimensionality
AT – abstract system type
Output
Two arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.
Checks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.
Return true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.
Input
expr – expression
Output
A Bool indicating whether expr is an equation or not.
If an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.
If an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.
Similiarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.
Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.
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)$.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
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.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Specifies if the dynamics of system s is specified by polynomial equations.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.
Discretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.
Input
algorithm – discretization algorithm
ΔT – sampling time
A – state matrix
B – input or noise matrix
Output
Returns a vector containing the discretized input arguments A and B.
Notes
This method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).
Return the complementary type of a system type system_type.
Input
system_type – type of AbstractSystem
Ouput
Return complementary type of system_type.
Notes
There are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.
To get the complementary type of system type, use _complementary_type(typename(system)).
Abstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
Exact 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].
Euler 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].
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 + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.
If the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.
Systems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
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.5]');
+
+julia> c = [1., 1.5];
+
+julia> X = BallInf(zeros(2), 10.);
+
+julia> U = BallInf(zeros(1), 2.);
+
+julia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)
+ConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([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,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))
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).
A scalar multiple of the identity matrix of given order and numeric type.
Fields
M – uniform scaling operator of type T
n – 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 AbstractMatix, 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
The easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:
julia> using MathematicalSystems: IdentityMultiple
+
+julia> I2 = I(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 2
The numeric type (default Float64) can be passed as a second argument:
julia> I2r = I(2, Rational{Int})
+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 2
To create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:
julia> I2 = I(2.0, 2)
+IdentityMultiple{Float64} of value 2.0 and order 2
+
+julia> I2r = I(2//1, 2)
+IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
Or use the constructor passing the UniformScaling (I):
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 2
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.
Type 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:
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)
An identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:
diff --git a/v0.11.3/search_index.js b/v0.11.3/search_index.js
new file mode 100644
index 00000000..4c77c081
--- /dev/null
+++ b/v0.11.3/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"lib/internals/#Internals-1","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"This section describes functions that are internal to the library.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]\nDepth = 3","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/internals/#Expression-handling-1","page":"Internals","title":"Expression handling","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"_corresponding_type\n_capture_dim\nextract_dyn_equation_parameters\nadd_asterisk\nsort","category":"page"},{"location":"lib/internals/#MathematicalSystems._corresponding_type","page":"Internals","title":"MathematicalSystems._corresponding_type","text":"_corresponding_type(AT::Type{<:AbstractSystem}, fields::Tuple)\n\nReturn the system type whose field names match those in fields.\n\nInput\n\nAT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem\nfields – tuple of field names\n\nOutput\n\nThe system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.\n\nExamples\n\njulia> using MathematicalSystems: _corresponding_type\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A),))\nLinearContinuousSystem\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A), (:B), (:X), (:U)))\nConstrainedLinearControlContinuousSystem\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._capture_dim","page":"Internals","title":"MathematicalSystems._capture_dim","text":"_capture_dim(expr)\n\nReturn the tuple containing the dimension(s) in expr.\n\nInput\n\nexpr – symbolic expression that can be of any of the following forms:\n:x or :(x) – state dimension\n:(x, u) – state and input dimension\n:(x, u, w) – state, input and noise dimensions\n\nOutput\n\nThe scalar x if expr specifies the state dimension.\nThe vector [x, u] if expr specifies state and input dimension.\nThe vector [x, u, w] if expr specifies state, input and noise dimensions.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_dyn_equation_parameters","page":"Internals","title":"MathematicalSystems.extract_dyn_equation_parameters","text":"extract_dyn_equation_parameters(equation, state, input, noise, dim, AT)\n\nExtract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.\n\nFor the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list\n\n(:A_user, :A)\n(:B_user, :B)\n(:c_user, :c)\n(:D_user, :D)\n(:f_user, :f)\n(:statedim_user :statedim)\n(:inputdim_user :inputdim)\n(:noisedim_user :noisedim)\n\nand for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.\n\nInput\n\nequation – dynamic equation\nstate – state variable\ninput – input variable\nnoise – noise variable\ndim – dimensionality\nAT – abstract system type\n\nOutput\n\nTwo arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.add_asterisk","page":"Internals","title":"MathematicalSystems.add_asterisk","text":"add_asterisk(summand, state::Symbol, input::Symbol, noise::Symbol)\n\nChecks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.\n\nInput\n\nsummand – expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nMultiplication expression or symbol.\n\nExample\n\njulia> using MathematicalSystems: add_asterisk\n\njulia> add_asterisk(:(A1*x), :x, :u, :w)\n:(A1 * x)\n\njulia> add_asterisk(:(c1), :x, :u, :w)\n:c1\n\njulia> add_asterisk(:(Ax1), :x1, :u, :w)\n:(A * x1)\n\njulia> add_asterisk(:(Awb), :x1, :u, :wb)\n:(A * wb)\n\njulia> add_asterisk(:(A1u), :x, :u, :w)\n:(A1 * u)\n\njulia> add_asterisk(:(A1ub), :x, :u, :w)\n:A1ub\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Base.sort","page":"Internals","title":"Base.sort","text":"sort(parameters::Vector, order::Tuple)\n\nFilter and sort the vector parameters according to order.\n\nInput\n\nparameters – vector of tuples\norder – tuple of symbols\n\nOutput\n\nA new vector of tuples corresponding to parameters filtered and sorted according to order.\n\nExamples\n\njulia> parameters= [(:U1, :U), (:X1, :X), (:W1, :W)];\n\njulia> sort(parameters, (:X, :U, :W))\n3-element Array{Tuple{Any,Symbol},1}:\n (:X1, :X)\n (:U1, :U)\n (:W1, :W)\n\njulia> parameters = [(:const, :c), (:A, :A)];\n\njulia> sort(parameters, (:A, :B, :c, :D))\n2-element Array{Tuple{Any,Symbol},1}:\n (:A, :A)\n (:const, :c)\n\nNotes\n\nparameters is a vector that contains tuples whose second element is considered for the sorting according to order.\n\nIf a value of order is not contained in parameters, the corresponding entry of order will be omitted.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Querying-expressions-1","page":"Internals","title":"Querying expressions","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"is_equation\nextract_sum","category":"page"},{"location":"lib/internals/#MathematicalSystems.is_equation","page":"Internals","title":"MathematicalSystems.is_equation","text":"is_equation(expr)\n\nReturn true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.\n\nInput\n\nexpr – expression\n\nOutput\n\nA Bool indicating whether expr is an equation or not.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_sum","page":"Internals","title":"MathematicalSystems.extract_sum","text":"extract_sum(summands, state::Symbol, input::Symbol, noise::Symbol)\n\nExtract the variable name and field name for every element of summands which corresponds to the elements of the right-hand side of an affine system.\n\nInput\n\nsummands – array of expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nArray of tuples of symbols with variable name and field name.\n\nExample\n\njulia> using MathematicalSystems: extract_sum\n\njulia> extract_sum([:(A1*x)], :x, :u, :w)\n1-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n\njulia> extract_sum([:(A1*x), :(B1*u), :c], :x, :u, :w)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(vcat(c)), :c)\n\njulia> extract_sum([:(A1*x7), :( B1*u7), :( B2*w7)], :x7, :u7, :w7)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(hcat(B2)), :D)\n\nNotes\n\nIf an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.\n\nIf an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.\n\nSimiliarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Naming-convention-for-systems'-fields-1","page":"Internals","title":"Naming convention for systems' fields","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Field Description Getter function\nA state matrix state_matrix\nB input matrix input_matrix\nc affine term affine_term\nD noise matrix noise_matrix\nX state constraints stateset\nU input constraints inputset\nW disturbance set noiseset","category":"page"},{"location":"about/#About-1","page":"About","title":"About","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This page contains some general information about this project, and recommendations about contributing.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Pages = [\"about.md\"]","category":"page"},{"location":"about/#Contributing-1","page":"About","title":"Contributing","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.","category":"page"},{"location":"about/#Branches-and-pull-requests-(PR)-1","page":"About","title":"Branches and pull requests (PR)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.","category":"page"},{"location":"about/#Unit-testing-and-continuous-integration-(CI)-1","page":"About","title":"Unit testing and continuous integration (CI)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes test/runtests.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Alternatively, you can achieve the same from inside the REPL using the following command:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> Pkg.test(\"MathematicalSystems\")","category":"page"},{"location":"about/#","page":"About","title":"About","text":"We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.","category":"page"},{"location":"about/#Contributing-to-the-documentation-1","page":"About","title":"Contributing to the documentation","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"New functions and types should be documented according to our guidelines directly in the source code.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> ?LinearContinuousSystem","category":"page"},{"location":"about/#","page":"About","title":"About","text":"This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).","category":"page"},{"location":"about/#","page":"About","title":"About","text":"To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes docs/make.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Note that this also runs all doctests which will take some time.","category":"page"},{"location":"about/#Related-projects-1","page":"About","title":"Related projects","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below we list more related projects.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia","category":"page"},{"location":"about/#Credits-1","page":"About","title":"Credits","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"These persons have contributed to MathematicalSystems.jl (in alphabetic order):","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Marcelo Forets\nBenoît Legat\nChristian Schilling\nUeli Wechsler","category":"page"},{"location":"lib/types/#Types-1","page":"Types","title":"Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"This section describes systems types implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"Pages = [\"types.md\"]\nDepth = 3","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/types/#Abstract-Systems-1","page":"Types","title":"Abstract Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractSystem","page":"Types","title":"MathematicalSystems.AbstractSystem","text":"AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractContinuousSystem","page":"Types","title":"MathematicalSystems.AbstractContinuousSystem","text":"AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractDiscreteSystem","page":"Types","title":"MathematicalSystems.AbstractDiscreteSystem","text":"AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Continuous-Systems-1","page":"Types","title":"Continuous Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem\nBlackBoxContinuousSystem\nConstrainedBlackBoxContinuousSystem\nBlackBoxControlContinuousSystem\nConstrainedBlackBoxControlContinuousSystem\nNoisyLinearContinuousSystem\nNoisyConstrainedLinearContinuousSystem\nNoisyLinearControlContinuousSystem\nNoisyConstrainedLinearControlContinuousSystem\nNoisyAffineControlContinuousSystem\nNoisyConstrainedAffineControlContinuousSystem\nNoisyBlackBoxControlContinuousSystem\nNoisyConstrainedBlackBoxControlContinuousSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.ContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ContinuousIdentitySystem","text":"ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form:\n\n x(t) = 0 forall t\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedContinuousIdentitySystem","text":"ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with domain constraints of the form:\n\n x(t) = 0 x(t) mathcalX forall t\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearContinuousSystem","page":"Types","title":"MathematicalSystems.LinearContinuousSystem","text":"LinearContinuousSystem\n\nContinuous-time linear system of the form:\n\n x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineContinuousSystem","page":"Types","title":"MathematicalSystems.AffineContinuousSystem","text":"AffineContinuousSystem\n\nContinuous-time affine system of the form:\n\n x(t) = A x(t) + c forall t\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.LinearControlContinuousSystem","text":"LinearControlContinuousSystem\n\nContinuous-time linear control system of the form:\n\n x(t) = A x(t) + B u(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearContinuousSystem","text":"ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineContinuousSystem","text":"ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with domain constraints of the form:\n\n x(t) = A x(t) + c x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlContinuousSystem","text":"ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlContinuousSystem","text":"ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicContinuousSystem","text":"LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form:\n\n E x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","text":"ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n E x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.PolynomialContinuousSystem","text":"PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form:\n\n x(t) = p(x(t)) forall t\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialContinuousSystem","text":"ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with domain constraints:\n\n x(t) = p(x(t)) x(t) mathcalX forall t\n\nFields\n\np – polynomial vector field\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxContinuousSystem","text":"BlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side of the form:\n\n x(t) = f(x(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxContinuousSystem","text":"ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t)) x(t) mathcalX forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlContinuousSystem","text":"BlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","text":"ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t)) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearContinuousSystem","text":"NoisyLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance of the form:\n\n x(t) = A x(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearContinuousSystem","text":"NoisyConstrainedLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + D w(t) x(t) mathcalX w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlContinuousSystem","text":"NoisyLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","text":"NoisyConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlContinuousSystem","text":"NoisyAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","text":"NoisyConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlContinuousSystem","text":"NoisyBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t) w(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","text":"NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t) w(t)) quad x(t) mathcalX quad u(t) mathcalU quad w(t) mathcalW quad forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discrete-Systems-1","page":"Types","title":"Discrete Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nAffineDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedAffineDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nConstrainedAffineControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem\nBlackBoxDiscreteSystem\nConstrainedBlackBoxDiscreteSystem\nBlackBoxControlDiscreteSystem\nConstrainedBlackBoxControlDiscreteSystem\nNoisyLinearDiscreteSystem\nNoisyConstrainedLinearDiscreteSystem\nNoisyLinearControlDiscreteSystem\nNoisyConstrainedLinearControlDiscreteSystem\nNoisyAffineControlDiscreteSystem\nNoisyConstrainedAffineControlDiscreteSystem\nNoisyBlackBoxControlDiscreteSystem\nNoisyConstrainedBlackBoxControlDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.DiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.DiscreteIdentitySystem","text":"DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form:\n\n x_k+1 = x_k forall k\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedDiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedDiscreteIdentitySystem","text":"ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with domain constraints of the form:\n\n x_k+1 = x_k x_k mathcalX forall k\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDiscreteSystem","text":"LinearDiscreteSystem\n\nDiscrete-time linear system of the form:\n\n x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineDiscreteSystem","text":"AffineDiscreteSystem\n\nDiscrete-time affine system of the form:\n\n x_k+1 = A x_k + c forall k\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearControlDiscreteSystem","text":"LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form:\n\n x_k+1 = A x_k + B u_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDiscreteSystem","text":"ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineDiscreteSystem","text":"ConstrainedAffineDiscreteSystem\n\nDiscrete-time affine system with domain constraints of the form:\n\n x_k+1 = A x_k + c x_k mathcalX forall k\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlDiscreteSystem","text":"ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlDiscreteSystem","text":"ConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicDiscreteSystem","text":"LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form:\n\n E x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","text":"ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n E x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.PolynomialDiscreteSystem","text":"PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form:\n\n x_k+1 = p(x_k) forall k\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialDiscreteSystem","text":"ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with domain constraints:\n\n x_k+1 = p(x_k) x_k mathcalX forall k\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxDiscreteSystem","text":"BlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","text":"ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k) x_k mathcalX forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlDiscreteSystem","text":"BlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","text":"ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearDiscreteSystem","text":"NoisyLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance of the form:\n\n x_k+1 = A x_k + D w_k forall k\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","text":"NoisyConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + D w_k x_k mathcalX w(t) mathcalW forall k\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlDiscreteSystem","text":"NoisyLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","text":"NoisyConstrainedLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlDiscreteSystem","text":"NoisyAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","text":"NoisyConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","text":"NoisyBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","text":"NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) quad x_k mathcalX quad u_k mathcalU quad w_k mathcalW quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discretization-Algorithms-1","page":"Types","title":"Discretization Algorithms","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractDiscretizationAlgorithm\nExactDiscretization\nEulerDiscretization","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractDiscretizationAlgorithm","page":"Types","title":"MathematicalSystems.AbstractDiscretizationAlgorithm","text":"AbstractDiscretizationAlgorithm\n\nAbstract supertype for all discretization algorithms.\n\nNote\n\nFor implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method\n\n_discretize(::NewDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nare required.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ExactDiscretization","page":"Types","title":"MathematicalSystems.ExactDiscretization","text":"ExactDiscretization <: AbstractDiscretizationAlgorithm\n\nExact discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Discretizationoflinearstatespace_models\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.EulerDiscretization","page":"Types","title":"MathematicalSystems.EulerDiscretization","text":"EulerDiscretization <: AbstractDiscretizationAlgorithm\n\nEuler discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Approximations\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#System-macro-1","page":"Types","title":"System macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@system","category":"page"},{"location":"lib/types/#MathematicalSystems.@system","page":"Types","title":"MathematicalSystems.@system","text":"system(expr...)\n\nReturn an instance of the system type corresponding to the given expressions.\n\nInput\n\nexpr – expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system\n\nOutput\n\nA system that best matches the given expressions.\n\nNotes\n\nTerms. The expression expr contains one or more of the following sub-expressions:\n\ndynamic equation, either continuous, e.g.x' = Ax, or discrete, e.g. x⁺ = Ax\nset constraints, e.g. x ∈ X\ninput constraints, e.g. u ∈ U\ndimensionality, e.g. dim: (2,1) or dim = 1\nspecification of the input variable, e.g. input: u or input = u\nspecification of the noise variable, e,g, noise: w or noise = w\n\nThe macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:\n\n@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)\n\nThe 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.\n\nDynamic 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.\n\nDefault 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.\n\nExceptions. The following exceptions and particular cases apply:\n\nIf the right-hand side has the form A*x + B*foo, A*x + B*foo + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.\nIf the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.\nSystems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.\n\nExamples\n\nLet us first create a continuous linear system using this macro:\n\njulia> A = [1. 0; 0 1.];\n\njulia> @system(x' = A*x)\nLinearContinuousSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nA discrete system is defined by using ⁺:\n\njulia> @system(x⁺ = A*x)\nLinearDiscreteSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nAdditionally, 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:\n\njulia> using LazySets\n\njulia> B = Matrix([1. 0.5]');\n\njulia> c = [1., 1.5];\n\njulia> X = BallInf(zeros(2), 10.);\n\njulia> U = BallInf(zeros(1), 2.);\n\njulia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)\nConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\nFor 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\n\njulia> f(x, u) = x + u;\n\njulia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))\nConstrainedBlackBoxControlDiscreteSystem{typeof(f),BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Initial-value-problem-macro-1","page":"Types","title":"Initial-value problem macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@ivp","category":"page"},{"location":"lib/types/#MathematicalSystems.@ivp","page":"Types","title":"MathematicalSystems.@ivp","text":"ivp(expr...)\n\nReturn an instance of the initial-value problem type corresponding to the given expressions.\n\nInput\n\nexpr – 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)\n\nOutput\n\nAn initial-value problem that best matches the given expressions.\n\nNotes\n\nThis 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.\n\nThe macro can also be called with a system argument of type AbstractSystem in the form @ivp(system, state(0) ∈ initial_set).\n\nExamples\n\njulia> p = @ivp(x' = -x, x(0) ∈ [1.0]);\n\njulia> typeof(p)\nInitialValueProblem{LinearContinuousSystem{Float64,IdentityMultiple{Float64}},Array{Float64,1}}\n\njulia> initial_state(p)\n1-element Array{Float64,1}:\n 1.0\n\njulia> sys = @system(x' = [1 0; 0 1] * x);\n\njulia> @ivp(sys, x(0) ∈ [-1, 1])\nInitialValueProblem{LinearContinuousSystem{Int64,Array{Int64,2}},Array{Int64,1}}(LinearContinuousSystem{Int64,Array{Int64,2}}([1 0; 0 1]), [-1, 1])\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Identity-operator-1","page":"Types","title":"Identity operator","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"IdentityMultiple","category":"page"},{"location":"lib/types/#MathematicalSystems.IdentityMultiple","page":"Types","title":"MathematicalSystems.IdentityMultiple","text":"IdentityMultiple{T} < AbstractMatrix{T} where T\n\nA scalar multiple of the identity matrix of given order and numeric type.\n\nFields\n\nM – uniform scaling operator of type T\nn – size of the identity matrix\n\nNotes\n\nThis 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.\n\nInternally, the type wraps Julia's lazy multiple of the identity operator, UniformScaling. IdentityMultiple subtypes AbstractMatix, hence it can be used in usual matrix arithmetic and for dispatch on AbstractMatrix.\n\nThe difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.\n\nExamples\n\nThe easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:\n\njulia> using MathematicalSystems: IdentityMultiple\n\njulia> I2 = I(2)\nIdentityMultiple{Float64} of value 1.0 and order 2\n\njulia> I2 + I2\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> 4*I2\nIdentityMultiple{Float64} of value 4.0 and order 2\n\nThe numeric type (default Float64) can be passed as a second argument:\n\njulia> I2r = I(2, Rational{Int})\nIdentityMultiple{Rational{Int64}} of value 1//1 and order 2\n\njulia> I2r + I2r\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\njulia> 4*I2r\nIdentityMultiple{Rational{Int64}} of value 4//1 and order 2\n\nTo create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:\n\njulia> I2 = I(2.0, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = I(2//1, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\nOr use the constructor passing the UniformScaling (I):\n\njulia> I2 = IdentityMultiple(2.0*I, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = IdentityMultiple(2//1*I, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Initial-Value-Problems-1","page":"Types","title":"Initial Value Problems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"InitialValueProblem\nIVP\ninitial_state\nsystem","category":"page"},{"location":"lib/types/#MathematicalSystems.InitialValueProblem","page":"Types","title":"MathematicalSystems.InitialValueProblem","text":"InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystem\n\nParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x₀ = -12 12:\n\njulia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);\n\njulia> x₀ = [-1/2, 1/2];\n\njulia> p = InitialValueProblem(s, x₀);\n\njulia> initial_state(p) # same as p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IVP","page":"Types","title":"MathematicalSystems.IVP","text":"IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.initial_state","page":"Types","title":"MathematicalSystems.initial_state","text":"initial_state(ivp::InitialValueProblem)\n\nReturn the initial state of an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe initial state of an initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.system","page":"Types","title":"MathematicalSystems.system","text":"system(ivp::InitialValueProblem)\n\nReturn the system wrapped by an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe system of the given initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Input-Types-1","page":"Types","title":"Input Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractInput\nConstantInput\nVaryingInput","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractInput","page":"Types","title":"MathematicalSystems.AbstractInput","text":"AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstantInput","page":"Types","title":"MathematicalSystems.ConstantInput","text":"ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.VaryingInput","page":"Types","title":"MathematicalSystems.VaryingInput","text":"VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase's iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64},Array{Rational{Int64},1}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Maps-1","page":"Types","title":"Maps","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractMap\nIdentityMap\nConstrainedIdentityMap\nLinearMap\nConstrainedLinearMap\nAffineMap\nConstrainedAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap\nResetMap\nConstrainedResetMap","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractMap","page":"Types","title":"MathematicalSystems.AbstractMap","text":"AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IdentityMap","page":"Types","title":"MathematicalSystems.IdentityMap","text":"IdentityMap\n\nAn identity map,\n\n x x\n\nFields\n\ndim – dimension\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedIdentityMap","page":"Types","title":"MathematicalSystems.ConstrainedIdentityMap","text":"ConstrainedIdentityMap\n\nAn identity map with state constraints of the form:\n\n x x x(t) mathcalX\n\nFields\n\ndim – dimension\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearMap","page":"Types","title":"MathematicalSystems.LinearMap","text":"LinearMap\n\nA linear map,\n\n x Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearMap","text":"ConstrainedLinearMap\n\nA linear map with state constraints of the form:\n\n x Ax x(t) mathcalX\n\nFields\n\nA – matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineMap","page":"Types","title":"MathematicalSystems.AffineMap","text":"AffineMap\n\nAn affine map,\n\n x Ax + c\n\nFields\n\nA – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineMap","text":"ConstrainedAffineMap\n\nAn affine map with state constraints of the form:\n\n x Ax + c x(t) mathcalX\n\nFields\n\nA – matrix\nc – vector\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlMap","page":"Types","title":"MathematicalSystems.LinearControlMap","text":"LinearControlMap\n\nA linear control map,\n\n (x u) Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlMap","text":"ConstrainedLinearControlMap\n\nA linear control map with state and input constraints,\n\n (x u) Ax + Bu x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlMap","page":"Types","title":"MathematicalSystems.AffineControlMap","text":"AffineControlMap\n\nAn affine control map,\n\n (x u) Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlMap","text":"ConstrainedAffineControlMap\n\nAn affine control map with state and input constraints,\n\n (x u) Ax + Bu + c x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ResetMap","page":"Types","title":"MathematicalSystems.ResetMap","text":"ResetMap\n\nA reset map,\n\n x R(x)\n\nsuch that a subset of the variables is given a specified value, and the rest are unchanged.\n\nFields\n\ndim – dimension\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedResetMap","page":"Types","title":"MathematicalSystems.ConstrainedResetMap","text":"ConstrainedResetMap\n\nA reset map with state constraints of the form:\n\n x R(x) x mathcalX\n\nsuch that the specified variables are assigned a given value, and the remaining variables are unchanged.\n\nFields\n\ndim – dimension\nX – state constraints\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Macros-1","page":"Types","title":"Macros","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@map","category":"page"},{"location":"lib/types/#MathematicalSystems.@map","page":"Types","title":"MathematicalSystems.@map","text":"map(ex, args)\n\nReturn an instance of the map type corresponding to the given expression.\n\nInput\n\nex – an expression defining the map, in the form of an anonymous function\nargs – additional optional arguments\n\nOutput\n\nA map that best matches the given expression.\n\nExamples\n\nLet us first create a linear map using this macro:\n\njulia> @map x -> [1 0; 0 0]*x\nLinearMap{Int64,Array{Int64,2}}([1 0; 0 0])\n\nWe can create an affine system as well:\n\njulia> @map x -> [1 0; 0 0]*x + [2, 0]\nAffineMap{Int64,Array{Int64,2},Array{Int64,1}}([1 0; 0 0], [2, 0])\n\nAdditional 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:\n\njulia> @map(x -> x, dim=5)\nIdentityMap(5)\n\nAn identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:\n\njulia> @map x -> I(5)*x\nIdentityMap(5)\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Systems-with-output-1","page":"Types","title":"Systems with output","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem","category":"page"},{"location":"lib/types/#MathematicalSystems.SystemWithOutput","page":"Types","title":"MathematicalSystems.SystemWithOutput","text":"SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap}\n\nParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearTimeInvariantSystem","page":"Types","title":"MathematicalSystems.LinearTimeInvariantSystem","text":"LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.LTISystem","page":"Types","title":"MathematicalSystems.LTISystem","text":"LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n","category":"function"},{"location":"#MathematicalSystems.jl-1","page":"Home","title":"MathematicalSystems.jl","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]","category":"page"},{"location":"#","page":"Home","title":"Home","text":"MathematicalSystems is a Julia package for mathematical systems interfaces.","category":"page"},{"location":"#Features-1","page":"Home","title":"Features","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled, linear algebraic, etc.\nIterator interfaces to handle constant or time-varying inputs.","category":"page"},{"location":"#Library-Outline-1","page":"Home","title":"Library Outline","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Pages = [\n \"lib/types.md\",\n \"lib/methods.md\",\n \"lib/internals.md\"\n]\nDepth = 2","category":"page"},{"location":"lib/methods/#Methods-1","page":"Methods","title":"Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"This section describes systems methods implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"Pages = [\"methods.md\"]\nDepth = 3","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/methods/#States-1","page":"Methods","title":"States","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"statedim\nstateset","category":"page"},{"location":"lib/methods/#MathematicalSystems.statedim","page":"Methods","title":"MathematicalSystems.statedim","text":"statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.stateset","page":"Methods","title":"MathematicalSystems.stateset","text":"stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Inputs-1","page":"Methods","title":"Inputs","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"inputdim\ninputset\nnextinput","category":"page"},{"location":"lib/methods/#MathematicalSystems.inputdim","page":"Methods","title":"MathematicalSystems.inputdim","text":"inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.inputset","page":"Methods","title":"MathematicalSystems.inputset","text":"inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.nextinput","page":"Methods","title":"MathematicalSystems.nextinput","text":"nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Output-1","page":"Methods","title":"Output","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"outputdim\noutputmap","category":"page"},{"location":"lib/methods/#MathematicalSystems.outputdim","page":"Methods","title":"MathematicalSystems.outputdim","text":"outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.outputmap","page":"Methods","title":"MathematicalSystems.outputmap","text":"outputmap(s::SystemWithOutput)\n\nReturns the output map of a system with output.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Traits-1","page":"Methods","title":"Traits","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"islinear(::AbstractSystem)\nislinear(::AbstractMap)\nisaffine(::AbstractSystem)\nispolynomial(::AbstractSystem)\nisaffine(::AbstractMap)\nisnoisy(::AbstractSystem)\niscontrolled(::AbstractSystem)\nisconstrained(::AbstractSystem)\nstate_matrix(::AbstractSystem)\ninput_matrix(::AbstractSystem)\nnoise_matrix(::AbstractSystem)\naffine_term(::AbstractSystem)","category":"page"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by linear equations.\n\nNotes\n\nWe 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 mathbbR. 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).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(m::AbstractMap)\n\nSpecifies if the map m is linear or not.\n\nNotes\n\nA map is linear if it preserves the operations of scalar multiplication and vector addition.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by affine equations.\n\nNotes\n\nAn 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.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.ispolynomial-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.ispolynomial","text":"ispolynomial(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by polynomial equations.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(m::AbstractMap)\n\nSpecifies if the map m is affine or not.\n\nNotes\n\nAn affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isnoisy-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isnoisy","text":"isnoisy(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a noise term w.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.iscontrolled-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.iscontrolled","text":"iscontrolled(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a control input u.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isconstrained-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isconstrained","text":"isconstrained(s::AbstractSystem)\n\nDetermines if the system s has constraints on the state, input and noise, respectively (those that are available).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.state_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.state_matrix","text":"state_matrix(::AbstractSystem)\n\nReturn the state matrix of an affine system.\n\nNotes\n\nThe state matrix is the matrix proportional to the state, e.g. the matrix A in the linear continuous system x = Ax.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.input_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.input_matrix","text":"input_matrix(::AbstractSystem)\n\nReturn the input matrix of a system with linear input.\n\nNotes\n\nThe input matrix is the matrix proportional to the input, e.g. the matrix B in the linear continuous system with input, x = Ax + Bu.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.noise_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.noise_matrix","text":"noise_matrix(::AbstractSystem)\n\nReturn the noise matrix of a system with linear noise.\n\nNotes\n\nThe noise matrix is the matrix proportional to the noise, e.g. the matrix D in the linear system with noise, x = Ax + Dw.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.affine_term-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.affine_term","text":"affine_term(::AbstractSystem)\n\nReturn the affine term in an affine system.\n\nNotes\n\nThe affine term is e.g. the vector c in the affine system x = Ax + c.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#Maps-1","page":"Methods","title":"Maps","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"apply","category":"page"},{"location":"lib/methods/#MathematicalSystems.apply","page":"Methods","title":"MathematicalSystems.apply","text":"apply(m::AbstractMap, args...)\n\nApply the rule specified by the map to the given arguments.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Successor-1","page":"Methods","title":"Successor","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"successor","category":"page"},{"location":"lib/methods/#MathematicalSystems.successor","page":"Methods","title":"MathematicalSystems.successor","text":"successor(system::DiscreteIdentitySystem, x::AbstractVector)\n\nReturn the successor state of a DiscreteIdentitySystem.\n\nInput\n\nsystem – DiscreteIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::ConstrainedDiscreteIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedDiscreteIdentitySystem.\n\nInput\n\nsystem – ConstrainedDiscreteIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::LinearDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a LinearDiscreteSystem.\n\nInput\n\nsystem – LinearDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::AffineDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a AffineDiscreteSystem.\n\nInput\n\nsystem – AffineDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::LinearControlDiscreteSystem, x::AbstractVector, u::AbstractVector)\n\nReturn the successor state of a LinearControlDiscreteSystem.\n\nInput\n\nsystem – LinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineDiscreteSystem, x::AbstractVector;\n [check_constraints])\n\nReturn the successor state of a ConstrainedAffineDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::BlackBoxDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a BlackBoxDiscreteSystem.\n\nInput\n\nsystem – BlackBoxDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearDiscreteSystem, x::AbstractVector,\n w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearControlDiscreteSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Discretization-1","page":"Methods","title":"Discretization","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"discretize","category":"page"},{"location":"lib/methods/#MathematicalSystems.discretize","page":"Methods","title":"MathematicalSystems.discretize","text":"discretize(system::AbstractContinuousSystem, ΔT::Real,\n algorithm::AbstractDiscretizationAlgorithm=ExactDiscretization(),\n constructor=_default_complementary_constructor(system))\n\nDiscretization of a isaffine AbstractContinuousSystem to a AbstractDiscreteSystem with sampling time ΔT using the discretization method algorithm.\n\nInput\n\nsystem – an affine continuous system\nΔT – sampling time\nalgorithm – (optional, default: ExactDiscretization()) discretization algorithm\nconstructor – (optional, default: _default_complementary_constructor(system)) construction method\n\nOutput\n\nReturns a discretization of the input system system with discretization method algorithm and sampling time ΔT.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Internal-Methods-1","page":"Methods","title":"Internal Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"_discretize\ntypename(::AbstractSystem)\n_complementary_type(::Type{<:AbstractSystem})","category":"page"},{"location":"lib/methods/#MathematicalSystems._discretize","page":"Methods","title":"MathematicalSystems._discretize","text":"_discretize(::AbstractDiscretizationAlgorithm, ΔT::Real\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nImplementation of the discretization algorithm defined by the first input argument with sampling time ΔT.\n\nInput\n\n`` – discretization algorithm, used for dispatch\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B, c and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(A::AbstractMatrix, ΔT::Real; algorithm=:exact)\n\nDiscretize the state matrix A with sampling time ΔT and discretization method algorithm.\n\nInput\n\nA – state matrix\nΔT – sampling time\nalgorithm – (optional, default: :exact) discretization algorithm\n\nOutput\n\nReturns a vector containing the discretized input argument A.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix)\n\nDiscretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input or noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A and B.\n\nNotes\n\nThis method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix,c::AbstractVector)\n\nDiscretize the state matrix A and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector)\n\nDiscretize the state matrix A, input matrix B and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, D::AbstractMatrix)\n\nDiscretize the state matrix A, input matrix B and noise matrix C with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.typename-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.typename","text":"typename(system::AbstractSystem)\n\nReturns the base type of system without parameter information.\n\nInput\n\nsystem – AbstractSystem\n\nOutput\n\nThe base type of system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems._complementary_type-Tuple{Type{#s3} where #s3<:AbstractSystem}","page":"Methods","title":"MathematicalSystems._complementary_type","text":"_complementary_type(system_type::Type{<:AbstractSystem})\n\nReturn the complementary type of a system type system_type.\n\nInput\n\nsystem_type – type of AbstractSystem\n\nOuput\n\nReturn complementary type of system_type.\n\nNotes\n\nThere are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.\n\nTo get the complementary type of system type, use _complementary_type(typename(system)).\n\n\n\n\n\n","category":"method"}]
+}
diff --git a/v0.11.3/siteinfo.js b/v0.11.3/siteinfo.js
new file mode 100644
index 00000000..9ef7e189
--- /dev/null
+++ b/v0.11.3/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.11.3";
diff --git a/v0.11.4/about/index.html b/v0.11.4/about/index.html
new file mode 100644
index 00000000..53f1576e
--- /dev/null
+++ b/v0.11.4/about/index.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
Return the system type whose field names match those in fields.
Input
AT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem
fields – tuple of field names
Output
The system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.
Extract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.
For the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list
(:A_user, :A)
(:B_user, :B)
(:c_user, :c)
(:D_user, :D)
(:f_user, :f)
(:statedim_user :statedim)
(:inputdim_user :inputdim)
(:noisedim_user :noisedim)
and for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.
Input
equation – dynamic equation
state – state variable
input – input variable
noise – noise variable
dim – dimensionality
AT – abstract system type
Output
Two arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.
Checks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.
Return true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.
Input
expr – expression
Output
A Bool indicating whether expr is an equation or not.
If an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.
If an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.
Similiarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.
Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.
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)$.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
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.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Specifies if the dynamics of system s is specified by polynomial equations.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.
Discretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.
Input
algorithm – discretization algorithm
ΔT – sampling time
A – state matrix
B – input or noise matrix
Output
Returns a vector containing the discretized input arguments A and B.
Notes
This method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).
Return the complementary type of a system type system_type.
Input
system_type – type of AbstractSystem
Ouput
Return complementary type of system_type.
Notes
There are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.
To get the complementary type of system type, use _complementary_type(typename(system)).
Abstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
Exact 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].
Euler 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].
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 + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.
If the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.
Systems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
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.5]');
+
+julia> c = [1., 1.5];
+
+julia> X = BallInf(zeros(2), 10.);
+
+julia> U = BallInf(zeros(1), 2.);
+
+julia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)
+ConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([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,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))
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).
A scalar multiple of the identity matrix of given order and numeric type.
Fields
M – uniform scaling operator of type T
n – 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 AbstractMatix, 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
The easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:
julia> using MathematicalSystems: IdentityMultiple
+
+julia> I2 = I(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 2
The numeric type (default Float64) can be passed as a second argument:
julia> I2r = I(2, Rational{Int})
+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 2
To create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:
julia> I2 = I(2.0, 2)
+IdentityMultiple{Float64} of value 2.0 and order 2
+
+julia> I2r = I(2//1, 2)
+IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
Or use the constructor passing the UniformScaling (I):
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 2
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.
Type 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:
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 I(n), for example:
diff --git a/v0.11.4/search_index.js b/v0.11.4/search_index.js
new file mode 100644
index 00000000..56a66762
--- /dev/null
+++ b/v0.11.4/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"lib/internals/#Internals-1","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"This section describes functions that are internal to the library.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]\nDepth = 3","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/internals/#Expression-handling-1","page":"Internals","title":"Expression handling","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"_corresponding_type\n_capture_dim\nextract_dyn_equation_parameters\nadd_asterisk\nsort","category":"page"},{"location":"lib/internals/#MathematicalSystems._corresponding_type","page":"Internals","title":"MathematicalSystems._corresponding_type","text":"_corresponding_type(AT::Type{<:AbstractSystem}, fields::Tuple)\n\nReturn the system type whose field names match those in fields.\n\nInput\n\nAT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem\nfields – tuple of field names\n\nOutput\n\nThe system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.\n\nExamples\n\njulia> using MathematicalSystems: _corresponding_type\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A),))\nLinearContinuousSystem\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A), (:B), (:X), (:U)))\nConstrainedLinearControlContinuousSystem\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._capture_dim","page":"Internals","title":"MathematicalSystems._capture_dim","text":"_capture_dim(expr)\n\nReturn the tuple containing the dimension(s) in expr.\n\nInput\n\nexpr – symbolic expression that can be of any of the following forms:\n:x or :(x) – state dimension\n:(x, u) – state and input dimension\n:(x, u, w) – state, input and noise dimensions\n\nOutput\n\nThe scalar x if expr specifies the state dimension.\nThe vector [x, u] if expr specifies state and input dimension.\nThe vector [x, u, w] if expr specifies state, input and noise dimensions.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_dyn_equation_parameters","page":"Internals","title":"MathematicalSystems.extract_dyn_equation_parameters","text":"extract_dyn_equation_parameters(equation, state, input, noise, dim, AT)\n\nExtract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.\n\nFor the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list\n\n(:A_user, :A)\n(:B_user, :B)\n(:c_user, :c)\n(:D_user, :D)\n(:f_user, :f)\n(:statedim_user :statedim)\n(:inputdim_user :inputdim)\n(:noisedim_user :noisedim)\n\nand for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.\n\nInput\n\nequation – dynamic equation\nstate – state variable\ninput – input variable\nnoise – noise variable\ndim – dimensionality\nAT – abstract system type\n\nOutput\n\nTwo arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.add_asterisk","page":"Internals","title":"MathematicalSystems.add_asterisk","text":"add_asterisk(summand, state::Symbol, input::Symbol, noise::Symbol)\n\nChecks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.\n\nInput\n\nsummand – expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nMultiplication expression or symbol.\n\nExample\n\njulia> using MathematicalSystems: add_asterisk\n\njulia> add_asterisk(:(A1*x), :x, :u, :w)\n:(A1 * x)\n\njulia> add_asterisk(:(c1), :x, :u, :w)\n:c1\n\njulia> add_asterisk(:(Ax1), :x1, :u, :w)\n:(A * x1)\n\njulia> add_asterisk(:(Awb), :x1, :u, :wb)\n:(A * wb)\n\njulia> add_asterisk(:(A1u), :x, :u, :w)\n:(A1 * u)\n\njulia> add_asterisk(:(A1ub), :x, :u, :w)\n:A1ub\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Base.sort","page":"Internals","title":"Base.sort","text":"sort(parameters::Vector, order::Tuple)\n\nFilter and sort the vector parameters according to order.\n\nInput\n\nparameters – vector of tuples\norder – tuple of symbols\n\nOutput\n\nA new vector of tuples corresponding to parameters filtered and sorted according to order.\n\nExamples\n\njulia> parameters= [(:U1, :U), (:X1, :X), (:W1, :W)];\n\njulia> sort(parameters, (:X, :U, :W))\n3-element Array{Tuple{Any,Symbol},1}:\n (:X1, :X)\n (:U1, :U)\n (:W1, :W)\n\njulia> parameters = [(:const, :c), (:A, :A)];\n\njulia> sort(parameters, (:A, :B, :c, :D))\n2-element Array{Tuple{Any,Symbol},1}:\n (:A, :A)\n (:const, :c)\n\nNotes\n\nparameters is a vector that contains tuples whose second element is considered for the sorting according to order.\n\nIf a value of order is not contained in parameters, the corresponding entry of order will be omitted.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Querying-expressions-1","page":"Internals","title":"Querying expressions","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"is_equation\nextract_sum","category":"page"},{"location":"lib/internals/#MathematicalSystems.is_equation","page":"Internals","title":"MathematicalSystems.is_equation","text":"is_equation(expr)\n\nReturn true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.\n\nInput\n\nexpr – expression\n\nOutput\n\nA Bool indicating whether expr is an equation or not.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_sum","page":"Internals","title":"MathematicalSystems.extract_sum","text":"extract_sum(summands, state::Symbol, input::Symbol, noise::Symbol)\n\nExtract the variable name and field name for every element of summands which corresponds to the elements of the right-hand side of an affine system.\n\nInput\n\nsummands – array of expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nArray of tuples of symbols with variable name and field name.\n\nExample\n\njulia> using MathematicalSystems: extract_sum\n\njulia> extract_sum([:(A1*x)], :x, :u, :w)\n1-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n\njulia> extract_sum([:(A1*x), :(B1*u), :c], :x, :u, :w)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(vcat(c)), :c)\n\njulia> extract_sum([:(A1*x7), :( B1*u7), :( B2*w7)], :x7, :u7, :w7)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(hcat(B2)), :D)\n\nNotes\n\nIf an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.\n\nIf an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.\n\nSimiliarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Naming-convention-for-systems'-fields-1","page":"Internals","title":"Naming convention for systems' fields","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Field Description Getter function\nA state matrix state_matrix\nB input matrix input_matrix\nc affine term affine_term\nD noise matrix noise_matrix\nX state constraints stateset\nU input constraints inputset\nW disturbance set noiseset","category":"page"},{"location":"about/#About-1","page":"About","title":"About","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This page contains some general information about this project, and recommendations about contributing.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Pages = [\"about.md\"]","category":"page"},{"location":"about/#Contributing-1","page":"About","title":"Contributing","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.","category":"page"},{"location":"about/#Branches-and-pull-requests-(PR)-1","page":"About","title":"Branches and pull requests (PR)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.","category":"page"},{"location":"about/#Unit-testing-and-continuous-integration-(CI)-1","page":"About","title":"Unit testing and continuous integration (CI)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes test/runtests.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Alternatively, you can achieve the same from inside the REPL using the following command:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> Pkg.test(\"MathematicalSystems\")","category":"page"},{"location":"about/#","page":"About","title":"About","text":"We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.","category":"page"},{"location":"about/#Contributing-to-the-documentation-1","page":"About","title":"Contributing to the documentation","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"New functions and types should be documented according to our guidelines directly in the source code.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> ?LinearContinuousSystem","category":"page"},{"location":"about/#","page":"About","title":"About","text":"This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).","category":"page"},{"location":"about/#","page":"About","title":"About","text":"To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes docs/make.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Note that this also runs all doctests which will take some time.","category":"page"},{"location":"about/#Related-projects-1","page":"About","title":"Related projects","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below we list more related projects.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia","category":"page"},{"location":"about/#Credits-1","page":"About","title":"Credits","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"These persons have contributed to MathematicalSystems.jl (in alphabetic order):","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Marcelo Forets\nBenoît Legat\nChristian Schilling\nUeli Wechsler","category":"page"},{"location":"lib/types/#Types-1","page":"Types","title":"Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"This section describes systems types implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"Pages = [\"types.md\"]\nDepth = 3","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/types/#Abstract-Systems-1","page":"Types","title":"Abstract Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractSystem","page":"Types","title":"MathematicalSystems.AbstractSystem","text":"AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractContinuousSystem","page":"Types","title":"MathematicalSystems.AbstractContinuousSystem","text":"AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractDiscreteSystem","page":"Types","title":"MathematicalSystems.AbstractDiscreteSystem","text":"AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Continuous-Systems-1","page":"Types","title":"Continuous Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem\nBlackBoxContinuousSystem\nConstrainedBlackBoxContinuousSystem\nBlackBoxControlContinuousSystem\nConstrainedBlackBoxControlContinuousSystem\nNoisyLinearContinuousSystem\nNoisyConstrainedLinearContinuousSystem\nNoisyLinearControlContinuousSystem\nNoisyConstrainedLinearControlContinuousSystem\nNoisyAffineControlContinuousSystem\nNoisyConstrainedAffineControlContinuousSystem\nNoisyBlackBoxControlContinuousSystem\nNoisyConstrainedBlackBoxControlContinuousSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.ContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ContinuousIdentitySystem","text":"ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form:\n\n x(t) = 0 forall t\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedContinuousIdentitySystem","text":"ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with domain constraints of the form:\n\n x(t) = 0 x(t) mathcalX forall t\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearContinuousSystem","page":"Types","title":"MathematicalSystems.LinearContinuousSystem","text":"LinearContinuousSystem\n\nContinuous-time linear system of the form:\n\n x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineContinuousSystem","page":"Types","title":"MathematicalSystems.AffineContinuousSystem","text":"AffineContinuousSystem\n\nContinuous-time affine system of the form:\n\n x(t) = A x(t) + c forall t\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.LinearControlContinuousSystem","text":"LinearControlContinuousSystem\n\nContinuous-time linear control system of the form:\n\n x(t) = A x(t) + B u(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearContinuousSystem","text":"ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineContinuousSystem","text":"ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with domain constraints of the form:\n\n x(t) = A x(t) + c x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlContinuousSystem","text":"ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlContinuousSystem","text":"ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicContinuousSystem","text":"LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form:\n\n E x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","text":"ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n E x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.PolynomialContinuousSystem","text":"PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form:\n\n x(t) = p(x(t)) forall t\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialContinuousSystem","text":"ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with domain constraints:\n\n x(t) = p(x(t)) x(t) mathcalX forall t\n\nFields\n\np – polynomial vector field\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxContinuousSystem","text":"BlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side of the form:\n\n x(t) = f(x(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxContinuousSystem","text":"ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t)) x(t) mathcalX forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlContinuousSystem","text":"BlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","text":"ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t)) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearContinuousSystem","text":"NoisyLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance of the form:\n\n x(t) = A x(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearContinuousSystem","text":"NoisyConstrainedLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + D w(t) x(t) mathcalX w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlContinuousSystem","text":"NoisyLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","text":"NoisyConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlContinuousSystem","text":"NoisyAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","text":"NoisyConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlContinuousSystem","text":"NoisyBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t) w(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","text":"NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t) w(t)) quad x(t) mathcalX quad u(t) mathcalU quad w(t) mathcalW quad forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discrete-Systems-1","page":"Types","title":"Discrete Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nAffineDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedAffineDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nConstrainedAffineControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem\nBlackBoxDiscreteSystem\nConstrainedBlackBoxDiscreteSystem\nBlackBoxControlDiscreteSystem\nConstrainedBlackBoxControlDiscreteSystem\nNoisyLinearDiscreteSystem\nNoisyConstrainedLinearDiscreteSystem\nNoisyLinearControlDiscreteSystem\nNoisyConstrainedLinearControlDiscreteSystem\nNoisyAffineControlDiscreteSystem\nNoisyConstrainedAffineControlDiscreteSystem\nNoisyBlackBoxControlDiscreteSystem\nNoisyConstrainedBlackBoxControlDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.DiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.DiscreteIdentitySystem","text":"DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form:\n\n x_k+1 = x_k forall k\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedDiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedDiscreteIdentitySystem","text":"ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with domain constraints of the form:\n\n x_k+1 = x_k x_k mathcalX forall k\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDiscreteSystem","text":"LinearDiscreteSystem\n\nDiscrete-time linear system of the form:\n\n x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineDiscreteSystem","text":"AffineDiscreteSystem\n\nDiscrete-time affine system of the form:\n\n x_k+1 = A x_k + c forall k\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearControlDiscreteSystem","text":"LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form:\n\n x_k+1 = A x_k + B u_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDiscreteSystem","text":"ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineDiscreteSystem","text":"ConstrainedAffineDiscreteSystem\n\nDiscrete-time affine system with domain constraints of the form:\n\n x_k+1 = A x_k + c x_k mathcalX forall k\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlDiscreteSystem","text":"ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlDiscreteSystem","text":"ConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicDiscreteSystem","text":"LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form:\n\n E x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","text":"ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n E x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.PolynomialDiscreteSystem","text":"PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form:\n\n x_k+1 = p(x_k) forall k\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialDiscreteSystem","text":"ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with domain constraints:\n\n x_k+1 = p(x_k) x_k mathcalX forall k\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxDiscreteSystem","text":"BlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","text":"ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k) x_k mathcalX forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlDiscreteSystem","text":"BlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","text":"ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearDiscreteSystem","text":"NoisyLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance of the form:\n\n x_k+1 = A x_k + D w_k forall k\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","text":"NoisyConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + D w_k x_k mathcalX w(t) mathcalW forall k\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlDiscreteSystem","text":"NoisyLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","text":"NoisyConstrainedLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlDiscreteSystem","text":"NoisyAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","text":"NoisyConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","text":"NoisyBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","text":"NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) quad x_k mathcalX quad u_k mathcalU quad w_k mathcalW quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discretization-Algorithms-1","page":"Types","title":"Discretization Algorithms","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractDiscretizationAlgorithm\nExactDiscretization\nEulerDiscretization","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractDiscretizationAlgorithm","page":"Types","title":"MathematicalSystems.AbstractDiscretizationAlgorithm","text":"AbstractDiscretizationAlgorithm\n\nAbstract supertype for all discretization algorithms.\n\nNote\n\nFor implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method\n\n_discretize(::NewDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nare required.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ExactDiscretization","page":"Types","title":"MathematicalSystems.ExactDiscretization","text":"ExactDiscretization <: AbstractDiscretizationAlgorithm\n\nExact discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Discretizationoflinearstatespace_models\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.EulerDiscretization","page":"Types","title":"MathematicalSystems.EulerDiscretization","text":"EulerDiscretization <: AbstractDiscretizationAlgorithm\n\nEuler discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Approximations\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#System-macro-1","page":"Types","title":"System macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@system","category":"page"},{"location":"lib/types/#MathematicalSystems.@system","page":"Types","title":"MathematicalSystems.@system","text":"system(expr...)\n\nReturn an instance of the system type corresponding to the given expressions.\n\nInput\n\nexpr – expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system\n\nOutput\n\nA system that best matches the given expressions.\n\nNotes\n\nTerms. The expression expr contains one or more of the following sub-expressions:\n\ndynamic equation, either continuous, e.g.x' = Ax, or discrete, e.g. x⁺ = Ax\nset constraints, e.g. x ∈ X\ninput constraints, e.g. u ∈ U\ndimensionality, e.g. dim: (2,1) or dim = 1\nspecification of the input variable, e.g. input: u or input = u\nspecification of the noise variable, e,g, noise: w or noise = w\n\nThe macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:\n\n@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)\n\nThe 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.\n\nDynamic 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.\n\nDefault 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.\n\nExceptions. The following exceptions and particular cases apply:\n\nIf the right-hand side has the form A*x + B*foo, A*x + B*foo + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.\nIf the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.\nSystems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.\n\nExamples\n\nLet us first create a continuous linear system using this macro:\n\njulia> A = [1. 0; 0 1.];\n\njulia> @system(x' = A*x)\nLinearContinuousSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nA discrete system is defined by using ⁺:\n\njulia> @system(x⁺ = A*x)\nLinearDiscreteSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nAdditionally, 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:\n\njulia> using LazySets\n\njulia> B = Matrix([1. 0.5]');\n\njulia> c = [1., 1.5];\n\njulia> X = BallInf(zeros(2), 10.);\n\njulia> U = BallInf(zeros(1), 2.);\n\njulia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)\nConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\nFor 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\n\njulia> f(x, u) = x + u;\n\njulia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))\nConstrainedBlackBoxControlDiscreteSystem{typeof(f),BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Initial-value-problem-macro-1","page":"Types","title":"Initial-value problem macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@ivp","category":"page"},{"location":"lib/types/#MathematicalSystems.@ivp","page":"Types","title":"MathematicalSystems.@ivp","text":"ivp(expr...)\n\nReturn an instance of the initial-value problem type corresponding to the given expressions.\n\nInput\n\nexpr – 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)\n\nOutput\n\nAn initial-value problem that best matches the given expressions.\n\nNotes\n\nThis 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.\n\nThe macro can also be called with a system argument of type AbstractSystem in the form @ivp(system, state(0) ∈ initial_set).\n\nExamples\n\njulia> p = @ivp(x' = -x, x(0) ∈ [1.0]);\n\njulia> typeof(p)\nInitialValueProblem{LinearContinuousSystem{Float64,IdentityMultiple{Float64}},Array{Float64,1}}\n\njulia> initial_state(p)\n1-element Array{Float64,1}:\n 1.0\n\njulia> sys = @system(x' = [1 0; 0 1] * x);\n\njulia> @ivp(sys, x(0) ∈ [-1, 1])\nInitialValueProblem{LinearContinuousSystem{Int64,Array{Int64,2}},Array{Int64,1}}(LinearContinuousSystem{Int64,Array{Int64,2}}([1 0; 0 1]), [-1, 1])\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Identity-operator-1","page":"Types","title":"Identity operator","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"IdentityMultiple","category":"page"},{"location":"lib/types/#MathematicalSystems.IdentityMultiple","page":"Types","title":"MathematicalSystems.IdentityMultiple","text":"IdentityMultiple{T} < AbstractMatrix{T} where T\n\nA scalar multiple of the identity matrix of given order and numeric type.\n\nFields\n\nM – uniform scaling operator of type T\nn – size of the identity matrix\n\nNotes\n\nThis 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.\n\nInternally, the type wraps Julia's lazy multiple of the identity operator, UniformScaling. IdentityMultiple subtypes AbstractMatix, hence it can be used in usual matrix arithmetic and for dispatch on AbstractMatrix.\n\nThe difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.\n\nExamples\n\nThe easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:\n\njulia> using MathematicalSystems: IdentityMultiple\n\njulia> I2 = I(2)\nIdentityMultiple{Float64} of value 1.0 and order 2\n\njulia> I2 + I2\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> 4*I2\nIdentityMultiple{Float64} of value 4.0 and order 2\n\nThe numeric type (default Float64) can be passed as a second argument:\n\njulia> I2r = I(2, Rational{Int})\nIdentityMultiple{Rational{Int64}} of value 1//1 and order 2\n\njulia> I2r + I2r\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\njulia> 4*I2r\nIdentityMultiple{Rational{Int64}} of value 4//1 and order 2\n\nTo create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:\n\njulia> I2 = I(2.0, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = I(2//1, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\nOr use the constructor passing the UniformScaling (I):\n\njulia> I2 = IdentityMultiple(2.0*I, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = IdentityMultiple(2//1*I, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Initial-Value-Problems-1","page":"Types","title":"Initial Value Problems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"InitialValueProblem\nIVP\ninitial_state\nsystem","category":"page"},{"location":"lib/types/#MathematicalSystems.InitialValueProblem","page":"Types","title":"MathematicalSystems.InitialValueProblem","text":"InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystem\n\nParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x₀ = -12 12:\n\njulia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);\n\njulia> x₀ = [-1/2, 1/2];\n\njulia> p = InitialValueProblem(s, x₀);\n\njulia> initial_state(p) # same as p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IVP","page":"Types","title":"MathematicalSystems.IVP","text":"IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.initial_state","page":"Types","title":"MathematicalSystems.initial_state","text":"initial_state(ivp::InitialValueProblem)\n\nReturn the initial state of an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe initial state of an initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.system","page":"Types","title":"MathematicalSystems.system","text":"system(ivp::InitialValueProblem)\n\nReturn the system wrapped by an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe system of the given initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Input-Types-1","page":"Types","title":"Input Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractInput\nConstantInput\nVaryingInput","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractInput","page":"Types","title":"MathematicalSystems.AbstractInput","text":"AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstantInput","page":"Types","title":"MathematicalSystems.ConstantInput","text":"ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.VaryingInput","page":"Types","title":"MathematicalSystems.VaryingInput","text":"VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase's iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64},Array{Rational{Int64},1}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Maps-1","page":"Types","title":"Maps","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractMap\nIdentityMap\nConstrainedIdentityMap\nLinearMap\nConstrainedLinearMap\nAffineMap\nConstrainedAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap\nResetMap\nConstrainedResetMap","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractMap","page":"Types","title":"MathematicalSystems.AbstractMap","text":"AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IdentityMap","page":"Types","title":"MathematicalSystems.IdentityMap","text":"IdentityMap\n\nAn identity map,\n\n x x\n\nFields\n\ndim – dimension\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedIdentityMap","page":"Types","title":"MathematicalSystems.ConstrainedIdentityMap","text":"ConstrainedIdentityMap\n\nAn identity map with state constraints of the form:\n\n x x x(t) mathcalX\n\nFields\n\ndim – dimension\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearMap","page":"Types","title":"MathematicalSystems.LinearMap","text":"LinearMap\n\nA linear map,\n\n x Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearMap","text":"ConstrainedLinearMap\n\nA linear map with state constraints of the form:\n\n x Ax x(t) mathcalX\n\nFields\n\nA – matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineMap","page":"Types","title":"MathematicalSystems.AffineMap","text":"AffineMap\n\nAn affine map,\n\n x Ax + c\n\nFields\n\nA – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineMap","text":"ConstrainedAffineMap\n\nAn affine map with state constraints of the form:\n\n x Ax + c x(t) mathcalX\n\nFields\n\nA – matrix\nc – vector\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlMap","page":"Types","title":"MathematicalSystems.LinearControlMap","text":"LinearControlMap\n\nA linear control map,\n\n (x u) Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlMap","text":"ConstrainedLinearControlMap\n\nA linear control map with state and input constraints,\n\n (x u) Ax + Bu x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlMap","page":"Types","title":"MathematicalSystems.AffineControlMap","text":"AffineControlMap\n\nAn affine control map,\n\n (x u) Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlMap","text":"ConstrainedAffineControlMap\n\nAn affine control map with state and input constraints,\n\n (x u) Ax + Bu + c x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ResetMap","page":"Types","title":"MathematicalSystems.ResetMap","text":"ResetMap\n\nA reset map,\n\n x R(x)\n\nsuch that a subset of the variables is given a specified value, and the rest are unchanged.\n\nFields\n\ndim – dimension\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedResetMap","page":"Types","title":"MathematicalSystems.ConstrainedResetMap","text":"ConstrainedResetMap\n\nA reset map with state constraints of the form:\n\n x R(x) x mathcalX\n\nsuch that the specified variables are assigned a given value, and the remaining variables are unchanged.\n\nFields\n\ndim – dimension\nX – state constraints\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Macros-1","page":"Types","title":"Macros","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@map","category":"page"},{"location":"lib/types/#MathematicalSystems.@map","page":"Types","title":"MathematicalSystems.@map","text":"map(ex, args)\n\nReturn an instance of the map type corresponding to the given expression.\n\nInput\n\nex – an expression defining the map, in the form of an anonymous function\nargs – additional optional arguments\n\nOutput\n\nA map that best matches the given expression.\n\nExamples\n\nLet us first create a linear map using this macro:\n\njulia> @map x -> [1 0; 0 0]*x\nLinearMap{Int64,Array{Int64,2}}([1 0; 0 0])\n\nWe can create an affine system as well:\n\njulia> @map x -> [1 0; 0 0]*x + [2, 0]\nAffineMap{Int64,Array{Int64,2},Array{Int64,1}}([1 0; 0 0], [2, 0])\n\nAdditional 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:\n\njulia> @map(x -> x, dim=5)\nIdentityMap(5)\n\nA state constraint on such map can be specified passing the additional argument x ∈ X.\n\nAn identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:\n\njulia> @map x -> I(5)*x\nIdentityMap(5)\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Systems-with-output-1","page":"Types","title":"Systems with output","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem","category":"page"},{"location":"lib/types/#MathematicalSystems.SystemWithOutput","page":"Types","title":"MathematicalSystems.SystemWithOutput","text":"SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap}\n\nParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearTimeInvariantSystem","page":"Types","title":"MathematicalSystems.LinearTimeInvariantSystem","text":"LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.LTISystem","page":"Types","title":"MathematicalSystems.LTISystem","text":"LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n","category":"function"},{"location":"#MathematicalSystems.jl-1","page":"Home","title":"MathematicalSystems.jl","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]","category":"page"},{"location":"#","page":"Home","title":"Home","text":"MathematicalSystems is a Julia package for mathematical systems interfaces.","category":"page"},{"location":"#Features-1","page":"Home","title":"Features","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled, linear algebraic, etc.\nIterator interfaces to handle constant or time-varying inputs.","category":"page"},{"location":"#Library-Outline-1","page":"Home","title":"Library Outline","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Pages = [\n \"lib/types.md\",\n \"lib/methods.md\",\n \"lib/internals.md\"\n]\nDepth = 2","category":"page"},{"location":"lib/methods/#Methods-1","page":"Methods","title":"Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"This section describes systems methods implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"Pages = [\"methods.md\"]\nDepth = 3","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/methods/#States-1","page":"Methods","title":"States","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"statedim\nstateset","category":"page"},{"location":"lib/methods/#MathematicalSystems.statedim","page":"Methods","title":"MathematicalSystems.statedim","text":"statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.stateset","page":"Methods","title":"MathematicalSystems.stateset","text":"stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Inputs-1","page":"Methods","title":"Inputs","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"inputdim\ninputset\nnextinput","category":"page"},{"location":"lib/methods/#MathematicalSystems.inputdim","page":"Methods","title":"MathematicalSystems.inputdim","text":"inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.inputset","page":"Methods","title":"MathematicalSystems.inputset","text":"inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.nextinput","page":"Methods","title":"MathematicalSystems.nextinput","text":"nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Output-1","page":"Methods","title":"Output","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"outputdim\noutputmap","category":"page"},{"location":"lib/methods/#MathematicalSystems.outputdim","page":"Methods","title":"MathematicalSystems.outputdim","text":"outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.outputmap","page":"Methods","title":"MathematicalSystems.outputmap","text":"outputmap(s::SystemWithOutput)\n\nReturns the output map of a system with output.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Traits-1","page":"Methods","title":"Traits","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"islinear(::AbstractSystem)\nislinear(::AbstractMap)\nisaffine(::AbstractSystem)\nispolynomial(::AbstractSystem)\nisaffine(::AbstractMap)\nisnoisy(::AbstractSystem)\niscontrolled(::AbstractSystem)\nisconstrained(::AbstractSystem)\nstate_matrix(::AbstractSystem)\ninput_matrix(::AbstractSystem)\nnoise_matrix(::AbstractSystem)\naffine_term(::AbstractSystem)","category":"page"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by linear equations.\n\nNotes\n\nWe 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 mathbbR. 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).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(m::AbstractMap)\n\nSpecifies if the map m is linear or not.\n\nNotes\n\nA map is linear if it preserves the operations of scalar multiplication and vector addition.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by affine equations.\n\nNotes\n\nAn 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.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.ispolynomial-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.ispolynomial","text":"ispolynomial(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by polynomial equations.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(m::AbstractMap)\n\nSpecifies if the map m is affine or not.\n\nNotes\n\nAn affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isnoisy-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isnoisy","text":"isnoisy(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a noise term w.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.iscontrolled-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.iscontrolled","text":"iscontrolled(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a control input u.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isconstrained-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isconstrained","text":"isconstrained(s::AbstractSystem)\n\nDetermines if the system s has constraints on the state, input and noise, respectively (those that are available).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.state_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.state_matrix","text":"state_matrix(::AbstractSystem)\n\nReturn the state matrix of an affine system.\n\nNotes\n\nThe state matrix is the matrix proportional to the state, e.g. the matrix A in the linear continuous system x = Ax.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.input_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.input_matrix","text":"input_matrix(::AbstractSystem)\n\nReturn the input matrix of a system with linear input.\n\nNotes\n\nThe input matrix is the matrix proportional to the input, e.g. the matrix B in the linear continuous system with input, x = Ax + Bu.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.noise_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.noise_matrix","text":"noise_matrix(::AbstractSystem)\n\nReturn the noise matrix of a system with linear noise.\n\nNotes\n\nThe noise matrix is the matrix proportional to the noise, e.g. the matrix D in the linear system with noise, x = Ax + Dw.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.affine_term-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.affine_term","text":"affine_term(::AbstractSystem)\n\nReturn the affine term in an affine system.\n\nNotes\n\nThe affine term is e.g. the vector c in the affine system x = Ax + c.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#Maps-1","page":"Methods","title":"Maps","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"apply","category":"page"},{"location":"lib/methods/#MathematicalSystems.apply","page":"Methods","title":"MathematicalSystems.apply","text":"apply(m::AbstractMap, args...)\n\nApply the rule specified by the map to the given arguments.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Successor-1","page":"Methods","title":"Successor","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"successor","category":"page"},{"location":"lib/methods/#MathematicalSystems.successor","page":"Methods","title":"MathematicalSystems.successor","text":"successor(system::DiscreteIdentitySystem, x::AbstractVector)\n\nReturn the successor state of a DiscreteIdentitySystem.\n\nInput\n\nsystem – DiscreteIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::ConstrainedDiscreteIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedDiscreteIdentitySystem.\n\nInput\n\nsystem – ConstrainedDiscreteIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::LinearDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a LinearDiscreteSystem.\n\nInput\n\nsystem – LinearDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::AffineDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a AffineDiscreteSystem.\n\nInput\n\nsystem – AffineDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::LinearControlDiscreteSystem, x::AbstractVector, u::AbstractVector)\n\nReturn the successor state of a LinearControlDiscreteSystem.\n\nInput\n\nsystem – LinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineDiscreteSystem, x::AbstractVector;\n [check_constraints])\n\nReturn the successor state of a ConstrainedAffineDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::BlackBoxDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a BlackBoxDiscreteSystem.\n\nInput\n\nsystem – BlackBoxDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearDiscreteSystem, x::AbstractVector,\n w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearControlDiscreteSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Discretization-1","page":"Methods","title":"Discretization","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"discretize","category":"page"},{"location":"lib/methods/#MathematicalSystems.discretize","page":"Methods","title":"MathematicalSystems.discretize","text":"discretize(system::AbstractContinuousSystem, ΔT::Real,\n algorithm::AbstractDiscretizationAlgorithm=ExactDiscretization(),\n constructor=_default_complementary_constructor(system))\n\nDiscretization of a isaffine AbstractContinuousSystem to a AbstractDiscreteSystem with sampling time ΔT using the discretization method algorithm.\n\nInput\n\nsystem – an affine continuous system\nΔT – sampling time\nalgorithm – (optional, default: ExactDiscretization()) discretization algorithm\nconstructor – (optional, default: _default_complementary_constructor(system)) construction method\n\nOutput\n\nReturns a discretization of the input system system with discretization method algorithm and sampling time ΔT.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Internal-Methods-1","page":"Methods","title":"Internal Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"_discretize\ntypename(::AbstractSystem)\n_complementary_type(::Type{<:AbstractSystem})","category":"page"},{"location":"lib/methods/#MathematicalSystems._discretize","page":"Methods","title":"MathematicalSystems._discretize","text":"_discretize(::AbstractDiscretizationAlgorithm, ΔT::Real\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nImplementation of the discretization algorithm defined by the first input argument with sampling time ΔT.\n\nInput\n\n`` – discretization algorithm, used for dispatch\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B, c and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(A::AbstractMatrix, ΔT::Real; algorithm=:exact)\n\nDiscretize the state matrix A with sampling time ΔT and discretization method algorithm.\n\nInput\n\nA – state matrix\nΔT – sampling time\nalgorithm – (optional, default: :exact) discretization algorithm\n\nOutput\n\nReturns a vector containing the discretized input argument A.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix)\n\nDiscretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input or noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A and B.\n\nNotes\n\nThis method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix,c::AbstractVector)\n\nDiscretize the state matrix A and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector)\n\nDiscretize the state matrix A, input matrix B and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, D::AbstractMatrix)\n\nDiscretize the state matrix A, input matrix B and noise matrix C with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.typename-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.typename","text":"typename(system::AbstractSystem)\n\nReturns the base type of system without parameter information.\n\nInput\n\nsystem – AbstractSystem\n\nOutput\n\nThe base type of system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems._complementary_type-Tuple{Type{#s3} where #s3<:AbstractSystem}","page":"Methods","title":"MathematicalSystems._complementary_type","text":"_complementary_type(system_type::Type{<:AbstractSystem})\n\nReturn the complementary type of a system type system_type.\n\nInput\n\nsystem_type – type of AbstractSystem\n\nOuput\n\nReturn complementary type of system_type.\n\nNotes\n\nThere are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.\n\nTo get the complementary type of system type, use _complementary_type(typename(system)).\n\n\n\n\n\n","category":"method"}]
+}
diff --git a/v0.11.4/siteinfo.js b/v0.11.4/siteinfo.js
new file mode 100644
index 00000000..549e425c
--- /dev/null
+++ b/v0.11.4/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.11.4";
diff --git a/v0.11.5/about/index.html b/v0.11.5/about/index.html
new file mode 100644
index 00000000..53f1576e
--- /dev/null
+++ b/v0.11.5/about/index.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
Return the system type whose field names match those in fields.
Input
AT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem
fields – tuple of field names
Output
The system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.
Extract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.
For the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list
(:A_user, :A)
(:B_user, :B)
(:c_user, :c)
(:D_user, :D)
(:f_user, :f)
(:statedim_user :statedim)
(:inputdim_user :inputdim)
(:noisedim_user :noisedim)
and for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.
Input
equation – dynamic equation
state – state variable
input – input variable
noise – noise variable
dim – dimensionality
AT – abstract system type
Output
Two arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.
Checks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.
Return true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.
Input
expr – expression
Output
A Bool indicating whether expr is an equation or not.
If an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.
If an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.
Similiarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.
Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.
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)$.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
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.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Specifies if the dynamics of system s is specified by polynomial equations.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.
Discretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.
Input
algorithm – discretization algorithm
ΔT – sampling time
A – state matrix
B – input or noise matrix
Output
Returns a vector containing the discretized input arguments A and B.
Notes
This method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).
Return the complementary type of a system type system_type.
Input
system_type – type of AbstractSystem
Ouput
Return complementary type of system_type.
Notes
There are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.
To get the complementary type of system type, use _complementary_type(typename(system)).
Abstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
Exact 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].
Euler 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].
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 + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.
If the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.
Systems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
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.5]');
+
+julia> c = [1., 1.5];
+
+julia> X = BallInf(zeros(2), 10.);
+
+julia> U = BallInf(zeros(1), 2.);
+
+julia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)
+ConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([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,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))
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).
A scalar multiple of the identity matrix of given order and numeric type.
Fields
M – uniform scaling operator of type T
n – 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 AbstractMatix, 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
The easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:
julia> using MathematicalSystems: IdentityMultiple
+
+julia> I2 = I(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 2
The numeric type (default Float64) can be passed as a second argument:
julia> I2r = I(2, Rational{Int})
+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 2
To create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:
julia> I2 = I(2.0, 2)
+IdentityMultiple{Float64} of value 2.0 and order 2
+
+julia> I2r = I(2//1, 2)
+IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
Or use the constructor passing the UniformScaling (I):
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 2
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.
Type 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:
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 I(n), for example:
diff --git a/v0.11.5/search_index.js b/v0.11.5/search_index.js
new file mode 100644
index 00000000..63eb7203
--- /dev/null
+++ b/v0.11.5/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"lib/internals/#Internals-1","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"This section describes functions that are internal to the library.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]\nDepth = 3","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/internals/#Expression-handling-1","page":"Internals","title":"Expression handling","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"_corresponding_type\n_capture_dim\nextract_dyn_equation_parameters\nadd_asterisk\nsort","category":"page"},{"location":"lib/internals/#MathematicalSystems._corresponding_type","page":"Internals","title":"MathematicalSystems._corresponding_type","text":"_corresponding_type(AT::Type{<:AbstractSystem}, fields::Tuple)\n\nReturn the system type whose field names match those in fields.\n\nInput\n\nAT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem\nfields – tuple of field names\n\nOutput\n\nThe system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.\n\nExamples\n\njulia> using MathematicalSystems: _corresponding_type\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A),))\nLinearContinuousSystem\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A), (:B), (:X), (:U)))\nConstrainedLinearControlContinuousSystem\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._capture_dim","page":"Internals","title":"MathematicalSystems._capture_dim","text":"_capture_dim(expr)\n\nReturn the tuple containing the dimension(s) in expr.\n\nInput\n\nexpr – symbolic expression that can be of any of the following forms:\n:x or :(x) – state dimension\n:(x, u) – state and input dimension\n:(x, u, w) – state, input and noise dimensions\n\nOutput\n\nThe scalar x if expr specifies the state dimension.\nThe vector [x, u] if expr specifies state and input dimension.\nThe vector [x, u, w] if expr specifies state, input and noise dimensions.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_dyn_equation_parameters","page":"Internals","title":"MathematicalSystems.extract_dyn_equation_parameters","text":"extract_dyn_equation_parameters(equation, state, input, noise, dim, AT)\n\nExtract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.\n\nFor the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list\n\n(:A_user, :A)\n(:B_user, :B)\n(:c_user, :c)\n(:D_user, :D)\n(:f_user, :f)\n(:statedim_user :statedim)\n(:inputdim_user :inputdim)\n(:noisedim_user :noisedim)\n\nand for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.\n\nInput\n\nequation – dynamic equation\nstate – state variable\ninput – input variable\nnoise – noise variable\ndim – dimensionality\nAT – abstract system type\n\nOutput\n\nTwo arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.add_asterisk","page":"Internals","title":"MathematicalSystems.add_asterisk","text":"add_asterisk(summand, state::Symbol, input::Symbol, noise::Symbol)\n\nChecks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.\n\nInput\n\nsummand – expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nMultiplication expression or symbol.\n\nExample\n\njulia> using MathematicalSystems: add_asterisk\n\njulia> add_asterisk(:(A1*x), :x, :u, :w)\n:(A1 * x)\n\njulia> add_asterisk(:(c1), :x, :u, :w)\n:c1\n\njulia> add_asterisk(:(Ax1), :x1, :u, :w)\n:(A * x1)\n\njulia> add_asterisk(:(Awb), :x1, :u, :wb)\n:(A * wb)\n\njulia> add_asterisk(:(A1u), :x, :u, :w)\n:(A1 * u)\n\njulia> add_asterisk(:(A1ub), :x, :u, :w)\n:A1ub\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Base.sort","page":"Internals","title":"Base.sort","text":"sort(parameters::Vector, order::Tuple)\n\nFilter and sort the vector parameters according to order.\n\nInput\n\nparameters – vector of tuples\norder – tuple of symbols\n\nOutput\n\nA new vector of tuples corresponding to parameters filtered and sorted according to order.\n\nExamples\n\njulia> parameters= [(:U1, :U), (:X1, :X), (:W1, :W)];\n\njulia> sort(parameters, (:X, :U, :W))\n3-element Array{Tuple{Any,Symbol},1}:\n (:X1, :X)\n (:U1, :U)\n (:W1, :W)\n\njulia> parameters = [(:const, :c), (:A, :A)];\n\njulia> sort(parameters, (:A, :B, :c, :D))\n2-element Array{Tuple{Any,Symbol},1}:\n (:A, :A)\n (:const, :c)\n\nNotes\n\nparameters is a vector that contains tuples whose second element is considered for the sorting according to order.\n\nIf a value of order is not contained in parameters, the corresponding entry of order will be omitted.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Querying-expressions-1","page":"Internals","title":"Querying expressions","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"is_equation\nextract_sum","category":"page"},{"location":"lib/internals/#MathematicalSystems.is_equation","page":"Internals","title":"MathematicalSystems.is_equation","text":"is_equation(expr)\n\nReturn true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.\n\nInput\n\nexpr – expression\n\nOutput\n\nA Bool indicating whether expr is an equation or not.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_sum","page":"Internals","title":"MathematicalSystems.extract_sum","text":"extract_sum(summands, state::Symbol, input::Symbol, noise::Symbol)\n\nExtract the variable name and field name for every element of summands which corresponds to the elements of the right-hand side of an affine system.\n\nInput\n\nsummands – array of expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nArray of tuples of symbols with variable name and field name.\n\nExample\n\njulia> using MathematicalSystems: extract_sum\n\njulia> extract_sum([:(A1*x)], :x, :u, :w)\n1-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n\njulia> extract_sum([:(A1*x), :(B1*u), :c], :x, :u, :w)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(vcat(c)), :c)\n\njulia> extract_sum([:(A1*x7), :( B1*u7), :( B2*w7)], :x7, :u7, :w7)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(hcat(B2)), :D)\n\nNotes\n\nIf an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.\n\nIf an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.\n\nSimiliarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Naming-convention-for-systems'-fields-1","page":"Internals","title":"Naming convention for systems' fields","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Field Description Getter function\nA state matrix state_matrix\nB input matrix input_matrix\nc affine term affine_term\nD noise matrix noise_matrix\nX state constraints stateset\nU input constraints inputset\nW disturbance set noiseset","category":"page"},{"location":"about/#About-1","page":"About","title":"About","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This page contains some general information about this project, and recommendations about contributing.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Pages = [\"about.md\"]","category":"page"},{"location":"about/#Contributing-1","page":"About","title":"Contributing","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.","category":"page"},{"location":"about/#Branches-and-pull-requests-(PR)-1","page":"About","title":"Branches and pull requests (PR)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.","category":"page"},{"location":"about/#Unit-testing-and-continuous-integration-(CI)-1","page":"About","title":"Unit testing and continuous integration (CI)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes test/runtests.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Alternatively, you can achieve the same from inside the REPL using the following command:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> Pkg.test(\"MathematicalSystems\")","category":"page"},{"location":"about/#","page":"About","title":"About","text":"We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.","category":"page"},{"location":"about/#Contributing-to-the-documentation-1","page":"About","title":"Contributing to the documentation","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"New functions and types should be documented according to our guidelines directly in the source code.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> ?LinearContinuousSystem","category":"page"},{"location":"about/#","page":"About","title":"About","text":"This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).","category":"page"},{"location":"about/#","page":"About","title":"About","text":"To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes docs/make.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Note that this also runs all doctests which will take some time.","category":"page"},{"location":"about/#Related-projects-1","page":"About","title":"Related projects","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below we list more related projects.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia","category":"page"},{"location":"about/#Credits-1","page":"About","title":"Credits","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"These persons have contributed to MathematicalSystems.jl (in alphabetic order):","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Marcelo Forets\nBenoît Legat\nChristian Schilling\nUeli Wechsler","category":"page"},{"location":"lib/types/#Types-1","page":"Types","title":"Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"This section describes systems types implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"Pages = [\"types.md\"]\nDepth = 3","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/types/#Abstract-Systems-1","page":"Types","title":"Abstract Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractSystem","page":"Types","title":"MathematicalSystems.AbstractSystem","text":"AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractContinuousSystem","page":"Types","title":"MathematicalSystems.AbstractContinuousSystem","text":"AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractDiscreteSystem","page":"Types","title":"MathematicalSystems.AbstractDiscreteSystem","text":"AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Continuous-Systems-1","page":"Types","title":"Continuous Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem\nBlackBoxContinuousSystem\nConstrainedBlackBoxContinuousSystem\nBlackBoxControlContinuousSystem\nConstrainedBlackBoxControlContinuousSystem\nNoisyLinearContinuousSystem\nNoisyConstrainedLinearContinuousSystem\nNoisyLinearControlContinuousSystem\nNoisyConstrainedLinearControlContinuousSystem\nNoisyAffineControlContinuousSystem\nNoisyConstrainedAffineControlContinuousSystem\nNoisyBlackBoxControlContinuousSystem\nNoisyConstrainedBlackBoxControlContinuousSystem\nSecondOrderLinearContinuousSystem\nSecondOrderAffineContinuousSystem\nSecondOrderConstrainedAffineControlContinuousSystem\nSecondOrderConstrainedLinearControlContinuousSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.ContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ContinuousIdentitySystem","text":"ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form:\n\n x(t) = 0 forall t\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedContinuousIdentitySystem","text":"ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with domain constraints of the form:\n\n x(t) = 0 x(t) mathcalX forall t\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearContinuousSystem","page":"Types","title":"MathematicalSystems.LinearContinuousSystem","text":"LinearContinuousSystem\n\nContinuous-time linear system of the form:\n\n x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineContinuousSystem","page":"Types","title":"MathematicalSystems.AffineContinuousSystem","text":"AffineContinuousSystem\n\nContinuous-time affine system of the form:\n\n x(t) = A x(t) + c forall t\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.LinearControlContinuousSystem","text":"LinearControlContinuousSystem\n\nContinuous-time linear control system of the form:\n\n x(t) = A x(t) + B u(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearContinuousSystem","text":"ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineContinuousSystem","text":"ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with domain constraints of the form:\n\n x(t) = A x(t) + c x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlContinuousSystem","text":"ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlContinuousSystem","text":"ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicContinuousSystem","text":"LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form:\n\n E x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","text":"ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n E x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.PolynomialContinuousSystem","text":"PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form:\n\n x(t) = p(x(t)) forall t\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialContinuousSystem","text":"ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with domain constraints:\n\n x(t) = p(x(t)) x(t) mathcalX forall t\n\nFields\n\np – polynomial vector field\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxContinuousSystem","text":"BlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side of the form:\n\n x(t) = f(x(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxContinuousSystem","text":"ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t)) x(t) mathcalX forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlContinuousSystem","text":"BlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","text":"ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t)) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearContinuousSystem","text":"NoisyLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance of the form:\n\n x(t) = A x(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearContinuousSystem","text":"NoisyConstrainedLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + D w(t) x(t) mathcalX w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlContinuousSystem","text":"NoisyLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","text":"NoisyConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlContinuousSystem","text":"NoisyAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","text":"NoisyConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlContinuousSystem","text":"NoisyBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t) w(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","text":"NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t) w(t)) quad x(t) mathcalX quad u(t) mathcalU quad w(t) mathcalW quad forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderLinearContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderLinearContinuousSystem","text":"SecondOrderLinearContinuousSystem\n\nContinuous-time second order linear system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = 0 forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderAffineContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderAffineContinuousSystem","text":"SecondOrderAffineContinuousSystem\n\nContinuous-time second order affine system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = b forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nb – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem","text":"SecondOrderConstrainedAffineControlContinuousSystem\n\nContinuous-time second order constrained affine control system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = Bu(t) + d x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nd – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem","text":"SecondOrderConstrainedLinearControlContinuousSystem\n\nContinuous-time second order constrained linear control system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = Bu(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discrete-Systems-1","page":"Types","title":"Discrete Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nAffineDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedAffineDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nConstrainedAffineControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem\nBlackBoxDiscreteSystem\nConstrainedBlackBoxDiscreteSystem\nBlackBoxControlDiscreteSystem\nConstrainedBlackBoxControlDiscreteSystem\nNoisyLinearDiscreteSystem\nNoisyConstrainedLinearDiscreteSystem\nNoisyLinearControlDiscreteSystem\nNoisyConstrainedLinearControlDiscreteSystem\nNoisyAffineControlDiscreteSystem\nNoisyConstrainedAffineControlDiscreteSystem\nNoisyBlackBoxControlDiscreteSystem\nNoisyConstrainedBlackBoxControlDiscreteSystem\nSecondOrderLinearDiscreteSystem\nSecondOrderAffineDiscreteSystem\nSecondOrderConstrainedAffineControlDiscreteSystem\nSecondOrderConstrainedLinearControlDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.DiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.DiscreteIdentitySystem","text":"DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form:\n\n x_k+1 = x_k forall k\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedDiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedDiscreteIdentitySystem","text":"ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with domain constraints of the form:\n\n x_k+1 = x_k x_k mathcalX forall k\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDiscreteSystem","text":"LinearDiscreteSystem\n\nDiscrete-time linear system of the form:\n\n x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineDiscreteSystem","text":"AffineDiscreteSystem\n\nDiscrete-time affine system of the form:\n\n x_k+1 = A x_k + c forall k\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearControlDiscreteSystem","text":"LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form:\n\n x_k+1 = A x_k + B u_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDiscreteSystem","text":"ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineDiscreteSystem","text":"ConstrainedAffineDiscreteSystem\n\nDiscrete-time affine system with domain constraints of the form:\n\n x_k+1 = A x_k + c x_k mathcalX forall k\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlDiscreteSystem","text":"ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlDiscreteSystem","text":"ConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicDiscreteSystem","text":"LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form:\n\n E x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","text":"ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n E x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.PolynomialDiscreteSystem","text":"PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form:\n\n x_k+1 = p(x_k) forall k\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialDiscreteSystem","text":"ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with domain constraints:\n\n x_k+1 = p(x_k) x_k mathcalX forall k\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxDiscreteSystem","text":"BlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","text":"ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k) x_k mathcalX forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlDiscreteSystem","text":"BlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","text":"ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearDiscreteSystem","text":"NoisyLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance of the form:\n\n x_k+1 = A x_k + D w_k forall k\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","text":"NoisyConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + D w_k x_k mathcalX w(t) mathcalW forall k\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlDiscreteSystem","text":"NoisyLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","text":"NoisyConstrainedLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlDiscreteSystem","text":"NoisyAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","text":"NoisyConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","text":"NoisyBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","text":"NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) quad x_k mathcalX quad u_k mathcalU quad w_k mathcalW quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderLinearDiscreteSystem","text":"SecondOrderLinearDiscreteSystem\n\nDiscrete-time second order linear system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = 0 forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderAffineDiscreteSystem","text":"SecondOrderAffineDiscreteSystem\n\nDiscrete-time second order affine system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = b forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nb – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem","text":"SecondOrderConstrainedAffineControlDiscreteSystem\n\nDiscrete-time second order constrained affine control system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = Bu_k + d x_k mathcalX u_k mathcalU forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nd – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem","text":"SecondOrderConstrainedLinearControlDiscreteSystem\n\nDiscrete-time second order constrained linear control system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = Bu_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discretization-Algorithms-1","page":"Types","title":"Discretization Algorithms","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractDiscretizationAlgorithm\nExactDiscretization\nEulerDiscretization","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractDiscretizationAlgorithm","page":"Types","title":"MathematicalSystems.AbstractDiscretizationAlgorithm","text":"AbstractDiscretizationAlgorithm\n\nAbstract supertype for all discretization algorithms.\n\nNote\n\nFor implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method\n\n_discretize(::NewDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nare required.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ExactDiscretization","page":"Types","title":"MathematicalSystems.ExactDiscretization","text":"ExactDiscretization <: AbstractDiscretizationAlgorithm\n\nExact discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Discretizationoflinearstatespace_models\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.EulerDiscretization","page":"Types","title":"MathematicalSystems.EulerDiscretization","text":"EulerDiscretization <: AbstractDiscretizationAlgorithm\n\nEuler discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Approximations\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#System-macro-1","page":"Types","title":"System macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@system","category":"page"},{"location":"lib/types/#MathematicalSystems.@system","page":"Types","title":"MathematicalSystems.@system","text":"system(expr...)\n\nReturn an instance of the system type corresponding to the given expressions.\n\nInput\n\nexpr – expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system\n\nOutput\n\nA system that best matches the given expressions.\n\nNotes\n\nTerms. The expression expr contains one or more of the following sub-expressions:\n\ndynamic equation, either continuous, e.g.x' = Ax, or discrete, e.g. x⁺ = Ax\nset constraints, e.g. x ∈ X\ninput constraints, e.g. u ∈ U\ndimensionality, e.g. dim: (2,1) or dim = 1\nspecification of the input variable, e.g. input: u or input = u\nspecification of the noise variable, e,g, noise: w or noise = w\n\nThe macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:\n\n@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)\n\nThe 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.\n\nDynamic 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.\n\nDefault 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.\n\nExceptions. The following exceptions and particular cases apply:\n\nIf the right-hand side has the form A*x + B*foo, A*x + B*foo + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.\nIf the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.\nSystems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.\n\nExamples\n\nLet us first create a continuous linear system using this macro:\n\njulia> A = [1. 0; 0 1.];\n\njulia> @system(x' = A*x)\nLinearContinuousSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nA discrete system is defined by using ⁺:\n\njulia> @system(x⁺ = A*x)\nLinearDiscreteSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nAdditionally, 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:\n\njulia> using LazySets\n\njulia> B = Matrix([1. 0.5]');\n\njulia> c = [1., 1.5];\n\njulia> X = BallInf(zeros(2), 10.);\n\njulia> U = BallInf(zeros(1), 2.);\n\njulia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)\nConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\nFor 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\n\njulia> f(x, u) = x + u;\n\njulia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))\nConstrainedBlackBoxControlDiscreteSystem{typeof(f),BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Initial-value-problem-macro-1","page":"Types","title":"Initial-value problem macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@ivp","category":"page"},{"location":"lib/types/#MathematicalSystems.@ivp","page":"Types","title":"MathematicalSystems.@ivp","text":"ivp(expr...)\n\nReturn an instance of the initial-value problem type corresponding to the given expressions.\n\nInput\n\nexpr – 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)\n\nOutput\n\nAn initial-value problem that best matches the given expressions.\n\nNotes\n\nThis 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.\n\nThe macro can also be called with a system argument of type AbstractSystem in the form @ivp(system, state(0) ∈ initial_set).\n\nExamples\n\njulia> p = @ivp(x' = -x, x(0) ∈ [1.0]);\n\njulia> typeof(p)\nInitialValueProblem{LinearContinuousSystem{Float64,IdentityMultiple{Float64}},Array{Float64,1}}\n\njulia> initial_state(p)\n1-element Array{Float64,1}:\n 1.0\n\njulia> sys = @system(x' = [1 0; 0 1] * x);\n\njulia> @ivp(sys, x(0) ∈ [-1, 1])\nInitialValueProblem{LinearContinuousSystem{Int64,Array{Int64,2}},Array{Int64,1}}(LinearContinuousSystem{Int64,Array{Int64,2}}([1 0; 0 1]), [-1, 1])\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Identity-operator-1","page":"Types","title":"Identity operator","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"IdentityMultiple","category":"page"},{"location":"lib/types/#MathematicalSystems.IdentityMultiple","page":"Types","title":"MathematicalSystems.IdentityMultiple","text":"IdentityMultiple{T} < AbstractMatrix{T} where T\n\nA scalar multiple of the identity matrix of given order and numeric type.\n\nFields\n\nM – uniform scaling operator of type T\nn – size of the identity matrix\n\nNotes\n\nThis 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.\n\nInternally, the type wraps Julia's lazy multiple of the identity operator, UniformScaling. IdentityMultiple subtypes AbstractMatix, hence it can be used in usual matrix arithmetic and for dispatch on AbstractMatrix.\n\nThe difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.\n\nExamples\n\nThe easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:\n\njulia> using MathematicalSystems: IdentityMultiple\n\njulia> I2 = I(2)\nIdentityMultiple{Float64} of value 1.0 and order 2\n\njulia> I2 + I2\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> 4*I2\nIdentityMultiple{Float64} of value 4.0 and order 2\n\nThe numeric type (default Float64) can be passed as a second argument:\n\njulia> I2r = I(2, Rational{Int})\nIdentityMultiple{Rational{Int64}} of value 1//1 and order 2\n\njulia> I2r + I2r\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\njulia> 4*I2r\nIdentityMultiple{Rational{Int64}} of value 4//1 and order 2\n\nTo create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:\n\njulia> I2 = I(2.0, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = I(2//1, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\nOr use the constructor passing the UniformScaling (I):\n\njulia> I2 = IdentityMultiple(2.0*I, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = IdentityMultiple(2//1*I, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Initial-Value-Problems-1","page":"Types","title":"Initial Value Problems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"InitialValueProblem\nIVP\ninitial_state\nsystem","category":"page"},{"location":"lib/types/#MathematicalSystems.InitialValueProblem","page":"Types","title":"MathematicalSystems.InitialValueProblem","text":"InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystem\n\nParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x₀ = -12 12:\n\njulia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);\n\njulia> x₀ = [-1/2, 1/2];\n\njulia> p = InitialValueProblem(s, x₀);\n\njulia> initial_state(p) # same as p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IVP","page":"Types","title":"MathematicalSystems.IVP","text":"IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.initial_state","page":"Types","title":"MathematicalSystems.initial_state","text":"initial_state(ivp::InitialValueProblem)\n\nReturn the initial state of an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe initial state of an initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.system","page":"Types","title":"MathematicalSystems.system","text":"system(ivp::InitialValueProblem)\n\nReturn the system wrapped by an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe system of the given initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Input-Types-1","page":"Types","title":"Input Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractInput\nConstantInput\nVaryingInput","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractInput","page":"Types","title":"MathematicalSystems.AbstractInput","text":"AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstantInput","page":"Types","title":"MathematicalSystems.ConstantInput","text":"ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.VaryingInput","page":"Types","title":"MathematicalSystems.VaryingInput","text":"VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase's iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64},Array{Rational{Int64},1}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Maps-1","page":"Types","title":"Maps","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractMap\nIdentityMap\nConstrainedIdentityMap\nLinearMap\nConstrainedLinearMap\nAffineMap\nConstrainedAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap\nResetMap\nConstrainedResetMap","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractMap","page":"Types","title":"MathematicalSystems.AbstractMap","text":"AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IdentityMap","page":"Types","title":"MathematicalSystems.IdentityMap","text":"IdentityMap\n\nAn identity map,\n\n x x\n\nFields\n\ndim – dimension\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedIdentityMap","page":"Types","title":"MathematicalSystems.ConstrainedIdentityMap","text":"ConstrainedIdentityMap\n\nAn identity map with state constraints of the form:\n\n x x x(t) mathcalX\n\nFields\n\ndim – dimension\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearMap","page":"Types","title":"MathematicalSystems.LinearMap","text":"LinearMap\n\nA linear map,\n\n x Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearMap","text":"ConstrainedLinearMap\n\nA linear map with state constraints of the form:\n\n x Ax x(t) mathcalX\n\nFields\n\nA – matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineMap","page":"Types","title":"MathematicalSystems.AffineMap","text":"AffineMap\n\nAn affine map,\n\n x Ax + c\n\nFields\n\nA – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineMap","text":"ConstrainedAffineMap\n\nAn affine map with state constraints of the form:\n\n x Ax + c x(t) mathcalX\n\nFields\n\nA – matrix\nc – vector\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlMap","page":"Types","title":"MathematicalSystems.LinearControlMap","text":"LinearControlMap\n\nA linear control map,\n\n (x u) Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlMap","text":"ConstrainedLinearControlMap\n\nA linear control map with state and input constraints,\n\n (x u) Ax + Bu x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlMap","page":"Types","title":"MathematicalSystems.AffineControlMap","text":"AffineControlMap\n\nAn affine control map,\n\n (x u) Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlMap","text":"ConstrainedAffineControlMap\n\nAn affine control map with state and input constraints,\n\n (x u) Ax + Bu + c x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ResetMap","page":"Types","title":"MathematicalSystems.ResetMap","text":"ResetMap\n\nA reset map,\n\n x R(x)\n\nsuch that a subset of the variables is given a specified value, and the rest are unchanged.\n\nFields\n\ndim – dimension\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedResetMap","page":"Types","title":"MathematicalSystems.ConstrainedResetMap","text":"ConstrainedResetMap\n\nA reset map with state constraints of the form:\n\n x R(x) x mathcalX\n\nsuch that the specified variables are assigned a given value, and the remaining variables are unchanged.\n\nFields\n\ndim – dimension\nX – state constraints\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Macros-1","page":"Types","title":"Macros","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@map","category":"page"},{"location":"lib/types/#MathematicalSystems.@map","page":"Types","title":"MathematicalSystems.@map","text":"map(ex, args)\n\nReturn an instance of the map type corresponding to the given expression.\n\nInput\n\nex – an expression defining the map, in the form of an anonymous function\nargs – additional optional arguments\n\nOutput\n\nA map that best matches the given expression.\n\nExamples\n\nLet us first create a linear map using this macro:\n\njulia> @map x -> [1 0; 0 0]*x\nLinearMap{Int64,Array{Int64,2}}([1 0; 0 0])\n\nWe can create an affine system as well:\n\njulia> @map x -> [1 0; 0 0]*x + [2, 0]\nAffineMap{Int64,Array{Int64,2},Array{Int64,1}}([1 0; 0 0], [2, 0])\n\nAdditional 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:\n\njulia> @map(x -> x, dim=5)\nIdentityMap(5)\n\nA state constraint on such map can be specified passing the additional argument x ∈ X.\n\nAn identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:\n\njulia> @map x -> I(5)*x\nIdentityMap(5)\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Systems-with-output-1","page":"Types","title":"Systems with output","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem","category":"page"},{"location":"lib/types/#MathematicalSystems.SystemWithOutput","page":"Types","title":"MathematicalSystems.SystemWithOutput","text":"SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap}\n\nParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearTimeInvariantSystem","page":"Types","title":"MathematicalSystems.LinearTimeInvariantSystem","text":"LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.LTISystem","page":"Types","title":"MathematicalSystems.LTISystem","text":"LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n","category":"function"},{"location":"#MathematicalSystems.jl-1","page":"Home","title":"MathematicalSystems.jl","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]","category":"page"},{"location":"#","page":"Home","title":"Home","text":"MathematicalSystems is a Julia package for mathematical systems interfaces.","category":"page"},{"location":"#Features-1","page":"Home","title":"Features","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled, linear algebraic, etc.\nIterator interfaces to handle constant or time-varying inputs.","category":"page"},{"location":"#Library-Outline-1","page":"Home","title":"Library Outline","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Pages = [\n \"lib/types.md\",\n \"lib/methods.md\",\n \"lib/internals.md\"\n]\nDepth = 2","category":"page"},{"location":"lib/methods/#Methods-1","page":"Methods","title":"Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"This section describes systems methods implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"Pages = [\"methods.md\"]\nDepth = 3","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/methods/#States-1","page":"Methods","title":"States","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"statedim\nstateset","category":"page"},{"location":"lib/methods/#MathematicalSystems.statedim","page":"Methods","title":"MathematicalSystems.statedim","text":"statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.stateset","page":"Methods","title":"MathematicalSystems.stateset","text":"stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Inputs-1","page":"Methods","title":"Inputs","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"inputdim\ninputset\nnextinput","category":"page"},{"location":"lib/methods/#MathematicalSystems.inputdim","page":"Methods","title":"MathematicalSystems.inputdim","text":"inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.inputset","page":"Methods","title":"MathematicalSystems.inputset","text":"inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.nextinput","page":"Methods","title":"MathematicalSystems.nextinput","text":"nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Output-1","page":"Methods","title":"Output","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"outputdim\noutputmap","category":"page"},{"location":"lib/methods/#MathematicalSystems.outputdim","page":"Methods","title":"MathematicalSystems.outputdim","text":"outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.outputmap","page":"Methods","title":"MathematicalSystems.outputmap","text":"outputmap(s::SystemWithOutput)\n\nReturns the output map of a system with output.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Traits-1","page":"Methods","title":"Traits","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"islinear(::AbstractSystem)\nislinear(::AbstractMap)\nisaffine(::AbstractSystem)\nispolynomial(::AbstractSystem)\nisaffine(::AbstractMap)\nisnoisy(::AbstractSystem)\niscontrolled(::AbstractSystem)\nisconstrained(::AbstractSystem)\nstate_matrix(::AbstractSystem)\ninput_matrix(::AbstractSystem)\nnoise_matrix(::AbstractSystem)\naffine_term(::AbstractSystem)","category":"page"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by linear equations.\n\nNotes\n\nWe 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 mathbbR. 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).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(m::AbstractMap)\n\nSpecifies if the map m is linear or not.\n\nNotes\n\nA map is linear if it preserves the operations of scalar multiplication and vector addition.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by affine equations.\n\nNotes\n\nAn 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.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.ispolynomial-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.ispolynomial","text":"ispolynomial(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by polynomial equations.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(m::AbstractMap)\n\nSpecifies if the map m is affine or not.\n\nNotes\n\nAn affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isnoisy-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isnoisy","text":"isnoisy(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a noise term w.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.iscontrolled-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.iscontrolled","text":"iscontrolled(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a control input u.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isconstrained-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isconstrained","text":"isconstrained(s::AbstractSystem)\n\nDetermines if the system s has constraints on the state, input and noise, respectively (those that are available).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.state_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.state_matrix","text":"state_matrix(::AbstractSystem)\n\nReturn the state matrix of an affine system.\n\nNotes\n\nThe state matrix is the matrix proportional to the state, e.g. the matrix A in the linear continuous system x = Ax.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.input_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.input_matrix","text":"input_matrix(::AbstractSystem)\n\nReturn the input matrix of a system with linear input.\n\nNotes\n\nThe input matrix is the matrix proportional to the input, e.g. the matrix B in the linear continuous system with input, x = Ax + Bu.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.noise_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.noise_matrix","text":"noise_matrix(::AbstractSystem)\n\nReturn the noise matrix of a system with linear noise.\n\nNotes\n\nThe noise matrix is the matrix proportional to the noise, e.g. the matrix D in the linear system with noise, x = Ax + Dw.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.affine_term-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.affine_term","text":"affine_term(::AbstractSystem)\n\nReturn the affine term in an affine system.\n\nNotes\n\nThe affine term is e.g. the vector c in the affine system x = Ax + c.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#Maps-1","page":"Methods","title":"Maps","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"apply","category":"page"},{"location":"lib/methods/#MathematicalSystems.apply","page":"Methods","title":"MathematicalSystems.apply","text":"apply(m::AbstractMap, args...)\n\nApply the rule specified by the map to the given arguments.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Successor-1","page":"Methods","title":"Successor","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"successor","category":"page"},{"location":"lib/methods/#MathematicalSystems.successor","page":"Methods","title":"MathematicalSystems.successor","text":"successor(system::DiscreteIdentitySystem, x::AbstractVector)\n\nReturn the successor state of a DiscreteIdentitySystem.\n\nInput\n\nsystem – DiscreteIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::ConstrainedDiscreteIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedDiscreteIdentitySystem.\n\nInput\n\nsystem – ConstrainedDiscreteIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::LinearDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a LinearDiscreteSystem.\n\nInput\n\nsystem – LinearDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::AffineDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a AffineDiscreteSystem.\n\nInput\n\nsystem – AffineDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::LinearControlDiscreteSystem, x::AbstractVector, u::AbstractVector)\n\nReturn the successor state of a LinearControlDiscreteSystem.\n\nInput\n\nsystem – LinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineDiscreteSystem, x::AbstractVector;\n [check_constraints])\n\nReturn the successor state of a ConstrainedAffineDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedLinearControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::ConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::BlackBoxDiscreteSystem, x::AbstractVector)\n\nReturn the successor state of a BlackBoxDiscreteSystem.\n\nInput\n\nsystem – BlackBoxDiscreteSystem\nx – state (it should be any vector type)\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x.\n\n\n\n\n\nsuccessor(system::ConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a ConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – ConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearDiscreteSystem, x::AbstractVector,\n w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearDiscreteSystem\nx – state (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedLinearControlDiscreteSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedLinearControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedLinearControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedAffineControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedAffineControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedAffineControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state (resp. input) belongs to the state set (resp. input set)\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\nsuccessor(system::NoisyConstrainedBlackBoxControlDiscreteSystem, x::AbstractVector,\n u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of a NoisyConstrainedBlackBoxControlDiscreteSystem.\n\nInput\n\nsystem – NoisyConstrainedBlackBoxControlDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to x, with input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Discretization-1","page":"Methods","title":"Discretization","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"discretize","category":"page"},{"location":"lib/methods/#MathematicalSystems.discretize","page":"Methods","title":"MathematicalSystems.discretize","text":"discretize(system::AbstractContinuousSystem, ΔT::Real,\n algorithm::AbstractDiscretizationAlgorithm=ExactDiscretization(),\n constructor=_default_complementary_constructor(system))\n\nDiscretization of a isaffine AbstractContinuousSystem to a AbstractDiscreteSystem with sampling time ΔT using the discretization method algorithm.\n\nInput\n\nsystem – an affine continuous system\nΔT – sampling time\nalgorithm – (optional, default: ExactDiscretization()) discretization algorithm\nconstructor – (optional, default: _default_complementary_constructor(system)) construction method\n\nOutput\n\nReturns a discretization of the input system system with discretization method algorithm and sampling time ΔT.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Internal-Methods-1","page":"Methods","title":"Internal Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"_discretize\ntypename(::AbstractSystem)\n_complementary_type(::Type{<:AbstractSystem})","category":"page"},{"location":"lib/methods/#MathematicalSystems._discretize","page":"Methods","title":"MathematicalSystems._discretize","text":"_discretize(::AbstractDiscretizationAlgorithm, ΔT::Real\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nImplementation of the discretization algorithm defined by the first input argument with sampling time ΔT.\n\nInput\n\n`` – discretization algorithm, used for dispatch\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B, c and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(A::AbstractMatrix, ΔT::Real; algorithm=:exact)\n\nDiscretize the state matrix A with sampling time ΔT and discretization method algorithm.\n\nInput\n\nA – state matrix\nΔT – sampling time\nalgorithm – (optional, default: :exact) discretization algorithm\n\nOutput\n\nReturns a vector containing the discretized input argument A.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix)\n\nDiscretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input or noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A and B.\n\nNotes\n\nThis method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix,c::AbstractVector)\n\nDiscretize the state matrix A and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector)\n\nDiscretize the state matrix A, input matrix B and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, D::AbstractMatrix)\n\nDiscretize the state matrix A, input matrix B and noise matrix C with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.typename-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.typename","text":"typename(system::AbstractSystem)\n\nReturns the base type of system without parameter information.\n\nInput\n\nsystem – AbstractSystem\n\nOutput\n\nThe base type of system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems._complementary_type-Tuple{Type{#s5} where #s5<:AbstractSystem}","page":"Methods","title":"MathematicalSystems._complementary_type","text":"_complementary_type(system_type::Type{<:AbstractSystem})\n\nReturn the complementary type of a system type system_type.\n\nInput\n\nsystem_type – type of AbstractSystem\n\nOuput\n\nReturn complementary type of system_type.\n\nNotes\n\nThere are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.\n\nTo get the complementary type of system type, use _complementary_type(typename(system)).\n\n\n\n\n\n","category":"method"}]
+}
diff --git a/v0.11.5/siteinfo.js b/v0.11.5/siteinfo.js
new file mode 100644
index 00000000..0bba6808
--- /dev/null
+++ b/v0.11.5/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.11.5";
diff --git a/v0.11.6/about/index.html b/v0.11.6/about/index.html
new file mode 100644
index 00000000..53f1576e
--- /dev/null
+++ b/v0.11.6/about/index.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
Return the system type whose field names match those in fields.
Input
AT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem
fields – tuple of field names
Output
The system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.
Extract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.
For the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list
(:A_user, :A)
(:B_user, :B)
(:c_user, :c)
(:D_user, :D)
(:f_user, :f)
(:statedim_user :statedim)
(:inputdim_user :inputdim)
(:noisedim_user :noisedim)
and for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.
Input
equation – dynamic equation
state – state variable
input – input variable
noise – noise variable
dim – dimensionality
AT – abstract system type
Output
Two arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.
Checks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.
Return true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.
Input
expr – expression
Output
A Bool indicating whether expr is an equation or not.
If an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.
If an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.
Similiarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.
Return the result of instantiating an AbstractSystem at the current state.
Input
system – AbstractSystem
x – state (it should be any vector type)
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x.
Notes
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Return the result of instantiating an AbstractSystem at the current state and applying one input.
Input
system – AbstractSystem
x – state (it should be any vector type)
u – input (it should be any vector type) or noise, if system is not controlled
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x and input u.
Notes
If the system is not controlled but noisy, the input u is interpreted as noise.
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Return the result of instantiating an AbstractSystem at the current state and applying two inputs to an AbstractSystem.
Input
system – AbstractSystem
x – state (it should be any vector type)
u – input (it should be any vector type)
w – noise (it should be any vector type)
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x, input u and noise w.
Notes
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.
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)$.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
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.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Specifies if the dynamics of system s is specified by polynomial equations.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.
Discretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.
Input
algorithm – discretization algorithm
ΔT – sampling time
A – state matrix
B – input or noise matrix
Output
Returns a vector containing the discretized input arguments A and B.
Notes
This method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).
Return the complementary type of a system type system_type.
Input
system_type – type of AbstractSystem
Ouput
Return complementary type of system_type.
Notes
There are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.
To get the complementary type of system type, use _complementary_type(typename(system)).
Abstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
Exact 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].
Euler 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].
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 + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.
If the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.
Systems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
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.5]');
+
+julia> c = [1., 1.5];
+
+julia> X = BallInf(zeros(2), 10.);
+
+julia> U = BallInf(zeros(1), 2.);
+
+julia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)
+ConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([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,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))
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).
A scalar multiple of the identity matrix of given order and numeric type.
Fields
M – uniform scaling operator of type T
n – 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 AbstractMatix, 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
The easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:
julia> using MathematicalSystems: IdentityMultiple
+
+julia> I2 = I(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 2
The numeric type (default Float64) can be passed as a second argument:
julia> I2r = I(2, Rational{Int})
+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 2
To create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:
julia> I2 = I(2.0, 2)
+IdentityMultiple{Float64} of value 2.0 and order 2
+
+julia> I2r = I(2//1, 2)
+IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
Or use the constructor passing the UniformScaling (I):
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 2
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.
Type 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:
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 I(n), for example:
diff --git a/v0.11.6/search_index.js b/v0.11.6/search_index.js
new file mode 100644
index 00000000..0a689580
--- /dev/null
+++ b/v0.11.6/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"lib/internals/#Internals-1","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"This section describes functions that are internal to the library.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]\nDepth = 3","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/internals/#Expression-handling-1","page":"Internals","title":"Expression handling","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"_corresponding_type\n_capture_dim\nextract_dyn_equation_parameters\nadd_asterisk\nsort","category":"page"},{"location":"lib/internals/#MathematicalSystems._corresponding_type","page":"Internals","title":"MathematicalSystems._corresponding_type","text":"_corresponding_type(AT::Type{<:AbstractSystem}, fields::Tuple)\n\nReturn the system type whose field names match those in fields.\n\nInput\n\nAT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem\nfields – tuple of field names\n\nOutput\n\nThe system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.\n\nExamples\n\njulia> using MathematicalSystems: _corresponding_type\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A),))\nLinearContinuousSystem\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A), (:B), (:X), (:U)))\nConstrainedLinearControlContinuousSystem\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._capture_dim","page":"Internals","title":"MathematicalSystems._capture_dim","text":"_capture_dim(expr)\n\nReturn the tuple containing the dimension(s) in expr.\n\nInput\n\nexpr – symbolic expression that can be of any of the following forms:\n:x or :(x) – state dimension\n:(x, u) – state and input dimension\n:(x, u, w) – state, input and noise dimensions\n\nOutput\n\nThe scalar x if expr specifies the state dimension.\nThe vector [x, u] if expr specifies state and input dimension.\nThe vector [x, u, w] if expr specifies state, input and noise dimensions.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_dyn_equation_parameters","page":"Internals","title":"MathematicalSystems.extract_dyn_equation_parameters","text":"extract_dyn_equation_parameters(equation, state, input, noise, dim, AT)\n\nExtract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.\n\nFor the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list\n\n(:A_user, :A)\n(:B_user, :B)\n(:c_user, :c)\n(:D_user, :D)\n(:f_user, :f)\n(:statedim_user :statedim)\n(:inputdim_user :inputdim)\n(:noisedim_user :noisedim)\n\nand for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.\n\nInput\n\nequation – dynamic equation\nstate – state variable\ninput – input variable\nnoise – noise variable\ndim – dimensionality\nAT – abstract system type\n\nOutput\n\nTwo arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.add_asterisk","page":"Internals","title":"MathematicalSystems.add_asterisk","text":"add_asterisk(summand, state::Symbol, input::Symbol, noise::Symbol)\n\nChecks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.\n\nInput\n\nsummand – expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nMultiplication expression or symbol.\n\nExample\n\njulia> using MathematicalSystems: add_asterisk\n\njulia> add_asterisk(:(A1*x), :x, :u, :w)\n:(A1 * x)\n\njulia> add_asterisk(:(c1), :x, :u, :w)\n:c1\n\njulia> add_asterisk(:(Ax1), :x1, :u, :w)\n:(A * x1)\n\njulia> add_asterisk(:(Awb), :x1, :u, :wb)\n:(A * wb)\n\njulia> add_asterisk(:(A1u), :x, :u, :w)\n:(A1 * u)\n\njulia> add_asterisk(:(A1ub), :x, :u, :w)\n:A1ub\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Base.sort","page":"Internals","title":"Base.sort","text":"sort(parameters::Vector, order::Tuple)\n\nFilter and sort the vector parameters according to order.\n\nInput\n\nparameters – vector of tuples\norder – tuple of symbols\n\nOutput\n\nA new vector of tuples corresponding to parameters filtered and sorted according to order.\n\nExamples\n\njulia> parameters= [(:U1, :U), (:X1, :X), (:W1, :W)];\n\njulia> sort(parameters, (:X, :U, :W))\n3-element Array{Tuple{Any,Symbol},1}:\n (:X1, :X)\n (:U1, :U)\n (:W1, :W)\n\njulia> parameters = [(:const, :c), (:A, :A)];\n\njulia> sort(parameters, (:A, :B, :c, :D))\n2-element Array{Tuple{Any,Symbol},1}:\n (:A, :A)\n (:const, :c)\n\nNotes\n\nparameters is a vector that contains tuples whose second element is considered for the sorting according to order.\n\nIf a value of order is not contained in parameters, the corresponding entry of order will be omitted.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Querying-expressions-1","page":"Internals","title":"Querying expressions","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"is_equation\nextract_sum","category":"page"},{"location":"lib/internals/#MathematicalSystems.is_equation","page":"Internals","title":"MathematicalSystems.is_equation","text":"is_equation(expr)\n\nReturn true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.\n\nInput\n\nexpr – expression\n\nOutput\n\nA Bool indicating whether expr is an equation or not.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_sum","page":"Internals","title":"MathematicalSystems.extract_sum","text":"extract_sum(summands, state::Symbol, input::Symbol, noise::Symbol)\n\nExtract the variable name and field name for every element of summands which corresponds to the elements of the right-hand side of an affine system.\n\nInput\n\nsummands – array of expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nArray of tuples of symbols with variable name and field name.\n\nExample\n\njulia> using MathematicalSystems: extract_sum\n\njulia> extract_sum([:(A1*x)], :x, :u, :w)\n1-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n\njulia> extract_sum([:(A1*x), :(B1*u), :c], :x, :u, :w)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(vcat(c)), :c)\n\njulia> extract_sum([:(A1*x7), :( B1*u7), :( B2*w7)], :x7, :u7, :w7)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(hcat(B2)), :D)\n\nNotes\n\nIf an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.\n\nIf an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.\n\nSimiliarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Evaluation-of-AbstractSystem-at-given-state-1","page":"Internals","title":"Evaluation of AbstractSystem at given state","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"_instantiate","category":"page"},{"location":"lib/internals/#MathematicalSystems._instantiate","page":"Internals","title":"MathematicalSystems._instantiate","text":"_instantiate(system::AbstractSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x.\n\nNotes\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n_instantiate(system::AbstractSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state and applying one input.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x and input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n_instantiate(system::AbstractSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state and applying two inputs to an AbstractSystem.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x, input u and noise w.\n\nNotes\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Naming-convention-for-systems'-fields-1","page":"Internals","title":"Naming convention for systems' fields","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Field Description Getter function\nA state matrix state_matrix\nB input matrix input_matrix\nc affine term affine_term\nD noise matrix noise_matrix\nX state constraints stateset\nU input constraints inputset\nW disturbance set noiseset","category":"page"},{"location":"about/#About-1","page":"About","title":"About","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This page contains some general information about this project, and recommendations about contributing.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Pages = [\"about.md\"]","category":"page"},{"location":"about/#Contributing-1","page":"About","title":"Contributing","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.","category":"page"},{"location":"about/#Branches-and-pull-requests-(PR)-1","page":"About","title":"Branches and pull requests (PR)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.","category":"page"},{"location":"about/#Unit-testing-and-continuous-integration-(CI)-1","page":"About","title":"Unit testing and continuous integration (CI)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes test/runtests.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Alternatively, you can achieve the same from inside the REPL using the following command:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> Pkg.test(\"MathematicalSystems\")","category":"page"},{"location":"about/#","page":"About","title":"About","text":"We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.","category":"page"},{"location":"about/#Contributing-to-the-documentation-1","page":"About","title":"Contributing to the documentation","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"New functions and types should be documented according to our guidelines directly in the source code.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> ?LinearContinuousSystem","category":"page"},{"location":"about/#","page":"About","title":"About","text":"This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).","category":"page"},{"location":"about/#","page":"About","title":"About","text":"To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes docs/make.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Note that this also runs all doctests which will take some time.","category":"page"},{"location":"about/#Related-projects-1","page":"About","title":"Related projects","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below we list more related projects.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia","category":"page"},{"location":"about/#Credits-1","page":"About","title":"Credits","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"These persons have contributed to MathematicalSystems.jl (in alphabetic order):","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Marcelo Forets\nBenoît Legat\nChristian Schilling\nUeli Wechsler","category":"page"},{"location":"lib/types/#Types-1","page":"Types","title":"Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"This section describes systems types implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"Pages = [\"types.md\"]\nDepth = 3","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/types/#Abstract-Systems-1","page":"Types","title":"Abstract Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractSystem","page":"Types","title":"MathematicalSystems.AbstractSystem","text":"AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractContinuousSystem","page":"Types","title":"MathematicalSystems.AbstractContinuousSystem","text":"AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractDiscreteSystem","page":"Types","title":"MathematicalSystems.AbstractDiscreteSystem","text":"AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Continuous-Systems-1","page":"Types","title":"Continuous Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem\nBlackBoxContinuousSystem\nConstrainedBlackBoxContinuousSystem\nBlackBoxControlContinuousSystem\nConstrainedBlackBoxControlContinuousSystem\nNoisyLinearContinuousSystem\nNoisyConstrainedLinearContinuousSystem\nNoisyLinearControlContinuousSystem\nNoisyConstrainedLinearControlContinuousSystem\nNoisyAffineControlContinuousSystem\nNoisyConstrainedAffineControlContinuousSystem\nNoisyBlackBoxControlContinuousSystem\nNoisyConstrainedBlackBoxControlContinuousSystem\nSecondOrderLinearContinuousSystem\nSecondOrderAffineContinuousSystem\nSecondOrderConstrainedAffineControlContinuousSystem\nSecondOrderConstrainedLinearControlContinuousSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.ContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ContinuousIdentitySystem","text":"ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form:\n\n x(t) = 0 forall t\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedContinuousIdentitySystem","text":"ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with domain constraints of the form:\n\n x(t) = 0 x(t) mathcalX forall t\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearContinuousSystem","page":"Types","title":"MathematicalSystems.LinearContinuousSystem","text":"LinearContinuousSystem\n\nContinuous-time linear system of the form:\n\n x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineContinuousSystem","page":"Types","title":"MathematicalSystems.AffineContinuousSystem","text":"AffineContinuousSystem\n\nContinuous-time affine system of the form:\n\n x(t) = A x(t) + c forall t\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.LinearControlContinuousSystem","text":"LinearControlContinuousSystem\n\nContinuous-time linear control system of the form:\n\n x(t) = A x(t) + B u(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearContinuousSystem","text":"ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineContinuousSystem","text":"ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with domain constraints of the form:\n\n x(t) = A x(t) + c x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlContinuousSystem","text":"ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlContinuousSystem","text":"ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicContinuousSystem","text":"LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form:\n\n E x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","text":"ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n E x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.PolynomialContinuousSystem","text":"PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form:\n\n x(t) = p(x(t)) forall t\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialContinuousSystem","text":"ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with domain constraints:\n\n x(t) = p(x(t)) x(t) mathcalX forall t\n\nFields\n\np – polynomial vector field\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxContinuousSystem","text":"BlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side of the form:\n\n x(t) = f(x(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxContinuousSystem","text":"ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t)) x(t) mathcalX forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlContinuousSystem","text":"BlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","text":"ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t)) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearContinuousSystem","text":"NoisyLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance of the form:\n\n x(t) = A x(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearContinuousSystem","text":"NoisyConstrainedLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + D w(t) x(t) mathcalX w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlContinuousSystem","text":"NoisyLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","text":"NoisyConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlContinuousSystem","text":"NoisyAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","text":"NoisyConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlContinuousSystem","text":"NoisyBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t) w(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","text":"NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t) w(t)) quad x(t) mathcalX quad u(t) mathcalU quad w(t) mathcalW quad forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderLinearContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderLinearContinuousSystem","text":"SecondOrderLinearContinuousSystem\n\nContinuous-time second order linear system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = 0 forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderAffineContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderAffineContinuousSystem","text":"SecondOrderAffineContinuousSystem\n\nContinuous-time second order affine system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = b forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nb – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem","text":"SecondOrderConstrainedAffineControlContinuousSystem\n\nContinuous-time second order constrained affine control system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = Bu(t) + d x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nd – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem","text":"SecondOrderConstrainedLinearControlContinuousSystem\n\nContinuous-time second order constrained linear control system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = Bu(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discrete-Systems-1","page":"Types","title":"Discrete Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nAffineDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedAffineDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nConstrainedAffineControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem\nBlackBoxDiscreteSystem\nConstrainedBlackBoxDiscreteSystem\nBlackBoxControlDiscreteSystem\nConstrainedBlackBoxControlDiscreteSystem\nNoisyLinearDiscreteSystem\nNoisyConstrainedLinearDiscreteSystem\nNoisyLinearControlDiscreteSystem\nNoisyConstrainedLinearControlDiscreteSystem\nNoisyAffineControlDiscreteSystem\nNoisyConstrainedAffineControlDiscreteSystem\nNoisyBlackBoxControlDiscreteSystem\nNoisyConstrainedBlackBoxControlDiscreteSystem\nSecondOrderLinearDiscreteSystem\nSecondOrderAffineDiscreteSystem\nSecondOrderConstrainedAffineControlDiscreteSystem\nSecondOrderConstrainedLinearControlDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.DiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.DiscreteIdentitySystem","text":"DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form:\n\n x_k+1 = x_k forall k\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedDiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedDiscreteIdentitySystem","text":"ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with domain constraints of the form:\n\n x_k+1 = x_k x_k mathcalX forall k\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDiscreteSystem","text":"LinearDiscreteSystem\n\nDiscrete-time linear system of the form:\n\n x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineDiscreteSystem","text":"AffineDiscreteSystem\n\nDiscrete-time affine system of the form:\n\n x_k+1 = A x_k + c forall k\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearControlDiscreteSystem","text":"LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form:\n\n x_k+1 = A x_k + B u_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDiscreteSystem","text":"ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineDiscreteSystem","text":"ConstrainedAffineDiscreteSystem\n\nDiscrete-time affine system with domain constraints of the form:\n\n x_k+1 = A x_k + c x_k mathcalX forall k\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlDiscreteSystem","text":"ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlDiscreteSystem","text":"ConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicDiscreteSystem","text":"LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form:\n\n E x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","text":"ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n E x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.PolynomialDiscreteSystem","text":"PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form:\n\n x_k+1 = p(x_k) forall k\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialDiscreteSystem","text":"ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with domain constraints:\n\n x_k+1 = p(x_k) x_k mathcalX forall k\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxDiscreteSystem","text":"BlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","text":"ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k) x_k mathcalX forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlDiscreteSystem","text":"BlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","text":"ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearDiscreteSystem","text":"NoisyLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance of the form:\n\n x_k+1 = A x_k + D w_k forall k\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","text":"NoisyConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + D w_k x_k mathcalX w(t) mathcalW forall k\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlDiscreteSystem","text":"NoisyLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","text":"NoisyConstrainedLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlDiscreteSystem","text":"NoisyAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","text":"NoisyConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","text":"NoisyBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","text":"NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) quad x_k mathcalX quad u_k mathcalU quad w_k mathcalW quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderLinearDiscreteSystem","text":"SecondOrderLinearDiscreteSystem\n\nDiscrete-time second order linear system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = 0 forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderAffineDiscreteSystem","text":"SecondOrderAffineDiscreteSystem\n\nDiscrete-time second order affine system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = b forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nb – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem","text":"SecondOrderConstrainedAffineControlDiscreteSystem\n\nDiscrete-time second order constrained affine control system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = Bu_k + d x_k mathcalX u_k mathcalU forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nd – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem","text":"SecondOrderConstrainedLinearControlDiscreteSystem\n\nDiscrete-time second order constrained linear control system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = Bu_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discretization-Algorithms-1","page":"Types","title":"Discretization Algorithms","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractDiscretizationAlgorithm\nExactDiscretization\nEulerDiscretization","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractDiscretizationAlgorithm","page":"Types","title":"MathematicalSystems.AbstractDiscretizationAlgorithm","text":"AbstractDiscretizationAlgorithm\n\nAbstract supertype for all discretization algorithms.\n\nNote\n\nFor implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method\n\n_discretize(::NewDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nare required.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ExactDiscretization","page":"Types","title":"MathematicalSystems.ExactDiscretization","text":"ExactDiscretization <: AbstractDiscretizationAlgorithm\n\nExact discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Discretizationoflinearstatespace_models\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.EulerDiscretization","page":"Types","title":"MathematicalSystems.EulerDiscretization","text":"EulerDiscretization <: AbstractDiscretizationAlgorithm\n\nEuler discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Approximations\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#System-macro-1","page":"Types","title":"System macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@system","category":"page"},{"location":"lib/types/#MathematicalSystems.@system","page":"Types","title":"MathematicalSystems.@system","text":"system(expr...)\n\nReturn an instance of the system type corresponding to the given expressions.\n\nInput\n\nexpr – expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system\n\nOutput\n\nA system that best matches the given expressions.\n\nNotes\n\nTerms. The expression expr contains one or more of the following sub-expressions:\n\ndynamic equation, either continuous, e.g.x' = Ax, or discrete, e.g. x⁺ = Ax\nset constraints, e.g. x ∈ X\ninput constraints, e.g. u ∈ U\ndimensionality, e.g. dim: (2,1) or dim = 1\nspecification of the input variable, e.g. input: u or input = u\nspecification of the noise variable, e,g, noise: w or noise = w\n\nThe macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:\n\n@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)\n\nThe 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.\n\nDynamic 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.\n\nDefault 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.\n\nExceptions. The following exceptions and particular cases apply:\n\nIf the right-hand side has the form A*x + B*foo, A*x + B*foo + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.\nIf the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.\nSystems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.\n\nExamples\n\nLet us first create a continuous linear system using this macro:\n\njulia> A = [1. 0; 0 1.];\n\njulia> @system(x' = A*x)\nLinearContinuousSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nA discrete system is defined by using ⁺:\n\njulia> @system(x⁺ = A*x)\nLinearDiscreteSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nAdditionally, 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:\n\njulia> using LazySets\n\njulia> B = Matrix([1. 0.5]');\n\njulia> c = [1., 1.5];\n\njulia> X = BallInf(zeros(2), 10.);\n\njulia> U = BallInf(zeros(1), 2.);\n\njulia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)\nConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\nFor 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\n\njulia> f(x, u) = x + u;\n\njulia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))\nConstrainedBlackBoxControlDiscreteSystem{typeof(f),BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Initial-value-problem-macro-1","page":"Types","title":"Initial-value problem macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@ivp","category":"page"},{"location":"lib/types/#MathematicalSystems.@ivp","page":"Types","title":"MathematicalSystems.@ivp","text":"ivp(expr...)\n\nReturn an instance of the initial-value problem type corresponding to the given expressions.\n\nInput\n\nexpr – 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)\n\nOutput\n\nAn initial-value problem that best matches the given expressions.\n\nNotes\n\nThis 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.\n\nThe macro can also be called with a system argument of type AbstractSystem in the form @ivp(system, state(0) ∈ initial_set).\n\nExamples\n\njulia> p = @ivp(x' = -x, x(0) ∈ [1.0]);\n\njulia> typeof(p)\nInitialValueProblem{LinearContinuousSystem{Float64,IdentityMultiple{Float64}},Array{Float64,1}}\n\njulia> initial_state(p)\n1-element Array{Float64,1}:\n 1.0\n\njulia> sys = @system(x' = [1 0; 0 1] * x);\n\njulia> @ivp(sys, x(0) ∈ [-1, 1])\nInitialValueProblem{LinearContinuousSystem{Int64,Array{Int64,2}},Array{Int64,1}}(LinearContinuousSystem{Int64,Array{Int64,2}}([1 0; 0 1]), [-1, 1])\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Identity-operator-1","page":"Types","title":"Identity operator","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"IdentityMultiple","category":"page"},{"location":"lib/types/#MathematicalSystems.IdentityMultiple","page":"Types","title":"MathematicalSystems.IdentityMultiple","text":"IdentityMultiple{T} < AbstractMatrix{T} where T\n\nA scalar multiple of the identity matrix of given order and numeric type.\n\nFields\n\nM – uniform scaling operator of type T\nn – size of the identity matrix\n\nNotes\n\nThis 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.\n\nInternally, the type wraps Julia's lazy multiple of the identity operator, UniformScaling. IdentityMultiple subtypes AbstractMatix, hence it can be used in usual matrix arithmetic and for dispatch on AbstractMatrix.\n\nThe difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.\n\nExamples\n\nThe easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:\n\njulia> using MathematicalSystems: IdentityMultiple\n\njulia> I2 = I(2)\nIdentityMultiple{Float64} of value 1.0 and order 2\n\njulia> I2 + I2\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> 4*I2\nIdentityMultiple{Float64} of value 4.0 and order 2\n\nThe numeric type (default Float64) can be passed as a second argument:\n\njulia> I2r = I(2, Rational{Int})\nIdentityMultiple{Rational{Int64}} of value 1//1 and order 2\n\njulia> I2r + I2r\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\njulia> 4*I2r\nIdentityMultiple{Rational{Int64}} of value 4//1 and order 2\n\nTo create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:\n\njulia> I2 = I(2.0, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = I(2//1, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\nOr use the constructor passing the UniformScaling (I):\n\njulia> I2 = IdentityMultiple(2.0*I, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = IdentityMultiple(2//1*I, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Initial-Value-Problems-1","page":"Types","title":"Initial Value Problems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"InitialValueProblem\nIVP\ninitial_state\nsystem","category":"page"},{"location":"lib/types/#MathematicalSystems.InitialValueProblem","page":"Types","title":"MathematicalSystems.InitialValueProblem","text":"InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystem\n\nParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x₀ = -12 12:\n\njulia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);\n\njulia> x₀ = [-1/2, 1/2];\n\njulia> p = InitialValueProblem(s, x₀);\n\njulia> initial_state(p) # same as p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IVP","page":"Types","title":"MathematicalSystems.IVP","text":"IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.initial_state","page":"Types","title":"MathematicalSystems.initial_state","text":"initial_state(ivp::InitialValueProblem)\n\nReturn the initial state of an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe initial state of an initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.system","page":"Types","title":"MathematicalSystems.system","text":"system(ivp::InitialValueProblem)\n\nReturn the system wrapped by an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe system of the given initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Input-Types-1","page":"Types","title":"Input Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractInput\nConstantInput\nVaryingInput","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractInput","page":"Types","title":"MathematicalSystems.AbstractInput","text":"AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstantInput","page":"Types","title":"MathematicalSystems.ConstantInput","text":"ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.VaryingInput","page":"Types","title":"MathematicalSystems.VaryingInput","text":"VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase's iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64},Array{Rational{Int64},1}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Maps-1","page":"Types","title":"Maps","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractMap\nIdentityMap\nConstrainedIdentityMap\nLinearMap\nConstrainedLinearMap\nAffineMap\nConstrainedAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap\nResetMap\nConstrainedResetMap","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractMap","page":"Types","title":"MathematicalSystems.AbstractMap","text":"AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IdentityMap","page":"Types","title":"MathematicalSystems.IdentityMap","text":"IdentityMap\n\nAn identity map,\n\n x x\n\nFields\n\ndim – dimension\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedIdentityMap","page":"Types","title":"MathematicalSystems.ConstrainedIdentityMap","text":"ConstrainedIdentityMap\n\nAn identity map with state constraints of the form:\n\n x x x(t) mathcalX\n\nFields\n\ndim – dimension\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearMap","page":"Types","title":"MathematicalSystems.LinearMap","text":"LinearMap\n\nA linear map,\n\n x Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearMap","text":"ConstrainedLinearMap\n\nA linear map with state constraints of the form:\n\n x Ax x(t) mathcalX\n\nFields\n\nA – matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineMap","page":"Types","title":"MathematicalSystems.AffineMap","text":"AffineMap\n\nAn affine map,\n\n x Ax + c\n\nFields\n\nA – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineMap","text":"ConstrainedAffineMap\n\nAn affine map with state constraints of the form:\n\n x Ax + c x(t) mathcalX\n\nFields\n\nA – matrix\nc – vector\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlMap","page":"Types","title":"MathematicalSystems.LinearControlMap","text":"LinearControlMap\n\nA linear control map,\n\n (x u) Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlMap","text":"ConstrainedLinearControlMap\n\nA linear control map with state and input constraints,\n\n (x u) Ax + Bu x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlMap","page":"Types","title":"MathematicalSystems.AffineControlMap","text":"AffineControlMap\n\nAn affine control map,\n\n (x u) Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlMap","text":"ConstrainedAffineControlMap\n\nAn affine control map with state and input constraints,\n\n (x u) Ax + Bu + c x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ResetMap","page":"Types","title":"MathematicalSystems.ResetMap","text":"ResetMap\n\nA reset map,\n\n x R(x)\n\nsuch that a subset of the variables is given a specified value, and the rest are unchanged.\n\nFields\n\ndim – dimension\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedResetMap","page":"Types","title":"MathematicalSystems.ConstrainedResetMap","text":"ConstrainedResetMap\n\nA reset map with state constraints of the form:\n\n x R(x) x mathcalX\n\nsuch that the specified variables are assigned a given value, and the remaining variables are unchanged.\n\nFields\n\ndim – dimension\nX – state constraints\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Macros-1","page":"Types","title":"Macros","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@map","category":"page"},{"location":"lib/types/#MathematicalSystems.@map","page":"Types","title":"MathematicalSystems.@map","text":"map(ex, args)\n\nReturn an instance of the map type corresponding to the given expression.\n\nInput\n\nex – an expression defining the map, in the form of an anonymous function\nargs – additional optional arguments\n\nOutput\n\nA map that best matches the given expression.\n\nExamples\n\nLet us first create a linear map using this macro:\n\njulia> @map x -> [1 0; 0 0]*x\nLinearMap{Int64,Array{Int64,2}}([1 0; 0 0])\n\nWe can create an affine system as well:\n\njulia> @map x -> [1 0; 0 0]*x + [2, 0]\nAffineMap{Int64,Array{Int64,2},Array{Int64,1}}([1 0; 0 0], [2, 0])\n\nAdditional 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:\n\njulia> @map(x -> x, dim=5)\nIdentityMap(5)\n\nA state constraint on such map can be specified passing the additional argument x ∈ X.\n\nAn identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:\n\njulia> @map x -> I(5)*x\nIdentityMap(5)\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Systems-with-output-1","page":"Types","title":"Systems with output","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem","category":"page"},{"location":"lib/types/#MathematicalSystems.SystemWithOutput","page":"Types","title":"MathematicalSystems.SystemWithOutput","text":"SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap}\n\nParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearTimeInvariantSystem","page":"Types","title":"MathematicalSystems.LinearTimeInvariantSystem","text":"LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.LTISystem","page":"Types","title":"MathematicalSystems.LTISystem","text":"LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Vector-Field-1","page":"Types","title":"Vector Field","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"VectorField","category":"page"},{"location":"lib/types/#MathematicalSystems.VectorField","page":"Types","title":"MathematicalSystems.VectorField","text":"VectorField{T<:Function}\n\nType that computes the vector field of an AbstractContinuousSystem.\n\nFields\n\nfield – function for calculating the vector field\n\n\n\n\n\n","category":"type"},{"location":"#MathematicalSystems.jl-1","page":"Home","title":"MathematicalSystems.jl","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]","category":"page"},{"location":"#","page":"Home","title":"Home","text":"MathematicalSystems is a Julia package for mathematical systems interfaces.","category":"page"},{"location":"#Features-1","page":"Home","title":"Features","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled, linear algebraic, etc.\nIterator interfaces to handle constant or time-varying inputs.","category":"page"},{"location":"#Library-Outline-1","page":"Home","title":"Library Outline","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Pages = [\n \"lib/types.md\",\n \"lib/methods.md\",\n \"lib/internals.md\"\n]\nDepth = 2","category":"page"},{"location":"lib/methods/#Methods-1","page":"Methods","title":"Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"This section describes systems methods implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"Pages = [\"methods.md\"]\nDepth = 3","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/methods/#States-1","page":"Methods","title":"States","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"statedim\nstateset","category":"page"},{"location":"lib/methods/#MathematicalSystems.statedim","page":"Methods","title":"MathematicalSystems.statedim","text":"statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.stateset","page":"Methods","title":"MathematicalSystems.stateset","text":"stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Inputs-1","page":"Methods","title":"Inputs","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"inputdim\ninputset\nnextinput","category":"page"},{"location":"lib/methods/#MathematicalSystems.inputdim","page":"Methods","title":"MathematicalSystems.inputdim","text":"inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.inputset","page":"Methods","title":"MathematicalSystems.inputset","text":"inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.nextinput","page":"Methods","title":"MathematicalSystems.nextinput","text":"nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Output-1","page":"Methods","title":"Output","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"outputdim\noutputmap","category":"page"},{"location":"lib/methods/#MathematicalSystems.outputdim","page":"Methods","title":"MathematicalSystems.outputdim","text":"outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.outputmap","page":"Methods","title":"MathematicalSystems.outputmap","text":"outputmap(s::SystemWithOutput)\n\nReturns the output map of a system with output.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Traits-1","page":"Methods","title":"Traits","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"islinear(::AbstractSystem)\nislinear(::AbstractMap)\nisaffine(::AbstractSystem)\nispolynomial(::AbstractSystem)\nisaffine(::AbstractMap)\nisblackbox(::AbstractSystem)\nisnoisy(::AbstractSystem)\niscontrolled(::AbstractSystem)\nisconstrained(::AbstractSystem)\nstate_matrix(::AbstractSystem)\ninput_matrix(::AbstractSystem)\nnoise_matrix(::AbstractSystem)\naffine_term(::AbstractSystem)","category":"page"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by linear equations.\n\nNotes\n\nWe 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 mathbbR. 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).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(m::AbstractMap)\n\nSpecifies if the map m is linear or not.\n\nNotes\n\nA map is linear if it preserves the operations of scalar multiplication and vector addition.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by affine equations.\n\nNotes\n\nAn 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.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.ispolynomial-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.ispolynomial","text":"ispolynomial(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by polynomial equations.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(m::AbstractMap)\n\nSpecifies if the map m is affine or not.\n\nNotes\n\nAn affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isblackbox-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isblackbox","text":"isblackbox(s::AbstractSystem)\n\nSpecifies if no specific structure is assumed for the dynamics of system s.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isnoisy-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isnoisy","text":"isnoisy(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a noise term w.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.iscontrolled-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.iscontrolled","text":"iscontrolled(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a control input u.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isconstrained-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isconstrained","text":"isconstrained(s::AbstractSystem)\n\nDetermines if the system s has constraints on the state, input and noise, respectively (those that are available).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.state_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.state_matrix","text":"state_matrix(::AbstractSystem)\n\nReturn the state matrix of an affine system.\n\nNotes\n\nThe state matrix is the matrix proportional to the state, e.g. the matrix A in the linear continuous system x = Ax.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.input_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.input_matrix","text":"input_matrix(::AbstractSystem)\n\nReturn the input matrix of a system with linear input.\n\nNotes\n\nThe input matrix is the matrix proportional to the input, e.g. the matrix B in the linear continuous system with input, x = Ax + Bu.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.noise_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.noise_matrix","text":"noise_matrix(::AbstractSystem)\n\nReturn the noise matrix of a system with linear noise.\n\nNotes\n\nThe noise matrix is the matrix proportional to the noise, e.g. the matrix D in the linear system with noise, x = Ax + Dw.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.affine_term-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.affine_term","text":"affine_term(::AbstractSystem)\n\nReturn the affine term in an affine system.\n\nNotes\n\nThe affine term is e.g. the vector c in the affine system x = Ax + c.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#Maps-1","page":"Methods","title":"Maps","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"apply","category":"page"},{"location":"lib/methods/#MathematicalSystems.apply","page":"Methods","title":"MathematicalSystems.apply","text":"apply(m::AbstractMap, args...)\n\nApply the rule specified by the map to the given arguments.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Successor-1","page":"Methods","title":"Successor","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"successor","category":"page"},{"location":"lib/methods/#MathematicalSystems.successor","page":"Methods","title":"MathematicalSystems.successor","text":"successor(system::DiscreteIdentitySystem, x::AbstractVector)\n\nReturn the successor state of a DiscreteIdentitySystem.\n\nInput\n\nsystem – DiscreteIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::ConstrainedDiscreteIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedDiscreteIdentitySystem.\n\nInput\n\nsystem – ConstrainedDiscreteIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x and input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x, input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Vector-Field-1","page":"Methods","title":"Vector Field","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"vector_field","category":"page"},{"location":"lib/methods/#MathematicalSystems.vector_field","page":"Methods","title":"MathematicalSystems.vector_field","text":"vector_field(system::ContinuousIdentitySystem, x::AbstractVector)\n\nReturn the vector field state of a ContinuousIdentitySystem.\n\nInput\n\nsystem – ContinuousIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nA zeros vector of dimension statedim.\n\n\n\n\n\nvector_field(system::ConstrainedContinuousIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of a ConstrainedContinuousIdentitySystem.\n\nInput\n\nsystem – ConstrainedContinuousIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nA zeros vector of dimension statedim.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x and applying input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x and applying input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Discretization-1","page":"Methods","title":"Discretization","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"discretize","category":"page"},{"location":"lib/methods/#MathematicalSystems.discretize","page":"Methods","title":"MathematicalSystems.discretize","text":"discretize(system::AbstractContinuousSystem, ΔT::Real,\n algorithm::AbstractDiscretizationAlgorithm=ExactDiscretization(),\n constructor=_default_complementary_constructor(system))\n\nDiscretization of a isaffine AbstractContinuousSystem to a AbstractDiscreteSystem with sampling time ΔT using the discretization method algorithm.\n\nInput\n\nsystem – an affine continuous system\nΔT – sampling time\nalgorithm – (optional, default: ExactDiscretization()) discretization algorithm\nconstructor – (optional, default: _default_complementary_constructor(system)) construction method\n\nOutput\n\nReturns a discretization of the input system system with discretization method algorithm and sampling time ΔT.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Internal-Methods-1","page":"Methods","title":"Internal Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"_discretize\ntypename(::AbstractSystem)\n_complementary_type(::Type{<:AbstractSystem})","category":"page"},{"location":"lib/methods/#MathematicalSystems._discretize","page":"Methods","title":"MathematicalSystems._discretize","text":"_discretize(::AbstractDiscretizationAlgorithm, ΔT::Real\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nImplementation of the discretization algorithm defined by the first input argument with sampling time ΔT.\n\nInput\n\n`` – discretization algorithm, used for dispatch\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B, c and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(A::AbstractMatrix, ΔT::Real; algorithm=:exact)\n\nDiscretize the state matrix A with sampling time ΔT and discretization method algorithm.\n\nInput\n\nA – state matrix\nΔT – sampling time\nalgorithm – (optional, default: :exact) discretization algorithm\n\nOutput\n\nReturns a vector containing the discretized input argument A.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix)\n\nDiscretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input or noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A and B.\n\nNotes\n\nThis method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix,c::AbstractVector)\n\nDiscretize the state matrix A and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector)\n\nDiscretize the state matrix A, input matrix B and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, D::AbstractMatrix)\n\nDiscretize the state matrix A, input matrix B and noise matrix C with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.typename-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.typename","text":"typename(system::AbstractSystem)\n\nReturns the base type of system without parameter information.\n\nInput\n\nsystem – AbstractSystem\n\nOutput\n\nThe base type of system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems._complementary_type-Tuple{Type{#s7} where #s7<:AbstractSystem}","page":"Methods","title":"MathematicalSystems._complementary_type","text":"_complementary_type(system_type::Type{<:AbstractSystem})\n\nReturn the complementary type of a system type system_type.\n\nInput\n\nsystem_type – type of AbstractSystem\n\nOuput\n\nReturn complementary type of system_type.\n\nNotes\n\nThere are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.\n\nTo get the complementary type of system type, use _complementary_type(typename(system)).\n\n\n\n\n\n","category":"method"}]
+}
diff --git a/v0.11.6/siteinfo.js b/v0.11.6/siteinfo.js
new file mode 100644
index 00000000..138b1c7c
--- /dev/null
+++ b/v0.11.6/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.11.6";
diff --git a/v0.11.7/about/index.html b/v0.11.7/about/index.html
new file mode 100644
index 00000000..53f1576e
--- /dev/null
+++ b/v0.11.7/about/index.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.
Return the system type whose field names match those in fields.
Input
AT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem
fields – tuple of field names
Output
The system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.
Extract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.
For the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list
(:A_user, :A)
(:B_user, :B)
(:c_user, :c)
(:D_user, :D)
(:f_user, :f)
(:statedim_user :statedim)
(:inputdim_user :inputdim)
(:noisedim_user :noisedim)
and for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.
Input
equation – dynamic equation
state – state variable
input – input variable
noise – noise variable
dim – dimensionality
AT – abstract system type
Output
Two arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.
Checks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.
Return true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.
Input
expr – expression
Output
A Bool indicating whether expr is an equation or not.
If an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.
If an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.
Similiarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.
Return the result of instantiating an AbstractSystem at the current state.
Input
system – AbstractSystem
x – state (it should be any vector type)
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x.
Notes
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Return the result of instantiating an AbstractSystem at the current state and applying one input.
Input
system – AbstractSystem
x – state (it should be any vector type)
u – input (it should be any vector type) or noise, if system is not controlled
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x and input u.
Notes
If the system is not controlled but noisy, the input u is interpreted as noise.
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Return the result of instantiating an AbstractSystem at the current state and applying two inputs to an AbstractSystem.
Input
system – AbstractSystem
x – state (it should be any vector type)
u – input (it should be any vector type)
w – noise (it should be any vector type)
check_constraints – (optional, default: true) check if the state belongs to the state set
Output
The result of applying the system to state x, input u and noise w.
Notes
The _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.
Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.
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)$.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
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.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.
Specifies if the dynamics of system s is specified by polynomial equations.
The result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.
Discretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.
Input
algorithm – discretization algorithm
ΔT – sampling time
A – state matrix
B – input or noise matrix
Output
Returns a vector containing the discretized input arguments A and B.
Notes
This method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).
Return the complementary type of a system type system_type.
Input
system_type – type of AbstractSystem
Ouput
Return complementary type of system_type.
Notes
There are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.
To get the complementary type of system type, use _complementary_type(typename(system)).
Abstract supertype for all discretization algorithms.
Note
For implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method
Exact 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].
Euler 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].
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 + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.
If the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.
Systems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.
Examples
Let us first create a continuous linear system using this macro:
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.5]');
+
+julia> c = [1., 1.5];
+
+julia> X = BallInf(zeros(2), 10.);
+
+julia> U = BallInf(zeros(1), 2.);
+
+julia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)
+ConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([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,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))
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).
A scalar multiple of the identity matrix of given order and numeric type.
Fields
M – uniform scaling operator of type T
n – 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 AbstractMatix, 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
The easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:
julia> using MathematicalSystems: IdentityMultiple
+
+julia> I2 = I(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 2
The numeric type (default Float64) can be passed as a second argument:
julia> I2r = I(2, Rational{Int})
+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 2
To create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:
julia> I2 = I(2.0, 2)
+IdentityMultiple{Float64} of value 2.0 and order 2
+
+julia> I2r = I(2//1, 2)
+IdentityMultiple{Rational{Int64}} of value 2//1 and order 2
Or use the constructor passing the UniformScaling (I):
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 2
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.
Type 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:
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 I(n), for example:
diff --git a/v0.11.7/search_index.js b/v0.11.7/search_index.js
new file mode 100644
index 00000000..6e609207
--- /dev/null
+++ b/v0.11.7/search_index.js
@@ -0,0 +1,3 @@
+var documenterSearchIndex = {"docs":
+[{"location":"lib/internals/#Internals-1","page":"Internals","title":"Internals","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"This section describes functions that are internal to the library.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Pages = [\"internals.md\"]\nDepth = 3","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/internals/#Expression-handling-1","page":"Internals","title":"Expression handling","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"_corresponding_type\n_capture_dim\nextract_dyn_equation_parameters\nadd_asterisk\nsort","category":"page"},{"location":"lib/internals/#MathematicalSystems._corresponding_type","page":"Internals","title":"MathematicalSystems._corresponding_type","text":"_corresponding_type(AT::Type{<:AbstractSystem}, fields::Tuple)\n\nReturn the system type whose field names match those in fields.\n\nInput\n\nAT – abstract system type, which can be either AbstractContinuousSystem or AbstractDiscreSystem\nfields – tuple of field names\n\nOutput\n\nThe system type (either discrete or continous, depending on AT) whose fields names correspond to those in fields, or an error if the fields do not match any known system type.\n\nExamples\n\njulia> using MathematicalSystems: _corresponding_type\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A),))\nLinearContinuousSystem\n\njulia> _corresponding_type(AbstractContinuousSystem, ((:A), (:B), (:X), (:U)))\nConstrainedLinearControlContinuousSystem\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems._capture_dim","page":"Internals","title":"MathematicalSystems._capture_dim","text":"_capture_dim(expr)\n\nReturn the tuple containing the dimension(s) in expr.\n\nInput\n\nexpr – symbolic expression that can be of any of the following forms:\n:x or :(x) – state dimension\n:(x, u) – state and input dimension\n:(x, u, w) – state, input and noise dimensions\n\nOutput\n\nThe scalar x if expr specifies the state dimension.\nThe vector [x, u] if expr specifies state and input dimension.\nThe vector [x, u, w] if expr specifies state, input and noise dimensions.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_dyn_equation_parameters","page":"Internals","title":"MathematicalSystems.extract_dyn_equation_parameters","text":"extract_dyn_equation_parameters(equation, state, input, noise, dim, AT)\n\nExtract the value and field parameter from the dynamic equation equation according to the variable state, input and noise.\n\nFor the right-hand side of the dynamic equation, this function returns a vector of tuples containing some elements from the list\n\n(:A_user, :A)\n(:B_user, :B)\n(:c_user, :c)\n(:D_user, :D)\n(:f_user, :f)\n(:statedim_user :statedim)\n(:inputdim_user :inputdim)\n(:noisedim_user :noisedim)\n\nand for the left-hand side, it returns either an empty vector Any[] or [(:E_user, :E)] where the first argument of the tuple corresponds to the value and the second argument of the tuple corresponds to the field parameter.\n\nInput\n\nequation – dynamic equation\nstate – state variable\ninput – input variable\nnoise – noise variable\ndim – dimensionality\nAT – abstract system type\n\nOutput\n\nTwo arrays of tuples containing the value and field parameters for the right-hand and left-hand side of the dynamic equation equation.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.add_asterisk","page":"Internals","title":"MathematicalSystems.add_asterisk","text":"add_asterisk(summand, state::Symbol, input::Symbol, noise::Symbol)\n\nChecks if expression summand contains state, input or noise at its end. If so, a multiplication expression, e.g. Expr(:call, :*, :A, :x) is created. If not,summand` is returned.\n\nInput\n\nsummand – expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nMultiplication expression or symbol.\n\nExample\n\njulia> using MathematicalSystems: add_asterisk\n\njulia> add_asterisk(:(A1*x), :x, :u, :w)\n:(A1 * x)\n\njulia> add_asterisk(:(c1), :x, :u, :w)\n:c1\n\njulia> add_asterisk(:(Ax1), :x1, :u, :w)\n:(A * x1)\n\njulia> add_asterisk(:(Awb), :x1, :u, :wb)\n:(A * wb)\n\njulia> add_asterisk(:(A1u), :x, :u, :w)\n:(A1 * u)\n\njulia> add_asterisk(:(A1ub), :x, :u, :w)\n:A1ub\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Base.sort","page":"Internals","title":"Base.sort","text":"sort(parameters::Vector, order::Tuple)\n\nFilter and sort the vector parameters according to order.\n\nInput\n\nparameters – vector of tuples\norder – tuple of symbols\n\nOutput\n\nA new vector of tuples corresponding to parameters filtered and sorted according to order.\n\nExamples\n\njulia> parameters= [(:U1, :U), (:X1, :X), (:W1, :W)];\n\njulia> sort(parameters, (:X, :U, :W))\n3-element Array{Tuple{Any,Symbol},1}:\n (:X1, :X)\n (:U1, :U)\n (:W1, :W)\n\njulia> parameters = [(:const, :c), (:A, :A)];\n\njulia> sort(parameters, (:A, :B, :c, :D))\n2-element Array{Tuple{Any,Symbol},1}:\n (:A, :A)\n (:const, :c)\n\nNotes\n\nparameters is a vector that contains tuples whose second element is considered for the sorting according to order.\n\nIf a value of order is not contained in parameters, the corresponding entry of order will be omitted.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Querying-expressions-1","page":"Internals","title":"Querying expressions","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"is_equation\nextract_sum","category":"page"},{"location":"lib/internals/#MathematicalSystems.is_equation","page":"Internals","title":"MathematicalSystems.is_equation","text":"is_equation(expr)\n\nReturn true if the given expression expr corresponds to an equation lhs = rhs and false otherwise. This function just detects the presence of the symbol =.\n\nInput\n\nexpr – expression\n\nOutput\n\nA Bool indicating whether expr is an equation or not.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#MathematicalSystems.extract_sum","page":"Internals","title":"MathematicalSystems.extract_sum","text":"extract_sum(summands, state::Symbol, input::Symbol, noise::Symbol)\n\nExtract the variable name and field name for every element of summands which corresponds to the elements of the right-hand side of an affine system.\n\nInput\n\nsummands – array of expressions\nstate – state variable\ninput – input variable\nnoise – noise variable\n\nOutput\n\nArray of tuples of symbols with variable name and field name.\n\nExample\n\njulia> using MathematicalSystems: extract_sum\n\njulia> extract_sum([:(A1*x)], :x, :u, :w)\n1-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n\njulia> extract_sum([:(A1*x), :(B1*u), :c], :x, :u, :w)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(vcat(c)), :c)\n\njulia> extract_sum([:(A1*x7), :( B1*u7), :( B2*w7)], :x7, :u7, :w7)\n3-element Array{Tuple{Any,Symbol},1}:\n (:(hcat(A1)), :A)\n (:(hcat(B1)), :B)\n (:(hcat(B2)), :D)\n\nNotes\n\nIf an element of summands is a multiplication expression lhs*rhs, return lhs as variable name and :A as field name if rhs==state, :B as field name if rhs==input and :D as field name if rhs==noise.\n\nIf an element of summands is a symbol, and not equal to input or noise, the symbol is the variable name and the field name is :c. If it is equal to input, the variable name is a IdentityMultiple(I,state_dim) where state_dim is extracted from the state matrix (i.e. take the symbol lhs of lhs*rhs where rhs==state which corresponds to the state matrix and generate the expression state_dim = size(lhs,1) which is evaluated in the scope where @system is called) and the field name is :B.\n\nSimiliarily, if the element is equal to noise, the variable name is IdentityMultiple(I, state_dim) and the field name is :D.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Evaluation-of-AbstractSystem-at-given-state-1","page":"Internals","title":"Evaluation of AbstractSystem at given state","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"_instantiate","category":"page"},{"location":"lib/internals/#MathematicalSystems._instantiate","page":"Internals","title":"MathematicalSystems._instantiate","text":"_instantiate(system::AbstractSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x.\n\nNotes\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n_instantiate(system::AbstractSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state and applying one input.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x and input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n_instantiate(system::AbstractSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the result of instantiating an AbstractSystem at the current state and applying two inputs to an AbstractSystem.\n\nInput\n\nsystem – AbstractSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x, input u and noise w.\n\nNotes\n\nThe _instantiate method generalizes the successor of an AbstractDiscreteSystem and the vector_field of an AbstractContinuousSystem into a single method.\n\n\n\n\n\n","category":"function"},{"location":"lib/internals/#Naming-convention-for-systems'-fields-1","page":"Internals","title":"Naming convention for systems' fields","text":"","category":"section"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Systems' fields should be accessed externally by their respective getter functions. Internally to the library, the following naming conventions are used.","category":"page"},{"location":"lib/internals/#","page":"Internals","title":"Internals","text":"Field Description Getter function\nA state matrix state_matrix\nB input matrix input_matrix\nc affine term affine_term\nD noise matrix noise_matrix\nX state constraints stateset\nU input constraints inputset\nW disturbance set noiseset","category":"page"},{"location":"about/#About-1","page":"About","title":"About","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This page contains some general information about this project, and recommendations about contributing.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Pages = [\"about.md\"]","category":"page"},{"location":"about/#Contributing-1","page":"About","title":"Contributing","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.","category":"page"},{"location":"about/#Branches-and-pull-requests-(PR)-1","page":"About","title":"Branches and pull requests (PR)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.","category":"page"},{"location":"about/#Unit-testing-and-continuous-integration-(CI)-1","page":"About","title":"Unit testing and continuous integration (CI)","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes test/runtests.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Alternatively, you can achieve the same from inside the REPL using the following command:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> Pkg.test(\"MathematicalSystems\")","category":"page"},{"location":"about/#","page":"About","title":"About","text":"We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.","category":"page"},{"location":"about/#Contributing-to-the-documentation-1","page":"About","title":"Contributing to the documentation","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"New functions and types should be documented according to our guidelines directly in the source code.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"julia> ?LinearContinuousSystem","category":"page"},{"location":"about/#","page":"About","title":"About","text":"This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).","category":"page"},{"location":"about/#","page":"About","title":"About","text":"To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:","category":"page"},{"location":"about/#","page":"About","title":"About","text":"$ julia --color=yes docs/make.jl","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Note that this also runs all doctests which will take some time.","category":"page"},{"location":"about/#Related-projects-1","page":"About","title":"Related projects","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"This package originated from Hybrid Systems and systems definitions for reachability problems within JuliaReach.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Below we list more related projects.","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Package name Description\nHybridSystems.jl Hybrid Systems definitions in Julia.\nLTISystems.jl Julia package for representing linear time-invariant system models and operations defined on them.\nControlToolbox.jl Analysis and design tools for control systems.\nronisbr/ControlToolbox.jl A Control Toolbox for Julia language.\nDynamicalSystemsBase.jl Definitions of core system and data types used in the ecosystem of DynamicalSystems.jl.\nControlSystems.jl A Control Systems Toolbox for Julia\nModelingToolkit.jl A toolkit for modeling and creating DSLs for Scientific Computing in Julia","category":"page"},{"location":"about/#Credits-1","page":"About","title":"Credits","text":"","category":"section"},{"location":"about/#","page":"About","title":"About","text":"These persons have contributed to MathematicalSystems.jl (in alphabetic order):","category":"page"},{"location":"about/#","page":"About","title":"About","text":"Marcelo Forets\nBenoît Legat\nChristian Schilling\nUeli Wechsler","category":"page"},{"location":"lib/types/#Types-1","page":"Types","title":"Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"This section describes systems types implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"Pages = [\"types.md\"]\nDepth = 3","category":"page"},{"location":"lib/types/#","page":"Types","title":"Types","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/types/#Abstract-Systems-1","page":"Types","title":"Abstract Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractSystem\nAbstractContinuousSystem\nAbstractDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractSystem","page":"Types","title":"MathematicalSystems.AbstractSystem","text":"AbstractSystem\n\nAbstract supertype for all system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractContinuousSystem","page":"Types","title":"MathematicalSystems.AbstractContinuousSystem","text":"AbstractContinuousSystem\n\nAbstract supertype for all continuous system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AbstractDiscreteSystem","page":"Types","title":"MathematicalSystems.AbstractDiscreteSystem","text":"AbstractDiscreteSystem\n\nAbstract supertype for all discrete system types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Continuous-Systems-1","page":"Types","title":"Continuous Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"ContinuousIdentitySystem\nConstrainedContinuousIdentitySystem\nLinearContinuousSystem\nAffineContinuousSystem\nLinearControlContinuousSystem\nConstrainedLinearContinuousSystem\nConstrainedAffineContinuousSystem\nConstrainedAffineControlContinuousSystem\nConstrainedLinearControlContinuousSystem\nLinearAlgebraicContinuousSystem\nConstrainedLinearAlgebraicContinuousSystem\nPolynomialContinuousSystem\nConstrainedPolynomialContinuousSystem\nBlackBoxContinuousSystem\nConstrainedBlackBoxContinuousSystem\nBlackBoxControlContinuousSystem\nConstrainedBlackBoxControlContinuousSystem\nNoisyLinearContinuousSystem\nNoisyConstrainedLinearContinuousSystem\nNoisyLinearControlContinuousSystem\nNoisyConstrainedLinearControlContinuousSystem\nNoisyAffineControlContinuousSystem\nNoisyConstrainedAffineControlContinuousSystem\nNoisyBlackBoxControlContinuousSystem\nNoisyConstrainedBlackBoxControlContinuousSystem\nSecondOrderLinearContinuousSystem\nSecondOrderAffineContinuousSystem\nSecondOrderConstrainedAffineControlContinuousSystem\nSecondOrderConstrainedLinearControlContinuousSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.ContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ContinuousIdentitySystem","text":"ContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system of the form:\n\n x(t) = 0 forall t\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedContinuousIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedContinuousIdentitySystem","text":"ConstrainedContinuousIdentitySystem <: AbstractContinuousSystem\n\nTrivial identity continuous-time system with domain constraints of the form:\n\n x(t) = 0 x(t) mathcalX forall t\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearContinuousSystem","page":"Types","title":"MathematicalSystems.LinearContinuousSystem","text":"LinearContinuousSystem\n\nContinuous-time linear system of the form:\n\n x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineContinuousSystem","page":"Types","title":"MathematicalSystems.AffineContinuousSystem","text":"AffineContinuousSystem\n\nContinuous-time affine system of the form:\n\n x(t) = A x(t) + c forall t\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.LinearControlContinuousSystem","text":"LinearControlContinuousSystem\n\nContinuous-time linear control system of the form:\n\n x(t) = A x(t) + B u(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearContinuousSystem","text":"ConstrainedLinearContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineContinuousSystem","text":"ConstrainedAffineContinuousSystem\n\nContinuous-time affine system with domain constraints of the form:\n\n x(t) = A x(t) + c x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlContinuousSystem","text":"ConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlContinuousSystem","text":"ConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with domain constraints of the form:\n\n x(t) = A x(t) + B u(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicContinuousSystem","text":"LinearAlgebraicContinuousSystem\n\nContinuous-time linear algebraic system of the form:\n\n E x(t) = A x(t) forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicContinuousSystem","text":"ConstrainedLinearAlgebraicContinuousSystem\n\nContinuous-time linear system with domain constraints of the form:\n\n E x(t) = A x(t) x(t) mathcalX forall t\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.PolynomialContinuousSystem","text":"PolynomialContinuousSystem\n\nContinuous-time polynomial system of the form:\n\n x(t) = p(x(t)) forall t\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialContinuousSystem","text":"ConstrainedPolynomialContinuousSystem\n\nContinuous-time polynomial system with domain constraints:\n\n x(t) = p(x(t)) x(t) mathcalX forall t\n\nFields\n\np – polynomial vector field\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxContinuousSystem","text":"BlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side of the form:\n\n x(t) = f(x(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxContinuousSystem","text":"ConstrainedBlackBoxContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t)) x(t) mathcalX forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlContinuousSystem","text":"BlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem","text":"ConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t)) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearContinuousSystem","text":"NoisyLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance of the form:\n\n x(t) = A x(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearContinuousSystem","text":"NoisyConstrainedLinearContinuousSystem\n\nContinuous-time linear system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + D w(t) x(t) mathcalX w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlContinuousSystem","text":"NoisyLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlContinuousSystem","text":"NoisyConstrainedLinearControlContinuousSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlContinuousSystem","text":"NoisyAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlContinuousSystem","text":"NoisyConstrainedAffineControlContinuousSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x(t) = A x(t) + B u(t) + c + D w(t) x(t) mathcalX u(t) mathcalU w(t) mathcalW forall t\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlContinuousSystem","text":"NoisyBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side of the form:\n\n x(t) = f(x(t) u(t) w(t)) forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlContinuousSystem","text":"NoisyConstrainedBlackBoxControlContinuousSystem <: AbstractContinuousSystem\n\nContinuous-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x(t) = f(x(t) u(t) w(t)) quad x(t) mathcalX quad u(t) mathcalU quad w(t) mathcalW quad forall t\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderLinearContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderLinearContinuousSystem","text":"SecondOrderLinearContinuousSystem\n\nContinuous-time second order linear system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = 0 forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderAffineContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderAffineContinuousSystem","text":"SecondOrderAffineContinuousSystem\n\nContinuous-time second order affine system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = b forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nb – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedAffineControlContinuousSystem","text":"SecondOrderConstrainedAffineControlContinuousSystem\n\nContinuous-time second order constrained affine control system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = Bu(t) + d x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nd – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedLinearControlContinuousSystem","text":"SecondOrderConstrainedLinearControlContinuousSystem\n\nContinuous-time second order constrained linear control system of the form:\n\n Mx(t) + Cx(t) + Kx(t) = Bu(t) x(t) mathcalX u(t) mathcalU forall t\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discrete-Systems-1","page":"Types","title":"Discrete Systems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"DiscreteIdentitySystem\nConstrainedDiscreteIdentitySystem\nLinearDiscreteSystem\nAffineDiscreteSystem\nLinearControlDiscreteSystem\nConstrainedLinearDiscreteSystem\nConstrainedAffineDiscreteSystem\nConstrainedLinearControlDiscreteSystem\nConstrainedAffineControlDiscreteSystem\nLinearAlgebraicDiscreteSystem\nConstrainedLinearAlgebraicDiscreteSystem\nPolynomialDiscreteSystem\nConstrainedPolynomialDiscreteSystem\nBlackBoxDiscreteSystem\nConstrainedBlackBoxDiscreteSystem\nBlackBoxControlDiscreteSystem\nConstrainedBlackBoxControlDiscreteSystem\nNoisyLinearDiscreteSystem\nNoisyConstrainedLinearDiscreteSystem\nNoisyLinearControlDiscreteSystem\nNoisyConstrainedLinearControlDiscreteSystem\nNoisyAffineControlDiscreteSystem\nNoisyConstrainedAffineControlDiscreteSystem\nNoisyBlackBoxControlDiscreteSystem\nNoisyConstrainedBlackBoxControlDiscreteSystem\nSecondOrderLinearDiscreteSystem\nSecondOrderAffineDiscreteSystem\nSecondOrderConstrainedAffineControlDiscreteSystem\nSecondOrderConstrainedLinearControlDiscreteSystem","category":"page"},{"location":"lib/types/#MathematicalSystems.DiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.DiscreteIdentitySystem","text":"DiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system of the form:\n\n x_k+1 = x_k forall k\n\nFields\n\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedDiscreteIdentitySystem","page":"Types","title":"MathematicalSystems.ConstrainedDiscreteIdentitySystem","text":"ConstrainedDiscreteIdentitySystem <: AbstractDiscreteSystem\n\nTrivial identity discrete-time system with domain constraints of the form:\n\n x_k+1 = x_k x_k mathcalX forall k\n\nFields\n\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearDiscreteSystem","text":"LinearDiscreteSystem\n\nDiscrete-time linear system of the form:\n\n x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineDiscreteSystem","page":"Types","title":"MathematicalSystems.AffineDiscreteSystem","text":"AffineDiscreteSystem\n\nDiscrete-time affine system of the form:\n\n x_k+1 = A x_k + c forall k\n\nFields\n\nA – state matrix\nc – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearControlDiscreteSystem","text":"LinearControlDiscreteSystem\n\nDiscrete-time linear control system of the form:\n\n x_k+1 = A x_k + B u_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearDiscreteSystem","text":"ConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineDiscreteSystem","text":"ConstrainedAffineDiscreteSystem\n\nDiscrete-time affine system with domain constraints of the form:\n\n x_k+1 = A x_k + c x_k mathcalX forall k\n\nFields\n\nA – state matrix\nc – affine term\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlDiscreteSystem","text":"ConstrainedLinearControlDiscreteSystem\n\nDiscrete-time linear control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlDiscreteSystem","text":"ConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c x_k mathcalX u_k mathcalU forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.LinearAlgebraicDiscreteSystem","text":"LinearAlgebraicDiscreteSystem\n\nDiscrete-time linear algebraic system of the form:\n\n E x_k+1 = A x_k forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedLinearAlgebraicDiscreteSystem","text":"ConstrainedLinearAlgebraicDiscreteSystem\n\nDiscrete-time linear system with domain constraints of the form:\n\n E x_k+1 = A x_k x_k mathcalX forall k\n\nFields\n\nA – state matrix\nE – matrix, same size as A\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.PolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.PolynomialDiscreteSystem","text":"PolynomialDiscreteSystem\n\nDiscrete-time polynomial system of the form:\n\n x_k+1 = p(x_k) forall k\n\nFields\n\np – polynomial vector field\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedPolynomialDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedPolynomialDiscreteSystem","text":"ConstrainedPolynomialDiscreteSystem\n\nDiscrete-time polynomial system with domain constraints:\n\n x_k+1 = p(x_k) x_k mathcalX forall k\n\nFields\n\np – polynomial\nX – constraint set\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxDiscreteSystem","text":"BlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxDiscreteSystem","text":"ConstrainedBlackBoxDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k) x_k mathcalX forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.BlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.BlackBoxControlDiscreteSystem","text":"BlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem","text":"ConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) x_k mathcalX u_k mathcalU forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearDiscreteSystem","text":"NoisyLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance of the form:\n\n x_k+1 = A x_k + D w_k forall k\n\nFields\n\nA – state matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearDiscreteSystem","text":"NoisyConstrainedLinearDiscreteSystem\n\nDiscrete-time linear system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + D w_k x_k mathcalX w(t) mathcalW forall k\n\nFields\n\nA – state matrix\nD – noise matrix\nX – state constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyLinearControlDiscreteSystem","text":"NoisyLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedLinearControlDiscreteSystem","text":"NoisyConstrainedLinearControlDiscreteSystem\n\nContinuous-time linear control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyAffineControlDiscreteSystem","text":"NoisyAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedAffineControlDiscreteSystem","text":"NoisyConstrainedAffineControlDiscreteSystem\n\nContinuous-time affine control system with additive disturbance and domain constraints of the form:\n\n x_k+1 = A x_k + B u_k + c + D w_k x_k mathcalX u_k mathcalU w_k mathcalW forall k\n\nFields\n\nA – state matrix\nB – input matrix\nc – affine term\nD – noise matrix\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyBlackBoxControlDiscreteSystem","text":"NoisyBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side of the form:\n\n x_k+1 = f(x_k u_k) quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","page":"Types","title":"MathematicalSystems.NoisyConstrainedBlackBoxControlDiscreteSystem","text":"NoisyConstrainedBlackBoxControlDiscreteSystem <: AbstractDiscreteSystem\n\nDiscrete-time disturbance-affected control system defined by a right-hand side with domain constraints of the form:\n\n x_k+1 = f(x_k u_k) quad x_k mathcalX quad u_k mathcalU quad w_k mathcalW quad forall k\n\nFields\n\nf – function that holds the right-hand side\nstatedim – number of state variables\ninputdim – number of input variables\nnoisedim – number of noise variables\nX – state constraints\nU – input constraints\nW – disturbance set\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderLinearDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderLinearDiscreteSystem","text":"SecondOrderLinearDiscreteSystem\n\nDiscrete-time second order linear system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = 0 forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderAffineDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderAffineDiscreteSystem","text":"SecondOrderAffineDiscreteSystem\n\nDiscrete-time second order affine system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = b forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nb – affine term\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedAffineControlDiscreteSystem","text":"SecondOrderConstrainedAffineControlDiscreteSystem\n\nDiscrete-time second order constrained affine control system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = Bu_k + d x_k mathcalX u_k mathcalU forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nd – affine term\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem","page":"Types","title":"MathematicalSystems.SecondOrderConstrainedLinearControlDiscreteSystem","text":"SecondOrderConstrainedLinearControlDiscreteSystem\n\nDiscrete-time second order constrained linear control system of the form:\n\n Mx_k+2 + Cx_k+1 + Kx_k = Bu_k x_k mathcalX u_k mathcalU forall k\n\nFields\n\nM – mass matrix\nC – viscosity matrix\nK – stiffness matrix\nB – input matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Discretization-Algorithms-1","page":"Types","title":"Discretization Algorithms","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractDiscretizationAlgorithm\nExactDiscretization\nEulerDiscretization","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractDiscretizationAlgorithm","page":"Types","title":"MathematicalSystems.AbstractDiscretizationAlgorithm","text":"AbstractDiscretizationAlgorithm\n\nAbstract supertype for all discretization algorithms.\n\nNote\n\nFor implementing a custom discretization algorithm, a type definition struct NewDiscretizationAlgorithm <: AbstractDiscretizationAlgorithm end and a _discretize method\n\n_discretize(::NewDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nare required.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ExactDiscretization","page":"Types","title":"MathematicalSystems.ExactDiscretization","text":"ExactDiscretization <: AbstractDiscretizationAlgorithm\n\nExact discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Discretizationoflinearstatespace_models\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.EulerDiscretization","page":"Types","title":"MathematicalSystems.EulerDiscretization","text":"EulerDiscretization <: AbstractDiscretizationAlgorithm\n\nEuler discretization algorithm for affine systems.\n\nAlgorithm\n\nThis 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.\n\nWithout loss of generality, consider a NoisyAffineControlledContinuousSystem with system dynamics x = Ax + Bu + c + Dw.\n\nThe 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.\n\nThe algorithm described above is a well known result from the literature [1].\n\n[1] https://en.wikipedia.org/wiki/Discretization#Approximations\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#System-macro-1","page":"Types","title":"System macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@system","category":"page"},{"location":"lib/types/#MathematicalSystems.@system","page":"Types","title":"MathematicalSystems.@system","text":"system(expr...)\n\nReturn an instance of the system type corresponding to the given expressions.\n\nInput\n\nexpr – expressions separated by commas which define the dynamic equation, the constraint sets or the dimensionality of the system\n\nOutput\n\nA system that best matches the given expressions.\n\nNotes\n\nTerms. The expression expr contains one or more of the following sub-expressions:\n\ndynamic equation, either continuous, e.g.x' = Ax, or discrete, e.g. x⁺ = Ax\nset constraints, e.g. x ∈ X\ninput constraints, e.g. u ∈ U\ndimensionality, e.g. dim: (2,1) or dim = 1\nspecification of the input variable, e.g. input: u or input = u\nspecification of the noise variable, e,g, noise: w or noise = w\n\nThe macro call is then formed by separating the previous sub-expressions (which we simply call terms hereafter), as in:\n\n@system(dynamic eq., set constr., input constr., input specif., noise spec., dimens.)\n\nThe 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.\n\nDynamic 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.\n\nDefault 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.\n\nExceptions. The following exceptions and particular cases apply:\n\nIf the right-hand side has the form A*x + B*foo, A*x + B*foo + c or f(x, foo), the equation is parsed as a controlled linear (affine) or controlled black-box system with input foo. Note that in this case, input variable does not correspond to the default value of u, but foo is parsed as being the input.\nIf the left-hand side contains a multiplicative term in the form E*x⁺ or E*x', the equation is parsed as an algebraic system. In this case, the asterisk * operator is mandatory.\nSystems of the form x' = α*x where α is a scalar are parsed as linear systems. The default dimension is 1 and α is parsed as Float64; if the system is higher-dimensional, use dim, as in x' = 2x, dim=3.\n\nExamples\n\nLet us first create a continuous linear system using this macro:\n\njulia> A = [1. 0; 0 1.];\n\njulia> @system(x' = A*x)\nLinearContinuousSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nA discrete system is defined by using ⁺:\n\njulia> @system(x⁺ = A*x)\nLinearDiscreteSystem{Float64,Array{Float64,2}}([1.0 0.0; 0.0 1.0])\n\nAdditionally, 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:\n\njulia> using LazySets\n\njulia> B = Matrix([1. 0.5]');\n\njulia> c = [1., 1.5];\n\njulia> X = BallInf(zeros(2), 10.);\n\njulia> U = BallInf(zeros(1), 2.);\n\njulia> @system(x' = A*x + B*u + c, x ∈ X, u ∈ U)\nConstrainedAffineControlContinuousSystem{Float64,Array{Float64,2},Array{Float64,2},Array{Float64,1},BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}([1.0 0.0; 0.0 1.0], [1.0; 0.5], [1.0, 1.5], BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\nFor 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\n\njulia> f(x, u) = x + u;\n\njulia> @system(x⁺ = f(x, u), x ∈ X, u ∈ U, dim: (2,2))\nConstrainedBlackBoxControlDiscreteSystem{typeof(f),BallInf{Float64,Array{Float64,1}},BallInf{Float64,Array{Float64,1}}}(f, 2, 2, BallInf{Float64,Array{Float64,1}}([0.0, 0.0], 10.0), BallInf{Float64,Array{Float64,1}}([0.0], 2.0))\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Initial-value-problem-macro-1","page":"Types","title":"Initial-value problem macro","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@ivp","category":"page"},{"location":"lib/types/#MathematicalSystems.@ivp","page":"Types","title":"MathematicalSystems.@ivp","text":"ivp(expr...)\n\nReturn an instance of the initial-value problem type corresponding to the given expressions.\n\nInput\n\nexpr – 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)\n\nOutput\n\nAn initial-value problem that best matches the given expressions.\n\nNotes\n\nThis 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.\n\nThe macro can also be called with a system argument of type AbstractSystem in the form @ivp(system, state(0) ∈ initial_set).\n\nExamples\n\njulia> p = @ivp(x' = -x, x(0) ∈ [1.0]);\n\njulia> typeof(p)\nInitialValueProblem{LinearContinuousSystem{Float64,IdentityMultiple{Float64}},Array{Float64,1}}\n\njulia> initial_state(p)\n1-element Array{Float64,1}:\n 1.0\n\njulia> sys = @system(x' = [1 0; 0 1] * x);\n\njulia> @ivp(sys, x(0) ∈ [-1, 1])\nInitialValueProblem{LinearContinuousSystem{Int64,Array{Int64,2}},Array{Int64,1}}(LinearContinuousSystem{Int64,Array{Int64,2}}([1 0; 0 1]), [-1, 1])\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Identity-operator-1","page":"Types","title":"Identity operator","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"IdentityMultiple","category":"page"},{"location":"lib/types/#MathematicalSystems.IdentityMultiple","page":"Types","title":"MathematicalSystems.IdentityMultiple","text":"IdentityMultiple{T} < AbstractMatrix{T} where T\n\nA scalar multiple of the identity matrix of given order and numeric type.\n\nFields\n\nM – uniform scaling operator of type T\nn – size of the identity matrix\n\nNotes\n\nThis 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.\n\nInternally, the type wraps Julia's lazy multiple of the identity operator, UniformScaling. IdentityMultiple subtypes AbstractMatix, hence it can be used in usual matrix arithmetic and for dispatch on AbstractMatrix.\n\nThe difference between UniformScaling and IdentityMultiple is that while the size of the former is generic, the size of the latter is fixed.\n\nExamples\n\nThe easiest way to create an identity multiple is to use the callable version of LinearAlgebra.I:\n\njulia> using MathematicalSystems: IdentityMultiple\n\njulia> I2 = I(2)\nIdentityMultiple{Float64} of value 1.0 and order 2\n\njulia> I2 + I2\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> 4*I2\nIdentityMultiple{Float64} of value 4.0 and order 2\n\nThe numeric type (default Float64) can be passed as a second argument:\n\njulia> I2r = I(2, Rational{Int})\nIdentityMultiple{Rational{Int64}} of value 1//1 and order 2\n\njulia> I2r + I2r\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\njulia> 4*I2r\nIdentityMultiple{Rational{Int64}} of value 4//1 and order 2\n\nTo create the matrix with a value different from the default (1.0), there are two ways. Either pass the value through the callable I, as in:\n\njulia> I2 = I(2.0, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = I(2//1, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\nOr use the constructor passing the UniformScaling (I):\n\njulia> I2 = IdentityMultiple(2.0*I, 2)\nIdentityMultiple{Float64} of value 2.0 and order 2\n\njulia> I2r = IdentityMultiple(2//1*I, 2)\nIdentityMultiple{Rational{Int64}} of value 2//1 and order 2\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Initial-Value-Problems-1","page":"Types","title":"Initial Value Problems","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"InitialValueProblem\nIVP\ninitial_state\nsystem","category":"page"},{"location":"lib/types/#MathematicalSystems.InitialValueProblem","page":"Types","title":"MathematicalSystems.InitialValueProblem","text":"InitialValueProblem{S <: AbstractSystem, XT} <: AbstractSystem\n\nParametric composite type for initial value problems. It is parameterized in the system's type and the initial state's type\n\nFields\n\ns – system\nx0 – initial state\n\nExamples\n\nThe linear system x = -x with initial condition x₀ = -12 12:\n\njulia> s = LinearContinuousSystem([-1.0 0.0; 0.0 -1.0]);\n\njulia> x₀ = [-1/2, 1/2];\n\njulia> p = InitialValueProblem(s, x₀);\n\njulia> initial_state(p) # same as p.x0\n2-element Array{Float64,1}:\n -0.5\n 0.5\n\njulia> statedim(p)\n2\n\njulia> inputdim(p)\n0\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IVP","page":"Types","title":"MathematicalSystems.IVP","text":"IVP\n\nIVP is an alias for InitialValueProblem.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.initial_state","page":"Types","title":"MathematicalSystems.initial_state","text":"initial_state(ivp::InitialValueProblem)\n\nReturn the initial state of an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe initial state of an initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.system","page":"Types","title":"MathematicalSystems.system","text":"system(ivp::InitialValueProblem)\n\nReturn the system wrapped by an initial-value problem.\n\nInput\n\nivp – initial-value problem\n\nOutput\n\nThe system of the given initial-value problem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Input-Types-1","page":"Types","title":"Input Types","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractInput\nConstantInput\nVaryingInput","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractInput","page":"Types","title":"MathematicalSystems.AbstractInput","text":"AbstractInput\n\nAbstract supertype for all input types.\n\nNotes\n\nThe 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.\n\nIteration 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.\n\nA convenience function nextinput(input, n) is also provided and it returns the first n elements of input.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstantInput","page":"Types","title":"MathematicalSystems.ConstantInput","text":"ConstantInput{UT} <: AbstractInput\n\nType representing an input that remains constant in time.\n\nFields\n\nU – input set\n\nExamples\n\nThe 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:\n\njulia> c = ConstantInput(-1//2)\nConstantInput{Rational{Int64}}(-1//2)\n\njulia> iterate(c, 1)\n(-1//2, nothing)\n\njulia> iterate(c, 2)\n(-1//2, nothing)\n\njulia> collect(nextinput(c, 4))\n4-element Array{Rational{Int64},1}:\n -1//2\n -1//2\n -1//2\n -1//2\n\nThe elements of this input are rational numbers:\n\njulia> eltype(c)\nRational{Int64}\n\nTo transform a constant input, you can use map as in:\n\njulia> map(x->2*x, c)\nConstantInput{Rational{Int64}}(-1//1)\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.VaryingInput","page":"Types","title":"MathematicalSystems.VaryingInput","text":"VaryingInput{UT, VUT<:AbstractVector{UT}} <: AbstractInput\n\nType representing an input that may vary with time.\n\nFields\n\nU – vector of input sets\n\nExamples\n\nThe 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:\n\njulia> v = VaryingInput([-1//2, 1//2])\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//2, 1//2])\n\njulia> length(v)\n2\n\njulia> eltype(v)\nRational{Int64}\n\nBase's iterate method receives the input and an integer state and returns the input element and the next iteration state:\n\njulia> iterate(v, 1)\n(-1//2, 2)\n\njulia> iterate(v, 2)\n(1//2, 3)\n\nThe 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):\n\njulia> typeof(nextinput(v))\nBase.Iterators.Take{VaryingInput{Rational{Int64},Array{Rational{Int64},1}}}\n\njulia> collect(nextinput(v, 1))\n1-element Array{Rational{Int64},1}:\n -1//2\n\njulia> collect(nextinput(v, 2))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nYou can collect the inputs in an array, or equivalently use list comprehension, (or use a for loop):\n\njulia> collect(v)\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\njulia> [2*vi for vi in v]\n2-element Array{Rational{Int64},1}:\n -1//1\n 1//1\n\nSince this input type is finite, querying more elements than its length returns the full vector:\n\njulia> collect(nextinput(v, 4))\n2-element Array{Rational{Int64},1}:\n -1//2\n 1//2\n\nTo transform a varying input, you can use map as in:\n\njulia> map(x->2*x, v)\nVaryingInput{Rational{Int64},Array{Rational{Int64},1}}(Rational{Int64}[-1//1, 1//1])\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Maps-1","page":"Types","title":"Maps","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"AbstractMap\nIdentityMap\nConstrainedIdentityMap\nLinearMap\nConstrainedLinearMap\nAffineMap\nConstrainedAffineMap\nLinearControlMap\nConstrainedLinearControlMap\nAffineControlMap\nConstrainedAffineControlMap\nResetMap\nConstrainedResetMap","category":"page"},{"location":"lib/types/#MathematicalSystems.AbstractMap","page":"Types","title":"MathematicalSystems.AbstractMap","text":"AbstractMap\n\nAbstract supertype for all map types.\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.IdentityMap","page":"Types","title":"MathematicalSystems.IdentityMap","text":"IdentityMap\n\nAn identity map,\n\n x x\n\nFields\n\ndim – dimension\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedIdentityMap","page":"Types","title":"MathematicalSystems.ConstrainedIdentityMap","text":"ConstrainedIdentityMap\n\nAn identity map with state constraints of the form:\n\n x x x(t) mathcalX\n\nFields\n\ndim – dimension\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearMap","page":"Types","title":"MathematicalSystems.LinearMap","text":"LinearMap\n\nA linear map,\n\n x Ax\n\nFields\n\nA – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearMap","text":"ConstrainedLinearMap\n\nA linear map with state constraints of the form:\n\n x Ax x(t) mathcalX\n\nFields\n\nA – matrix\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineMap","page":"Types","title":"MathematicalSystems.AffineMap","text":"AffineMap\n\nAn affine map,\n\n x Ax + c\n\nFields\n\nA – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineMap","text":"ConstrainedAffineMap\n\nAn affine map with state constraints of the form:\n\n x Ax + c x(t) mathcalX\n\nFields\n\nA – matrix\nc – vector\nX – state constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearControlMap","page":"Types","title":"MathematicalSystems.LinearControlMap","text":"LinearControlMap\n\nA linear control map,\n\n (x u) Ax + Bu\n\nFields\n\nA – matrix\nB – matrix\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedLinearControlMap","page":"Types","title":"MathematicalSystems.ConstrainedLinearControlMap","text":"ConstrainedLinearControlMap\n\nA linear control map with state and input constraints,\n\n (x u) Ax + Bu x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.AffineControlMap","page":"Types","title":"MathematicalSystems.AffineControlMap","text":"AffineControlMap\n\nAn affine control map,\n\n (x u) Ax + Bu + c\n\nFields\n\nA – matrix\nB – matrix\nc – vector\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedAffineControlMap","page":"Types","title":"MathematicalSystems.ConstrainedAffineControlMap","text":"ConstrainedAffineControlMap\n\nAn affine control map with state and input constraints,\n\n (x u) Ax + Bu + c x mathcalX u mathcalU\n\nFields\n\nA – matrix\nB – matrix\nc – vector\nX – state constraints\nU – input constraints\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ResetMap","page":"Types","title":"MathematicalSystems.ResetMap","text":"ResetMap\n\nA reset map,\n\n x R(x)\n\nsuch that a subset of the variables is given a specified value, and the rest are unchanged.\n\nFields\n\ndim – dimension\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.ConstrainedResetMap","page":"Types","title":"MathematicalSystems.ConstrainedResetMap","text":"ConstrainedResetMap\n\nA reset map with state constraints of the form:\n\n x R(x) x mathcalX\n\nsuch that the specified variables are assigned a given value, and the remaining variables are unchanged.\n\nFields\n\ndim – dimension\nX – state constraints\ndict – dictionary whose keys are the indices of the variables that are reset, and whose values are the new values\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#Macros-1","page":"Types","title":"Macros","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"@map","category":"page"},{"location":"lib/types/#MathematicalSystems.@map","page":"Types","title":"MathematicalSystems.@map","text":"map(ex, args)\n\nReturn an instance of the map type corresponding to the given expression.\n\nInput\n\nex – an expression defining the map, in the form of an anonymous function\nargs – additional optional arguments\n\nOutput\n\nA map that best matches the given expression.\n\nExamples\n\nLet us first create a linear map using this macro:\n\njulia> @map x -> [1 0; 0 0]*x\nLinearMap{Int64,Array{Int64,2}}([1 0; 0 0])\n\nWe can create an affine system as well:\n\njulia> @map x -> [1 0; 0 0]*x + [2, 0]\nAffineMap{Int64,Array{Int64,2},Array{Int64,1}}([1 0; 0 0], [2, 0])\n\nAdditional 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:\n\njulia> @map(x -> x, dim=5)\nIdentityMap(5)\n\nA state constraint on such map can be specified passing the additional argument x ∈ X.\n\nAn identity map can alternatively be created by giving a the size of the identity matrix as I(n), for example:\n\njulia> @map x -> I(5)*x\nIdentityMap(5)\n\n\n\n\n\n","category":"macro"},{"location":"lib/types/#Systems-with-output-1","page":"Types","title":"Systems with output","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"SystemWithOutput\nLinearTimeInvariantSystem\nLTISystem","category":"page"},{"location":"lib/types/#MathematicalSystems.SystemWithOutput","page":"Types","title":"MathematicalSystems.SystemWithOutput","text":"SystemWithOutput{ST<:AbstractSystem, MT<:AbstractMap} <: AbstractSystem\n\nParametric composite type for systems with outputs. It is parameterized in the system's type (ST) and in the map's type (MT).\n\nFields\n\ns – system of type ST\noutputmap – output map of type MT\n\n\n\n\n\n","category":"type"},{"location":"lib/types/#MathematicalSystems.LinearTimeInvariantSystem","page":"Types","title":"MathematicalSystems.LinearTimeInvariantSystem","text":"LinearTimeInvariantSystem(A, B, C, D)\n\nA linear time-invariant system with of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\n\nOutput\n\nA system with output such that the system is a linear control continuous system and the output map is a linear control map.\n\n\n\n\n\nLinearTimeInvariantSystem(A, B, C, D, X, U)\n\nA linear time-invariant system with state and input constraints of the form\n\nx = Ax + Bu\ny = Cx + Du\n\nwhere x(t) X and u(t) U for all t.\n\nInput\n\nA – matrix\nB – matrix\nC – matrix\nD – matrix\nX – state constraints\nU – input constraints\n\nOutput\n\nA system with output such that the system is a constrained linear control continuous system and the output map is a constrained linear control map.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#MathematicalSystems.LTISystem","page":"Types","title":"MathematicalSystems.LTISystem","text":"LTISystem\n\nLTISystem is an alias for LinearTimeInvariantSystem.\n\n\n\n\n\n","category":"function"},{"location":"lib/types/#Vector-Field-1","page":"Types","title":"Vector Field","text":"","category":"section"},{"location":"lib/types/#","page":"Types","title":"Types","text":"VectorField","category":"page"},{"location":"lib/types/#MathematicalSystems.VectorField","page":"Types","title":"MathematicalSystems.VectorField","text":"VectorField{T<:Function}\n\nType that computes the vector field of an AbstractContinuousSystem.\n\nFields\n\nfield – function for calculating the vector field\n\n\n\n\n\n","category":"type"},{"location":"#MathematicalSystems.jl-1","page":"Home","title":"MathematicalSystems.jl","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"DocTestFilters = [r\"[0-9\\.]+ seconds \\(.*\\)\"]","category":"page"},{"location":"#","page":"Home","title":"Home","text":"MathematicalSystems is a Julia package for mathematical systems interfaces.","category":"page"},{"location":"#Features-1","page":"Home","title":"Features","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Generic and flexible systems definitions, while being fast and type stable.\nTypes for mathematical systems modeling: continuous, discrete, controlled, linear algebraic, etc.\nIterator interfaces to handle constant or time-varying inputs.","category":"page"},{"location":"#Library-Outline-1","page":"Home","title":"Library Outline","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"Pages = [\n \"lib/types.md\",\n \"lib/methods.md\",\n \"lib/internals.md\"\n]\nDepth = 2","category":"page"},{"location":"lib/methods/#Methods-1","page":"Methods","title":"Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"This section describes systems methods implemented in MathematicalSystems.jl.","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"Pages = [\"methods.md\"]\nDepth = 3","category":"page"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"CurrentModule = MathematicalSystems\nDocTestSetup = quote\n using MathematicalSystems\nend","category":"page"},{"location":"lib/methods/#States-1","page":"Methods","title":"States","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"statedim\nstateset","category":"page"},{"location":"lib/methods/#MathematicalSystems.statedim","page":"Methods","title":"MathematicalSystems.statedim","text":"statedim(s::AbstractSystem)\n\nReturns the dimension of the state space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.stateset","page":"Methods","title":"MathematicalSystems.stateset","text":"stateset(s::AbstractSystem)\n\nReturns the set of allowed states of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Inputs-1","page":"Methods","title":"Inputs","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"inputdim\ninputset\nnextinput","category":"page"},{"location":"lib/methods/#MathematicalSystems.inputdim","page":"Methods","title":"MathematicalSystems.inputdim","text":"inputdim(s::AbstractSystem)\n\nReturns the dimension of the input space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.inputset","page":"Methods","title":"MathematicalSystems.inputset","text":"inputset(s::AbstractSystem)\n\nReturns the set of allowed inputs of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.nextinput","page":"Methods","title":"MathematicalSystems.nextinput","text":"nextinput(input::ConstantInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – a constant input\nn – (optional, default: 1) the number of desired elements\n\nOutput\n\nA repeated iterator that generates n equal samples of this input.\n\n\n\n\n\nnextinput(input::VaryingInput, n::Int=1)\n\nReturns the first n elements of this input.\n\nInput\n\ninput – varying input\nn – (optional, default: 1) number of desired elements\n\nOutput\n\nAn iterator of type Base.Iterators.Take that represents at most the first n elements of this input.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Noises-1","page":"Methods","title":"Noises","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"noisedim\nnoiseset","category":"page"},{"location":"lib/methods/#MathematicalSystems.noisedim","page":"Methods","title":"MathematicalSystems.noisedim","text":"noisedim(s::AbstractSystem)\n\nReturns the dimension of the noise space of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.noiseset","page":"Methods","title":"MathematicalSystems.noiseset","text":"noiseset(s::AbstractSystem)\n\nReturns the set of allowed noises of system s.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Output-1","page":"Methods","title":"Output","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"outputdim\noutputmap","category":"page"},{"location":"lib/methods/#MathematicalSystems.outputdim","page":"Methods","title":"MathematicalSystems.outputdim","text":"outputdim(m::AbstractMap)\n\nReturns the dimension of the output space of the map m.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.outputmap","page":"Methods","title":"MathematicalSystems.outputmap","text":"outputmap(s::SystemWithOutput)\n\nReturns the output map of a system with output.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Traits-1","page":"Methods","title":"Traits","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"islinear(::AbstractSystem)\nislinear(::AbstractMap)\nisaffine(::AbstractSystem)\nispolynomial(::AbstractSystem)\nisaffine(::AbstractMap)\nisblackbox(::AbstractSystem)\nisnoisy(::AbstractSystem)\niscontrolled(::AbstractSystem)\nisconstrained(::AbstractSystem)\nstate_matrix(::AbstractSystem)\ninput_matrix(::AbstractSystem)\nnoise_matrix(::AbstractSystem)\naffine_term(::AbstractSystem)","category":"page"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by linear equations.\n\nNotes\n\nWe 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 mathbbR. 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).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n[1] Sontag, Eduardo D. Mathematical control theory: deterministic finite dimensional systems. Vol. 6. Springer Science & Business Media, 2013.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.islinear-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.islinear","text":"islinear(m::AbstractMap)\n\nSpecifies if the map m is linear or not.\n\nNotes\n\nA map is linear if it preserves the operations of scalar multiplication and vector addition.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by affine equations.\n\nNotes\n\nAn 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.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). 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.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.ispolynomial-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.ispolynomial","text":"ispolynomial(s::AbstractSystem)\n\nSpecifies if the dynamics of system s is specified by polynomial equations.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s). Hence, e.g. a LinearContinuousSystem is not considered to be of polynomial type.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isaffine-Tuple{AbstractMap}","page":"Methods","title":"MathematicalSystems.isaffine","text":"isaffine(m::AbstractMap)\n\nSpecifies if the map m is affine or not.\n\nNotes\n\nAn affine map is the composition of a linear map and a translation. See also islinear(::AbstractMap).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isblackbox-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isblackbox","text":"isblackbox(s::AbstractSystem)\n\nSpecifies if no specific structure is assumed for the dynamics of system s.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isnoisy-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isnoisy","text":"isnoisy(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a noise term w.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.iscontrolled-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.iscontrolled","text":"iscontrolled(s::AbstractSystem)\n\nDetermines if the dynamics of system s contains a control input u.\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.isconstrained-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.isconstrained","text":"isconstrained(s::AbstractSystem)\n\nDetermines if the system s has constraints on the state, input and noise, respectively (those that are available).\n\nThe result of this function only depends on the system type, not the value, and can also be applied to typeof(s).\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.state_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.state_matrix","text":"state_matrix(s::AbstractSystem)\n\nReturn the state matrix of an affine system.\n\nNotes\n\nThe state matrix is the matrix proportional to the state, e.g. the matrix A in the linear continuous system x = Ax.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.input_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.input_matrix","text":"input_matrix(s::AbstractSystem)\n\nReturn the input matrix of a system with linear input.\n\nNotes\n\nThe input matrix is the matrix proportional to the input, e.g. the matrix B in the linear continuous system with input, x = Ax + Bu.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.noise_matrix-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.noise_matrix","text":"noise_matrix(s::AbstractSystem)\n\nReturn the noise matrix of a system with linear noise.\n\nNotes\n\nThe noise matrix is the matrix proportional to the noise, e.g. the matrix D in the linear system with noise, x = Ax + Dw.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems.affine_term-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.affine_term","text":"affine_term(s::AbstractSystem)\n\nReturn the affine term in an affine system.\n\nNotes\n\nThe affine term is e.g. the vector c in the affine system x = Ax + c.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#Maps-1","page":"Methods","title":"Maps","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"apply","category":"page"},{"location":"lib/methods/#MathematicalSystems.apply","page":"Methods","title":"MathematicalSystems.apply","text":"apply(m::AbstractMap, args...)\n\nApply the rule specified by the map to the given arguments.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Successor-1","page":"Methods","title":"Successor","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"successor","category":"page"},{"location":"lib/methods/#MathematicalSystems.successor","page":"Methods","title":"MathematicalSystems.successor","text":"successor(system::DiscreteIdentitySystem, x::AbstractVector)\n\nReturn the successor state of a DiscreteIdentitySystem.\n\nInput\n\nsystem – DiscreteIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::ConstrainedDiscreteIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of a ConstrainedDiscreteIdentitySystem.\n\nInput\n\nsystem – ConstrainedDiscreteIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe same state x.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x and input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\n\n\n\n\nsuccessor(system::AbstractDiscreteSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the successor state of an AbstractDiscreteSystem.\n\nInput\n\nsystem – AbstractDiscreteSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe result of applying the system to state x, input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Vector-Field-1","page":"Methods","title":"Vector Field","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"vector_field","category":"page"},{"location":"lib/methods/#MathematicalSystems.vector_field","page":"Methods","title":"MathematicalSystems.vector_field","text":"vector_field(system::ContinuousIdentitySystem, x::AbstractVector)\n\nReturn the vector field state of a ContinuousIdentitySystem.\n\nInput\n\nsystem – ContinuousIdentitySystem\nx – state (it should be any vector type)\n\nOutput\n\nA zeros vector of dimension statedim.\n\n\n\n\n\nvector_field(system::ConstrainedContinuousIdentitySystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of a ConstrainedContinuousIdentitySystem.\n\nInput\n\nsystem – ConstrainedContinuousIdentitySystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nA zeros vector of dimension statedim.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem, x::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem, x::AbstractVector, u::AbstractVector;\n [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type) or noise, if system is not controlled\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x and applying input u.\n\nNotes\n\nIf the system is not controlled but noisy, the input u is interpreted as noise.\n\n\n\n\n\nvector_field(system::AbstractContinuousSystem,\n x::AbstractVector, u::AbstractVector, w::AbstractVector; [check_constraints]=true)\n\nReturn the vector field state of an AbstractContinuousSystem.\n\nInput\n\nsystem – AbstractContinuousSystem\nx – state (it should be any vector type)\nu – input (it should be any vector type)\nw – noise (it should be any vector type)\ncheck_constraints – (optional, default: true) check if the state belongs to the state set\n\nOutput\n\nThe vector field of the system at state x and applying input u and noise w.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Discretization-1","page":"Methods","title":"Discretization","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"discretize","category":"page"},{"location":"lib/methods/#MathematicalSystems.discretize","page":"Methods","title":"MathematicalSystems.discretize","text":"discretize(system::AbstractContinuousSystem, ΔT::Real,\n algorithm::AbstractDiscretizationAlgorithm=ExactDiscretization(),\n constructor=_default_complementary_constructor(system))\n\nDiscretization of a isaffine AbstractContinuousSystem to a AbstractDiscreteSystem with sampling time ΔT using the discretization method algorithm.\n\nInput\n\nsystem – an affine continuous system\nΔT – sampling time\nalgorithm – (optional, default: ExactDiscretization()) discretization algorithm\nconstructor – (optional, default: _default_complementary_constructor(system)) construction method\n\nOutput\n\nReturns a discretization of the input system system with discretization method algorithm and sampling time ΔT.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#Internal-Methods-1","page":"Methods","title":"Internal Methods","text":"","category":"section"},{"location":"lib/methods/#","page":"Methods","title":"Methods","text":"_discretize\ntypename(::AbstractSystem)\n_complementary_type(::Type{<:AbstractSystem})","category":"page"},{"location":"lib/methods/#MathematicalSystems._discretize","page":"Methods","title":"MathematicalSystems._discretize","text":"_discretize(::AbstractDiscretizationAlgorithm, ΔT::Real\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector, D::AbstractMatrix)\n\nImplementation of the discretization algorithm defined by the first input argument with sampling time ΔT.\n\nInput\n\n`` – discretization algorithm, used for dispatch\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B, c and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(A::AbstractMatrix, ΔT::Real; algorithm=:exact)\n\nDiscretize the state matrix A with sampling time ΔT and discretization method algorithm.\n\nInput\n\nA – state matrix\nΔT – sampling time\nalgorithm – (optional, default: :exact) discretization algorithm\n\nOutput\n\nReturns a vector containing the discretized input argument A.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix)\n\nDiscretize the state matrix A and input or noise matrix B with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input or noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A and B.\n\nNotes\n\nThis method signature with two arguments of type AbstractMatrix works both for a noisy system with fields (:A,:D) and a controlled system with fields (:A,:B).\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix,c::AbstractVector)\n\nDiscretize the state matrix A and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, c::AbstractVector)\n\nDiscretize the state matrix A, input matrix B and vector c with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nc – vector\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and c.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n_discretize(algorithm::AbstractDiscretizationAlgorithm, ΔT::Real,\n A::AbstractMatrix, B::AbstractMatrix, D::AbstractMatrix)\n\nDiscretize the state matrix A, input matrix B and noise matrix C with sampling time ΔT and discretization method algorithm.\n\nInput\n\nalgorithm – discretization algorithm\nΔT – sampling time\nA – state matrix\nB – input matrix\nD – noise matrix\n\nOutput\n\nReturns a vector containing the discretized input arguments A, B and D.\n\nNotes\n\nSee discretize for more details.\n\n\n\n\n\n","category":"function"},{"location":"lib/methods/#MathematicalSystems.typename-Tuple{AbstractSystem}","page":"Methods","title":"MathematicalSystems.typename","text":"typename(system::AbstractSystem)\n\nReturns the base type of system without parameter information.\n\nInput\n\nsystem – AbstractSystem\n\nOutput\n\nThe base type of system.\n\n\n\n\n\n","category":"method"},{"location":"lib/methods/#MathematicalSystems._complementary_type-Tuple{Type{#s7} where #s7<:AbstractSystem}","page":"Methods","title":"MathematicalSystems._complementary_type","text":"_complementary_type(system_type::Type{<:AbstractSystem})\n\nReturn the complementary type of a system type system_type.\n\nInput\n\nsystem_type – type of AbstractSystem\n\nOuput\n\nReturn complementary type of system_type.\n\nNotes\n\nThere are two main subclasses of abstract types: continuous types and discrete types. A complementary type of system_type has the same fields as system_type but belongs to the other subclass, e.g. for a LinearContinuousSystem which is a subtype of AbstractContinuousSystem and has the field :A, the subtype of AbstractDiscreteSystem with the field :A, i.e. LinearDiscreteSystem, is returned.\n\nTo get the complementary type of system type, use _complementary_type(typename(system)).\n\n\n\n\n\n","category":"method"}]
+}
diff --git a/v0.11.7/siteinfo.js b/v0.11.7/siteinfo.js
new file mode 100644
index 00000000..62742721
--- /dev/null
+++ b/v0.11.7/siteinfo.js
@@ -0,0 +1 @@
+var DOCUMENTER_CURRENT_VERSION = "v0.11.7";
diff --git a/v0.11.8/about/index.html b/v0.11.8/about/index.html
new file mode 100644
index 00000000..53f1576e
--- /dev/null
+++ b/v0.11.8/about/index.html
@@ -0,0 +1,2 @@
+
+About · MathematicalSystems.jl
If you like this package, consider contributing! You can send bug reports (or fix them and send your code), add examples to the documentation, or propose new features.
Below some conventions that we follow when contributing to this package are detailed. For specific guidelines on documentation, see the Documentations Guidelines wiki.
We use a standard pull request policy: You work in a private branch and eventually add a pull request, which is then reviewed by other programmers and merged into the master branch.
Each pull request should be pushed in a new branch with the name of the author followed by a descriptive name, e.g., mforets/my_feature. If the branch is associated to a previous discussion in one issue, we use the name of the issue for easier lookup, e.g., mforets/7.
This project is synchronized with Travis CI such that each PR gets tested before merging (and the build is automatically triggered after each new commit). For the maintainability of this project, it is important to understand and fix the failing doctests if they exist. We develop in Julia v0.6.0, but for experimentation we also build on the nightly branch.
When you modify code in this package, you should make sure that all unit tests pass. To run the unit tests locally, you should do:
$ julia --color=yes test/runtests.jl
Alternatively, you can achieve the same from inside the REPL using the following command:
julia> Pkg.test("MathematicalSystems")
We also advise adding new unit tests when adding new features to ensure long-term support of your contributions.
New functions and types should be documented according to our guidelines directly in the source code.
You can view the source code documentation from inside the REPL by typing ? followed by the name of the type or function. For example, the following command will print the documentation of the AbstractSystem type:
julia> ?LinearContinuousSystem
This documentation you are currently reading is written in Markdown, and it relies on Documenter.jl to produce the HTML layout. The sources for creating this documentation are found in docs/src. You can easily include the documentation that you wrote for your functions or types there (see the Documenter.jl guide or our sources for examples).
To generate the documentation locally, run make.jl, e.g., by executing the following command in the terminal:
$ julia --color=yes docs/make.jl
Note that this also runs all doctests which will take some time.