Large-scale physical phenomena can be modeled by means of differential and algebraic equations systems. Many engineering fields take advantage of modeling to facilitate the prototyping, verification and maintenance of any system, because it allows to know ahead of time the evolution of the behavior of these systems. Due to these needs, a declarative modeling language called Modelica was devised to describe a physical model with a high-level structure and then use this description to produce an accurate simulation. Currently, the Modelica compilers available on the market are unable to keep up with the always increasing complexity of modern-day technologies. This is caused by the inability of such compilers to take advantage of object-oriented structures that compose the model. For this reason, a new compiler has been designed in recent years to overcome these limitations. This compiler, called MARCO, has the main objective of maintaining intact data structures that compose the model as much as possible. Doing so, it is possible to fully exploit the locality properties of modern computer architectures. MARCO was initially only capable of simulating models through the use of the Forward Euler method. This poses great restrictions on the type of models that can be simulated using this compiler. This document describes how this newly born compiler has been enhanced with an external DAE solver, called IDA, while also maintaining the original objective of preserving the data structures of the physical model. This way, MARCO will be able to create an efficient simulation without posing any restriction on the input models. We will first make an overview of the most used mathematical methods to solve DAE systems and of the state of the art framework technologies for developing compilers. It will then be described how the introduction of an external DAE solver within MARCO was designed, along with some optimizations and implementation details on the most delicate parts. Finally, the correctness and the usefulness of this approach will be demonstrated through experimental tests.

I fenomeni fisici su larga scala possono essere modellati mediante sistemi di equazioni differenziali e algebriche. Molti campi dell'ingegneria sfruttano la modellazione per facilitare la prototipazione, la verifica e la manutenzione di qualsiasi sistema, perché questa permette di conoscere in anticipo l'evoluzione del comportamento di questi sistemi. A causa di queste esigenze, è stato ideato un linguaggio dichiarativo di modellazione chiamato Modelica per descrivere un modello fisico con una struttura di alto livello e quindi utilizzare questa descrizione per produrre una simulazione accurata. Al momento, i compilatori Modelica disponibili sul mercato non sono in grado di tenere il passo con la complessità sempre crescente delle tecnologie moderne. Questo è causato dall'impossibilità di tali compilatori di sfruttare le strutture orientate agli oggetti che compongono il modello. Per questo motivo, negli ultimi anni è stato progettato un nuovo compilatore per superare queste limitazioni. Questo compilatore, chiamato MARCO, ha come principale obiettivo il mantenere intatte le strutture dati che compongono il modello il più possibile. In questo modo è possibile sfruttare appieno le proprietà di località delle moderne architetture dei computer. MARCO inizialmente era solo in grado di simulare modelli attraverso l'uso del metodo di Eulero in avanti. Ciò pone grandi restrizioni sul tipo dei modelli che possono essere simulati tramite questo compilatore. Questo documento descrive come questo nuovo compilatore sia stato migliorato con un risolutore DAE esterno, chiamato IDA, mantenendo l'obiettivo originale di preservare le strutture dati del modello fisico. In questo modo, MARCO sarà in grado di creare una simulazione efficiente senza porre alcuna restrizione sui modelli in ingresso. Per prima cosa faremo una panoramica dei metodi matematici più utilizzati per risolvere i sistemi DAE e delle tecnologie all'avanguardia per lo sviluppo di compilatori. Verrà quindi descritto come è stata progettata l'introduzione di un solutore DAE esterno all'interno di MARCO, insieme ad alcune ottimizzazioni e dettagli implementativi sulle parti più delicate. Infine, la correttezza e l'utilità di questo approccio sarà dimostrata attraverso verifiche sperimentali.

Compilation and optimization of large scale Modelica DAE models

Camillucci, Nicola
2020/2021

Abstract

Large-scale physical phenomena can be modeled by means of differential and algebraic equations systems. Many engineering fields take advantage of modeling to facilitate the prototyping, verification and maintenance of any system, because it allows to know ahead of time the evolution of the behavior of these systems. Due to these needs, a declarative modeling language called Modelica was devised to describe a physical model with a high-level structure and then use this description to produce an accurate simulation. Currently, the Modelica compilers available on the market are unable to keep up with the always increasing complexity of modern-day technologies. This is caused by the inability of such compilers to take advantage of object-oriented structures that compose the model. For this reason, a new compiler has been designed in recent years to overcome these limitations. This compiler, called MARCO, has the main objective of maintaining intact data structures that compose the model as much as possible. Doing so, it is possible to fully exploit the locality properties of modern computer architectures. MARCO was initially only capable of simulating models through the use of the Forward Euler method. This poses great restrictions on the type of models that can be simulated using this compiler. This document describes how this newly born compiler has been enhanced with an external DAE solver, called IDA, while also maintaining the original objective of preserving the data structures of the physical model. This way, MARCO will be able to create an efficient simulation without posing any restriction on the input models. We will first make an overview of the most used mathematical methods to solve DAE systems and of the state of the art framework technologies for developing compilers. It will then be described how the introduction of an external DAE solver within MARCO was designed, along with some optimizations and implementation details on the most delicate parts. Finally, the correctness and the usefulness of this approach will be demonstrated through experimental tests.
CASELLA, FRANCESCO
CATTANEO, DANIELE
CHERUBIN, STEFANO
LEVA, ALBERTO
SCUTTARI, MICHELE
TERRANEO, FEDERICO
ING - Scuola di Ingegneria Industriale e dell'Informazione
28-apr-2022
2020/2021
I fenomeni fisici su larga scala possono essere modellati mediante sistemi di equazioni differenziali e algebriche. Molti campi dell'ingegneria sfruttano la modellazione per facilitare la prototipazione, la verifica e la manutenzione di qualsiasi sistema, perché questa permette di conoscere in anticipo l'evoluzione del comportamento di questi sistemi. A causa di queste esigenze, è stato ideato un linguaggio dichiarativo di modellazione chiamato Modelica per descrivere un modello fisico con una struttura di alto livello e quindi utilizzare questa descrizione per produrre una simulazione accurata. Al momento, i compilatori Modelica disponibili sul mercato non sono in grado di tenere il passo con la complessità sempre crescente delle tecnologie moderne. Questo è causato dall'impossibilità di tali compilatori di sfruttare le strutture orientate agli oggetti che compongono il modello. Per questo motivo, negli ultimi anni è stato progettato un nuovo compilatore per superare queste limitazioni. Questo compilatore, chiamato MARCO, ha come principale obiettivo il mantenere intatte le strutture dati che compongono il modello il più possibile. In questo modo è possibile sfruttare appieno le proprietà di località delle moderne architetture dei computer. MARCO inizialmente era solo in grado di simulare modelli attraverso l'uso del metodo di Eulero in avanti. Ciò pone grandi restrizioni sul tipo dei modelli che possono essere simulati tramite questo compilatore. Questo documento descrive come questo nuovo compilatore sia stato migliorato con un risolutore DAE esterno, chiamato IDA, mantenendo l'obiettivo originale di preservare le strutture dati del modello fisico. In questo modo, MARCO sarà in grado di creare una simulazione efficiente senza porre alcuna restrizione sui modelli in ingresso. Per prima cosa faremo una panoramica dei metodi matematici più utilizzati per risolvere i sistemi DAE e delle tecnologie all'avanguardia per lo sviluppo di compilatori. Verrà quindi descritto come è stata progettata l'introduzione di un solutore DAE esterno all'interno di MARCO, insieme ad alcune ottimizzazioni e dettagli implementativi sulle parti più delicate. Infine, la correttezza e l'utilità di questo approccio sarà dimostrata attraverso verifiche sperimentali.
File allegati
File Dimensione Formato  
2022_04_Camillucci_01.pdf

Open Access dal 01/04/2023

Descrizione: Thesis
Dimensione 1.14 MB
Formato Adobe PDF
1.14 MB Adobe PDF Visualizza/Apri
2022_04_Camillucci_02.pdf

Open Access dal 01/04/2023

Descrizione: Executive Summary
Dimensione 513.57 kB
Formato Adobe PDF
513.57 kB Adobe PDF Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/186108