Model-Based Dynamic Optimization with OpenModelica and CasADi

Similar documents
Sensitivity computation based on CasADi for dynamic optimization problems

Magnusson, Fredrik; Berntorp, Karl; Olofsson, Björn; Åkesson, Johan

Parallel Multiple-Shooting and Collocation Optimization with OpenModelica

An XML representation of DAE systems obtained from continuous-time Modelica models

Optimized Control of Hot-Gas Cycle for Solar Thermal Power Plants

CasADi tutorial Introduction

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

raceability Support in OpenModelica Using Open Services for Lifecycle Collaboration (OSLC)

Dynamic Load Balancing in Parallelization of Equation-based Models

This is the published version of a paper presented at IEEE PES General Meeting 2013.

A Strategy for Parallel Simulation of Declarative Object-Oriented Models of Generalized Physical Networks

INTEROPERABILITY WITH FMI TOOLS AND SOFTWARE COMPONENTS. Johan Åkesson

Automatic Regression Testing of Simulation Models and Concept for Simulation of Connected FMUs in PySimulator

Dynamic Optimization in JModelica.org

Improving Efficiency of Hybrid System Simulation in Modelica

Integration of CasADi and JModelica.org

1st Annual OpenModelica Workshop Feb 2, 2009

Modeling Kernel Language (MKL)

Rotational3D Efficient modelling of 3D effects in rotational mechanics

R. Franke, PSP-A24, OpenModelica Annual Workshop 2015 Mathematical Optimization of Dynamic Systems with OpenModelica. ABB February 2, 2015

Extending the IPG CarMaker by FMI Compliant Units

A Modular. OpenModelica. Compiler Backend

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

SIMULATOR TO FMU: A PYTHON UTILITY TO SUPPORT BUILDING SIMULATION TOOL INTEROPERABILITY

AN INTEGRATED MODELICA ENVIRONMENT FOR MODELING, DOCUMENTATION AND SIMULATION

Enhancing the RAMSAS method for Systems Reliability Analysis through Modelica

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

State Machines in OpenModelica

Contributions to Parallel Simulation of Equation-Based Models on Graphics Processing Units

AUTOMATIC PARALLELIZATION OF OBJECT ORIENTED MODELS ACROSS METHOD AND SYSTEM

Implementation of a Graphical Modelica Editor with Preserved Source Code Formatting

NMPC Application using JModelica.org: Features and Performance

Institutionen för datavetenskap Department of Computer and Information Science

A comparison of metacompilation approaches to implementing Modelica

EXPRESSING REQUIREMENTS IN MODELICA

Minimal Equation Sets for Output Computation in Object-Oriented Models

A Modelica Power System Library for Phasor Time-Domain Simulation

An Eclipse-based Integrated Environment for Developing Executable Structural Operational Semantics Specifications

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

Fault Tolerance Analysis using OpenModelica with Figaro Extensions for Modelica

Solving Large-scale Modelica Models: New Approaches and Experimental Results using OpenModelica

Functional Mockup Interface for Tool and Model Interoperability

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

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

ACADO TOOLKIT - AUTOMATIC CONTROL AND DYNAMIC OPTIMIZATION

Automatic Parallelization of Mathematical Models Solved with Inlined Runge-Kutta Solvers

Development of Custom Workflows for Simulation and Analysis of Functional Mock-up Units

Integrated Debugging of Equation-Based Models

Grey-Box Building Models for Model Order Reduction and Control

Multiple-Shooting Optimization using the JModelica.org Platform

Optimal Control Techniques for Dynamic Walking

CURRICULUM VITAE: DI MARTIN BERNAUER. DI Martin Bernauer. Chemnitz University of Technology Faculty of Mathematics D Chemnitz Germany

Modeling and Optimization with Modelica and Optimica Using the JModelica.org Open Source Platform

Framework for dynamic optimization of district heating systems using Optimica Compiler Toolkit

Towards Run-time Debugging of Equation-based Object-oriented Languages

COMPARISON OF CONTROL OPTIMIZATION APPROACHES FOR LOW- EXERGY HEATING AND COOLING SYSTEMS. Dominik Wystrcil 1, Doreen Kalz 1

Toolbox for development and validation of grey-box building models for forecasting and control

Numerical and Symbolic Methods for Dynamic Optimization

Modelica3D. Platform Independent Simulation Visualization. Christoph Höger. Technische Universität Berlin Fraunhofer FIRST

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

Industrial Evaluation of an Efficient Equation Model Debugger in OpenModelica

Survey of appropriate matching algorithms for large scale systems of differential algebraic equations

Automated Modelica Package Generation of Parameterized Multibody Systems in CATIA

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

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

Simulation and Benchmarking of Modelica Models on Multi-core Architectures with Explicit Parallel Algorithmic Language Extensions

Modeling and Simulation for Heterogeneous systems

Consistent Simulation Environment with FMI based Tool Chain

On Extending JGrafchart with Support for FMI for Co-Simulation

FMI Kit for Simulink version by Dassault Systèmes

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

Parallel Computing Using Modelica

User Documentation for CasADi v Joel Andersson Joris Gillis Moritz Diehl

Towards Unified System Modeling with the ModelicaML UML Profile

Finite element methods

FMI for Industrial Programmable Logic Controllers Rüdiger Kampfmann

top left cx,cy bottom

Variability and Type Calculation for Equation of Modelica. model

API for Accessing OpenModelica Models From Python

Variable Structure Modeling for Vehicle Refrigeration Applications

MODPROD'2014 8th International Workshop on Model-Based Product Development

Software-Entwicklungswerkzeuge

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

Translation of Modelica Code into Hybrid Automata

Traceability Support in OpenModelica using Open Services for Lifecycle Collaboration (OSLC)

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

Modelica Based Parser Generator with Good Error Handling

An Overview of the SysML-Modelica Transformation Specification

Solving Optimal Control Problems with ACADO Toolkit

Olofsson, Björn; Nilsson, Henrik; Robertsson, Anders; Åkesson, Johan

JModelica.org User Guide. Version 1.13

Design Approach for a Generic and Scalable Framework for Parallel FMU Simulations

A Model-Driven JSON Editor

Equation based parallelization of Modelica models

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

Towards Generic Models

Modelica for Embedded Systems

Equation-Based Model Data Structure for High Level Physical Modelling, Model Simplification and Modelica-Export

JModelica.org User Guide. Version 2.2

Comodeling Revisited: Execution of Behavior Trees in Modelica

Transcription:

Model-Based Dynamic Optimization with OpenModelica and CasADi Alachew Shitahun PELAB Programming Environment Lab, Dept. Computer Science Linköping University, SE-581 83 Linköping, Sweden Vitalij Ruge Mathematics and Engineering, University of Applied Sciences Bielefeld Moritz Diehl Dept. of Electrical Engineering and Optimization in Engineering Center (OPTEC), K.U. Leuven, Belgium 5th OpenModelica Workshop February 4, 2013 Linköping 1

Outline of Presentation 1. Motivation 2. Optimization with Modelica 3. OpenModelica and CasADi 4. XML Code Generation in OpenModelica 5. Optimization Tool Chain for OpenModelica and CasADi 6. Test Cases and Results 7. Conclusions 8. Questions 2

Motivation Modelica enable users to conveniently model large-scale physical systems Traditionally used for simulation Nonlinear optimal control problems (NOCP) based on differential-algebraic equations (DAE) 3 State-of-the-art methods are using numerical algorithms Many other possible usages of the model For example dynamic optimization for NOCP Current Modelica tools mainly focused on simulation, but recently also optimization Dymola supports parameter and design optimization of models written in Modelica whereas JModelica.org and OpenModelica have native support for optimal control.

Optimization with Modelica Modelica has strong support for modeling of dynamic systems Additional elements for optimization: Cost function What to optimize (Variables and Parameters) and Constraints Optimica language extension: Extension of Modelica. Enables formulation of optimization problems in Modelica models. How? Export Models in XML from OpenModelica and Import to CasADi 4

OpenModelica and CasADi OpenModelica 5 Modelica-based modeling and simulation platform Support optimica extension Extended with XML export of models based on standardized XML schema for models The XML export also includes the Optimica extension CasADi An open-source framework for numerical optimization developed by KU Leuven Enable users to implement optimal control algorithms with a wide range of methods, including Multiple shooting and Collocation Imports XML for dynamic optimization

XML Code Generation in OpenModelica Modelica models are first flattened. XML schema structure mapped to the abstract syntax tree of OpenModelica compiler Text template based implementation of the code generation to XML 6

Optimization Tool Chain for OpenModelica and CasADi Export of model from OpenModelica platform Import the model in CasADi Solve optimization problem in CasADi 7

Test Cases - Diesel Electric Powertrain Presented by Martin Sivertsson and Lars Eriksson. (2012) Bernhard Bachmann and et al. (2012). Nonlinear mean value engine model (MVEM) Find fuel optimal control and state trajectories from idling condition to a certain power level Mathematical problem formulation: 2 inputs (uf,uwg) 4 states (ωice,pim,pem,ωtc) 32 algebraic equations The problem solved here is a minimum fuel problem for a transient from idle to 170 kw, in a certain time interval [0,0.5]. 8

Results- Diesel Electric Powertrain State variables (ωice,pim,pem,ωtc) Control variables (uf,uwg) Engine is accelerated only near the end of the time interval to meet the end constraints while minimizing the fuel consumption 9

Conclusions Model-based dynamic optimization with OpenModelica and CasADi has been demonstrated on three industrial use cases. The OpenModelica platform coupling with CasADi demonstrates the use of an XML-based model exchange format for model-based optimization with OpenModelica 10

References Alachew Shitahun, Vitalij Ruge, Mahder Gebremedhin, Bernhard Bachmann, Lars Eriksson, Joel Andersson, Moritz Diehl, Peter Fritzson. Model-Based Optimization with OpenModelica and CasADi. Subm: 7th IFAC Symp. on Advances in Automotive Control. Alachew Shitahun. Template Based XML and Modelica Unparsers in OpenModelica. Master thesis. Linkoping University, August 30, 2012 Roberto Parrotto, Johan Åkesson, and Francesco Casella. An XML representation of DAE systems obtained from continuous-time Modelica models. In 3rd Int. Workshop on Equation-based Object-Oriented Modeling Languages and Tools - EOOLT 2010, Sept. 2010. Johan Åkesson. Languages and Tools for Optimization of Large-Scale Systems. Ph.D. Thesis, Lund University, Nov 2007. 11

References Joel Andersson, Johan Åkesson and Moritz Diehl. CasADi --A symbolic package for automatic differentiation and optimal control, Recent Advances in Algorithmic Differentiation, Lecture Notes in Computational Science and Engineering Volume 87: 297-307, 2012. Martin Sivertsson and Lars Eriksson. (2012). Time and Fuel Optimal Power Response of a Diesel-Electric Powertrain. E-CoSM 12 IFAC Workshop on Engine and Powertrain Control, Simulation and Modeling, 2012. Bernhard Bachmann and et al. (2012). Parallel Multiple-Shooting and Collocation Optimization with OpenModelica. In Pro. Of 9th International Modelica Conference. Munich, Germany pp. 659, Sept 3-5, 2012. 12

Questions Thank you!! 13