You are on page 1of 20

Modeling: Hybrid systems

Arijit Mondal
Dept. of Computer Science & Engineering
Indian Institute of Technology Patna
arijit@iitp.ac.in

IIT Patna 1
Introduction
• Most of the systems have both continuous and discrete behavior
• Continuous behavior can be modeled by ODE and discrete behavior by FSM
• Need to have separate modeling scheme to describe both the behavior
• Usually, states in discrete modelling are enhanced with time based behavior

IIT Patna 2
Hybrid systems: example
• Digital controller
• Thermostat
• Automatic cruise control
• Aircraft autopilot
• Phased operation
• Bouncing ball
• Biological cell growth
• Multiagent systems
• Interaction of robots
• Ground and air transportation systems

IIT Patna 3
Timed automata

guard/output action
set action

State 1 State 2
Initial set
condition
guard/output action
set action

time-based system time-based system

IIT Patna 4
Double click detector

variable: x(t) : R click ∧ x(t) < 1/double


input: click: pure
output: single, double: pure
x(t) ≥ 1/single

idle one
ẋ(t) = 0 ẋ(t) = 1
x(t) := 0
click/
x(t) := 0

IIT Patna 5
Bouncing ball

x(t) = 0/bump
ẋ(t) := −aẋ(t)

free
ẍ(t) = −g
x(t) := h
ẋ(t) = 0

IIT Patna 6
Thermostat

τ (t) ≤ 20 ∧ s(t) ≥ Tc
s(t) := 0

Cooling Heating
h(t) = 0 h(t) = 1
s(t) := Tc ṡ(t) = 1 ṡ(t) = 1

τ (t) ≥ 20 ∧ s(t) ≥ Th
s(t) := 0

τ h

IIT Patna 7
Example: pedestrian crosswalk
variable: count : {0, 1, . . . , 60}
input: pedestrian : pure
output: sigY , sigG , sigR : pure
green
count ≥ 60/sigG ẋ(t) = 1 pedestrian ∧ x(t) < 60/
x(t) := 0

red pedestrian ∧ x(t) ≥ 60/sigY pending


x(t) := 0 ẋ(t) = 1 x(t) := 0 ẋ(t) = 1

x(t) ≥ 60/sigY
x(t) ≥ 5/sigR yellow
x(t) := 0
x(t) := 0 ẋ(t) = 1

IIT Patna 8
Buck converter

L1

V1 C1 R1

IIT Patna 9
Buck converter: Mode 1

L1

V1 C1 R1

IIT Patna 10
Buck converter: Mode 2

L1

V1 C1 R1

IIT Patna 11
Buck converter: hybrid automata

x(t) > 4/OFF


x(t) := 0

ON OFF
ẋ(t) = 1 ẋ(t) = 1
x(t) := 0 i, v i, v

x(t) > 2/ON


x(t) := 0

IIT Patna 12
Automatic cruise control

right straight
ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

stop left
ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

IIT Patna 13
Automatic cruise control

right straight
ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

x(t) := 0 stop left


ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

IIT Patna 13
Automatic cruise control

right straight
ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

start

x(t) := 0 stop left


ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

IIT Patna 13
Automatic cruise control

right straight
ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )
stop

start

x(t) := 0 stop left


ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

IIT Patna 13
Automatic cruise control

right straight
ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )
stop

stop

start

x(t) := 0 stop left


ẋ, ẏ , θ̇ stop ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

IIT Patna 13
Automatic cruise control

right straight
ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )
stop

¬stop ∧ e(t) < −ε2


¬stop ∧ |e(t)| < ε1
stop

start

x(t) := 0 stop left


ẋ, ẏ , θ̇ stop ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

IIT Patna 13
Automatic cruise control
¬stop ∧ |e(t)| < ε1
right straight
ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )
¬stop ∧ e(t) < ε2
stop

¬stop ∧ e(t) < −ε2


¬stop ∧ |e(t)| < ε1
stop

start

x(t) := 0 stop left


ẋ, ẏ , θ̇ stop ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

IIT Patna 13
Automatic cruise control
¬stop ∧ |e(t)| < ε1
right straight
ẋ, ẏ , θ̇ ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )
¬stop ∧ e(t) < ε2
stop

¬s

¬stop ∧ e(t) < −ε2


¬stop ∧ |e(t)| < ε1
to
p

e(
t)
¬s
stop

to

>
p


ε2
e(
start

t)
>
ε2
x(t) := 0 stop left
ẋ, ẏ , θ̇ stop ẋ, ẏ , θ̇
e = f (x, y ) e = f (x, y )

IIT Patna 13

You might also like