modelon-community / PyFMI

PyFMI is a package for loading and interacting with Functional Mock-Up Units (FMUs) both for Model Exchange and Co-Simulation, which are compiled dynamic models compliant with the Functional Mock-Up Interface (FMI)
http://jmodelica.org/pyfmi
GNU Lesser General Public License v3.0
160 stars 38 forks source link

Realtime simulation #132

Closed Krokos11 closed 2 years ago

Krokos11 commented 2 years ago

Is there any way to run the simulation in realtime? I want to be able to run the simulation and change the inputs while it is running. If there is such a possibility, someone could provide an example of how to do it. How should the fmu model be constructed, is it necessary to do it in some special way. How to run simulation in realtime mode from python? How to change its inputs during the simulation?

Thank you in advance for your answer.

modelonrobinandersson commented 2 years ago

Hi @Krokos11, a new option for realtime simulation was added in PyFMI 2.9.7, see https://github.com/modelon-community/PyFMI/commit/9de8e4f76e4a746949286f9dae29550f71627577.