Methods
This section describes systems methods implemented in HybridSystems.jl
.
Switched Systems
The following method makes it easy to create specific kind of hybrid systems called switched systems
HybridSystems.discreteswitchedsystem
— Functiondiscreteswitchedsystem(A::AbstractVector{<:AbstractMatrix})
Creates the discrete switched linear system defined by
\[x_{k+1} = A_{\sigma_k} x_k, \sigma_k = 1, \ldots, m.\]
where m
is the length of A
.
discreteswitchedsystem(A::AbstractVector{<:AbstractMatrix}, S::AbstractVector)
Creates the state dependent discrete switched linear system defined by
\[x_{k+1} = A_{\sigma_k} x_k, \sigma_k = 1, \ldots, m, x_k \in S[\sigma_k].\]
where m
is the length of A
and S
.
discreteswitchedsystem(A::AbstractVector{<:AbstractMatrix}, G::AbstractAutomaton)
Creates the constrained discrete switched linear system defined by
\[x_{k+1} = A_{\sigma_k} x_k,\]
where $\sigma_1, \ldots, \sigma_k$ is a valid sequence of events of the automaton G
.
discreteswitchedsystem(A::AbstractVector{<:AbstractMatrix}, G::AbstractAutomaton, S::AbstractVector)
Creates the state-dependent constrained discrete switched linear system defined by
\[x_{k+1} = A_{\sigma_k} x_k, x_k \in S[q_k]\]
where $q_0, \sigma_1, q_1, \ldots, q_{k-1}, \sigma_k, q_k$ is a valid sequence of events of the automaton G
with intermediate states $q_0, \ldots, q_k$.
Continuous sub-systems
MathematicalSystems.statedim
— Functionstatedim(hs::HybridSystem, u::Int)
Returns the dimension of the state space of the system at discrete state u
.
MathematicalSystems.stateset
— Functionstateset(s::AbstractSystem, u::Int)
Returns the set of allowed states of the system at discrete state u
.
MathematicalSystems.inputdim
— Functioninputdim(s::AbstractSystem, u::Int)
Returns the dimension of the input space of the system at mode u
.
MathematicalSystems.inputset
— Functioninputset(s::AbstractSystem, u::Int)
Returns the set of allowed inputs of the system at mode u
.
inputset(s::AbstractSystem, t)
Returns the set of allowed inputs for the transition t
.
Hybrid automata
Modes
HybridSystems.states
— Functionstates(A::AbstractAutomaton)
Returns an iterator over the states of the automaton A
. It has the alias modes
.
HybridSystems.nstates
— Functionnstates(A::AbstractAutomaton)
Returns the number of states of the automaton A
. It has the alias nmodes
.
HybridSystems.rem_state!
— Functionrem_state!(A::AbstractAutomaton, q)
Remove the state q
to the automaton A
.
HybridSystems.mode
— Functionmode(hs::HybridSystem, u::Int)
Returns the mode of the dynamical system at discrete state u
.
HybridSystems.target_mode
— Functiontarget_mode(hs::AbstractHybridSystem, t)
Returns the target mode for the transition t
.
Transitions
HybridSystems.transitiontype
— Functiontransitiontype(A::AbstractAutomaton)
Returns type of the transitions of the automaton A
.
HybridSystems.transitions
— Functiontransitions(A::AbstractAutomaton)
Returns an iterator over the transitions of the automaton A
.
transitions(A::AbstractAutomaton, q, r)
Returns an iterator over the transitions from state q
to state r
of the automaton A
.
HybridSystems.ntransitions
— Functionntransitions(A::AbstractAutomaton)
Returns the number of transitions of the automaton A
.
HybridSystems.add_transition!
— Functionadd_transition!(A::AbstractAutomaton, q, r, σ)
Adds a transition between states q
and r
with symbol σ
to the automaton A
.
HybridSystems.has_transition
— Functionhas_transition(A::AbstractAutomaton, t::AbstractTransition)::Bool
Returns a Bool
indicating whether the automaton A
has the transition t
.
has_transition(A::AbstractAutomaton, q, r)::Bool
Returns a Bool
indicating whether the automaton A
has a transition from state q
to state r
.
HybridSystems.rem_transition!
— Functionrem_transition!(A::AbstractAutomaton, t::AbstractTransition)
Remove the transition t
from the automaton A
.
HybridSystems.source
— Functionsource(A::AbstractAutomaton, t::AbstractTransition)
Returns the source of the transition t
.
HybridSystems.event
— Functionevent(A::AbstractAutomaton, t::AbstractTransition)
Returns the event/symbol of the transition t
in the automaton A
. It has the alias symbol
.
HybridSystems.target
— Functiontarget(A::AbstractAutomaton, t::AbstractTransition)
Returns the target of the transition t
.
HybridSystems.in_transitions
— Functionin_transitions(A::AbstractAutomaton, s)
Returns an iterator over the transitions with target s
.
HybridSystems.out_transitions
— Functionout_transitions(A::AbstractAutomaton, s)
Returns an iterator over the transitions with source s
.
Guards and Assignments
HybridSystems.resetmap
— Functionresetmap(hs::HybridSystem, t)
Returns the reset map for the transition t
.
HybridSystems.guard
— Functionguard(hs::HybridSystem, t)
Returns the guard for the transition t
.
HybridSystems.assignment
— Functionassignment(hs::HybridSystem, t)
Returns the assignment for the transition t
.
Utilities
HybridSystems.switchings
— Functionswitchings(s::HybridSystem, k::Int, v0::Int, forward::Bool=true)
Iterates over all the forward
switching of length k
starting at mode v0
.