Methods

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

discreteswitchedsystem(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

statedim(hs::HybridSystem, u::Int)

Returns the dimension of the state space of the system at discrete state u.

stateset(s::AbstractSystem, u::Int)

Returns the set of allowed states of the system at discrete state u.

inputdim(s::AbstractSystem, u::Int)

Returns the dimension of the input space of the system at mode u.

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.statesFunction.
states(A::AbstractAutomaton)

Returns an iterator over the states of the automaton A. It has the alias modes.

HybridSystems.nstatesFunction.
nstates(A::AbstractAutomaton)

Returns the number of states of the automaton A. It has the alias nmodes.

rem_state!(A::AbstractAutomaton, q)

Remove the state q to the automaton A.

HybridSystems.modeFunction.
mode(hs::HybridSystem, u::Int)

Returns the mode of the dynamical system at discrete state u.

target_mode(hs::AbstractHybridSystem, t)

Returns the target mode for the transition t.

Transitions

transitiontype(A::AbstractAutomaton)

Returns type of the transitions of the automaton A.

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.

ntransitions(A::AbstractAutomaton)

Returns the number of transitions of the automaton A.

add_transition!(A::AbstractAutomaton, q, r, σ)

Adds a transition between states q and r with symbol σ to the automaton A.

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.

rem_transition!(A::AbstractAutomaton, t::AbstractTransition)

Remove the transition t from the automaton A.

HybridSystems.sourceFunction.
source(A::AbstractAutomaton, t::AbstractTransition)

Returns the source of the transition t.

HybridSystems.eventFunction.
event(A::AbstractAutomaton, t::AbstractTransition)

Returns the event/symbol of the transition t in the automaton A. It has the alias symbol.

HybridSystems.targetFunction.
target(A::AbstractAutomaton, t::AbstractTransition)

Returns the target of the transition t.

in_transitions(A::AbstractAutomaton, s)

Returns an iterator over the transitions with target s.

out_transitions(A::AbstractAutomaton, s)

Returns an iterator over the transitions with source s.

Guards and Assignments

resetmap(hs::HybridSystem, t)

Returns the reset map for the transition t.

HybridSystems.guardFunction.
guard(hs::HybridSystem, t)

Returns the guard for the transition t.

assignment(hs::HybridSystem, t)

Returns the assignment for the transition t.

Utilities

switchings(s::HybridSystem, k::Int, v0::Int, forward::Bool=true)

Iterates over all the forward switching of length k starting at mode v0.