Introduction to Object-Oriented Modeling

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to Object-Oriented Modeling Introduction to Object-Oriented Modeling, Modelica/OpenModelica Tutorial Plan for the Simulation, Debugging and Dynamic Optimization MOSES 2016 Workshop with Modelica using OpenModelica • Wednesday slot 24. The Modelica language part 1. MOSES 2016 Workshop Introductory hands-on Modelica modeling. Tutorial, Version May 18, 2016 Peter Fritzson Slides 8 – 49 Linköping University, [email protected] Director of the Open Source Modelica Consortium • Thursday slot 28. The OpenModelica tool. (slides Vice Chairman of Modelica Association Bernhard Thiele, Ph.D., [email protected] 50 – 78) The Modelica language part 2. (slides 95- Researcher at PELAB, Linköping University 115) Slides • Thursday slot 29. Hands-on with Modelica textual Based on book and lecture notes by Peter Fritzson Contributions 2004-2005 by Emma Larsdotter Nilsson, Peter Bunus equation-based modeling (slides 95-115) Contributions 2006-2008 by Adrian Pop and Peter Fritzson Contributions 2009 by David Broman, Peter Fritzson, Jan Brugård, and Mohsen Torabzadeh-Tari Contributions 2010 by Peter Fritzson Contributions 2011 by Peter F., Mohsen T,. Adeel Asghar, Contributions 2012, 2013, 2014, 2015, 2016 by Peter Fritzson, Lena Buffoni, Mahder Gebremedhin, Bernhard Thiele 2016-05-16 2 Copyright © Open Source Modelica Consortium Tutorial Based on Book, Decembr 2014 Introductory Download OpenModelica Software Modelica Book Peter Fritzson September 2011 232 pages Principles of Object Oriented Modeling and Simulation with 2015 –Translations Modelica 3.3 available in A Cyber-Physical Approach Chinese, Japanese, Can be ordered from Wiley or Amazon Spanish Wiley-IEEE Press, 2014, 1250 pages Wiley IEEE Press • OpenModelica For Introductory • www.openmodelica.org Short Courses on • Modelica Association Object Oriented • www.modelica.org Mathematical Modeling 3 Copyright © Open Source Modelica Consortium 4 Copyright © Open Source Modelica Consortium Acknowledgements, Usage, Copyrights Outline • If you want to use the Powerpoint version of these slides in your own course, send an email to: [email protected] Part I Part II • Thanks to Emma Larsdotter Nilsson, Peter Bunus, David Introduction to Modelica and a Modelica environments Broman, Jan Brugård, Mohsen-Torabzadeh-Tari, Adeel demo example Asghar, Lena Buffoni, for contributions to these slides. • Most examples and figures in this tutorial are adapted with permission from Peter Fritzson’s book ”Principles of Object Oriented Modeling and Simulation with Modelica 2.1”, copyright Wiley-IEEE Press • Some examples and figures reproduced with permission Part III Part IV and Part V from Modelica Association, Martin Otter, Hilding Elmqvist, Modelica language concepts Graphical modeling and the Wolfram MathCore, Siemens and textual modeling Modelica standard library • Modelica Association: www.modelica.org Dynamic Optimization • OpenModelica: www.openmodelica.org 5 Copyright © Open Source Modelica Consortium 6 Copyright © Open Source Modelica Consortium 1 Detailed Schedule (morning version) 09.00-12.30 Software Installation - Windows 09:00 - Introduction to Modeling and Simulation • Start installation of OpenModelica including OMEdit graphic editor 09:10 - Modelica – The Next Generation Modeling Language 09:25 - Exercises Part I (15 minutes) • Start the software installation • Short hands-on exercise on graphical modeling using OMEdit– RL Circuit 09:50 – Part II: Modelica Environments and the OpenModelica Environment 10:10 – Part III: Modelica Textual Modeling • Install OpenModelica-1.9.4beta.exe from the USB 10:15 - Exercises Part IIIa (10 minutes) • Hands-on exerciseson textual modeling using the OpenModelica environment Stick 10:25 – Coffee Break 10:40 - Modelica Discrete Events, Hybrid, Clocked Properties (Bernhard Thiele) 11:00- Exercises Part IIIb (15 minutes) • Hands-on exercises on textual modeling using the OpenModelica environment 11:20– Part IV: Components, Connectors and Connections - Modelica Libraries 11:30 –Part V Dynamic Optimization (Bernhard Thiele) • Hands-on exercise on dynamic optimization using OpenModelica 12:00 – Exercise Graphical Modeling DCMotor using OpenModelica 7 Copyright © Open Source Modelica Consortium 8 Copyright © Open Source Modelica Consortium Software Installation – Linux (requires internet connection) Software Installation – MAC (requires internet connection) •Go to •Go to https://openmodelica.org/index.php/download/down https://openmodelica.org/index.php/download/down load-mac and follow the instructions or follow the load-linux and follow the instructions. instructions written below. • The installation uses MacPorts. After setting up a MacPorts installation, run the following commands on the terminal (as root): • echo rsync://build.openmodelica.org/macports/ >> /opt/local/etc/macports/sources.conf # assuming you installed into /opt/local • port selfupdate • port install openmodelica-devel 9 Copyright © Open Source Modelica Consortium 10 Copyright © Open Source Modelica Consortium Modelica Background: Stored Knowledge Model knowledge is stored in books and human Part I minds which computers cannot access Introduction to Modelica and a demo example “The change of motion is proportional to the motive force impressed “ –Newton 11 Copyright © Open Source Modelica Consortium 12 Copyright © Open Source Modelica Consortium 2 Modelica Background: The Form – Equations What is Modelica? • Equations were used in the third millennium B.C. A language for modeling of complex cyber-physical systems • Equality sign was introduced by Robert Recorde in 1557 • Robotics • Automotive Newton still wrote text (Principia, vol. 1, 1686) • Aircrafts “The change of motion is proportional to the motive force • Satellites impressed ” • Power plants CSSL (1967) introduced a special form of “equation”: variable = expression • Systems biology v = INTEG(F)/m Programming languages usually do not allow equations! 13 Copyright © Open Source Modelica Consortium 14 Copyright © Open Source Modelica Consortium What is Modelica? What is Modelica? A language for modeling of complex cyber-physical systems A language for modeling of complex cyber-physical systems i.e., Modelica is not a tool Free, open language There exist several free and commercial specification: tools, for example: • OpenModelica from OSMC • Dymola from Dassault systems • Wolfram System Modeler fr Wolfram MathCore • SimulationX from ITI • MapleSim from MapleSoft • AMESIM from LMS • JModelica.org from Modelon Primary designed for simulation, but there are also other Available at: www.modelica.org • MWORKS from Tongyang Sw & Control usages of models, e.g. optimization. Developed and standardized • IDA Simulation Env, from Equa by Modelica Association • ESI Group Modeling tool, ESI Group 15 Copyright © Open Source Modelica Consortium 16 Copyright © Open Source Modelica Consortium Modelica – The Next Generation Modeling Language Modelica Acausal Modeling Declarative language What is acausal modeling/design? Equations and mathematical functions allow acausal modeling, high level specification, increased correctness Why does it increase reuse? Multi-domain modeling The acausality makes Modelica library classes more Combine electrical, mechanical, thermodynamic, hydraulic, reusable than traditional classes containing assignment biological, control, event, real-time, etc... statements where the input-output causality is fixed. Everything is a class Example: a resistor equation: Strongly typed object-oriented language with a general class concept, Java & MATLAB-like syntax R*i = v; Visual component programming can be used in three ways: Hierarchical system architecture capabilities i := v/R; Efficient, non-proprietary v := R*i; Efficiency comparable to C; advanced equation compilation, e.g. 300 000 equations, ~150 000 lines on standard PC R := v/i; 17 Copyright © Open Source Modelica Consortium 18 Copyright © Open Source Modelica Consortium 3 What is Special about Modelica? What is Special about Modelica? Cyber-Physical Modeling Multi-Domain 3 domains Modeling • Multi-Domain Modeling -electric Physical - mechanics • Visual acausal hierarchical component modeling - control • Typed declarative equation-based textual language • Hybrid modeling and simulation Cyber 19 Copyright © Open Source Modelica Consortium 20 Copyright © Open Source Modelica Consortium What is Special about Modelica? What is Special about Modelica? Multi-Domain Visual Acausal Multi-Domain Hierarchical system Visual Acausal Modeling Keeps the physical Hierarchical Modeling modeling Hierarchical structure Component k2 Component i axis6 qddRef cut joint Modeling qdRef qRef k1 r3Control Modeling r3Motor r3Drive1 tn 1 1 i 1 S S qd axis5 Acausal model l qdRef Kd (Modelica) S 0.03 rel joint=0 Jmotor=J spring=c axis4 S pSum Kv sum wSum rate2 rate3 qRef iRef gear=i +1 b(s) 340.8 0.3 - +1 - a(s) S fric=Rv0 axis3 rate1 tacho2 tacho1 b(s) b(s) g5 PT1 a(s) a(s) Causal axis2 Ra=250 q qd Rp2=50 C=0.004*D/w m Rd1=100 Rp1=200 block-based La=(250/(2*D*w m)) Srel = n*transpose(n)+(identity(3)-Rd2=100 n*transpose(n))*cos(q)- axis1 Ri=10 skew(n)*sin(q); - - - + + model wrela = n*qd; diff + pow er zrela = n*qdd; OpI Vs Sb = Sa*transpose(Srel); Rd4=100 (Simulink) r0b = r0a; emf vb = Srel*va; g3 y wb = Srel*(wa + wrela); Rd3=100 g1 x ab = Srel*aa; inertial zb = Srel*(za + zrela + cross(wa,hall2 wrela)); hall1 w r Courtesy of Martin Otter g4 g2 qd q 21 Copyright © Open Source Modelica Consortium 22 Copyright © Open Source Modelica Consortium What is Special about Modelica? What is Special about Modelica? Visual Acausal
Recommended publications
  • Applying Reinforcement Learning to Modelica Models
    ModelicaGym: Applying Reinforcement Learning to Modelica Models Oleh Lukianykhin∗ Tetiana Bogodorova [email protected] [email protected] The Machine Learning Lab, Ukrainian Catholic University Lviv, Ukraine Figure 1: A high-level overview of a considered pipeline and place of the presented toolbox in it. ABSTRACT CCS CONCEPTS This paper presents ModelicaGym toolbox that was developed • Theory of computation → Reinforcement learning; • Soft- to employ Reinforcement Learning (RL) for solving optimization ware and its engineering → Integration frameworks; System and control tasks in Modelica models. The developed tool allows modeling languages; • Computing methodologies → Model de- connecting models using Functional Mock-up Interface (FMI) to velopment and analysis. OpenAI Gym toolkit in order to exploit Modelica equation-based modeling and co-simulation together with RL algorithms as a func- KEYWORDS tionality of the tools correspondingly. Thus, ModelicaGym facilit- Cart Pole, FMI, JModelica.org, Modelica, model integration, Open ates fast and convenient development of RL algorithms and their AI Gym, OpenModelica, Python, reinforcement learning comparison when solving optimal control problem for Modelica dynamic models. Inheritance structure of ModelicaGym toolbox’s ACM Reference Format: Oleh Lukianykhin and Tetiana Bogodorova. 2019. ModelicaGym: Applying classes and the implemented methods are discussed in details. The Reinforcement Learning to Modelica Models. In EOOLT 2019: 9th Interna- toolbox functionality validation is performed on Cart-Pole balan- tional Workshop on Equation-Based Object-Oriented Modeling Languages and arXiv:1909.08604v1 [cs.SE] 18 Sep 2019 cing problem. This includes physical system model description and Tools, November 04–05, 2019, Berlin, DE. ACM, New York, NY, USA, 10 pages. its integration using the toolbox, experiments on selection and in- https://doi.org/10.1145/nnnnnnn.nnnnnnn fluence of the model parameters (i.e.
    [Show full text]
  • Reusing Static Analysis Across Di Erent Domain-Specific Languages
    Reusing Static Analysis across Dierent Domain-Specific Languages using Reference Attribute Grammars Johannes Meya, Thomas Kühnb, René Schönea, and Uwe Aßmanna a Technische Universität Dresden, Germany b Karlsruhe Institute of Technology, Germany Abstract Context: Domain-specific languages (DSLs) enable domain experts to specify tasks and problems themselves, while enabling static analysis to elucidate issues in the modelled domain early. Although language work- benches have simplified the design of DSLs and extensions to general purpose languages, static analyses must still be implemented manually. Inquiry: Moreover, static analyses, e.g., complexity metrics, dependency analysis, and declaration-use analy- sis, are usually domain-dependent and cannot be easily reused. Therefore, transferring existing static analyses to another DSL incurs a huge implementation overhead. However, this overhead is not always intrinsically necessary: in many cases, while the concepts of the DSL on which a static analysis is performed are domain- specific, the underlying algorithm employed in the analysis is actually domain-independent and thus can be reused in principle, depending on how it is specified. While current approaches either implement static anal- yses internally or with an external Visitor, the implementation is tied to the language’s grammar and cannot be reused easily. Thus far, a commonly used approach that achieves reusable static analysis relies on the trans- formation into an intermediate representation upon which the analysis is performed. This, however, entails a considerable additional implementation effort. Approach: To remedy this, it has been proposed to map the necessary domain-specific concepts to the algo- rithm’s domain-independent data structures, yet without a practical implementation and the demonstration of reuse.
    [Show full text]
  • Introduction to Dymola
    DYMOLA AND MODELICA Course overview DAY 1 Dymola and Modelica I • Introduction Dymola, Modelica, Modelon • Lecture 1 Overview of Dymola and Physical modeling . Workshop 1 Workflow of modeling physical systems in Dymola • Lecture 2 Simulation and post-processing with Dymola . Workshop 2 Simulating and analyzing a physical system • Lecture 3 Configure system models . Workshop 3 Creating a reconfigurable system DAY 2 Dymola and Modelica I • Lecture 4 Modelica I – Writing Modelica models . Workshop 4a Cauer low pass filter using Electric Library . Workshop 4b A moving coil using Magnetic, Electric and Translational mechanics libraries . Workshop 4c Temperature control using Heat transfer Library • Lecture 5 Understanding equation-based modeling . Workshop 5 Defining boundary conditions • Lecture 6 Trouble shooting and common pitfalls . Workshop 6 Common pitfalls DAY 3 Dymola and Modelica II • Lecture 7 Modelica II – Advanced features . Workshop 7 Implementing a solar collector • Lecture 8 Working with the Modelica Standard Library . Workshop 8a Lamp logic using StateGraph II . Workshop 8b Suspension linkage using MultiBody mechanics • Lecture 9 Hybrid modeling . Workshop 9a Hybrid examples . Workshop 9b Hammer impact model . Workshop 9c Designing a thermostat valve DAY 4 Dymola and Modelica II • Lecture 10 Efficient and reconfigurable modeling . Workshop 10 Creating a system architecture based on templates and interfaces • Lecture 11 Model variants and data management . Workshop 11 Creating a data architecture and adaptive parameter interfaces • Lecture 12 FMI technology . Workshop 12a Import and Export FMUs in Dymola . Workshop 12b FMI with Excel . Workshop 12c FMI with Simulink DAY 5 Dymola and Modelica II • Lecture 13 Workflow automation and scripting . Workshop 13 Automated sensitivity analysis • Lecture 14 Dymola code with other tools .
    [Show full text]
  • Early Insights on FMI-Based Co-Simulation of Aircraft Vehicle Systems
    The 15th Scandinavian International Conference on Fluid Power, SICFP’17, June 7-9, 2017, Linköping, Sweden Early Insights on FMI-based Co-Simulation of Aircraft Vehicle Systems Robert Hallqvist*, Robert Braun**, and Petter Krus** E-mail: [email protected], [email protected], [email protected] *Systems Simulation and Concept Design, Saab Aeronautics, Linköping, Sweden **Department of Fluid and Mechatronic Systems, Linköping University, Linköping, Sweden Abstract Modelling and Simulation is extensively used for aircraft vehicle system development at Saab Aeronautics in Linköping, Sweden. There is an increased desire to simulate interacting sub-systems together in order to reveal, and get an understanding of, the present cross-coupling effects early on in the development cycle of aircraft vehicle systems. The co-simulation methods implemented at Saab require a significant amount of manual effort, resulting in scarcely updated simulation models, and challenges associated with simulation model scalability, etc. The Functional Mock-up Interface (FMI) standard is identified as a possible enabler for efficient and standardized export and co-simulation of simulation models developed in a wide variety of tools. However, the ability to export industrially relevant models in a standardized way is merely the first step in simulating the targeted coupled sub-systems. Selecting a platform for efficient simulation of the system under investigation is the next step. Here, a strategy for adapting coupled Modelica models of aircraft vehicle systems to TLM-based simulation is presented. An industry-grade application example is developed, implementing this strategy, to be used for preliminary investigation and evaluation of a co- simulation framework supporting the Transmission Line element Method (TLM).
    [Show full text]
  • Lecture #4: Simulation of Hybrid Systems
    Embedded Control Systems Lecture 4 – Spring 2018 Knut Åkesson Modelling of Physcial Systems Model knowledge is stored in books and human minds which computers cannot access “The change of motion is proportional to the motive force impressed “ – Newton Newtons second law of motion: F=m*a Slide from: Open Source Modelica Consortium, Copyright © Equation Based Modelling • Equations were used in the third millennium B.C. • Equality sign was introduced by Robert Recorde in 1557 Newton still wrote text (Principia, vol. 1, 1686) “The change of motion is proportional to the motive force impressed ” Programming languages usually do not allow equations! Slide from: Open Source Modelica Consortium, Copyright © Languages for Equation-based Modelling of Physcial Systems Two widely used tools/languages based on the same ideas Modelica + Open standard + Supported by many different vendors, including open source implementations + Many existing libraries + A plant model in Modelica can be imported into Simulink - Matlab is often used for the control design History: The Modelica design effort was initiated in September 1996 by Hilding Elmqvist from Lund, Sweden. Simscape + Easy integration in the Mathworks tool chain (Simulink/Stateflow/Simscape) - Closed implementation What is Modelica A language for modeling of complex cyber-physical systems • Robotics • Automotive • Aircrafts • Satellites • Power plants • Systems biology Slide from: Open Source Modelica Consortium, Copyright © What is Modelica A language for modeling of complex cyber-physical systems
    [Show full text]
  • Exploitable Results by Third Parties 11004 MODRIO
    Exploitable Results by Third Parties 11004 MODRIO Project details Project leader: Daniel Bouskela Email: [email protected] Website: https://www.modelica.org/external-projects/modrio 4 Exploitable Results by Third Parties 11004 MODRIO Name: O3PRM editor Input(s): Main feature(s) Output(s): . PRM (Probabilistic . Syntactic editor for O3PRM . Probability Relational Model) language distributions of written in the . Bayesian inference engine the requested O3PRM modeling variables language . Observations and requests on some variables of the PRM Unique Selling . Supports object oriented PRM Proposition(s): . Will soon be connected to Modelica models . Performance of inference algorithms . Free, open source . Web site including documentation, ready to use executable, source code: http://o3prm.lip6.fr Integration . Uses the Agrum open source library for inference constraint(s): Intended user(s): . In a first step: researchers interested in creating diagnosis applications. Then the users of such applications in the industry. Provider: . Lip6 (Laboratoire d’informatique de Paris 6) and EDF Contact point: . Marc Bouissou (EDF R&D) Condition(s) for . This software is currently under a GPL license reuse: Latest update: 19/04/2016 5 Exploitable Results by Third Parties 11004 MODRIO Name: SKELBO Figaro library Input(s): Main feature(s) Output(s): . Thermohydraulic . This library can be exploited . Fault tree(s) system architecture by the Figaro processor in order to generate a fault tree describing the causes of a thermohydraulic system failure . Describes failure modes (on demand and in function) of the most common thermohydraulic components, with the way they can propagate in a system . Includes 29 classes of objects that can be used to describe a system .
    [Show full text]
  • Openmodelica Development Environment with Eclipse Integration for Browsing, Modeling, and Debugging
    OpenModelica Development Environment with Eclipse Integration for Browsing, Modeling, and Debugging Adrian Pop, Peter Fritzson, Andreas Remar, Elmir Jagudin, David Akhvlediani PELAB – Programming Environment Lab, Dept. Computer Science Linköping University, S-581 83 Linköping, Sweden {adrpo, petfr}@ida.liu.se Abstract mental if it gives quick feedback, e.g. without recom- puting everything from scratch, and maintains a dia- The OpenModelica (MDT) Eclipse Plugin integrates logue with the user, including preserving the state of the OpenModelica compiler and debugger with the previous interactions with the user. Interactive envi- Eclipse Integrated Development Environment Frame- ronments are typically both more productive and more work.. MDT, together with the OpenModelica compiler fun to use. and debugger, provides an environment for Modelica There are many things that one wants a program- development projects. This includes browsing, code ming environment to do for the programmer, particu- completion through menus or popups, automatic inden- larly if it is interactive. What functionality should be tation even of syntactically incorrect models, and included? Comprehensive software development envi- model debugging. Simulation and plotting is also pos- ronments are expected to provide support for the major sible from a special command window. To our knowl- development phases, such as: edge, this is the first Eclipse plugin for an equation- • based language. Requirements analysis. • Design. • Implementation. 1 Introduction • Maintenance. The goal of our work with the Eclipse framework inte- A programming environment can be somewhat more gration in the OpenModelica modeling and develop- restrictive and need not necessarily support early ment environment is to achieve a more comprehensive phases such as requirements analysis, but it is an ad- and more powerful environment.
    [Show full text]
  • A Modelica Power System Library for Phasor Time-Domain Simulation
    2013 4th IEEE PES Innovative Smart Grid Technologies Europe (ISGT Europe), October 6-9, Copenhagen 1 A Modelica Power System Library for Phasor Time-Domain Simulation T. Bogodorova, Student Member, IEEE, M. Sabate, G. Leon,´ L. Vanfretti, Member, IEEE, M. Halat, J. B. Heyberger, and P. Panciatici, Member, IEEE Abstract— Power system phasor time-domain simulation is the FMI Toolbox; while for Mathematica, SystemModeler often carried out through domain specific tools such as Eurostag, links Modelica models directly with the computation kernel. PSS/E, and others. While these tools are efficient, their individual The aims of this article is to demonstrate the value of sub-component models and solvers cannot be accessed by the users for modification. One of the main goals of the FP7 iTesla Modelica as a convenient language for modeling of complex project [1] is to perform model validation, for which, a modelling physical systems containing electric power subcomponents, and simulation environment that provides model transparency to show results of software-to-software validations in order and extensibility is necessary. 1 To this end, a power system to demonstrate the capability of Modelica for supporting library has been built using the Modelica language. This article phasor time-domain power system models, and to illustrate describes the Power Systems library, and the software-to-software validation carried out for the implemented component as well as how power system Modelica models can be shared across the validation of small-scale power system models constructed different simulation platforms. In addition, several aspects of using different library components. Simulations from the Mo- using Modelica for simulation of complex power systems are delica models are compared with their Eurostag equivalents.
    [Show full text]
  • Paramagic(TM) Users Guide
    75 Fifth Street NW, Suite 213 Atlanta, GA 30308, USA Voice: +1- 404-592-6897 Web: www.InterCAX.com E-mail: [email protected] ParaMagicTM v16.6 sp1 Users Guide Table of Contents 1! About ..................................................................................................................................................... 3! 2! Quick Start ............................................................................................................................................ 3! 2.1! First Pass – execute existing models .............................................................................................. 3! 2.2! Second Pass – create new models .................................................................................................. 4! 3! Installation ............................................................................................................................................ 5! 3.1! Installation Requirements ............................................................................................................... 5! 3.1.1! System Requirements .............................................................................................................. 5! 3.1.2! MagicDraw Requirements ....................................................................................................... 5! 3.1.3! Core Solver Requirements ...................................................................................................... 5 ! 3.2! Installation Process .....................................................................................................................
    [Show full text]
  • Component-Oriented Acausal Modeling of the Dynamical Systems in Python Language on the Example of the Model of the Sucker Rod String
    Component-oriented acausal modeling of the dynamical systems in Python language on the example of the model of the sucker rod string Volodymyr B. Kopei, Oleh R. Onysko and Vitalii G. Panchuk Department of Computerized Mechanical Engineering, Ivano-Frankivsk National Technical University of Oil and Gas, Ivano-Frankivsk, Ukraine ABSTRACT Typically, component-oriented acausal hybrid modeling of complex dynamic systems is implemented by specialized modeling languages. A well-known example is the Modelica language. The specialized nature, complexity of implementation and learning of such languages somewhat limits their development and wide use by developers who know only general-purpose languages. The paper suggests the principle of developing simple to understand and modify Modelica-like system based on the general-purpose programming language Python. The principle consists in: (1) Python classes are used to describe components and their systems, (2) declarative symbolic tools SymPy are used to describe components behavior by difference or differential equations, (3) the solution procedure uses a function initially created using the SymPy lambdify function and computes unknown values in the current step using known values from the previous step, (4) Python imperative constructs are used for simple events handling, (5) external solvers of differential-algebraic equations can optionally be applied via the Assimulo interface, (6) SymPy package allows to arbitrarily manipulate model equations, generate code and solve some equations symbolically. The basic set of mechanical components (1D translational “mass”, “spring-damper” and “force”) is developed. The models of a sucker rods string are developed and simulated using these components. The comparison of results of the sucker rod string simulations with practical dynamometer cards and Submitted 22 March 2019 Accepted 24 September 2019 Modelica results verify the adequacy of the models.
    [Show full text]
  • Modelica and Fmi As Enablers for Virtual Product Innovation
    OPEN STANDARDS IN SIMULATION MODELICA AND FMI AS ENABLERS FOR VIRTUAL PRODUCT INNOVATION Hubertus Tummescheit Board member, Modelica Association & co-founder of Modelon 1 OVERVIEW • Background and Motivation • Introduction – why open standards matter • Innovation in Model Based Design • Modelica – the equation based modeling language • The Functional-Mockup-Interface (FMI) • Examples • What’s next: upcoming innovations • Conclusions 2 The Modelica Association • An independent non-profit organization registered in Sweden. https://www.modelica.org • Members: ▪ Tool vendors ▪ Government research organizations ▪ Service providers ▪ Power users • Two standards and four core projects: ▪ The Modelica Language ▪ The Modelica Standard Library ▪ The FMI Standard for model exchange and co-simulation ▪ The SSP project for an upcoming standard on system structure and parameterization • FMI web site: http://www.fmi-standard.org • Next Modelica Conference: May 15-17 in Prague MOTIVATION: THE COMPLEXITY ISSUE ▪ System complexity increases ▪ Required time to market decreases (most industries) ▪ Without disruptive changes, an impossible equation to solve. Source: DARPA Large part of AVM project complexity is in software! 4 WHY OPEN STANDARDS ARE NEEDED • Computer Aided Engineering is a very fragmented industry • Tools evolved domain by domain • Interoperability has been an afterthought, at best • Today’s complex systems require interoperability! • An everyday challenge for engineering design • Open standards drastically reduce the cost of creating interoperability between tools • There is an interplay with open source: open source can also increase the speed of software innovation 5 TIE YOURSELF TO STANDARDS, NOT TOOLS! 1. It will be cheaper 2. It will keep software vendors on their toes to compete on tool capability, not quality of lock-in 3.
    [Show full text]
  • Openmodelica System Documentation
    OpenModelica Users Guide Version 2012-03-29 for OpenModelica 1.8.1 March 2012 Peter Fritzson Adrian Pop, Adeel Asghar, Willi Braun, Jens Frenkel, Lennart Ochel, Martin Sjölund, Per Östlund, Peter Aronsson, Mikael Axin, Bernhard Bachmann, Vasile Baluta, Robert Braun, David Broman, Stefan Brus, Francesco Casella, Filippo Donida, Anand Ganeson, Mahder Gebremedhin, Pavel Grozman, Daniel Hedberg, Michael Hanke, Alf Isaksson, Kim Jansson, Daniel Kanth, Tommi Karhela, Juha Kortelainen, Abhinn Kothari, Petter Krus, Alexey Lebedev, Oliver Lenord, Ariel Liebman, Rickard Lindberg, Håkan Lundvall, Abhi Raj Metkar, Eric Meyers, Tuomas Miettinen, Afshin Moghadam, Maroun Nemer, Hannu Niemistö, Peter Nordin, Kristoffer Norling, Karl Pettersson, Pavol Privitzer, Jhansi Reddy, Reino Ruusu, Per Sahlin,Wladimir Schamai, Gerhard Schmitz, Anton Sodja, Ingo Staack, Kristian Stavåker, Sonia Tariq, Mohsen Torabzadeh-Tari, Parham Vasaiely, Niklas Worschech, Robert Wotzlaw, Björn Zackrisson, Azam Zia Copyright by: Open Source Modelica Consortium 2 Copyright © 1998-CurrentYear, Open Source Modelica Consortium (OSMC), c/o Linköpings universitet, Department of Computer and Information Science, SE-58183 Linköping, Sweden All rights reserved. THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR THIS OSMC PUBLIC LICENSE (OSMC-PL). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. The OpenModelica software and the OSMC (Open Source Modelica Consortium) Public License (OSMC-PL) are obtained from OSMC, either from the above address, from the URLs: http://www.openmodelica.org or http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica distribution. GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
    [Show full text]