Logical Foundations of Cyber-Physical Systems Andr Platzer Andr - - PowerPoint PPT Presentation

logical foundations of cyber physical systems
SMART_READER_LITE
LIVE PREVIEW

Logical Foundations of Cyber-Physical Systems Andr Platzer Andr - - PowerPoint PPT Presentation

02: Differential Equations & Domains Logical Foundations of Cyber-Physical Systems Andr Platzer Logical Foundations of Cyber-Physical Systems Andr Platzer Andr Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02


slide-1
SLIDE 1

02: Differential Equations & Domains

Logical Foundations of Cyber-Physical Systems

Logical Foundations of Cyber-Physical Systems

André Platzer

André Platzer

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 1 / 18

slide-2
SLIDE 2

Outline

1

Learning Objectives

2

Introduction

3

Differential Equations

4

Examples of Differential Equations

5

Domains of Differential Equations Terms First-Order Formulas Continuous Programs

6

Summary

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 2 / 18

slide-3
SLIDE 3

Outline

1

Learning Objectives

2

Introduction

3

Differential Equations

4

Examples of Differential Equations

5

Domains of Differential Equations Terms First-Order Formulas Continuous Programs

6

Summary

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 2 / 18

slide-4
SLIDE 4

Learning Objectives

Differential Equations & Domains

CT M&C CPS semantics of differential equations descriptive power of differential equations syntax versus semantics continuous dynamics differential equations evolution domains first-order logic continuous operational effects

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 3 / 18

slide-5
SLIDE 5

Outline

1

Learning Objectives

2

Introduction

3

Differential Equations

4

Examples of Differential Equations

5

Domains of Differential Equations Terms First-Order Formulas Continuous Programs

6

Summary

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 3 / 18

slide-6
SLIDE 6

Differential Equations as Models of Continuous Processes

Example (Vector field and one solution of a differential equation)

  • y′(t) = f(t,y)

y(t0) = y0

  • Intuition:

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 4 / 18

slide-7
SLIDE 7

Differential Equations as Models of Continuous Processes

Example (Vector field and one solution of a differential equation)

  • y′(t) = f(t,y)

y(t0) = y0

  • Intuition:

1

At each point in space, plot the value

  • f RHS f(t,y) as a vector

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 4 / 18

slide-8
SLIDE 8

Differential Equations as Models of Continuous Processes

Example (Vector field and one solution of a differential equation)

  • y′(t) = f(t,y)

y(t0) = y0

  • Intuition:

1

At each point in space, plot the value

  • f RHS f(t,y) as a vector

2

Start at initial state y0 at initial time t0

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 4 / 18

slide-9
SLIDE 9

Differential Equations as Models of Continuous Processes

Example (Vector field and one solution of a differential equation)

  • y′(t) = f(t,y)

y(t0) = y0

  • Intuition:

1

At each point in space, plot the value

  • f RHS f(t,y) as a vector

2

Start at initial state y0 at initial time t0

3

Follow the direction of the vector

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 4 / 18

slide-10
SLIDE 10

Differential Equations as Models of Continuous Processes

Example (Vector field and one solution of a differential equation)

  • y′(t) = f(t,y)

y(t0) = y0

  • Intuition:

1

At each point in space, plot the value

  • f RHS f(t,y) as a vector

2

Start at initial state y0 at initial time t0

3

Follow the direction of the vector The diagram should really show infinitely many vectors . . .

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 4 / 18

slide-11
SLIDE 11

Differential Equations as Models of Continuous Processes

Example (Vector field and one solution of a differential equation)

  • y′(t) = f(t,y)

y(t0) = y0

  • Intuition:

1

At each point in space, plot the value

  • f RHS f(t,y) as a vector

2

Start at initial state y0 at initial time t0

3

Follow the direction of the vector The diagram should really show infinitely many vectors . . . Your car’s ODE: x′ = v,v′ = a

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 4 / 18

slide-12
SLIDE 12

Differential Equations as Models of Continuous Processes

Example (Vector field and one solution of a differential equation)

  • y′(t) = f(t,y)

y(t0) = y0

  • Intuition:

1

At each point in space, plot the value

  • f RHS f(t,y) as a vector

2

Start at initial state y0 at initial time t0

3

Follow the direction of the vector The diagram should really show infinitely many vectors . . . Your car’s ODE: x′ = v,v′ = a Well it’s a wee bit more complicated

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 4 / 18

slide-13
SLIDE 13

Intuition for Differential Equations

t x 1

  • x′(t) = 1

4x(t)

x(0) = 1

  • André Platzer (CMU)

LFCPS/02: Differential Equations & Domains LFCPS/02 5 / 18

slide-14
SLIDE 14

Intuition for Differential Equations

t x 1 8 3

∆ = 8

  • x′(t) = 1

4x(t)

x(0) = 1

  • x(t +∆) := x(t)+ 1

4x(t)∆

x(0) := 1

  • André Platzer (CMU)

LFCPS/02: Differential Equations & Domains LFCPS/02 5 / 18

slide-15
SLIDE 15

Intuition for Differential Equations

t x 1 3

∆ = 8

4 8 2

∆ = 4

  • x′(t) = 1

4x(t)

x(0) = 1

  • x(t +∆) := x(t)+ 1

4x(t)∆

x(0) := 1

  • André Platzer (CMU)

LFCPS/02: Differential Equations & Domains LFCPS/02 5 / 18

slide-16
SLIDE 16

Intuition for Differential Equations

t x 1 3

∆ = 8

4 8 2

∆ = 4

2 6 1 1.5 2.25 3.375

∆ = 2

  • x′(t) = 1

4x(t)

x(0) = 1

  • x(t +∆) := x(t)+ 1

4x(t)∆

x(0) := 1

  • André Platzer (CMU)

LFCPS/02: Differential Equations & Domains LFCPS/02 5 / 18

slide-17
SLIDE 17

Intuition for Differential Equations

t x 1 3

∆ = 8

4 8 2

∆ = 4

2 6 1 1.5 2.25 3.375

∆ = 2

1 3 5 7

∆ = 1

  • x′(t) = 1

4x(t)

x(0) = 1

  • x(t +∆) := x(t)+ 1

4x(t)∆

x(0) := 1

  • André Platzer (CMU)

LFCPS/02: Differential Equations & Domains LFCPS/02 5 / 18

slide-18
SLIDE 18

Intuition for Differential Equations

t x 1 3

∆ = 8

4 8 2

∆ = 4

2 6 1 1.5 2.25 3.375

∆ = 2

1 3 5 7

∆ = 1 ∆ =

1 2

  • x′(t) = 1

4x(t)

x(0) = 1

  • x(t +∆) := x(t)+ 1

4x(t)∆

x(0) := 1

  • André Platzer (CMU)

LFCPS/02: Differential Equations & Domains LFCPS/02 5 / 18

slide-19
SLIDE 19

Intuition for Differential Equations

t x 1 3

∆ = 8

4 8 2

∆ = 4

2 6 1 1.5 2.25 3.375

∆ = 2

1 3 5 7

∆ = 1 ∆ =

1 2

e

t 4

  • x′(t) = 1

4x(t)

x(0) = 1

  • x(t +∆) := x(t)+ 1

4x(t)∆

x(0) := 1

  • André Platzer (CMU)

LFCPS/02: Differential Equations & Domains LFCPS/02 5 / 18

slide-20
SLIDE 20

Outline

1

Learning Objectives

2

Introduction

3

Differential Equations

4

Examples of Differential Equations

5

Domains of Differential Equations Terms First-Order Formulas Continuous Programs

6

Summary

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 5 / 18

slide-21
SLIDE 21

The Meaning of Differential Equations

1

What exactly is a vector field?

2

What does it mean to describe directions of evolution at every point in space?

3

Could these directions possibly contradict each other? Importance of meaning The physical impacts of CPSs do not leave much room for failure. We immediately want to get into the habit of studying the behavior and exact meaning of all relevant aspects of CPS.

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 6 / 18

slide-22
SLIDE 22

Differential Equations & Initial Value Problems

Definition (Ordinary Differential Equation, ODE)

f : D → Rn on domain D ⊆ R×Rn (i.e., open connected set). Then Y : I → Rn is solution of initial value problem (IVP)

  • y′(t) = f(t,y)

y(t0) = y0

  • n the interval I ⊆ R, iff, for all times t ∈ I,

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 7 / 18

slide-23
SLIDE 23

Differential Equations & Initial Value Problems

Definition (Ordinary Differential Equation, ODE)

f : D → Rn on domain D ⊆ R×Rn (i.e., open connected set). Then Y : I → Rn is solution of initial value problem (IVP)

  • y′(t) = f(t,y)

y(t0) = y0

  • n the interval I ⊆ R, iff, for all times t ∈ I,

1

defined (t,Y(t)) ∈ D

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 7 / 18

slide-24
SLIDE 24

Differential Equations & Initial Value Problems

Definition (Ordinary Differential Equation, ODE)

f : D → Rn on domain D ⊆ R×Rn (i.e., open connected set). Then Y : I → Rn is solution of initial value problem (IVP)

  • y′(t) = f(t,y)

y(t0) = y0

  • n the interval I ⊆ R, iff, for all times t ∈ I,

1

defined (t,Y(t)) ∈ D

2

time-derivative Y ′(t) exists and satisfies Y ′(t) = f(t,Y(t)).

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 7 / 18

slide-25
SLIDE 25

Differential Equations & Initial Value Problems

Definition (Ordinary Differential Equation, ODE)

f : D → Rn on domain D ⊆ R×Rn (i.e., open connected set). Then Y : I → Rn is solution of initial value problem (IVP)

  • y′(t) = f(t,y)

y(t0) = y0

  • n the interval I ⊆ R, iff, for all times t ∈ I,

1

defined (t,Y(t)) ∈ D

2

time-derivative Y ′(t) exists and satisfies Y ′(t) = f(t,Y(t)).

3

initial value Y(t0) = y0

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 7 / 18

slide-26
SLIDE 26

Differential Equations & Initial Value Problems

Definition (Ordinary Differential Equation, ODE)

f : D → Rn on domain D ⊆ R×Rn (i.e., open connected set). Then Y : I → Rn is solution of initial value problem (IVP)

  • y′(t) = f(t,y)

y(t0) = y0

  • n the interval I ⊆ R, iff, for all times t ∈ I,

1

defined (t,Y(t)) ∈ D

2

time-derivative Y ′(t) exists and satisfies Y ′(t) = f(t,Y(t)).

3

initial value Y(t0) = y0 If f ∈ C(D,Rn), then Y ∈ C1(I,Rn). If f continuous, then Y continuously differentiable.

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 7 / 18

slide-27
SLIDE 27

Outline

1

Learning Objectives

2

Introduction

3

Differential Equations

4

Examples of Differential Equations

5

Domains of Differential Equations Terms First-Order Formulas Continuous Programs

6

Summary

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 7 / 18

slide-28
SLIDE 28

Example: A Constant Differential Equation

Example (Initial value problem)

  • x′(t) = 1

2

x(0) = −1

  • has a solution

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 8 / 18

slide-29
SLIDE 29

Example: A Constant Differential Equation

Example (Initial value problem)

  • x′(t) = 1

2

x(0) = −1

  • has a solution x(t) = 1

2t − 1 t x 1 1

−1

x

′ =

1 2

−1+ 1

2t

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 8 / 18

slide-30
SLIDE 30

Example: A Constant Differential Equation

Example (Initial value problem)

  • x′(t) = 1

2

x(0) = −1

  • has a solution x(t) = 1

2t − 1 t x 1 1

−1

x

′ =

1 2

−1+ 1

2t

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 8 / 18

slide-31
SLIDE 31

Example: A Constant Differential Equation

Example (Initial value problem)

  • x′(t) = 1

2

x(0) = −1

  • has a solution x(t) = 1

2t − 1 t x 1 1

−1

x

′ =

1 2

−1+ 1

2t

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 8 / 18

slide-32
SLIDE 32

Example: A Constant Differential Equation

Example (Initial value problem)

  • x′(t) = 1

2

x(0) = −1

  • has a solution x(t) = 1

2t − 1 t x 1 1

−1

x

′ =

1 2

−1+ 1

2t

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 8 / 18

slide-33
SLIDE 33

Example: A Constant Differential Equation

Example (Initial value problem)

  • x′(t) = 1

2

x(0) = −1

  • has a solution x(t) = 1

2t − 1

Check by inserting solution into ODE+IVP. (x(t))′ = ( 1

2t − 1)′ = 1 2

x(0) = 1

2 · 0− 1 = −1

  • t

x 1 1

−1

x

′ =

1 2

−1+ 1

2t

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 8 / 18

slide-34
SLIDE 34

Example: A Linear Differential Equation from before

Example (Initial value problem)

  • x′(t) = 1

4x(t)

x(0) = 1

  • has a solution

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 9 / 18

slide-35
SLIDE 35

Example: A Linear Differential Equation from before

Example (Initial value problem)

  • x′(t) = 1

4x(t)

x(0) = 1

  • has a solution x(t) = e

t 4

t x 1 1

e

t 4

x

′ = 1

4

x

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 9 / 18

slide-36
SLIDE 36

Example: A Linear Differential Equation from before

Example (Initial value problem)

  • x′(t) = 1

4x(t)

x(0) = 1

  • has a solution x(t) = e

t 4

t x 1 1

e

t 4

x

′ = 1

4

x

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 9 / 18

slide-37
SLIDE 37

Example: A Linear Differential Equation from before

Example (Initial value problem)

  • x′(t) = 1

4x(t)

x(0) = 1

  • has a solution x(t) = e

t 4

t x 1 1

e

t 4

x

′ = 1

4

x

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 9 / 18

slide-38
SLIDE 38

Example: A Linear Differential Equation from before

Example (Initial value problem)

  • x′(t) = 1

4x(t)

x(0) = 1

  • has a solution x(t) = e

t 4

t x 1 1

e

t 4

x

′ = 1

4

x

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 9 / 18

slide-39
SLIDE 39

Example: A Linear Differential Equation from before

Example (Initial value problem)

  • x′(t) = 1

4x(t)

x(0) = 1

  • has a solution x(t) = e

t 4

Check by inserting solution into ODE+IVP.

  • (x(t))′ = (e

t 4 )′ = e t 4 ( t

4)′ = e

t 4 1

4 = 1 4x(t)

x(0) = e

4 = 1

  • t

x 1 1

e

t 4

x

′ = 1

4

x

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 9 / 18

slide-40
SLIDE 40

Example: Linear Dynamics

Example (Initial value problem)    

v′(t) = w(t) w′(t) = −v(t) v(0) = 0 w(0) = 1

   

has solution

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 10 / 18

slide-41
SLIDE 41

Example: Rotational Dynamics

Example (Initial value problem)    

v′(t) = w(t) w′(t) = −v(t) v(0) = 0 w(0) = 1

   

has solution

  • v(t) = sin(t)

w(t) = cos(t)

  • v

w w = cost v

sint

1 v w

1 2 3 4 5 6

t

  • 1.0
  • 0.5

0.5 1.0 André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 10 / 18

slide-42
SLIDE 42

Example: Rotational Dynamics

Example (Initial value problem)    

v′(t) = ωw(t) w′(t) = −ωv(t) v(0) = 0 w(0) = 1

   

has solution v w w v 1 v w

1 2 3 4 5 6

t

  • 1.0
  • 0.5

0.5 1.0 André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 10 / 18

slide-43
SLIDE 43

Example: Rotational Dynamics

Example (Initial value problem)    

v′(t) = ωw(t) w′(t) = −ωv(t) v(0) = 0 w(0) = 1

   

has solution

  • v(t) = sin(ωt)

w(t) = cos(ωt)

  • v

w w v 1

ω

v w

1 2 3 4 5 6

t

  • 1.0
  • 0.5

0.5 1.0 André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 10 / 18

slide-44
SLIDE 44

Example: More Dynamics

Example (Initial value problem)            

x′(t) = v(t) y′(t) = w(t) v′(t) = ωw(t) w′(t) = −ωv(t) x(0) = x0 y(0) = y0 v(0) = v0 w(0) = w0

           

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 11 / 18

slide-45
SLIDE 45

Example: Planar Motion Dynamics

Example (Initial value problem)            

x′(t) = v(t) y′(t) = w(t) v′(t) = ωw(t) w′(t) = −ωv(t) x(0) = x0 y(0) = y0 v(0) = v0 w(0) = w0

           

x y (v,w) ϑ ω

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 11 / 18

slide-46
SLIDE 46

ODE Examples

ODE Solution x′ = 1,x(0) = x0 x(t) = x0 + t x′ = 5,x(0) = x0 x(t) = x0 + 5t x′ = x,x(0) = x0 x(t) = x0et x′ = x2,x(0) = x0 x(t) =

x0 1−tx0

x′ = 1

x ,x(0) = 1

x(t) = √ 1+ 2t ... y′(x) = −2xy,y(0) = 1 y(x) = e−x2 x′(t) = tx,x(0) = x0 x(t) = x0e

t2 2

x′ = √ x,x(0) = x0 x(t) = t2

4 ± t√x0 + x0

x′ = y,y′ = −x,x(0) = 0,y(0) = 1 x(t) = sint,y(t) = cost x′ = 1+ x2,x(0) = 0 x(t) = tant x′(t) = 2

t3 x(t)

x(t) = e− 1

t2 non-analytic

x′ = x2 + x4

???

x′(t) = et2 non-elementary

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 12 / 18

slide-47
SLIDE 47

ODE Examples Solutions more complicated than ODE

ODE Solution x′ = 1,x(0) = x0 x(t) = x0 + t x′ = 5,x(0) = x0 x(t) = x0 + 5t x′ = x,x(0) = x0 x(t) = x0et x′ = x2,x(0) = x0 x(t) =

x0 1−tx0

x′ = 1

x ,x(0) = 1

x(t) = √ 1+ 2t ... y′(x) = −2xy,y(0) = 1 y(x) = e−x2 x′(t) = tx,x(0) = x0 x(t) = x0e

t2 2

x′ = √ x,x(0) = x0 x(t) = t2

4 ± t√x0 + x0

x′ = y,y′ = −x,x(0) = 0,y(0) = 1 x(t) = sint,y(t) = cost x′ = 1+ x2,x(0) = 0 x(t) = tant x′(t) = 2

t3 x(t)

x(t) = e− 1

t2 non-analytic

x′ = x2 + x4

???

x′(t) = et2 non-elementary

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 12 / 18

slide-48
SLIDE 48

Takeaway Message

Descriptive power of differential equations

1

Solutions of differential equations can be much more involved than the differential equations themselves.

2

Representational and descriptive power of differential equations!

3

Simple differential equations can describe quite complicated physical processes.

4

Local description as the direction into which the system evolves.

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 13 / 18

slide-49
SLIDE 49

Outline

1

Learning Objectives

2

Introduction

3

Differential Equations

4

Examples of Differential Equations

5

Domains of Differential Equations Terms First-Order Formulas Continuous Programs

6

Summary

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 13 / 18

slide-50
SLIDE 50

Evolution Domain Constraints

Enable Cyber to interact with Physics

Definition (Evolution domain constraints)

A differential equation x′ = f(x) with evolution domain Q is denoted by x′ = f(x)&Q conjunctive notation (&) signifies that the system obeys the differential equation x′ = f(x) and the evolution domain Q. t x Q

ν ω

r x′ = f(x)&Q

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 14 / 18

slide-51
SLIDE 51

Evolution Domain Constraints

Enable Cyber to interact with Physics

Definition (Evolution domain constraints)

A differential equation x′ = f(x) with evolution domain Q is denoted by x′ = f(x)&Q conjunctive notation (&) signifies that the system obeys the differential equation x′ = f(x) and the evolution domain Q. t x Q

ν ω

r x′ = f(x)&Q

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 14 / 18

slide-52
SLIDE 52

Evolution Domain Constraints

Enable Cyber to interact with Physics

Definition (Evolution domain constraints)

A differential equation x′ = f(x) with evolution domain Q is denoted by x′ = f(x)&Q conjunctive notation (&) signifies that the system obeys the differential equation x′ = f(x) and the evolution domain Q. t x Q

ν

Q

ω

r s x′ = f(x)&Q

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 14 / 18

slide-53
SLIDE 53

Evolution Domain Constraints

Enable Cyber to interact with Physics

Definition (Evolution domain constraints)

A differential equation x′ = f(x) with evolution domain Q is denoted by x′ = f(x)&Q conjunctive notation (&) signifies that the system obeys the differential equation x′ = f(x) and the evolution domain Q. x′ = v,v′ = a,t′ = 1&t ≤ ε stops at clock ε at the latest x′ = v,v′ = a,t′ = 1&v ≥ 0 stops before velocity negative x′ = y,y′ = x + y2 &true no constraint

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 14 / 18

slide-54
SLIDE 54

Evolution Domain Constraints

Enable Cyber to interact with Physics

Definition (Evolution domain constraints)

A differential equation x′ = f(x) with evolution domain Q is denoted by x′ = f(x)&Q conjunctive notation (&) signifies that the system obeys the differential equation x′ = f(x) and the evolution domain Q. x′ = v,v′ = a,t′ = 1&t ≤ ε stops at clock ε at the latest x′ = v,v′ = a,t′ = 1&v ≥ 0 stops before velocity negative x′ = y,y′ = x + y2 &true no constraint Define: Terms Define: Formulas

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 14 / 18

slide-55
SLIDE 55

Terms: Syntax

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e where e,˜ e are terms, x ∈ V is a variable, c ∈ Q a rational number constant

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-56
SLIDE 56

Terms: Syntax

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e Variable Constant Add Multiply

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-57
SLIDE 57

Terms: Syntax & Semantics

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e

Definition (Semantics of terms) ([

[·] ] : Trm → (S → R))

The value of term e in state ω : V → R is a real number denoted ω[

[e] ] and

is defined by induction on the structure of e:

ω[ [x] ] = ω(x)

if x ∈ V is a variable

ω[ [c] ] = c

if c ∈ Q is a rational constant

ω[ [e + ˜

e]

] = ω[ [e] ]+ω[ [˜

e]

]

addition of reals

ω[ [e · ˜

e]

] = ω[ [e] ]·ω[ [˜

e]

]

multiplication of reals

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-58
SLIDE 58

Terms: Syntax & Semantics

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e

Definition (Semantics of terms) ([

[·] ] : Trm → (S → R))

The value of term e in state ω : V → R is a real number denoted ω[

[e] ] and

is defined by induction on the structure of e:

ω[ [x] ] = ω(x)

if x ∈ V is a variable

ω[ [c] ] = c

if c ∈ Q is a rational constant

ω[ [e + ˜

e]

] = ω[ [e] ]+ω[ [˜

e]

]

addition of reals

ω[ [e · ˜

e]

] = ω[ [e] ]·ω[ [˜

e]

]

multiplication of reals

ω[ [4+ x · 2] ] =

if ω(x) = 5

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-59
SLIDE 59

Terms: Syntax & Semantics

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e

Definition (Semantics of terms) ([

[·] ] : Trm → (S → R))

The value of term e in state ω : V → R is a real number denoted ω[

[e] ] and

is defined by induction on the structure of e:

ω[ [x] ] = ω(x)

if x ∈ V is a variable

ω[ [c] ] = c

if c ∈ Q is a rational constant

ω[ [e + ˜

e]

] = ω[ [e] ]+ω[ [˜

e]

]

addition of reals

ω[ [e · ˜

e]

] = ω[ [e] ]·ω[ [˜

e]

]

multiplication of reals

ω[ [4+ x · 2] ] = ω[ [4] ]+ω[ [x] ]·ω[ [2] ] = 4+ω(x)· 2 = 14

if ω(x) = 5

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-60
SLIDE 60

Terms: Syntax & Semantics

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e

Definition (Semantics of terms) ([

[·] ] : Trm → (S → R))

The value of term e in state ω : V → R is a real number denoted ω[

[e] ] and

is defined by induction on the structure of e:

ω[ [x] ] = ω(x)

if x ∈ V is a variable

ω[ [c] ] = c

if c ∈ Q is a rational constant

ω[ [e + ˜

e]

] = ω[ [e] ]+ω[ [˜

e]

]

addition of reals

ω[ [e · ˜

e]

] = ω[ [e] ]·ω[ [˜

e]

]

multiplication of reals What about x − y?

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-61
SLIDE 61

Terms: Syntax & Semantics

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e

Definition (Semantics of terms) ([

[·] ] : Trm → (S → R))

The value of term e in state ω : V → R is a real number denoted ω[

[e] ] and

is defined by induction on the structure of e:

ω[ [x] ] = ω(x)

if x ∈ V is a variable

ω[ [c] ] = c

if c ∈ Q is a rational constant

ω[ [e + ˜

e]

] = ω[ [e] ]+ω[ [˜

e]

]

addition of reals

ω[ [e · ˜

e]

] = ω[ [e] ]·ω[ [˜

e]

]

multiplication of reals What about x − y? Defined as x +(−1)· y

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-62
SLIDE 62

Terms: Syntax & Semantics

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e

Definition (Semantics of terms) ([

[·] ] : Trm → (S → R))

The value of term e in state ω : V → R is a real number denoted ω[

[e] ] and

is defined by induction on the structure of e:

ω[ [x] ] = ω(x)

if x ∈ V is a variable

ω[ [c] ] = c

if c ∈ Q is a rational constant

ω[ [e + ˜

e]

] = ω[ [e] ]+ω[ [˜

e]

]

addition of reals

ω[ [e · ˜

e]

] = ω[ [e] ]·ω[ [˜

e]

]

multiplication of reals What about x4?

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-63
SLIDE 63

Terms: Syntax & Semantics

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e

Definition (Semantics of terms) ([

[·] ] : Trm → (S → R))

The value of term e in state ω : V → R is a real number denoted ω[

[e] ] and

is defined by induction on the structure of e:

ω[ [x] ] = ω(x)

if x ∈ V is a variable

ω[ [c] ] = c

if c ∈ Q is a rational constant

ω[ [e + ˜

e]

] = ω[ [e] ]+ω[ [˜

e]

]

addition of reals

ω[ [e · ˜

e]

] = ω[ [e] ]·ω[ [˜

e]

]

multiplication of reals What about x4? Defined as x · x · x · x

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-64
SLIDE 64

Terms: Syntax & Semantics

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e

Definition (Semantics of terms) ([

[·] ] : Trm → (S → R))

The value of term e in state ω : V → R is a real number denoted ω[

[e] ] and

is defined by induction on the structure of e:

ω[ [x] ] = ω(x)

if x ∈ V is a variable

ω[ [c] ] = c

if c ∈ Q is a rational constant

ω[ [e + ˜

e]

] = ω[ [e] ]+ω[ [˜

e]

]

addition of reals

ω[ [e · ˜

e]

] = ω[ [e] ]·ω[ [˜

e]

]

multiplication of reals What about xn?

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-65
SLIDE 65

Terms: Syntax & Semantics

Definition (Syntax of terms)

A term e is a polynomial term defined by the grammar: e,˜ e ::= x | c | e + ˜ e | e · ˜ e

Definition (Semantics of terms) ([

[·] ] : Trm → (S → R))

The value of term e in state ω : V → R is a real number denoted ω[

[e] ] and

is defined by induction on the structure of e:

ω[ [x] ] = ω(x)

if x ∈ V is a variable

ω[ [c] ] = c

if c ∈ Q is a rational constant

ω[ [e + ˜

e]

] = ω[ [e] ]+ω[ [˜

e]

]

addition of reals

ω[ [e · ˜

e]

] = ω[ [e] ]·ω[ [˜

e]

]

multiplication of reals What about xn? Defined as x · x · x · x · x ·..., wait when do we stop???

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 15 / 18

slide-66
SLIDE 66

First-Order Logic Formulas: Syntax

Definition (Syntax of first-order logic formulas)

The formulas of FOL of real arithmetic are defined by the grammar: P,Q ::= e ≥ ˜ e | e = ˜ e | ¬P | P ∧ Q | P ∨ Q | P → Q | P ↔ Q | ∀x P | ∃x P

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 16 / 18

slide-67
SLIDE 67

First-Order Logic Formulas: Syntax

Definition (Syntax of first-order logic formulas)

The formulas of FOL of real arithmetic are defined by the grammar: P,Q ::= e ≥ ˜ e | e = ˜ e | ¬P | P ∧ Q | P ∨ Q | P → Q | P ↔ Q | ∀x P | ∃x P Greater-or-equal Not And Or Imply Equiv All Exists

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 16 / 18

slide-68
SLIDE 68

First-Order Logic Formulas: Syntax & Semantics

Definition (Syntax of first-order logic formulas)

The formulas of FOL of real arithmetic are defined by the grammar: P,Q ::= e ≥ ˜ e | e = ˜ e | ¬P | P ∧ Q | P ∨ Q | P → Q | P ↔ Q | ∀x P | ∃x P

Definition (Semantics of first-order logic formulas)

First-order formula P is true in state ω, written ω |

= P, defined inductively: ω | = e = ˜

e iff ω[

[e] ] = ω[ [˜

e]

] ω | = e ≥ ˜

e iff ω[

[e] ] ≥ ω[ [˜

e]

] ω | = ¬P

iff ω |

= P, i.e., if it is not the case that ω | = P ω | = P ∧ Q

iff ω |

= P and ω | = Q ω | = P ∨ Q

iff ω |

= P or ω | = Q ω | = P → Q

iff ω |

= P or ω | = Q ω | = ∀x P

iff ωd

x |

= P for all d ∈ R ωd

x (y) =

  • d

if y=x

ω(y)

if y=x

ω | = ∃x P

iff ωd

x |

= P for some d ∈ R

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 16 / 18

slide-69
SLIDE 69

First-Order Logic Formulas: Syntax & Semantics

ω | = P formula P is true in state ω P

formula P is valid, i.e., true in all states ω, i.e., ω |

= P for all ω [ [P] ] = {ω : ω | = P} set of all states in which P is true Definition (Semantics of first-order logic formulas)

First-order formula P is true in state ω, written ω |

= P, defined inductively: ω | = e = ˜

e iff ω[

[e] ] = ω[ [˜

e]

] ω | = e ≥ ˜

e iff ω[

[e] ] ≥ ω[ [˜

e]

] ω | = ¬P

iff ω |

= P, i.e., if it is not the case that ω | = P ω | = P ∧ Q

iff ω |

= P and ω | = Q ω | = P ∨ Q

iff ω |

= P or ω | = Q ω | = P → Q

iff ω |

= P or ω | = Q ω | = ∀x P

iff ωd

x |

= P for all d ∈ R ωd

x (y) =

  • d

if y=x

ω(y)

if y=x

ω | = ∃x P

iff ωd

x |

= P for some d ∈ R

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 16 / 18

slide-70
SLIDE 70

First-Order Logic Formulas: Syntax & Semantics

ω | = P formula P is true in state ω P

formula P is valid, i.e., true in all states ω, i.e., ω |

= P for all ω [ [P] ] = {ω : ω | = P} set of all states in which P is true ∃y (y2 ≤ x)

for ω(x) = 5 and ν(x) = −5

Definition (Semantics of first-order logic formulas)

First-order formula P is true in state ω, written ω |

= P, defined inductively: ω | = e = ˜

e iff ω[

[e] ] = ω[ [˜

e]

] ω | = e ≥ ˜

e iff ω[

[e] ] ≥ ω[ [˜

e]

] ω | = ¬P

iff ω |

= P, i.e., if it is not the case that ω | = P ω | = P ∧ Q

iff ω |

= P and ω | = Q ω | = P ∨ Q

iff ω |

= P or ω | = Q ω | = P → Q

iff ω |

= P or ω | = Q ω | = ∀x P

iff ωd

x |

= P for all d ∈ R ωd

x (y) =

  • d

if y=x

ω(y)

if y=x

ω | = ∃x P

iff ωd

x |

= P for some d ∈ R

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 16 / 18

slide-71
SLIDE 71

First-Order Logic Formulas: Syntax & Semantics

ω | = P formula P is true in state ω P

formula P is valid, i.e., true in all states ω, i.e., ω |

= P for all ω [ [P] ] = {ω : ω | = P} set of all states in which P is true ω | = ∃y (y2 ≤ x) but ν | = ∃y (y2 ≤ x)

for ω(x) = 5 and ν(x) = −5

Definition (Semantics of first-order logic formulas)

First-order formula P is true in state ω, written ω |

= P, defined inductively: ω | = e = ˜

e iff ω[

[e] ] = ω[ [˜

e]

] ω | = e ≥ ˜

e iff ω[

[e] ] ≥ ω[ [˜

e]

] ω | = ¬P

iff ω |

= P, i.e., if it is not the case that ω | = P ω | = P ∧ Q

iff ω |

= P and ω | = Q ω | = P ∨ Q

iff ω |

= P or ω | = Q ω | = P → Q

iff ω |

= P or ω | = Q ω | = ∀x P

iff ωd

x |

= P for all d ∈ R ωd

x (y) =

  • d

if y=x

ω(y)

if y=x

ω | = ∃x P

iff ωd

x |

= P for some d ∈ R

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 16 / 18

slide-72
SLIDE 72

Semantics of ODEs with Evolution Constraints

Definition (Semantics of differential equations)

A function ϕ : [0,r] → S of some duration r ≥ 0 satisfies the differential equation x′ = f(x)&Q, written ϕ |

= x′ = f(x)∧ Q, iff:

1

ϕ(z)(x′) = dϕ(t)(x)

dt

(z) exists at all times 0 ≤ z ≤ r

2

ϕ(z) | = x′ = f(x)∧ Q for all times 0 ≤ z ≤ r

3

ϕ(z) = ϕ(0) except at x,x′

t x Q r x′ = f(x)&Q z x′ = f(x)

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 17 / 18

slide-73
SLIDE 73

Semantics of ODEs with Evolution Constraints

Definition (Semantics of differential equations)

A function ϕ : [0,r] → S of some duration r ≥ 0 satisfies the differential equation x′ = f(x)&Q, written ϕ |

= x′ = f(x)∧ Q, iff:

1

ϕ(z)(x′) = dϕ(t)(x)

dt

(z) exists at all times 0 ≤ z ≤ r

2

ϕ(z) | = x′ = f(x)∧ Q for all times 0 ≤ z ≤ r

3

ϕ(z) = ϕ(0) except at x,x′

t x Q r x′ = f(x)&Q z x

′ =

f

(

x

)

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 17 / 18

slide-74
SLIDE 74

Semantics of ODEs with Evolution Constraints

Definition (Semantics of differential equations)

A function ϕ : [0,r] → S of some duration r ≥ 0 satisfies the differential equation x′ = f(x)&Q, written ϕ |

= x′ = f(x)∧ Q, iff:

1

ϕ(z)(x′) = dϕ(t)(x)

dt

(z) exists at all times 0 ≤ z ≤ r

2

ϕ(z) | = x′ = f(x)∧ Q for all times 0 ≤ z ≤ r

3

ϕ(z) = ϕ(0) except at x,x′

t x Q r x′ = f(x)&Q z x′ = f(x)

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 17 / 18

slide-75
SLIDE 75

Semantics of ODEs with Evolution Constraints

Definition (Semantics of differential equations)

A function ϕ : [0,r] → S of some duration r ≥ 0 satisfies the differential equation x′ = f(x)&Q, written ϕ |

= x′ = f(x)∧ Q, iff:

1

ϕ(z)(x′) = dϕ(t)(x)

dt

(z) exists at all times 0 ≤ z ≤ r

2

ϕ(z) | = x′ = f(x)∧ Q for all times 0 ≤ z ≤ r

3

ϕ(z) = ϕ(0) except at x,x′

t x Q r x′ = f(x)&Q z x′ = f(x)

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 17 / 18

slide-76
SLIDE 76

Outline

1

Learning Objectives

2

Introduction

3

Differential Equations

4

Examples of Differential Equations

5

Domains of Differential Equations Terms First-Order Formulas Continuous Programs

6

Summary

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 17 / 18

slide-77
SLIDE 77

Summary: Differential Equations & Domains

Definition (Syntax of terms)

e,˜ e ::= x | c | e + ˜ e | e · ˜ e

Definition (Syntax of first-order logic formulas)

P,Q ::= e ≥ ˜ e | e = ˜ e | ¬P | P ∧ Q | P ∨ Q | P → Q | P ↔ Q | ∀x P | ∃x P

Definition (Syntax of continuous programs)

A differential equation x′ = f(x) with evolution domain Q is denoted by x′ = f(x)&Q t x Q r z x′ = f(x)

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 18 / 18

slide-78
SLIDE 78

André Platzer. Logical Foundations of Cyber-Physical Systems. Springer, Switzerland, 2018. URL: http://www.springer.com/978-3-319-63587-3,

doi:10.1007/978-3-319-63588-0.

André Platzer. Logical Analysis of Hybrid Systems: Proving Theorems for Complex Dynamics. Springer, Heidelberg, 2010.

doi:10.1007/978-3-642-14509-4.

André Platzer (CMU) LFCPS/02: Differential Equations & Domains LFCPS/02 18 / 18