5 June 2008 Link¨ oping, Sweden some context for Adrian Pop’s thesis Integrated Model-Driven Development Environments for Equation-Based Object-Oriented Languages Hans Vangheluwe Modelling, Simulation and Design Lab (MSDL) School of Computer Science, McGill University, Montr´ eal, Canada Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 1
Overview 1. Why/When Simulation of Complex Systems? 2. Modelling and Simulation Concepts 3. Modelling Languages Evolution 4. Desirable Features 5. Domain-specific Modelling and Language Engineering Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 2
Simulation . . . when too costly/dangerous analysis ↔ design Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 3
Simulation . . . real experiment not ethical training, physical simulation Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 4
Simulation . . . evaluate alternatives Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 5
Simulation . . . “Do it Right the First Time” Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 6
Modelling/Simulation . . . and code/app Synthesis Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 7
Complex Systems: complexity due to . . . large number of components Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 8
Complex Systems: complexity due to . . . www.mathworks.com/products/demos/simulink/PowerWindow/html/PowerWindow1.html heterogeneity of components Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 9
Complex Systems: complexity due to . . . non-compositionality of networks (“emergent” behaviour) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 10
Modelling/Simulating Complex Systems . . . • at the most appropriate level of abstraction • using the most appropriate formalism(s) Ordinary Differential Equations, Petri Nets, Bond Graphs, Statecharts, Forrester System Dynamics, CSP, Queueing Networks, . . . Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 11
Defining “simulation” REALITY MODEL GOALS Real-World Base entity Model only study behaviour in experimental context within context Model Base System S Model M a-priori knowledge experiment simulate within context = virtual experiment validation Experiment Simulation Results Modelling and Simulation Observed Data Process Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 12
Modelling Languages: Simulation Code Library Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 13
Modelling Languages: CSSL Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 14
Modelling Languages: Causal Block Diagram 0.0 x0 K 0.0 1.0 x IC − OUT I y0 1.0 PLOT y IC Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 15
Non-Causal Modelling Languages Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 16
Modelica: Electrical Resistor model Resistor "Ideal linear electrical resistor" extends OnePort; parameter Resistance R=1 "Resistance"; equation R*i = v; end Resistor; Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 17
Modelica: Electrical Network model circuit Resistor R1(R=10); Capacitor C(C=0.01); Resistor R2(R=100); Inductor L(L=0.1); VsourceAC AC; Ground G; equation connect(AC.p, R1.p); connect(R1.n, C.p); connect(C.n, AC.n); connect(R1.p, R2.p); connect(R2.n, L.p); connect(L.n, C.n); connect(AC.n, G.p); end circuit; Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 18
Modelling Languages: EcosimPro Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 19
Modelling Languages: Visual Modelling Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 20
Visual Modelling Environments: gProms Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 21
Quality Criteria for (Modelling) Languages • well-defined syntax and semantics • modularity • library mechanism (and standard libraries) • appropriate abstraction level for particular task (e.g., virtual experimentation with physical systems) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 22
Were missing for Modelica: • Tools for debugging • Language features Beyond Equations Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 23
Beyond Equations Wishlist • Tools for going “under the hood” • Multi-formalism modelling • Domain-Specific (visual) modelling • Ability to bootstrap Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 24
Meta-Modelica and meta-programming eat your own dogfood! Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 25
Multi-formalism / Heterogeneous MoC (Ptolemy) solution: • co-simulation • formalism transformation Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 26
DSM: Waste Water Treatment Plants (WWTPs) NATO’s Sarajevo WWTP www.nato.int/sfor/cimic/env-pro/waterpla.htm Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 27
DS(V)M Environment www.hemmis.com/products/west/ Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 28
Why DS(V)M ? (as opposed to General Purpose modelling) • match the user’s mental model of the problem domain • maximally constrain the user (to the problem at hand) ⇒ easier to learn ⇒ avoid errors • separate domain-expert’s work from analysis/transformation expert’s work Anecdotal evidence of 5 to 10 times speedup Steven Kelly and Juha-Pekka Tolvanen. Domain-Specific Modeling: Enabling Full Code Generation. Wiley 2008. Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 29
Language Engineering (with Modelica) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 30
Warning: A Fool with a Tool . . . Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation: System Specification 31
Recommend
More recommend