You are on page 1of 11

# Discrete and Hybrid Dynamic Systems

Hybrid Automata

• Motivation
• Syntax and semantics
• Runs of hybrid automata
• Composition of hybrid systems
• Linear hybrid system
• Verification and model checking
• Conclusion

Presented by Chaiyut Thanukaew

DHS – SS05 – 1

Motivation

Model definition
(Mathematical) description/abstraction of a system and information connection

Why to model?
• Simulation purpose => to study behaviors of the system
• Analysis purpose => to get insight into the system, debugging
• Synthesis purpose => plant design, controller design

Why to model as HS?
• Modern systems comprise of discrete and continuous components
• Either differential equation or discrete program cannot explain the systems
completely
• Using both to describe behaviors of dynamical systems as HS

DHS – SS05 – 2

1
Syntax and semantics

Syntax*: an exposition of or set of rules for producing grammatical structures
according to the syntax of a language

Semantics*: the study of how meaning in language is created by the use and
interrelationships of words, phrases, and sentences.

Why to demand syntax and semantics for HS?
• To represent elements contained in the HS in abstracted/standard fashions
• To interpret the meaning of that syntax correctly wrt. the original HS

* Encarta World English Dictionary & (P) 1999 Microsoft Corporation
DHS – SS05 – 3

Syntax and semantics

Definition
HS is “A discrete program with an analog environment”,
“A formal model for mixed discrete-continuous system” or
“A dynamical system with both discrete and continuous components”

Example
- Bouncing ball
- Automobile engine whose fuel injection (continuous) is regulated by
microprocessor (discrete)

Hybrid Automata of bouncing ball
DHS – SS05 – 4

2
Syntax and semantics

A Model for HS: HS can be written down in several patterns, e.g.
H = (Loc, Var, Lab, Edg, Act, Inv),
H = (V, X, f, Init, Inv, Jump) or
H = (SH, InitH, fH, DomH, RH)
We, hereby, refer to H = (Loc, Var, Lab, Edg, Act, Inv).

HS is represented as a finite automaton with a set of variables, where;
- Vertices => continuous activities
- Edges => discrete transitions
Edge
Vertex
Note: Graph Theory**
A directed graph G is ordered pair G: = (V,A) with
• V a set of vertices or nodes, 2 3
• A a set of ordered pairs of vertices, called directed
edges, arcs, or arrows 1 4
e.g. V: = {1,2,3,4,5,6}
E: = {{1,2},{1,5},{2,3},{2,5},{3,4},{4,5},{4,6}} 5 6

** www.wikipedia.org
DHS – SS05 – 5

Syntax and semantics

HS H = (Loc, Var, Lab, Edg, Act, Inv) consists of;

• Loc (Locations): finite set of vertices
• Var (Variables): finite set X = {x1, x2,…, xn} of real-valued var.
valuation of each x
• Lab (Labels): finite set of synchronization labels
• Edg (Edges): edge labeling function assigned to each transition
• Act (Activities): vertex labeling function assigned to each location
Each activity is a function from nonnegative real
• Inv (Invariant conditions): vertex labeling function assigned to each location
• Furthermore, HS contains Init (Initial conditions) related to some locations

DHS – SS05 – 6

3
Syntax and semantics

Example

Thermostat automaton

Locations: Loc = {off, on}
Variables: X = {x} =>temperature
Initial conditions: the heater off and the temperature x 20 degC
Invariant conditions: x >= 18 and x <= 22
Activities: and
Labels: none
Jump conditions/ Guards: x > 21 and x < 19

DHS – SS05 – 7

Syntax and semantics

Example Act

Leaking gas burner

Locations: Loc = {1, 2} => Leak and Not leak respectively
Variables: X = {x, y, z} => time spent in that location, elaped time
and commulative leakge time respectively
Initial conditions: x, y, z = 0 and 1(the gas burner leaks)
Invariant conditions: x <= 1 in 1
Activities: see above
Labels: none
Jump conditions/ Guards: x >= 30
Reset: x := 0

DHS – SS05 – 8

4
Runs of hybrid system

Definition
⇒ state (li, vi): a pair of control location and values of all variables at any
time constant

Runs of HS
At any time constant, the state (li, vi) of HS can change in two ways;

1.) By a discrete and instantaneous transition => changes both control location
and values of the variables acc. to the transition relation
2.) By a time delay => changes only values of the variables acc. to activities
of current location

HS may stay at a location only if the location invariant is true; that is, some discrete
transition must be taken before the invariant becomes false

DHS – SS05 – 9

Runs of hybrid system

The Run [H] of HS is finite or infinite sequence

of states nonnegative real and activities
such for all
1.
2. for all
3. the state is a transition successor of the state

⇒State called time successor of state
⇒State called successor of state

The run diverges if is infinite and the infinite sum diverges.

DHS – SS05 – 10

5
Runs of hybrid system

Transition system
=>HS as transition system:

Runs of HS in transition system
1. Changing of locations by the discrete and instantaneous transition
=> Transition-step relation for

2. Changing the values of the variables (Act) within each location
=> Time-step relations for

DHS – SS05 – 11

Composition of hybrid systems

Hybrid systems with common set of synchronization labels can be composed
with each other.

• Given HS and

• Assume that two HS synchronize on the common set of synchronization
label
• Whenever H1 performs a discrete transition with the synchronization label
so does H2

DHS – SS05 – 12

6
Composition of hybrid systems

continued
• The product is the hybrid system
such that;

- iff
(1) and
(2) either and

(3)
-
-

DHS – SS05 – 13

Composition of hybrid systems

Model of a train on a circular track with a
gate, the circular tract is between 2000
and 5000 m. Initially, the speed of the
train is between 40 to 50 mps.
x: distance of train to gate
x: train speed
Events: approach and exit
Train automaton
DHS – SS05 – 14

7
Composition of hybrid systems

Example (con’d)

Model of the gate controller
z: clock measuring the elapsed time
u: symbolic constant that represents
the reaction delay of the controller
Events: approach, exit, lower and raise

Controller automaton

DHS – SS05 – 15

Composition of hybrid systems

Example (con’d)

Model of the gate, initially, the gate is
opened (y = 90 deg), then it may starts
closing at the rate 9 degrees per sec.
The opening rate is also the same
rate.
y: position of the gate in deg.
y: changing rate of the gate
Events: lower and raise

Gate automaton

DHS – SS05 – 16

8
Linear hybrid system

HS can be categorized in to two different types;
1. Nonlinear HS
2. Linear HS
We will, hereby, restrict ourselves on the linear HS because of verification/
model checking purposes

The time-deterministic H = (Loc, Var, Lab, Edg, Act, Inv) is linear iff

1) For all Loc, activities Act are defined by a set of diff. eq. of the form
x = kx where; x is Var and kx is constant
2) For all Loc, invariant Inv is defined by a linear formula over Var
3) For all transitions Edg, the guard is required a linear formula over Var

=> Linear term over Var is linear combination of variables in Var with integer
coefficients.
=> Linear formula over Var is boolean combination of inequalities between linear
terms over Var

DHS – SS05 – 17

Linear hybrid system

Example

The water level changes as a piecewise-
linear function over time, where;
Loc 0 and 1: pump on
Loc 2 and 3: pump off
Var: y(water level) and x(time)
There is a delay 2 sec. before the time
change becomes effective. The monitor
senses the water level only at 5 and 10
inches.

Water-level monitor

DHS – SS05 – 18

9
Verification and model checking

Reachability: assumed that there are 2 states of HS. If there is a run of HS
starting from initial state and ending at final state, so the final state is reachable
from the initial state

Verification: act of proving or disproving the correctness of system (plant &
controller) wrt. a formal specification

Model checking: verification by algorithmic approach, computation of reachable
states and check of the specification for these states e.g. CTL

Controller design with formal verification DHS – SS05 – 19

Verification and model checking

Introduction to Computational Tree Logic: CTL ***

Important CTL formulae
• Safety property: AG safe_state
• Goal attainment: EF goal_state or
AF goal_state

*** Lecture note of Logic Control SS2007, University of Dortmund
DHS – SS05 – 20

10
Conclusion

• HS is the formal model for mixed discrete-continuous system
• There are several patterns of HS syntaxes and semantics written down in
scientific printings, while they contains quite similar elements
• Syntax and semantics are used to represent HS in quite abstract fashion
• HS is graphically represented as hybrid automata (HA)
• Runs of HA give us comprehension how HS works in each unit of time
• HA with common synchronization labels can be composed together
• Linear HS is a class of HS for which algorithmic analysis techniques exist
and perform reasonably well in the verification problems
• Linear HA is checked if it satisfies all formal specifications by model
checking e.g. CTL (Computational Tree Logic)

Thank you
DHS – SS05 – 21

11