On the Soundness of Behavioural Abstraction in Hybrid Systems - - PowerPoint PPT Presentation

on the soundness of behavioural abstraction in hybrid
SMART_READER_LITE
LIVE PREVIEW

On the Soundness of Behavioural Abstraction in Hybrid Systems - - PowerPoint PPT Presentation

On the Soundness of Behavioural Abstraction in Hybrid Systems SIM@SYST.Level, 19 th of October, 2014, Cargse, France Simon Bliudze and Sbastien Furic Towards On the Soundness of Behavioural Abstraction in Hybrid Systems SIM@SYST.Level, 19


slide-1
SLIDE 1

SIM@SYST.Level, 19th of October, 2014, Cargèse, France Simon Bliudze and Sébastien Furic

On the Soundness of Behavioural Abstraction in Hybrid Systems

slide-2
SLIDE 2

SIM@SYST.Level, 19th of October, 2014, Cargèse, France Simon Bliudze and Sébastien Furic

On the Soundness of Behavioural Abstraction in Hybrid Systems

Towards

slide-3
SLIDE 3

SIM@SYST.Level, 19th of October, 2014, Cargèse, France Simon Bliudze and Sébastien Furic

On the Soundness of Behavioural Abstraction in Hybrid Systems

  • S. Bliudze and S. Furic. An Operational Semantics for Hybrid Systems

Involving Behavioral Abstraction. Proc. of the 10th International Modelica Conference, Lund, Sweden, pp. 693–706. 2014.

Towards

slide-4
SLIDE 4

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Abstraction

  • The fuse model assumes negligible melting duration
  • In particular w.r.t. the raise duration of the voltage source

2

model Fuse
 extends Interfaces.OnePort;
 parameter Real iMax; parameter Real Ron, Roff; Boolean on; protected Real R; initial equation

  • n = true;

equation
 when i > iMax then

  • n = false;


end when;
 R = if on then Ron else Roff; v = R * i; end Fuse;

slide-5
SLIDE 5

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Expected behaviour

  • Only the first fuse melts
  • Independently of the voltage slope

3

slide-6
SLIDE 6

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Nested abstraction

  • Suppose we also abstract the behaviour of the voltage source
  • Both fuses melt due to the loss of signal continuity

4

slide-7
SLIDE 7

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Desired behaviour

  • Signals are no longer maps from time to values
  • We need infinitesimal time steps to enable this behaviour

5

slide-8
SLIDE 8
slide-9
SLIDE 9

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Non-standard analysis

  • Used intuitively by Leibniz and Newton
  • Formalised by Abraham Robinson in the 60s

7

R infinitely great positive reals infinitely great negative reals infinitesimals

N, N + 1, N 2, N/2, eN, . . . ε = 1/N, . . . ε ≈ 0

slide-10
SLIDE 10

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Standardisation

  • Every finite non-standard real has a unique standard part
  • Functions can be standardised
  • Standardisation of a function is not defined on all non-

standard reals, but only on the standard ones

8

x = std(x) + ε std(x) ∈ R ε ≈ 0 ∀x ∈ R, std

  • f
  • (x)

def

= std

  • f(x)
  • f : ∗R → ∗R

std

  • f
  • : R → R
slide-11
SLIDE 11

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Examples

  • Differentiation
  • Integration
  • Continuity

9

d

  • x2

dx = (x + dx)2 − x2 dx = 2x dx + dx2 dx = 2x + dx ≈ 2x ∀x ∈ ∗R, x ≈ a = ⇒ ∗f(x) ≈ ∗f(a) Z 1 f(x)dx ≈

N−1

X

i=0

f(i dx)dx , where N = 1/dx

slide-12
SLIDE 12

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 21

Everything is a sequence

10

1 = [1, 1, 1, . . . ]

∗f = [f, f, f, . . . ]

N = [1, 2, 3, . . . ] ε = 1/N = ⇥ 1, 1 2, 1 3, . . . ⇤ N + 1 = [2, 3, 4, . . . ] ε2 = 1/N 2 = ⇥ 1, 1 4, 1 9, . . . ⇤ x = [x1, x2, x3, . . . ] y = [y1, y2, y3, . . . ] x < y

def

⇐ ⇒ xi < yi for almost all i Quite similar in spirit to the definition of reals using Cauchy sequences

slide-13
SLIDE 13

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 21

Everything is a sequence

10

1 = [1, 1, 1, . . . ]

∗f = [f, f, f, . . . ]

N = [1, 2, 3, . . . ] ε = 1/N = ⇥ 1, 1 2, 1 3, . . . ⇤ N + 1 = [2, 3, 4, . . . ] ε2 = 1/N 2 = ⇥ 1, 1 4, 1 9, . . . ⇤ x = [x1, x2, x3, . . . ] y = [y1, y2, y3, . . . ] x < y

def

⇐ ⇒ xi < yi for almost all i Quite similar in spirit to the definition of reals using Cauchy sequences

slide-14
SLIDE 14

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Transfer principle

  • Non-standard reals are a first-order equivalent model of

the real field

  • Any first-order formula true in is true in and vice-versa.
  • Example (continuity):

11

∀ε ∈ R(ε > 0), ∃δ ∈ R(δ > 0) : ∀x ∈ R,

  • |x − a| < δ ⇒ |f(x) − f(a)| < ε
  • R

∗R

slide-15
SLIDE 15

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Transfer principle

  • Non-standard reals are a first-order equivalent model of

the real field

  • Any first-order formula true in is true in and vice-versa.
  • Example (continuity):

11

∀ε ∈ R(ε > 0), ∃δ ∈ R(δ > 0) : ∀x ∈ R,

  • |x − a| < δ ⇒ |f(x) − f(a)| < ε
  • ∀ε ∈ ∗R(ε > 0), ∃δ ∈ ∗R(δ > 0) :

∀x ∈ ∗R,

  • |x − ∗a| < δ ⇒ |∗f(x) − ∗f(∗a)| < ε
  • R

∗R

slide-16
SLIDE 16

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Łoś' theorem

  • Generalisation of the transfer principle
  • Any first-order formula is true in if and only if it is true in for

almost all indices.

  • Example (Archimedean property):

12

∗R

R ε = [ε1, ε2, ε3, . . . ], ∀i ∈ N, εi ∈ R(εi > 0) ∀x ∈ R, ∃n ∈ Z : nεi < x ≤ (n + 1)εi ∀x ∈ ∗R, ∃n ∈ ∗Z : nε < x ≤ (n + 1)ε

slide-17
SLIDE 17
slide-18
SLIDE 18

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

QSS approach

  • Force all dense-time signals to have discrete codomains

14

∗T def

= ∗R+

∗T → r + ε · ∗Z

ε ≈ 0

slide-19
SLIDE 19

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

The meaning of ODE

  • Red dots indicate events on the input signal

15

e

˙ x = f(x, y) x(0) = r

slide-20
SLIDE 20

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Inifinite slope signals

  • After “standardisation” they have vertical slopes

16

slide-21
SLIDE 21

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Back to the circuit

  • When the current reaches the rated value of the first fuse,

this produces an input event, inverting the slope

17

slide-22
SLIDE 22
slide-23
SLIDE 23

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Key assumptions

  • We rely on two assumptions
  • The signal passes by all intermediate values in the “right order” (continuity)
  • The fuse melts infinitely faster than the voltage increases (model assumption)

19

slide-24
SLIDE 24

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Key assumptions

  • We rely on two assumptions
  • The signal passes by all intermediate values in the “right order” (continuity)
  • The fuse melts infinitely faster than the voltage increases (model assumption)

19

slide-25
SLIDE 25

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Signets

  • Consider signals as sequences of additive signets
  • A signet is a non-standard continuous internal function

20

f : ∗[0, df] → ∗R f(0) = 0

slide-26
SLIDE 26

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Specifying abstraction

  • Internal functions are


sequences of standard functions

  • As a consequence of Łoś' theorem, we can reason on standard

functions to draw conclusions about the signet

  • Use this to derive interval boundaries for the interval abstraction

21

slide-27
SLIDE 27

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Conclusion

  • We proposed a semantic model for hybrid signals
  • Uniform (linear) and dense nature of time
  • The “physical” properties of signals (read “continuity”)
  • Operational, although not directly implementable
  • Describes how to compute the exact solution of a system of dynamic equations
  • Disregarding the finiteness of computational resources
  • Can serve as a basis for reasoning and implementation
  • Concrete implementations approximate the solution with non-infinitesimal error
  • New language features can be discussed on a sound basis
  • First step towards formalising signal abstraction

22

slide-28
SLIDE 28

Appendix

slide-29
SLIDE 29

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 22 24

model BouncingBall Real v, x;
 constant Real g = 10; initial equation v = 1.0; x = 0.0; equation
 der(v) = -g; der(x) = v; when x < 0 then reinit(v, -0.8 * pre(v)); reinit(x, 0.0); end when; end BouncingBall;

slide-30
SLIDE 30

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 22 24

model BouncingBall Real v, x;
 constant Real g = 10; initial equation v = 1.0; x = 0.0; equation
 der(v) = -g; der(x) = v; when x < 0 then reinit(v, -0.8 * pre(v)); reinit(x, 0.0); end when; end BouncingBall;

slide-31
SLIDE 31

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 22 24

model BouncingBall Real v, x;
 constant Real g = 10; initial equation v = 1.0; x = 0.0; equation
 der(v) = -g; der(x) = v; when x < 0 then reinit(v, -0.8 * pre(v)); reinit(x, 0.0); end when; end BouncingBall;

slide-32
SLIDE 32

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 21

Which one is correct?

25

  • 0.06
  • 0.04
  • 0.02
0.02 0.04 0.06 0.5 1 1.5 2
  • 0.01
0.01 0.02 0.03 0.04 0.05 0.06 0.5 1 1.5 2

Results from simulator A Results from simulator B

slide-33
SLIDE 33

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 21

Which one is correct?

25

  • 0.06
  • 0.04
  • 0.02
0.02 0.04 0.06 0.5 1 1.5 2
  • 0.01
0.01 0.02 0.03 0.04 0.05 0.06 0.5 1 1.5 2

Results from simulator A Results from simulator B

slide-34
SLIDE 34

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 21

What’s wrong?

26

lim

n→∞ tn − t0 = 10v0

g = 1

slide-35
SLIDE 35

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 21

Zeno point

27

  • 0.06
  • 0.04
  • 0.02
0.02 0.04 0.06 0.5 1 1.5 2
  • 0.01
0.01 0.02 0.03 0.04 0.05 0.06 0.5 1 1.5 2

The model is undefined beyond the Zeno point!

slide-36
SLIDE 36

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 21

Abstraction

28

  • 0.01
0.01 0.02 0.03 0.04 0.05 0.06 0.5 1 1.5 2

model BouncingBall Real v, x;
 constant Real g = 10; initial equation v = 1.0; x = 0.0; equation
 der(v) = -g; der(x) = v; when x < 0 then reinit(v, -0.8 * pre(v)); reinit(x, 0.0); end when; end BouncingBall;

This model is an idealised representation of the real-world behaviour of the ball.

slide-37
SLIDE 37

/ 22

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

Approximation

29

  • Fixed-step Euler method
  • Approximates the desired model behaviour
  • Necessarily oversteps the Zeno point
  • To fit all models, we need an infinitesimal step.

xn+1 = xn + h · f(xn)

slide-38
SLIDE 38

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 21

Non-standard semantics

30

standard positive step sizes non-standard infinitesimal positive step sizes

∗T def

=

  • ε · n | n ∈ ∗N0

∀ε ≈ 0, ∀x ∈ ∗R, ∃n ∈ ∗Z : nε < x ≤ (n + 1)ε

slide-39
SLIDE 39

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 21

Non-standard semantics

30

standard positive step sizes non-standard infinitesimal positive step sizes

∗T def

=

  • ε · n | n ∈ ∗N0

∀ε ≈ 0, ∀x ∈ ∗R, ∃n ∈ ∗Z : nε < x ≤ (n + 1)ε

slide-40
SLIDE 40

S.Bliudze, SIM@SYST.Level, Cargèse, 19th of October, 2014

/ 21

Non-standard semantics

30

standard positive step sizes non-standard infinitesimal positive step sizes

∗T def

=

  • ε · n | n ∈ ∗N0

∀ε ≈ 0, ∀x ∈ ∗R, ∃n ∈ ∗Z : nε < x ≤ (n + 1)ε