Types
This section describes types implemented in HybridSystems.jl.
Hybrid systems
AbstractHybridSystemAbstract supertype for a hybrid system.
HybridSystems.HybridSystem — Type.HybridSystem{A, S, R, W, SV<:AbstractVector{S}, RV<:AbstractVector{R}, RW<:AbstractVector{W}} <: AbstractHybridSystemA hybrid system modelled as a hybrid automaton.
Fields
automaton– hybrid automaton of typeA.modes– vector of modes of typeSindexed by the discrete states, both the domain and the dynamic are stored in this field. Seestatesetto access the domain.resetmaps– vector of reset maps of typeRindexed by the label of the transition, the guard is stored as constraint of the map in this field. Seestatesetto access the guard.switchings– vector of switchings of typeWindexed by the label of the transition, seeAbstractSwitching.ext– dictionary that can be used by extensions.
Notes
The automaton automaton of type A models the different discrete states and the allowed transitions with corresponding labels.
The mode dynamic and domain are stored in a continuous dynamical system of type S in the vector modes. They are indexed by the discrete states of the automaton.
The reset maps and guards are given as a map or a discrete dynamical system of type R in the vector resetmaps. They are indexed by the labels of the corresponding transition.
The switching of type W is given in the switchings vector, indexed by the label of the transition.
Additional data can be stored in the ext field.
Examples
Automata
HybridSystems.AbstractAutomaton — Type.AbstractAutomatonAbstract type for an automaton.
HybridSystems.AbstractTransition — Type.AbstractTransitionAbstract type for the transition of an automaton.
HybridSystems.OneStateAutomaton — Type.OneStateAutomatonAutomaton with one state and the nt events 1, ..., nt.
HybridSystems.OneStateTransition — Type.OneStateTransitionTransition of OneStateAutomaton with label σ.
HybridSystems.LightAutomaton — Type.LightAutomaton{GT, ET} <: AbstractAutomatonA hybrid automaton that uses the LightGraphs backend. See the constructor LightAutomaton(::Int).
Fields
G– graph of typeGTwhose vertices determine the statesΣ– dictionary mapping the edges to their labels
HybridSystems.LightAutomaton — Method.LightAutomaton(n::Int)Creates a LightAutomaton with n states 1, 2, ..., n. The automaton is initialized without any transitions, use add_transition! to add transitions.
Examples
To create an automaton with 2 nodes 1, 2, self-loops of labels 1, a transition from 1 to 2 with label 2 and transition from 2 to 1 with label 3, do the following:
julia> a = LightAutomaton(2);
julia> add_transition!(a, 1, 1, 1) # Add a self-loop of label 1 for state 1
HybridSystems.LightTransition{LightGraphs.SimpleGraphs.SimpleEdge{Int64}}(Edge 1 => 1, 1)
julia> add_transition!(a, 2, 2, 1) # Add a self-loop of label 1 for state 2
HybridSystems.LightTransition{LightGraphs.SimpleGraphs.SimpleEdge{Int64}}(Edge 2 => 2, 2)
julia> add_transition!(a, 1, 2, 2) # Add a transition from state 1 to state 2 with label 2
HybridSystems.LightTransition{LightGraphs.SimpleGraphs.SimpleEdge{Int64}}(Edge 1 => 2, 3)
julia> add_transition!(a, 2, 1, 3) # Add a transition from state 2 to state 1 with label 3
HybridSystems.LightTransition{LightGraphs.SimpleGraphs.SimpleEdge{Int64}}(Edge 2 => 1, 4)struct LightTransitionIterator{GT, ET, VT}
automaton::LightAutomaton{GT, ET}
edge_iterator::VT
endIterate over the transitions of automaton by iterating over the edges edge of edge_iterator and the ids id of automaton.Σ[edge] for each one. Its elements are LightTransition(edge, id).
Switchings
HybridSystems.AbstractSwitching — Type.AbstractSwitchingNature of the switching, e.g. AutonomousSwitching or ControlledSwitching, see Section 1.1.3 of [1]
[1] Liberzon, D. Switching in systems and control. Springer Science & Business Media, 2012
AutonomousSwitching <: AbstractSwitchingControlled switching, the switching signal is autonomous.
ControlledSwitching <: AbstractSwitchingControlled switching, the switching signal is controlled.