dynamic structure modeling for causal block diargams
TRANSCRIPT
![Page 1: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/1.jpg)
1
Dynamic structure modelling for Causal
Block Diagrams
Master Thesis by Yves Maris
Promotors: Fernando Barros, Hans Vangheluwe
![Page 2: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/2.jpg)
2
Overview
– Background: Causal Block Diagrams
– Syntax
– Semantics
– Problem statement
– Dynamic structure CBD
– Syntax
– Semantics
– Implementation
– Case study: elevator model
![Page 3: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/3.jpg)
3
Overview
– Background: Causal Block Diagrams (CBD)
– Syntax
– Semantics
– Problem statement
– Dynamic structure CBD
– Syntax
– Semantics
– Implementation
– Case study: elevator model
![Page 4: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/4.jpg)
4
Causal Block Diagrams Abstract Syntax
![Page 5: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/5.jpg)
5
Causal Block Diagrams Visual Syntax
![Page 6: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/6.jpg)
6
Overview
– Background: Causal Block Diagrams (CBD)
– Syntax
– Semantics
– Problem statement
– Dynamic structure CBD
– Syntax
– Semantics
– Implementation
– Case study: elevator model
![Page 7: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/7.jpg)
7
Causal Block Diagrams semantics
![Page 8: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/8.jpg)
8
Background: flattening
– Purely syntactical
– Needed for loop detection
![Page 9: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/9.jpg)
9
Background: Evaluation Order
– Dependenties beween blocks
– Topological sort
![Page 10: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/10.jpg)
10
Loop detection
– Strong component algorithm
– Use gausian solver for implicit solution
![Page 11: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/11.jpg)
11
Overview
– Background: Causal Block Diagrams (CBD)
– Syntax
– Semantics
– Problem statement
– Dynamic structure CBD
– Syntax
– Semantics
– Implementation
– Case study: elevator model
![Page 12: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/12.jpg)
12
Problem Statement
– Expressiveness limited by fixed structure
– Changing model during simulation
– Staying consistent with CBD constructs
![Page 13: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/13.jpg)
13
Schedule
– Background: Causal Block Diagrams
– Problem statement
– Dynamic structure CBD
– Syntax
– Semantics
– Implementation
– Case study: elevator model
![Page 14: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/14.jpg)
14
Abstract Syntax
![Page 15: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/15.jpg)
15
Visual syntax: explicit representation
– Reuse of existing graph transformation syntax
– Left-hand side before
– Right-hand side after
– Trigger trough input port
![Page 16: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/16.jpg)
16
Visual syntax: implicit representation
– Trigger received trough CBD input port
– Added structures: green
– Removed structures: red
![Page 17: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/17.jpg)
17
Visual syntax: hybrid representation
– Mix between implicit and explicit representation
– Implicit representation separated by block
– Simulated model isolated
![Page 18: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/18.jpg)
18
Visual syntax: comparison
– Implicit representation not expressive enough
– Hybrid representation
– Same expressiveness as explicit representation
– More compact
![Page 19: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/19.jpg)
19
Overview
– Background: Causal Block Diagrams (CBD)
– Syntax
– Semantics
– Problem statement
– Dynamic structure CBD
– Visual syntax
– Semantics
– Implementation
– Case study: elevator model
![Page 20: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/20.jpg)
20
Related work
– Hybrid CBD
– Mustafiz, Sadaf, et al. "Towards Modular Language Design Using Language Fragments: The Hybrid Systems Case Study." Information
Technology: New Generations. Springer International Publishing, 2016. 785-797.
– Uses signal crossing
– Dynamic structure DEVS (DSDEVS)
– Barros, Fernando J. "Modeling formalisms for dynamic structure systems."ACM Transactions on Modeling and Computer Simulation
(TOMACS) 7.4 (1997): 501-515.
– Heterogeneous flow systems
– Barros, Fernando J. "Dynamic structure multiparadigm modeling and simulation." ACM Transactions on Modeling and Computer
Simulation (TOMACS) 13.3 (2003): 259-275.
– Use of model executive
![Page 21: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/21.jpg)
21
Triggering a change: zero crossing
– Piecewise constant signal to “event”
– Pre and post condition
– Implemented using basic blocks
![Page 22: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/22.jpg)
22
Triggering a change: zero crossing
– Signal must cross zero from below
– Previous iteration: condition must be not satisfied
– Current iteration: condition must be satisfied
![Page 23: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/23.jpg)
23
Triggering a change: timed event
– Generating “event” after a fixed number of timesteps
– Value determined when intialised
![Page 24: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/24.jpg)
24
Modeling a change: structure block
– Features of a dynamic structure formalism
– Identification of existing structures
– Creation of new structures
– Removal of existing structures
– Initialisation of values
![Page 25: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/25.jpg)
25
Modeling a change: structure block
– Structure block = adapted CBD specification
– Structure function for modelling change
– Multiple input/ no output ports
– Default 1: event that triggers a change
– Other input ports for initialisation of values
– Changes apply only to one CBD! (hierarchical)
![Page 26: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/26.jpg)
26
Modeling a change: examples
![Page 27: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/27.jpg)
27
Modeling a change: examples
![Page 28: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/28.jpg)
28
Adapted operational semantics
![Page 29: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/29.jpg)
29
Overview
– Background: Causal Block Diagrams (CBD)
– Syntax
– Semantics
– Problem statement
– Dynamic structure CBD
– Syntax
– Semantics
– Implementation
– Case study: elevator model
![Page 30: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/30.jpg)
30
Implementation
![Page 31: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/31.jpg)
31
Implementation: AToMPM
– Visual modeling enviroment
![Page 32: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/32.jpg)
32
Metadepth
– Exported AToMPM model using built in functionality
– Supports EGL for code generation
![Page 33: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/33.jpg)
33
XML
– Readable models
– Consistent declarations
– Remove tags
![Page 34: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/34.jpg)
34
Python
– Parser generates code including structure functions
– Simulator implemented in python
– Extended CBD simulator from MOSIS course
![Page 35: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/35.jpg)
35
Debugging
– Test driven development
– Traces
![Page 36: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/36.jpg)
36
Overview
– Background: Causal Block Diagrams (CBD)
– Syntax
– Semantics
– Problem statement
– Dynamic structure CBD
– Syntax
– Semantics
– Implementation
– Case study: elevator model
![Page 37: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/37.jpg)
37
Case Study
– Balls in elevator
– Doors open when elevator reaches floor
– Balls can enter and leave elevator trough door
![Page 38: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/38.jpg)
38
Modeling a Ball
![Page 39: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/39.jpg)
39
Position with constant velocity
![Page 40: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/40.jpg)
40
Position with constant acceleration
![Page 41: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/41.jpg)
41
Velocity CBD for elevator wall
![Page 42: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/42.jpg)
42
Demo
![Page 43: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/43.jpg)
43
Execution plots
![Page 44: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/44.jpg)
44
Execution plots
![Page 45: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/45.jpg)
45
Execution plots
![Page 46: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/46.jpg)
46
Future work
– Advanced scheduling of structure blocks
– Optimisation techniques
– Comparison to other methods (hybrid systems)
![Page 47: Dynamic structure modeling for Causal Block Diargams](https://reader031.vdocuments.net/reader031/viewer/2022022618/621923b5e26c4677ee5436e0/html5/thumbnails/47.jpg)
47
Questions?