DEVS Flattening with muModelica and pyDEVS Jesse Doherty Outline - - PowerPoint PPT Presentation

devs flattening with mumodelica and pydevs
SMART_READER_LITE
LIVE PREVIEW

DEVS Flattening with muModelica and pyDEVS Jesse Doherty Outline - - PowerPoint PPT Presentation

DEVS Flattening with muModelica and pyDEVS Jesse Doherty Outline Introduction Motivations Tools Solution Conclusion Introduction DEVS Atomic S ,ta, int , X , ext ,Y , Coupled X self ,Y self


slide-1
SLIDE 1

DEVS Flattening with muModelica and pyDEVS

Jesse Doherty

slide-2
SLIDE 2

Outline

  • Introduction
  • Motivations
  • Tools
  • Solution
  • Conclusion
slide-3
SLIDE 3
  • DEVS

– Atomic – Coupled

Introduction

〈S ,ta,int, X ,ext ,Y ,〉 〈 X self ,Y self , D,{M i},{I i},{Zij},select 〉

slide-4
SLIDE 4

Introduction

  • DEVS

– Closed under coupling, through flattening – Closure Procedure

〈S ,ta,int, X ,ext ,Y ,〉 〈 X self ,Y self , D,{M i},{I i},{Zij},select 〉

slide-5
SLIDE 5

Motivation

  • Why do we use a coupled DEVS solver?
slide-6
SLIDE 6

Motivation

  • Why do we use a coupled DEVS solver?

– Solver can be parallelized – Solving the original system seems more

satisfying

– Solving through flattening still requires an atomic

solver

slide-7
SLIDE 7

Motivation

  • Why would we want to flatten?
slide-8
SLIDE 8

Motivation

  • Why would we want to flatten?

– Static analysis – Optimizations – Tools become less complex

slide-9
SLIDE 9

How?

  • Seems simple

– take some cross products – find some minimums – keep track of some time – forward some transition functions

slide-10
SLIDE 10

Problems

  • Questions come up quickly

– how do we specify DEVS – how do we represent them – how do we transform them – how do we solve them

slide-11
SLIDE 11

Tools

  • Modelica
  • muModelica
  • Devs in Modelica
  • Python Devs
slide-12
SLIDE 12

Modelica

  • Object oriented model description language

– not a programming language

  • Highly structured
  • Suitable for high-level model description
slide-13
SLIDE 13

muModelica

  • Modelica compiler originally intended to

target octave code

  • Written in python
  • Extendable
  • Provides an AST of input code
slide-14
SLIDE 14

DEVS in Modelica

  • Set of Modelica classes used to represent

DEVS components

– Events – State – Port – Atomic DEVS – Coupled DEVS

  • More structured than pydevs representation
slide-15
SLIDE 15

DEVS in Modelica

  • Functionality added to muModelica to DEVS

semantics and output pydevs code

  • Some restrictions

– submodels must be explicitly listed – atomic DEVS' states are expected to have a

sequential state component (though not enforced)

slide-16
SLIDE 16

PyDEVS

  • All seen before
slide-17
SLIDE 17

Ideal Solution

  • For each coupled DEVS

– produce a new atomic DEVS with

  • state equivalent to a combination of all sub model

states

  • transition, output and ta functions are an inlining of

component functions

– discard original AST and produce AST for just

the new atomic DEVS

slide-18
SLIDE 18

Initial Solution

  • Maintain original AST structure
  • Create new flattened versions of coupled

models

  • State of these flattened versions would

consist of a list of instances of component models, and an elapsed time for each

  • For each function, perform appropriate logic

and forward the function to the needed component models

slide-19
SLIDE 19

Current Solution

  • While producing python code for modelica

models, also produce python code for flattened DEVS models

  • Benefits:

– Simpler to implement, direct access to python

language

  • Drawbacks:

– loose access to structure of flattened model

slide-20
SLIDE 20

Encountered Problems

  • muModelica AST can be clumsy when

dealing with DEVS structure

  • Need a useful way of representing combined

states, for use in analysis

slide-21
SLIDE 21

Conclusion

  • Flattening might be useful
  • More specialized tools for dealing with DEVS

structure would be needed produce useful analysis