Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate whether checkpointing will be supported in future releases of OpenModelica #4

Open
uekerman opened this issue May 19, 2023 · 2 comments

Comments

@uekerman
Copy link
Member

No description provided.

@LeonardWilleke
Copy link
Collaborator

LeonardWilleke commented Jun 21, 2023

The OpenModelica Editor is the most convenient way to create Modelica models (.mo). It has an interface with drag-and-drop elements to simulate many engineering aspects. It can export the .mo models as FMU models as well, but not with the rollback functionality we need for implicit coupling.

This feature was not supported by the OpenModelica Editor or other tools in the OM ecosystem as of 2017: https://openmodelica.org/forum/default-topic/2276-how-to-set-parameters-in-an-exported-fmu.html

There was a recent push to integrate the export of FMUs with canGetAndSetFMUstate=true in the OpenModelica Compiler: OpenModelica/OpenModelica#8638

This is still experimental and not part of the standard function of the OM Compiler. I am not sure how the OM Compiler and the OM Editor work together, but my guess is that the OM Editor calls the OM Compiler to build FMUs. So it might be some way to go until OM Editor can export rollback FMUs.

TODO:

  • Try to export a rollback FMU with OM Compiler
  • Test capabilities of rollback FMU
  • Ask developers if they plan to include it in OM Editor

@LeonardWilleke
Copy link
Collaborator

LeonardWilleke commented Jun 22, 2023

How to export a rollback FMU with OM Compiler:

Create script export-fmu.mos to load and build the model:

loadFile("MyModel.mo");getErrorString();
translateModelFMU(MyModel, fmuType="cs");getErrorString(); 

Execute the script with the OM Compiler and set the experimental flag:

omc --debug="fmuExperimental" export-fmu.mos

This creates a CS FMU with canGetAndSetFMUstate=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants