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
— Function.discreteswitchedsystem(A::AbstractVector{<:AbstractMatrix})
Creates the discrete switched linear system defined by
where m
is the length of A
.
discreteswitchedsystem(A::AbstractVector{<:AbstractMatrix}, S::AbstractVector)
Creates the state dependent discrete switched linear system defined by
where m
is the length of A
and S
.
discreteswitchedsystem(A::AbstractVector{<:AbstractMatrix}, G::AbstractAutomaton)
Creates the constrained discrete switched linear system defined by
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
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
— Function.statedim(hs::HybridSystem, u::Int)
Returns the dimension of the state space of the system at discrete state u
.
MathematicalSystems.stateset
— Function.stateset(s::AbstractSystem, u::Int)
Returns the set of allowed states of the system at discrete state u
.
MathematicalSystems.inputdim
— Function.inputdim(s::AbstractSystem, u::Int)
Returns the dimension of the input space of the system at mode u
.
MathematicalSystems.inputset
— Function.inputset(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
— Function.states(A::AbstractAutomaton)
Returns an iterator over the states of the automaton A
. It has the alias modes
.
HybridSystems.nstates
— Function.nstates(A::AbstractAutomaton)
Returns the number of states of the automaton A
. It has the alias nmodes
.
HybridSystems.rem_state!
— Function.rem_state!(A::AbstractAutomaton, q)
Remove the state q
to the automaton A
.
HybridSystems.mode
— Function.mode(hs::HybridSystem, u::Int)
Returns the mode of the dynamical system at discrete state u
.
HybridSystems.target_mode
— Function.target_mode(hs::AbstractHybridSystem, t)
Returns the target mode for the transition t
.
Transitions
HybridSystems.transitiontype
— Function.transitiontype(A::AbstractAutomaton)
Returns type of the transitions of the automaton A
.
HybridSystems.transitions
— Function.transitions(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
— Function.ntransitions(A::AbstractAutomaton)
Returns the number of transitions of the automaton A
.
HybridSystems.add_transition!
— Function.add_transition!(A::AbstractAutomaton, q, r, σ)
Adds a transition between states q
and r
with symbol σ
to the automaton A
.
HybridSystems.has_transition
— Function.has_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!
— Function.rem_transition!(A::AbstractAutomaton, t::AbstractTransition)
Remove the transition t
from the automaton A
.
HybridSystems.source
— Function.source(A::AbstractAutomaton, t::AbstractTransition)
Returns the source of the transition t
.
HybridSystems.event
— Function.event(A::AbstractAutomaton, t::AbstractTransition)
Returns the event/symbol of the transition t
in the automaton A
. It has the alias symbol
.
HybridSystems.target
— Function.target(A::AbstractAutomaton, t::AbstractTransition)
Returns the target of the transition t
.
HybridSystems.in_transitions
— Function.in_transitions(A::AbstractAutomaton, s)
Returns an iterator over the transitions with target s
.
HybridSystems.out_transitions
— Function.out_transitions(A::AbstractAutomaton, s)
Returns an iterator over the transitions with source s
.
Guards and Assignments
HybridSystems.resetmap
— Function.resetmap(hs::HybridSystem, t)
Returns the reset map for the transition t
.
HybridSystems.guard
— Function.guard(hs::HybridSystem, t)
Returns the guard for the transition t
.
HybridSystems.assignment
— Function.assignment(hs::HybridSystem, t)
Returns the assignment for the transition t
.
Utilities
HybridSystems.switchings
— Function.switchings(s::HybridSystem, k::Int, v0::Int, forward::Bool=true)
Iterates over all the forward
switching of length k
starting at mode v0
.