
2a35a1daae6cc55a069ae1e3398fc369.ppt
- Количество слайдов: 26
OMG, Santa Clara, December 2008 Sys. ML and Modelica: Opportunities for Synergy Chris Paredis, Peter Fritzson, Russell Peak Georgia Institute of Technology Linköping University
Intent of Presentation • Introduce Modelica to Sys. ML community • Propose an effort to explore an integration between Modelica and Sys. ML further: Descriptive Modeling in Sys. ML + Formal Executable Modeling for Analyses and Trade Studies in Modelica 2
Overview • Modelica overview • • • What is Modelica? What makes Modelica so appealing? The Modelica Standard Library The Open. Modelica Project Sys. ML – Modelica Synergy Sys. ML – Modelica Correspondence Steps Forward Summary Additional References 3
What is Modelica? • State-of-the-art Modeling Language for System Dynamics – Differential Algebraic Equations (DAE) – Discrete Events • Formal, object-oriented language • Ports represent energy flow (undirected) or signal flow (directed) • Acausal, equation-based, declarative • Multi-domain modeling 4
Modelica is Object-Oriented model Sliding. Mass "Sliding mass with inertia" extends Interfaces. Rigid; import SI = Modelica. SIunits; parameter SI. Mass m = 1 "mass o the sliding mass"; SI. Velocity v "absolute velocity of the component"; SI. Acceleration a "absolute acceleration of the component"; equation v = der(s); a = der(v); m*a = flange_a. f + flange_b. f; end Sliding. Mass; Class consists of declaration + equations Specify the default value for parameters Modelica is case sensitive Objects are declared as instances of classes Equations are non-causal Use dot-notation to refer to object variables
Modelica is Acausal, and Port-based • Acausal, equation-based – F = m*a – a = F/m – 0 = F – m*a • Port-based – Connectors represent energy flow – Undirected connections • Semantics of Kirchhoff's laws – E. g. , fluid port contains • • Pressure flow: Mass flow rate Temperature flow: Enthalpy flow rate 6
Textual and Graphical Views model my. Circuit Annotations for annotation (uses(Modelica(version="2. 2. 1"))); visualization, compilation Modelica. Electrical. Analog. Basic. Ground 1 & simulation annotation (extent=[-62, -44; -42, -24]); Modelica. Electrical. Analog. Basic. Resistor 1 annotation (extent=[0, -14; 20, 6], rotation=270); Do not affect Modelica. Electrical. Analog. Basic. Capacitor 1 mathematical model annotation (extent=[-32, 6; -12, 26]); Modelica. Electrical. Analog. Sources. Constant. Voltage 1 annotation (extent=[-62, -14; -42, 6], rotation=270); equation connect(Constant. Voltage 1. p, Resistor 1. p) annotation (points=[-52, -24; -52, -14], style(color=3, rgbcolor={0, 0, 255})); connect(Resistor 1. n, Capacitor 1. p) annotation (points=[-52, 6; -52, 16; -32, 16], style(color=3, rgbcolor={0, 0, 255})); connect(Capacitor 1. n, Constant. Voltage 1. n) annotation (points=[-12, 16; 10, 6], style(color=3, rgbcolor={0, 0, 255})); connect(Constant. Voltage 1. n, Ground 1. p) annotation (points=[10, -14; -52, -14], style(color=3, rgbcolor={0, 0, 255})); end my. Circuit; 7
What Makes Modelica so Appealing? Symbolic manipulation of equations enables – Causality assignment – Simplification / elimination of algebraic loops – Index reduction – Zero-crossing functions for event detection – Symbolic differentiation for faster root-finding • Bottom Line: – Very expressive models – Very efficient simulations 8
Example: Stribeck Friction • Hybrid model – DAE + discrete events • 5 states: 1. 2. 3. 4. 5. locked start. Forward forward start. Backward • Dynamically reverses causality when v=0 • Avoids typical stiffness at v=0
motor torque The Modelica Standard Library 10
The Modelica Standard Library Information about syntax and semantics of Modelica For working with signals & controls: generate waveforms, transfer functions, sampling, logical operators, look-up tables (interpolation) Defines constants: pi, e, G, h, … Motors and generators: DC, (a-)synchronous induction Multiphase power grids, power electronics (thyristors, etc. ) Standard Mathematical functions (trig, log, interpolation, …) Mechanical 3 D and 1 D (for planar motion use 3 D) Media = liquids and gasses; no component models Large number of units Simple models for flow of fluids with thermal properties Utilities for printing and file access
Other Modelica Libraries • Modelica association — 20+ free libs (www. modelica. org) • EUROSYSLIB project — 20+ libs under development (http: //www. itea 2. org/public/project_leaflets/EUROSYSLIB_profile_oct-07. pdf) 12
The Open. Modelica Project • Open source Modelica environment – – OMC, The Modelica Compiler/Interpreter OMShell, The Interactive Session Handler OMNotebook, Dr. Modelica Simple Electronic notebook Graphic Model Editor – Sim. Forge (developed by Technical University of Milan) – Modelica Development Tooling (MDT) as Eclipse Plugin – Modelica XML conversion – Debugger for extended subset algorithmic code • Supported by the Open Source Modelica Consortium • European ITEA 2 project OPENPROD – PI: P. Fritzson; 25 Partners; € 11 M • More info: http: //www. openmodelica. org 13
Sys. ML – Modelica Synergies • Modelica = state-of-the-art modeling language for system dynamics 1. Complements Sys. ML Parametrics – Very expressive, formal language for differential algebraic equations and discrete events 2. Is (more or less) Compatible with Sys. ML – Object-oriented, port-based 3. Broad Range of (Open Source) Libraries – Addresses need for domain models in Sys. ML 4. Access to Free, Open Source Solvers 14
Overview • Modelica overview • • • What is Modelica? What makes Modelica so appealing? The Modelica Standard Library The Open. Modelica Project Sys. ML – Modelica Synergy Sys. ML – Modelica Correspondence Steps Forward Summary Additional References 15
Sys. ML – Modelica Correspondence: Model Definitions Modelica • Class – Has restricted classes: package, record, function, … – "connector" is crucial • Connection – For energy-flow, the connections have the semantics of Kirchhoff's laws • Equations and Algorithms – Initial equations and algorithms Sys. ML • Block or Constraint Block – Modelica connectors could map to flow ports, or a stereotyped constraint property • Stereotyped connector or stereotyped binding connector • No formal equivalent textual constraint 16
Sys. ML – Modelica Correspondence: Model Usage Modelica • Component clauses – discrete, constant, parameter indicates time variance – input, output, flow • Arrays Sys. ML • Properties (usages) – No equivalents new stereotypes? • Multiplicities – Not sufficiently expressive • Modifiers – Change default values – Redeclare type – Arbitrarily deep in hierarchy • Visualization annotations • Property-specific types – Somewhat vaguely defined – Not (well) supported by tools • Fixed visualization NOTE: this is just an illustration – much work remains 17
Initial Work towards Integration • Modelica. ML UML profile – Pop, A. , and Akhvlediani, D. , and Fritzson, P. (2007). "Towards Unified Systems Modeling with the Modelica. ML UML Profile. " International Workshop on Equation-Based Object-Oriented Languages and Tools. Berlin, Germany, Linköping University Electronic Press. • Sys. ML-Modelica profile and mapping – Johnson, T. A. , C. J. J. Paredis and R. M. Burkhart (2008). "Integrating Models and Simulations of Continuous Dynamics into Sys. ML. " 6 th International Modelica Conference, Bielefeld, Germany, March 3 -4, Modelica Association, 135 -145. – Tool prototype • Automated mapping from Sys. ML (Magic. Draw) to Modelica • Model transformation with MOFLON • Model simulation with Dymola 18
Example: Hydraulic Circuit Diagram Pressure-Compensated, Load-Sensing Excavator—ISO 1219 notation 19
Sys. ML Schematic (ibd) — Basic View Pressure-Compensated, Load-Sensing Excavator 20
Hydraulics Subsystem Simulation Model bdd 21
Excavator Case Study Corresponding Modelica Models Hydraulics Model Multi-Body System Dynamics Model (linkages, . . . ) Dig Cycle hydraulics environment y world p_amb 101325 = T_amb 288. 15 = x 22
Simulation in Dymola Simulation Results Modelica Lexical Representation (auto-generated from Sys. ML) [Johnson, 2008 - Masters Thesis] 23
How to Move Forward from Here? • Further develop and refine Sys. ML-Modelica profile and mapping • In parallel with other Sys. ML 2. 0 efforts • Provide input to future Sys. ML 2. 0 submissions • Team members: Roger Burkhart, Sandy Friedenthal, Peter Fritzson, Chris Paredis, Russell Peak, … 24
Summary • Modelica = state-of-the-art modeling language for system dynamics • Strong Sys. ML-Modelica synergy – Complements Parametrics – Is (more or less) Compatible with Sys. ML – Broad range of libraries – Access to Free Solvers • Good high-level correspondence, but some (minor) differences • Team: extensive experience in both Modelica and Sys. ML 25
Additional References • Modelica Specification: http: //www. modelica. org/documents/Modelica. Spec 30. pdf • Fritzson, P. (2004). Principles of Object-Oriented Modeling and Simulation with Modelica 2. 1. New York, NY, Wiley. IEEE Press. • Akhvlediani, D. (2006). Design and implementation of a 'UML profile for Modelica'/Sys. ML. M. S. Thesis. Linköping University. LITH-IDA-EX--06/061—SE. • Johnson, T. A. (2008). Integrating Models and Simulations of Continuous Dynamic System Behavior into Sys. ML. M. S. Thesis. G. W. Woodruff School of Mechanical Engineering, Georgia Institute of Technology. Atlanta, GA. • Peak, R. , Mc. Ginnis, L. , Paredis, C. Integrating System Design with Simulation and Analysis Using Sys. ML – Phase 1 Final Report, (available from russell. peak@gatech. edu) 26
2a35a1daae6cc55a069ae1e3398fc369.ppt