Modelica2Pyomo: a tool to translate Modelica models into Pyomo optimization models

Authors

  • Matteo Luigi De Pascali Politecnico di Milano - DEIB
  • Lorenz T. Biegler Carnegie Mellon University, Dept. of Chemical Engineering
  • Emanuele Martelli Politecnico di Milano - DENG
  • Francesco Casella Politecnico di Milano - DEIB

DOI:

https://doi.org/10.3384/ecp218117

Keywords:

Modelica, Model Conversion, Base Modelica, Pyomo, Dynamic Optimization

Abstract

Tasks involving Modelica models often do not simplyinvestigate the dynamic behavior of a system, but ratherwant to characterize also possible optimal controlstrategies according to suitable criteria. Unfortunately,since Modelica does not support out-of-the-box optimizationfeatures, users are often forced to use other tools tocode again the system model for optimization studies. Forthis reason, the authors present Modelica2Pyomo, anopen-source tool to translate Modelica models into Pyomooptimization programs, leveraging on their flat BaseModelica representation. This work illustrates the mainfeatures of Modelica2Pyomo, including automatic variablesand constraints normalization, expressions manipulation andinitialization via Modelica simulation results. Todemonstrate the capabilities of this framework, twoexamples are showcased, including an industrial relevantopen-loop optimal control problem of a solid-oxide fuelcell.

Downloads

Published

2025-10-24