Mixed Domain Modeling in Modelica

Similar documents
Modelica. Language, Libraries, Tools, Workshop and EU-Project RealSim

Modelica. Language, Libraries, Tools, and Conferences

Software-Entwicklungswerkzeuge

Software-Entwicklungswerkzeuge. Modelica Overview. Contents. 1. Modelica Introduction. 2. Modelica Users View. 3. Modelica Libraries

Modelica: An International Effort to Design the Next Generation Modelling Language

MWorks: a Modern IDE for Modeling and Simulation of Multidomain Physical Systems Based on Modelica

Design optimisation of industrial robots using the Modelica multi-physics modeling language

car=1700 FS gear=13.5 Wind: cw=0.33 AutoGear ThrottlePos JMotorPump=0.28 TS Jturbine=0.034 TS 1 Engine converter ECU ControlBox

Proceedings of the 4th International Modelica Conference, Hamburg, March 7-8, 2005, Gerhard Schmitz (editor)

Sensor Accuracy in Vehicle Safety

Modeling Structural - Dynamics Systems in MODELICA/Dymola, MODELICA/Mosilab and AnyLogic

Proceedings of the 3 rd International Modelica Conference, Linköping, November 3-4, 2003, Peter Fritzson (editor)

Important Characteristics of VHDL-AMS and Modelica with Respect to Model Exchange

Tomas Skoglund Tetra Pak Processing Systems, Sweden: Simulation of Liquid Food Process in Modelica pp

Modelica TM - A Unified Object-Oriented Language for Physical Systems Modeling. TUTORIAL and RATIONALE

Rotational3D Efficient modelling of 3D effects in rotational mechanics

Proceedings of the 4th International Modelica Conference, Hamburg, March 7-8, 2005, Gerhard Schmitz (editor)

Dymola Dynamic Modeling Laboratory

Proceedings of the 4th International Modelica Conference, Hamburg, March 7-8, 2005, Gerhard Schmitz (editor)

Modeling Technical Systems [ ] Mag MA MA Schweiger Gerald TU Graz Spring 2017

Requirements for the Simulation of Complex Heterogeneous Systems

MathModelica An Extensible Modeling and Simulation Environment with Integrated Graphics and Literate Programming

Model-Based Dynamic Optimization with OpenModelica and CasADi

MapleSim User's Guide

Dymola Dynamic Modeling Laboratory

Proceedings of the 4th International Modelica Conference, Hamburg, March 7-8, 2005, Gerhard Schmitz (editor)

Master Class: Diseño de Sistemas Mecatrónicos

Integrated Modeling, Control Synthesis and Code Generation with Modelica and Dymola

Introduction to Physical Modelling Rory Adams Senior Application Engineer

Object-oriented Modelling of Physical Systems with Modelica using Design Patterns

THE DESIGNER'S GUIDE TO VERILOG-AMS First Edition June 2004

Using SPARK as a Solver for Modelica. Michael Wetter Philip Haves Michael A. Moshier Edward F. Sowell. July 30, 2008

Quick Start Training Guide

MathWorks Technology Session at GE Physical System Modeling with Simulink / Simscape

Peter Fritzson. Principles of Object-Oriented Modeling and Simulation with Modelica. Peter Fritzson

ELECTRONIC CIRCUIT MODELING AND SIMULATION IN MODELICA

Parallel Code Generation in MathModelica / An Object Oriented Component Based Simulation Environment

Proceedings of the 4th International Modelica Conference, Hamburg, March 7-8, 2005, Gerhard Schmitz (editor)

Real-Time Simulation of Simscape Models

Michael Tiller Ford Motor Company: Parsing and Semantic Analysis of Modelica Code for Non- Simulation Applications pp

Behavioral Model Composition in Simulation-Based Design

Modelica Change Proposal MCP-0021 Component Iterators Status: Under Evaluation , version v2, #1848

Automated Modelica Package Generation of Parameterized Multibody Systems in CATIA

Physical Modelling with Simscape

Advanced Modelica Tutorial Exercises

An Easy-to-use Generic Model Configurator for Models in Multiple Tool Formats

Introduction to Control Systems Design

Modeling physical properties. Controller, plant and environment model

Wolfram SystemModeler. Getting Started

SIMPACK - A Tool for Off-Line and Real- Time Simulation

Modelica for Embedded Systems

Translation of Modelica Code into Hybrid Automata

Equation-Based Modeling with Modelica Principles and Future Challenges

Computer Simulation And Modeling

Analog Mixed Signal Extensions for SystemC

DLR FF-DR-ER, Technical Report TR R101-93, March

Aircraft A Modelica Library for Aircraft Dynamics Simulation

Proceedings of the 3 rd International Modelica Conference, Linköping, November 3-4, 2003, Peter Fritzson (editor)

ANALYSIS AND COMPARISON OF A HYDRAULIC AND PNEUMATIC SYSTEM USING THE DYMOLA SOFTWARE

Activation Inheritance in Modelica

Dipartimento di Ingegneria Aerospaziale Politecnico di Milano

Experiment 6 SIMULINK

Scicos/Modelica for modeling and simulation

A TOOL FOR DATA MAPPING FROM DESIGN PRODUCT MODELS TO OBJECT-ORIENTED SIMULATION MODELS

Extending the IPG CarMaker by FMI Compliant Units

Model-based Embedded Control using Rosenbrock Integration Methods

VHDL Analog and Mixed-Signal Extensions Through Examples

Vom Konzept zum Modell physikalischer Systeme Smarter Modellieren mit Simscape

Functional Mockup Interface (FMI) A General Standard for Model Exchange and Simulator Coupling

Parallel Computing Using Modelica

Determining Over- and Under-Constrained Systems of Equations using Structural Constraint Delta

Written exams of Robotics 2

AN INTEGRATED MODELICA ENVIRONMENT FOR MODELING, DOCUMENTATION AND SIMULATION

Experiment 8 SIMULINK

Modeling Kernel Language (MKL)

Functional Mockup Interface for Tool and Model Interoperability

THE DESIGN ENVIRONMENT FOR HETEROGENEOUS SYSTEMS

MathModelica. a new modeling and simulation environment for Mathematica. Abstract

Mechatronic Design Approach D R. T A R E K A. T U T U N J I P H I L A D E L P H I A U N I V E R S I T Y, J O R D A N

INTRODUCTION TO OBJECT-ORIENTED MODELING AND SIMULATION WITH MODELICA USING THE OPENMODELICA ENVIRONMENT

Variable Structure Modeling for Vehicle Refrigeration Applications

Modeling of the wet end part of a paper mill with Dymola

High-Fidelity Transmission Simulation for Hardware-in-the-Loop Applications

s 3 s 3 s 4 s 2 s 1 f 3 f 3 t 2 f 1 f 1 p off p on t 1 s 4 f 4 f 2

Recent developments in simulation, optimization and control of flexible multibody systems

Data Mapping from Product Models to Object Oriented Simulation Models

Index. A a (atto) 154 above event 120, 207 restrictions 178

Mixed-Signal Extensions for SystemC

Towards Unified System Modeling with the ModelicaML UML Profile

-$QGUHDVVRQ$0 OOHU02WWHU 0RGHOLQJRID5DFLQJ&DUZLWK0RGHOLFDV 0XOWL%RG\/LEUDU\ 0RGHOLFD:RUNVKRS3URFHHGLQJVSS

Model Based Systems Engineering Engine Control: from concept to validation. Jan Smolders Technical Account Manager

Simscape User s Guide. R2014a

Composable Models for Simulation-Based Design

Large scale physics simulations in industrial vehicle simulators

Accurate Thermo-Fluid Simulation in Real Time Environments. Silvia Poles, Alberto Deponti, EnginSoft S.p.A. Frank Rhodes, Mentor Graphics

Model Library Mechanics

MSMS (02PCYQW)

CIM 2 Modelica Factory

Real Time Simulation of Complex Automatic Transmission Models. Marius Băţăuş, Andrei Maciac, Mircea Oprean, Nicolae Vasiliu

Automatic Control Industrial robotics

Transcription:

Mixed Domain Modeling in Modelica C. Clauss 1, H. Elmqvist 3, S. E. Mattsson 3, M. Otter 2, P. Schwarz 1 1 Fraunhofer Institute for Integrated Circuits, Design Automation Department, EAS, Dresden, Germany 2 German Aerospace Center (DLR), Oberpfaffenhofen, Germany 3 Dynasim AB, Lund, Sweden 1

Contents 1. Motivation 2. Modelica Fundamentals 3. Modelica Language Elements 4. Simulation Algorithm Related to the Dymola Simulator 5. Modelica Libraries 6. Application Examples 7. Comparison: VHDL-AMS and Modelica 8. Conclusions 2

1. Motivation Modelica yet another modeling language: why? VHDL-AMS, Verilog-AMS, SystemC-AMS have their roots in digital electronics, with extensions to heterogeneous systems: - analog/digital, mixed-signal - HW/SW, digital signal processing - multi-domain capabilities (e.g., in VHDL-AMS: THROUGH and ACROSS quantities instead of currents and voltages, NATURE attribute) Other languages: Dymola, gproms, NMF, ObjectMath, Omola, Smile, U.L.M, EcoSim,... have their roots in control systems, robotics, hydraulics, and mechatronics Modelica combines some of their features, together with - object-oriented modeling and object-oriented programming - orientation on advanced simulation algorithms, e.g., to avoid index problems ( but this is not part of language definition ) 3

Summary of some features Goal: Technique for multi-domain modeling of complex systems. Development started in 1978 by Hilding Elmqvist at Lund Institute of Technology (Sweden). Standardisation with the freely available modeling language Developed by the (non-profit) Modelica Association since 1996, differential, algebraic and discrete equations, declarative (= mathematical equations) and procedural (optional), many Modelica libraries available (mostly public domain): 1D/3D Mechanics, electronics, hydraulics, power systems, heat transfer, thermo-fluid pipe flow, flight dynamics, input/output,.... 4

Modelica Association Chairman Martin Otter DLR, Munich, Germany Vice-Chairman Peter Fritzson Linköping University, Sweden Secretary Hilding Elmqvist Dynasim AB, Lund, Sweden (former Chairman) Treasurer Michael Tiller Ford Motor Company, Dearborn, U.S.A. Bernhard Bachmann Dag Brück Peter Beater Vadim Engelson Thilo Ernst Jorge Ferreira Rüdiger Franke Pavel Grozman Johan Gunnarsson Mats Jirstrand Kaj Juslin Clemens Klein-Robbenhaar Sven Erik Mattsson Henrik Nilsson Hans Olsson Tommy Persson Levon Saldamli Per Sahlin Andre Schneider Peter Schwarz Hubertus Tummescheit Hans-Juerg Wiesmann Fachhochschule Bielefeld, Germany Dynasim AB, Lund, Sweden Gesamthochschule Paderborn, Germany Linköping University, Sweden GMD-FIRST, Berlin, Germany Universidade de Aveiro, Portugal ABB Heidelberg, Germany BrisData AB, Stockholm, Sweden MathCore, Linköping, Sweden MathCore, Linköping, Sweden VTT, Espoo, Finland Germany Dynasim AB, Lund, Sweden Linköping University, Sweden Dynasim AB, Lund, Sweden Linköping University, Sweden Linköping University, Sweden BrisData AB, Stockholm, Sweden Fraunhofer Institute for Integrated Circuits, Dresden, Germany Fraunhofer Institute for Integrated Circuits, Dresden, Germany Lund University, Sweden ABB Corporate Research Ltd, Baden, Switzerland 5

Homepage: Tutorial: Formal specification: Model libraries: Publications: Tools (simulators): www.modelica.org www.modelica.org/current/modelicatutorial14.pdf www.modelica.org/current/modelicaspecification14.pdf www.modelica.org/library/library.html www.modelica.org/workshop2000/proceedings www.modelica.org/workshop2002/proceedings www.modelica.org/tools.shtml Dymola (www.dynasim.se) MathModelica (www.mathcore.se) 6

Modeling and simulation of multi-physics systems where the overall system consists of components from different domains. For example, detailed vehicle model: Vehicle dynamics (3D mechanics) Power train (1D mechanics) Hydraulics Combustion Electrical/electronic systems Air conditioning (thermo fluid) 2. Modelica Fundamentals Control systems (I/O blocks, statecharts,...) 7

Composition Diagrams of Modelica (= object diagrams) component connection Interface Every Icon represents a physical component. e.g. electrical resistance, mechanical gear, pump The connection lines represent the actual physical connection. E.g.: electrical line, rigid mechanical connection, heat flow between components. Variables in the interface points define the coupling with other objects A component consists of a connection of components (= hierarchical structure) and/or is described by equations 8

A Complete Example of a Composition Diagram 9

3. Modelica Language Elements 3.1 Equations The general form in Modelica: expression = expression R*i = u (Ohm s law) not an assignment! A C =22 0 R 1=1 0 C =0. 0 1 R 2=1 0 L= 0. 1 The unknown depends on the model connection structure: i := u/r assignment u := R*I assignment R := u/i assignment G R1=10 or several unknowns (system of simultaneous equations) ε := R*i - u (residue -> 0) V g R 2=4 0 R 3=4 0 No preference to a specialized form of equations (e.g., the Modified Nodal Analysis (MNA) widely used in electronics) G 10

3.2 Variables predefined data types: Real, Integer, Boolean, String new data type predefined data type (floating point number) attributes (e.g. unit) type Angle = Real(quantity ="Angle, unit="rad", displayunit="deg"); type Torque = Real(quantity ="Torque, unit="n.m"); type Mass = Real(quantity ="Mass, unit="kg", min=0); type Pressure = Real(quantity ="Pressure", unit ="Pa", displayunit="bar, nominal=1.e5); attributes: quantity, unit, displayunit, min, max, start, fixed, nominal library Modelica.SIunits: 450 predefine ISO quantity types 11

3.3 Connectors (= interface definitions) connector Pin connector Flange import SI=Modelica.SIunits; import SI=Modelica.SIunits; SI.Voltage v; SI.Angle phi; flow SI.Current i; flow SI.Torque tau; end Pin; end Flange; Group of variables describing interaction Connected flow variables are summed to zero Other connected variables are set equal Flange flange_a; Gearbox gear; equation connect(flange_a, gear.flange_b); 12

Connectors electrical 1D translational mechanics R3 s 3 f 3 i 3 s 1 m3 R1 v 1 v 3 v 2 R2 m1 m3 i 1 i 2 s 2 f 1 f 2 connect(r1.p, R2.p); connect(r1.p, R3.p); connect(m1.flange_a, m2.flange_a); connect(m1.flange_a, m3.flange_a); v v 1 1 = = v v 1 2 3 0 = i + i + i 2 Generated statements: 3 s s 1 1 = = s s 2 3 0 = f + f + f 1 2 3 13

3.4 Component models ideal planetary gear box (no inertias) model IdealPlanetary parameter Real ratio=100/50 # ring_teeth/sun_teeth"; Flange sun "sun flange"; Flange carrier "carrier flange "; Flange ring "ring flange"; equation // kinematic relationship sun.phi - carrier.phi + ratio*(ring.phi - carrier.phi) = 0; // torque balance (no inertias) ring.tau = ratio*sun.tau; carrier.tau + sun.tau + ring.tau = 0; end IdealPlanetary 14

3.5 Partial models and inheritance partial model Rigid "Base for rigid connection of two flanges" import SI=Modelica.SIunits; Flange flange_a "(left) driving flange"; Flange flange_b "(right) driven flange"; SI.Angle phi; equation flange_a.phi = phi; flange_b.phi = phi; end Rigid; model Inertia "rotational inertia" extends Rigid; import SI=Modelica.SIunits; parameter SI.Inertia J; SI.AngularVelocity w; SI.AngularAcceleration a; equation w = der(phi); a = der(w); J*a = flange_a.tau + flange_b.tau; end Inertia; Addition of inertia properties 15

3.5 Partial models and inheritance (cont d) VoltageSource Source time x Function y o v p Example: electrical voltage sources n OnePort SingleOutput VoltageSource s Source f Function SineVoltage s SineSource f Sine Inheritance (is-a-relation) Composition (has-a-relation) 16

3.6 Model composition model SimpleCar import Modelica.Mechanics.Translational.Sensors; Car.Driver driver (k=30, T=50); Car.FullGear gearbox(tablefile="zf4hp22.dat"); Car.FullEngine engine (tablefile="engine1.dat"); Car.Resistance car(mass=1800, area=2.0,...); Car.Axle axle annotation(extent=[20, -10; 40, 10]); Sensors.SpeedSensor v; equation connect(car.flange_a, v.flange_a); connect(gearbox.flange_a, engine.flange_b); connect(gearbox.flange_b, axle.steeringwheel); connect(axle.flange_b, car.flange_a); connect(driver.throttle, engine.inport); connect(v.outport, driver.speed); connect(driver.throttle, gearbox.inport); connect(driver.brake, axle.inport); end SimpleCar; 17

3.7 Component libraries Modelica libraries are hierarchically structured and are mapped to the same hierarchy of the file system (i.e. file name = model name): Example: Modelica.Electrical.Analog.Basic \Modelica \Blocks \Electrical \Analog Basic.mo Semiconductors.mo Sources.mo... \Mechanics Rotational.mo Translational.mo Constants.mo Icons.mo Math.mo SIunits.mo... within Modelica.Electrical.Analog; package Basic model Resistor... end Resistor; new library model Capacitor... end Capacitor;... end Basic; File:...\Modelica\Electrical\Analog\Basic.mo 18

3.8 Additional language elements of Modelica Prozedural sections (algorithm) if, for, while Functions, including well defined external C function interface Multidimensional arrays (similiar to Matlab) Multidimensional component arrays (e.g. for PDE discretization) Replaceable model components (replaceable/redeclare) Discrete equations (when; e.g. sampled data systems) Discontinuous equations (time- and state events) Variable structure equations (e.g. friction, clutches, ideal diode) Very general initialization (if initial() then... end if) Re-initialization at events (impulse(..)) Graphical annotations and embedding of icons 19

4. Simulation Algorithm Related to the Dymola Simulator Overall system equations = equations of all components + equations of all connect statements Continuous, discrete, and mixed-signal equations are handled in the same way! The result is an implicit DAE (Differential Algebraic Equation) system ( x, x, y, t) = 0 f & Direct use of numerical DAE solver not advisable: dimension of y (algebraic variables) very high large Jacobian leads to inefficient simulation equations might need to be differentiated several times (high index problems) Modelica was designed such that symbolic transformation algorithms can be applied. In the following, the algorithms utilized in Dymola are sketched. 20

Dymola Symbolic SolverSimulator What Dymola Symbolic Solver Does for You: Transforms equations to efficient C-code Sorts and equations Solves equations symbolically (for reducing their number) Solves or generates code for algebraic loops Generates code to handle events Generates symbolic Jacobians for efficient nonlinear iterations Handles DAE with constraints (high index DAE s) Automatically assigns state variables Generates code for consistent initialization of DAE 21

Simulator Dymola graphical/textual input Modelica text symbolical processing C text Dymola simulation Output 22

Simulator Dymola graphical/textual input Modelica text symbolical processing C text Dymola simulation model rlc Modelica.Electrical.Analog.Basic.Ground Ground1; Modelica.Electrical.Analog.Basic.Resistor R(R=100); Modelica.Electrical.Analog.Basic.Capacitor C; Modelica.Electrical.Analog.Basic.Inductor L; equation connect (C.n, L.n); connect (L.n, R.n); connect (C.p, L.p); connect (L.p, R.p); connect (C.p, Ground1.p); end rlc; Output 23

Modelica Equation Set: 20 equations/variables Ground Ground1.p.v = 0 Components Resistor R OnePort for R Capacitor C OnePort for C Inductor L OnePort for L Connections: voltages currents voltages currents R.R*R.i = R.v R.v = R.p.v - R.n.v 0 = R.p.i + R.n.i R.i = R.p.i C.i = C.C*der(C.v) C.v = C.p.v - C.n.v 0 = C.p.i + C.n.i C.i = C.p.i L.L*der(L.i) = L.v L.v = L.p.v - L.n.v 0 = L.p.i + L.n.i L.i = L.p.i C.n.v = L.n.v L.n.v = R.n.v C.n.i + L.n.i + R.n.i = 0 C.p.v = L.p.v L.p.v = R.p.v C.p.v = Ground1.p.v C.p.i + L.p.i + R.p.i + Ground1.p.i = 0 24

Simulator Dymola graphical/textual input Modelica text symbolical processing C text Dymola simulation Protocol: - translatemodel("rlc") Translation started DAE with 20 unknown scalars and 20 scalar equations. 4 constants found. 0 parameter bound variables found. 11 alias variables found. 5 remaining time dependent variables. Finished Output 25

Modelica Equation Set: 5 equations/variables Ground Components Resistor R OnePort for R Capacitor C OnePort for C Inductor L OnePort for L Connections: voltages currents voltages currents Ground1.p.v = 0 R.p.i = C.v / R.R R.v = R.p.v - R.n.v 0 = R.p.i + R.n.i R.i = R.p.i der(c.v) = C.p.i / C.C C.v = C.p.v - C.n.v C.p.i = - (L.i + R.p.i) C.i = C.p.i der(l.i) = C.v / L.L L.v = L.p.v - L.n.v 0 = L.p.i + L.n.i L.i = L.p.i C.n.v = L.n.v L.n.v = R.n.v C.n.i + L.n.i + R.n.i = 0 C.p.v = L.p.v L.p.v = R.p.v C.p.v = Ground1.p.v Ground1.p.i = - (C.p.i + L.p.i + R.p.i) 26

Modified Nodal Analysis Equation Set: 2 equations/variables Ground Components Resistor R OnePort for R Capacitor C OnePort for C Inductor L OnePort for L Connections: voltages currents voltages currents Ground1.p.v = 0 R.R*R.i = R.v R.v = R.p.v - R.n.v 0 = R.p.i + R.n.i R.i = R.p.i C.i = C.C*der(C.v) C.v = C.p.v - C.n.v 0 = C.p.i + C.n.i C.i = C.p.i L.L*der(L.i) = C.v L.v = L.p.v - L.n.v 0 = L.p.i + L.n.i L.i = L.p.i C.n.v = L.n.v L.n.v = R.n.v C.C*der(C.v) + L.i + C.v / R.R C.p.v = L.p.v L.p.v = R.p.v C.p.v = Ground1.p.v C.p.i + L.p.i + R.p.i + Ground1.p.i = 0 27

Simulator Dymola graphical/textual input Modelica text symbolical processing C text Dymola simulation Output /* DSblock model generated by Dymola... */ #include... /* DSblock C-code: */... /* Define variable names. */ #define Sections_ #define Ground1_p_v Variable(0) #define Ground1_p_i Variable(1) #define R_p_v Variable(2) #define L_L Parameter(2)... TranslatedEquations... DynamicsSection L_der_i = divmacro(c_v,"c.v",l_l,"l.l"); R_p_i = divmacro(c_v,"c.v",r_r,"r.r"); C_p_i = -(L_i+R_p_i); C_der_v = divmacro(c_p_i,"c.p.i",c_c,"c.c"); Ground1_p_i = -(C_p_i+L_i+R_p_i); EndTranslatedEquations... 28

Simulator Dymola graphical/textual input Modelica text symbolical processing C text Dymola simulation Output - experiment StopTime=500 NumberOfIntervals=5000 - C.v := 5 ; -simulate -------------------------------------------------------------------------- Log-file of program.\dymosim (generated: Fri May 03 08:49:01 2002) dymosim started... Integration started at T = 0 using integration method DASSL (DAE multi-step solver (dassl/dasslrt of Petzold modified by Dynasim)) Integration terminated successfully at T = 500 CPU-time for integration : 0.13 seconds CPU-time for one GRID interval: 0.026 milli-seconds Number of result points : 5001 Number of GRID points : 5001 Number of (successful) steps : 3355 Number of F-evaluations : 6733 Number of Jacobian-evaluations: 17 Number of (model) time events : 0 Number of (U) time events : 0 29

Simulator Dymola graphical/textual input Modelica text symbolical processing C text Dymola simulation Output 30

Real-time simulation of stiff systems Two basic ideas for simulation acceleration: 1. New method mixed mode integration for real time simulation of systems which have slow and fast states: - Slowstates x S are discretized with the explicit Euler method. - Faststates x F are discretized with the implicit Euler method. 2. Discretization formulae are inserted into model ( inline integration ) and overall systems of equations are symbolically solved with Dymolas algorithms to reduce the non-linear system and to generate analytical Jacobians! x x 0 = f ( x& S n F n = = x x n S n 1 F n 1, x n, y + h x& + h x& n S n 1 F n, t n ) slow fast Local implicit small systems of equations Automatic procedure for partitioning Speed-up of 4 (diesel engine)... 15 (detailed robot model). 31

5. Modelica libraries Modelica Standard Library ( Modelica Association) Electrical sublibrary Block sublibrary Rotational sublibrary Translational sublibrary Constants Mathematical functions SI unit types HyLibLight Hydraulic Systems (Beater) ObjectStab ModelicaAdditions Library (DLR) Power Systems (Larsson) ExtendedPetriNet SystemDynamics FuzzyControl ATplus (Building simulation and control) Thermo fluid systems (Tummescheit) Electrical motors (Beuschel) Thermal systems (Tiller and DLR) PQLib (power quality analysis in networks) 32

Modelica libraries (cont d) Only commercially available: HyLib Hydraulic Systems full version (Beater) PowerTrain (DLR) Fuel Cells (DLR) Thermal Building Behavior (U Kaiserslautern) Cooling and Heating Systems (U Hamburg-Harburg) TechThermo (DLR) Mass Flow in Process Plants (Zurich) Hybrid Electric Vehicles (U Gothenburg) Tyre Model Library (Royal Institute of Technology, S) Flight Dynamics Library (DLR) Actual information: http://www.modelica.org/libraries.html 33

Modelica libraries (cont d) Modelica.Thermal.Lumped 34

Modelica libraries (cont d) Modelica.Electrical.Analog 35

Modelica libraries (cont d) Modelica.Electrical.Analog.Basic 36

Modelica libraries (cont d) Modelica.Electrical.Analog.Ideal 37

Modelica libraries (cont d) Modelica.Electrical.Analog.Lines Modelica.Electrical.Analog.Semiconductors Modelica.Electrical.Analog.Sources 38

6. Application Examples 39

Example: Industrial robot (DLR, Dynasim, KUKA) model Resistor extends OnePort; parameter Real R; equation v = R*i; end Resistor; 1000 nontrivial algebraic equations, 80 states. With mixed-mode integration : faster as real time on 650 Mhz PC. 40

Example: hardware-in-the-loop simulation of automatic gearbox (various car manufacturers) Electronic Control Unit (Hardware) desired clutch pressure (Simulation) + driver + motor + torque converter + 1D vehicle dynamics 41

Example: Large, detailed vehicle model (Ford Motors, Dynasim, DLR) 3D-Mechanics (60 joints, 70 bodies) ~ 250.000 equations before reduction ~ 25.000 nontrival algebraic equations 320 states Motor (combustion) Hydraulics Power train (automatic gear box) 42

Example: Material Testing Machine (U Paderborn, FhG EAS) Hydraulic machine, controlled by an electronic circuit Number of Equations/Variables before after symbolic reduction total 1.031 487 without electronics 309 137 43

Different controller models tested, here: operational amplifier 44

45

7. Comparison: VHDL-AMS and Modelica Differences Modelica VHDL-AMS Origin Control systems, mechatronics Electronics, IC s Simulation modes TR, DC TR, DC, AC, Steady-State, Noise Netlists Components, connection of pins, Components, nodes nodes not explicitely used Graphics Annotations (for Docum., icons) (via EDA-tools) Compact data like MATLAB-Syntax, matrices Operator overloading Model change Composition, configuration, Composition, configuration inheritance Digital time scale Digital event at any time possible Minimal resolvable time Delays Not yet elaborated Precisely defined ( MVL9,... ) Structure of model Cut set law explicitely to formulate Defines internal branches User s training For experts of object oriented For VHDL experts: easy to learn languages: easy to learn Graphical input: very simple 46

8. Conclusion How to model and simulate heterogeneous systems? Modelica/Dymola is well suited to model large parts of the physical components, such as 3-dim. vehicle dynamics, power train including automatic gearboxes, hydraulics, combustion, electric/electronics, air conditioning, etc. Matlab/Simulink is well suited for signal-flow oriented components (control system / state charts and for the technical infra-structure: download to signal processors / Real Time Workshop; many toolboxes). Combination of Modelica and Simulink is very attractive (Dymola can generate Simulink CMEX S-Function of Modelica models). VHDL-AMS (e.g. VeriasHDL and AdvanceMS) is very powerful for electronic subsystems, but perhaps not so strong for other parts of a complex systems, such as 3-dim. mechanics, power train, combustion,... (lack of libraries!). Modelica/Dymola is especially suited for real-time simulation, such as hardware-in-the-loop (HIL); VHDL-AMS/RT in preparation. Modelica is supported by many multi-domain libraries, VHDL-AMS by large digital (and, in future, analog electrical) libraries; SPICE compatibility in analog electronics! 47