George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint...

44
George M. Coghill The Morven Framework

Transcript of George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint...

Page 1: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

George M. Coghill

The Morven Framework

Page 2: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Motivation

• To provide properly constructive, constraint based qualitative simulation

• Retain QR ethos• To alleviate the problem of spurious behaviours• General purpose QR• Why a “Framework”

– No system is suitable for all situations– Permits testing and comparison of approaches– Consists in modular constituents

Page 3: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Context

PredictiveAlgorithm

Vector Envisionment

FuSim

Qualitative

Reasoning

P.A. V.E.

QSIM

TQA & TCP

Morven

Page 4: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Constituents

• Predecessors– Variables are represented as vectors– Models are distributed over differential planes– Fuzzy quantity spaces are utilised– Empirical knowledge can be incorporated.

• Specific to Morven– Transitions only generated for state variables– Constructive (assynchronous) simulation– Fuzzy Vector Envisionment– Different approach to prioritisation– Discrete time (synchronous) simulation

Page 5: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Constiuents (2)

• Permits multi-dimensional comparisons• Constructive & Non-constructive

• Simulation & Envisionment

• Synchronous & Assynchronous

Page 6: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

The Morven Framework

ConstructiveNon-constructive

Simulation

Envisionment

Synchronous

Asynchronous

Page 7: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Fuzzy Qualitative Reasoning

• Motivation

• Integration of qualitative and vague quantitative information - captured in the nature of fuzzy sets

• Ability to utilise and calculate temporal information in a qualitative simulator

• To include empirically derived information into a qualitative simulator

Page 8: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

• 4-tuple fuzzy numbers (a, b, )

• precise and approximate

• useful for computation

μ

a x

x a

x a x a a

x a b

b x x b b

x b

( )

( ) [ ]

[ ]

( ) [ ]

=

< −

− + ∈ −

+ − ∈ +

> +

⎪⎪⎪

⎪⎪⎪

0

1

0

1

1

x

μA(x)

1

0 a x

(a)

μA(x)

1

0 a b x

(b)μA(x)

1

0 a- a xa+

(c)

μA(x)

1

0 a- b+a b

(d)

A convenient fuzzy representation

Page 9: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Fuzzy Quantity Spaces

μA

(x)

10 x-1 0.2 0.4 0.6 0.8-0.8 -0.6 -0.4 -0.2

n-top n-large n-medium n-small zero p-small p-medium p-large p-top

μA

(x)

10 x-1 0.2 0.4 0.6 0.8-0.8 -0.6 -0.4 -0.2

0

Page 10: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Curve Shapes

+ 0

0

+

_

_

d1d2

Page 11: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Transition Rules• Intermediate Value Theorem (IVT)

– States that for a continuous system, a function joining two points of opposite sign must pass through zero.

• Mean Value Theorem (MVT)– Defines the direction of change of a variable between two points.

[++] [+o] [+-]

[o+] [oo] [o-]

[-+] [-o] [- -]

Page 12: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Single Tank System

V

qi

qo

plane 0qO = kVV’ = qi - qO

plane 1q’O = kV’V’’ = q’i - q’O

plane 2q’’O = kV’’V’’’ = q’’i - q’’O

Page 13: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Single Compartment System

plane 0k10x1 = k10.x1x1’ = u - k10x1

plane 1k10x1’ = k10.x1’x1’’ = u’ - k10x1’

plane 2k10x1’’ = k10.x1’’x1’’’ = u’’ - k10x1’’

1

u

k10.x1

Page 14: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Models in Morven

(define-fuzzy-model <model_name>

(short-name <short_name_of_model>)

(variables <list-of [variable_name, bounds, quantity-space]>)

(auxiliary-variables <list-of auxiliary_variable_names>)

(input <list-of [input_name, bounds, quantity-space]>)

(constraints <list-of [differential_planes (list-of constraints)]>

(print <list-of variable_names>)

)

Page 15: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

A JMorven Modelmodel-name: single-tankshort-name: fst

NumSystemVariables: 2variable: qo range: zero p-max NumDerivatives: 1 qspaces: tanks-quantity-spacevariable: V range: zero p-max NumDerivatives: 2 qsapces: tanks-quantity-space tanks-quantity-space2

NumExogenousVariables: 1variable: qi range: zero p-max NumDerivatives: 1 qspaces: tanks-quantity-space

Constraints:NumDiffPlanes: 2

Plane: 0 NumConstraints: 2Constraint: func (dt 0 qo) (dt 0 V) NumMappings: 9Mappings:

n-max n-maxn-large n-largen-medium n-mediumn-small n-smallzero zerop-small p-smallp-medium p-mediump-large p-largep-max p-max

Constraint: sub (dt 1 V) (dt 0 qi) (dt 0 qo)

NumVarsToPrint: 3 VarsToPrint: V qi qo

Page 16: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

A JMorven Quantity Space NumQSpaces: 2

QSpaceName: tanks-quantity-spaceNumQuantities: 9

n-max -1 -1 0 0.1n-large -0.9 -0.75 0.05 0.15n-medium -0.6 -0.4 0.1 0.1n-small -0.25 -0.15 0.1 0.15zero 0 0 0 0p-small 0.15 0.25 0.15 0.1p-medium 0.4 0.6 0.1 0.1p-large 0.75 0.9 0.15 0.05p-max 1 1 0.1 0

QSpaceName: tanks-quantity-space2NumQuantities: 5

nl-dash -1 -0.75 0 0.15ns-dash -0.6 -0.15 0.1 0.15zero 0 0 0 0ps-dash 0.15 0.6 0.15 0.1pl-dash 0.75 1 0.15 0

Page 17: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Possible States

state vector state vector1 + + + + 22 + - o +2 + + + o 23 + - o o3 + + + - 24 + - o -4 + + o + 25 + - - +5 + + o o 26 + - - o6 + + o - 27 + - - -7 + + - + 28 o + + +8 + + - o 29 o + + o9 + + - - 30 o + + -10 + o + + 31 o + o +11 + o + o 32 o + o o12 + o + - 33 o + o -13 + o o + 34 o + - +14 + o o o 35 o + - o15 + o o - 36 o + - -16 + o - + 37 o o + +17 + o - o 38 o o + o18 + o - - 39 o o + -19 + - + + 40 o o o +20 + - + o 41 o o o o21 + - + -

Page 18: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Step Response

t

V

Page 19: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Solution Space

21

147

30V

qi

Page 20: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Soundness and Completeness

• Sound– Guarantees to find all possible behaviours of system

• Incomplete– Unfortunately also finds non-existent (spurious) behaviours

• Still useful for ascertaining that a dangerous state cannot be reached.

• Large research effort to remove spurious behaviours– we will skim the surfarce of the surface!

Page 21: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Single Tank System: Ramp Input

V

qi

qo

t

qi

•Input: Stepped Ramp

plane 0qO = kVV’ = qi - qO

plane 1q’O = kV’V’’ = q’i - q’O

plane 2q’’O = kV’’V’’’ = q’’i - q’’O

Page 22: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

2 Element Vector Envisionment

State Vector21 + - +12 + 0 +3 + + +5 + + 07 + + -

30 0 + +32 0 + 034 0 + -

21 12 3

30

5

32

7

34

Page 23: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

3 Element Vector EnvisionmentState Vector21 + - + -12 + 0 + -3 + + + -5 + + 0 07 + + - +

30 0 + + -32 0 + 0 034 0 + - +

21 12 3

30

5

32

7

34

Page 24: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Distinct Behaviours

t

V 21

12

3

7

3

5

32

34

30

Page 25: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Solution Space

21

7

30

V

qi

123

5

32

34

Page 26: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Total Solution Space: Single Compartment

u 0

u 1

d

1

,d

3

,d

2

x(0)

Page 27: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Cascaded Systems

plane 0qx = k1.h1qo = k2.h2h1’ = qi - qxh2’ = qx - qo

plane 1qx’ = k1.h1’qo’ = k2.h2’h1’’ = qi’ - qx’h2’’ = qx’ - qo’

plane 2qx’’ = k1.h1’’qo’’ = k2.h2’’h1’’’ = qi’’ - qx’’h2’’’ = qx’’ - qo’’

Tank A

Tank B

1 2

u

k12.x1

k20.x2

h1

h2

qi

qx

qo

Page 28: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Cascaded Systems Envisionment

1

11

12

6 2

0 10 13 9

8

7

5

3

4

State h1 h2 qx qo

0 [0 +] [0 0] [0 +] [0 0]1 [0 +] [+ -] [0 +] [+ -]2 [+ -] [0 +] [+ -] [0 +]3 [+ -] [+ -] [+ -] [+ -]4 [+ -] [+ 0] [+ -] [+ 0]5 [+ -] [+ +] [+ -] [+ +]6 [+ 0] [0 +] [+ 0] [0 +]7 [+ 0] [+ -] [+ 0] [+ -]8 [+ 0] [+ 0] [+ 0] [+ 0]9 [+ 0] [+ +] [+ 0] [+ +]10 [+ +] [0 +] [+ +] [0 +]11 [+ +] [+ -] [+ +] [+ -]12 [+ +] [+ 0] [+ +] [+ 0]13 [+ +] [+ +] [+ +] [+ +]

Page 29: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Cascaded Systems Solution Space

h2

h1

h1’=0

h1’=0

111

12

6 2010

13 9

8

7

5

3

4

Page 30: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Complete Solution Space: Cascaded Compartments

u 0

x 1

x 2

d11,d12,d13

d21

d22

d23

Page 31: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Categorisation of Behaviours

Behaviours

SpuriousReal

Non-chatteringChatteringPotentialActual

Page 32: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Fuzzy Set Theory and FQR

• Two main concepts: the cut and the Approximation principle

• The cutA = [p1, p2, p3, p4]

A= [p1+p3(p2+p4(1-

x

μ A ( )x

(a)

x

μ A (x)

α

(b)

Page 33: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Representational Primitives

Arithmetic primitives

Operation Result Conditions

-n (-d, -c, δ,γ) alln

n

d c d d c c

, ,

( )

,

( )

δ

δ

γ

γ+ −

n >0

0 ,n <0

0

m+n (a+ ,cb+ ,dτ+γ,+δ) allm,nm-n (a- ,d -b c,τ+δ,+γ) allm,nm n× (ac,bd,aγ+cτ−τγ,bδ+d+δ) m n> >

0 0

0 0,

(ad,bc,dτ−aδ+τδ,−bγ+c−γ) m n< >0 0

0 0,

(bc,ad,bγ−c+γ,−dτ+aδ−τδ) m n> <0 0

0 0,

(bd,ac,-bδ−d−δ,−aγ−cτ+τγ) m n< <0 0

0 0,

m=[a,b,τ,],n=[c,d,γ,δ]

Page 34: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Representational Primitives (2)

• Functional primitives– More specific than M+/- relations, though still

incomplete– Compiled (tabular) set of fuzzy if-then rules -

permits incusion of empirical information

• Derivative primitive

Page 35: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

The Approximation Principle

The Approximation principle facilitates the mapping of the result of a fuzzy operation onto the values in the quantity space of the result variable.A measure of the Goodness of Approximation is

achieved by means of a Distance Metric

d(A, A’) = [(power(A)-power(A’))2+(centre(A)-(centre(A’))2]0.5

power([a,b, = 0.5[2(a+b) + centre([a,b, = 0.5[a+b]

Page 36: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Approximation Principle (2)

Propagated value

4 76 8 11 15

Predicted values

10 12 a

Page 37: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Transition RulesGeneration Rules

(G1) If there exists a derivative,dtmk, such that dtmk is the first non-zero derivative which is a higher derivative than dtjk, then If dtmk>0(dtmk<0) Ifqi∈ℜ,then dtjk+=qi+(dtjk+=qi−) else dtjk+=[ ]qqi i∨+(dtjk+=[ ]qqi i∨−)( 2)G Ifallderivativeshigherthandtjk ,are zero orifj=,nthen dtjk+=[ ]qqqi i i− +∨∨ FilteringRules( )F Iflili>+<−( ),the n¬ok( the adjacencyfilte )r ( 2)F Ifthereexists a derivative,dtmk, sucht hatdtmk is thefirstnon- zero derivativewhichis a higherderivativet handtjk,andmn<,then Ifdtmk>0(dtmk<0), then Ifqi∈ℜ,then Iflili≤≥()then¬ok else Iflili<>()then¬ok

Page 38: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Temporal CalculationsPersistence time, ΔTp:

If0∉+dn,then Δ T

W d

d

p

n

n

+

( )

• calculates the end points of an interval

Relative Arrival time, ΔTa:

If 01∉+dnα, then [ ] [ ]

Δ T

L d U d

d

a

j

n

j

n

n

−+

+

1

1

α α

α

Absolute Arrival time, TA:

TA

n

= Δ Tp

i

( d

n

)

i = 0

n − 1

∑+ Δ T

aj

( d

n

)

j = 1

n

Absolute Departure time, TD:

TD

n

= TA

n

+ Δ Tp

n

TD

n + 1

= TD

n

® Δ Tp

n

+ Δ Tp

n , n + 1

Page 39: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Fuzzy Vector Envisionment

T.A.Q.A.

Generate Filter

Page 40: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Experimental Test

h

qi

qo

Page 41: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Fuzzy Vector State Labels

State Fuzzy Vector State Fuzzy Vector State Fuzzy Vector

1 pt z z z 8 pl nm pm nm 14 pm nm pm nm

2 pt ns ps ns 9 pl nl pl nl 15 ps pl nl pl

3 pt nm pm nm 10 pm pm nm pm 16 ps pm nm pm

4 pt nl pl nl 11 pm ps ns ps 17 ps ps ns ps

5 pl ps ns ps 12 pm z z z 18 ps z z z

6 pl z z z 13 pm ns ps ns 19 ps ns ps ns

7 pl ns ps ns

Page 42: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

FVE Graph for a Step Input

34

9 8

14 13

171819

23

8 7

17 16

111213p-medium

p-small

p-large

p-max

p-mediump-small

2

11 10

16 15

567

1

11 10

16 15

5

p-maxp-largeqi

h

Page 43: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Fuzzy Qualitative Behaviours

h

t

72

6

510

16p-small

p-medium

p-large

p-max

Page 44: George M. Coghill The Morven Framework. Motivation To provide properly constructive, constraint based qualitative simulation Retain QR ethos To alleviate.

Cascaded SystemS

mal

l

Small

Lar

ge

Large

h2

h1

Sm

all

Small

Med

ium

Medium Large

Lar

geH

uge

Huge

h2

h1