Types

Types

This section describes types implemented in HybridSystems.jl.

Hybrid systems

AbstractHybridSystem

Abstract supertype for a hybrid system.

HybridSystem{A, S, R, W, SV<:AbstractVector{S}, RV<:AbstractVector{R}, RW<:AbstractVector{W}} <: AbstractHybridSystem

A hybrid system modelled as a hybrid automaton.

Fields

  • automaton – hybrid automaton of type A.
  • modes – vector of modes of type S indexed by the discrete states, both the domain and the dynamic are stored in this field. See stateset to access the domain.
  • resetmaps – vector of reset maps of type R indexed by the label of the transition, the guard is stored as constraint of the map in this field. See stateset to access the guard.
  • switchings – vector of switchings of type W indexed by the label of the transition, see AbstractSwitching.
  • 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

See the Thermostat example.

Automata

AbstractAutomaton

Abstract type for an automaton.

AbstractTransition

Abstract type for the transition of an automaton.

OneStateAutomaton

Automaton with one state and the nt events 1, ..., nt.

OneStateTransition

Transition of OneStateAutomaton with label σ.

LightAutomaton{GT, ET} <: AbstractAutomaton

A hybrid automaton that uses the LightGraphs backend. See the constructor LightAutomaton(::Int).

Fields

  • G – graph of type GT whose vertices determine the states
  • Σ – dictionary mapping the edges to their labels
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
end

Iterate 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

AbstractSwitching

Nature 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 <: AbstractSwitching

Controlled switching, the switching signal is autonomous.

ControlledSwitching <: AbstractSwitching

Controlled switching, the switching signal is controlled.