Questions tagged [pyfmi]
52 questions
6
votes
3 answers
Is there a way to list of parameters of FMU (or of submodel in FMU) using the python libraries FMPy or pyFMI?
I have a FMU of a model and the use case is to change parameter values of the FMU to see the impact on the results. Is there a way to list top level parameters of the FMU using either FMPy or pyFMI if I dont' have access to the Modelica model?
One…

Kaustubh
- 391
- 2
- 10
6
votes
2 answers
How to run EnergyPlus-FMU using PyFMI
I am in trouble in simulating the EnergyPlus-FMU by PyFMI. I created an EnergyPlus FMU using the reference building model. I am using PyFMI2.5. How do I run the do_step() function?
from pyfmi import load_fmu
model =…

mindcoder
- 377
- 3
- 11
4
votes
1 answer
Combine multiple FMUs into one
I have a pandapower network and at some buses I have included batteries and photovoltaics as FMUs. Right now I have a master algorithm that creates the connections between the inputs and the outputs of the different FMUs and it runs the…

Kosmylo
- 436
- 1
- 6
- 20
3
votes
1 answer
FMPy - model forward operator for Kalman filter
I want to implement a simple unscented Kalman filter in python for some Modelica models. The models are compiled to FMU and I want to use them via the FMPy library.
I have played around a bit with the interface and I can't find a way to define a…

Philipp Weder
- 41
- 2
3
votes
1 answer
How to using FMPy extract the list of (continuous time) states?
In some interactive simulation work it is convenient to simulate up to a time point,
change some parameters, and then continue simulation.
Using FMU for simulation then you need to reload or reset the FMU, and then enter new initial values for the…

janpeter
- 681
- 8
- 22
3
votes
1 answer
How to co-simulate fmu with a Python function?
With Python libraries like FMPy I am able to simulate fmus (using fmpy.simulate_fmu) for given start_time and stop_time. In such case, the function simulate_fmu completes the simulation and return the time-series results.
However, I want to create…

Kaustubh
- 391
- 2
- 10
3
votes
1 answer
FMU FMI simulation, no evaluation of some equations after initialization
I believe my problem is somehow related to this previous question but I was not able to fix my problem with their advices.
Here is a minimal non working example. I have a simple electrical circuit with a commutating switch in it (developed in…

Danto N
- 65
- 7
2
votes
0 answers
Error executing FMU model with pyFMI: "pyfmi.fmi.FMUException: Failed to get the Boolean values"
I am using the code below to simulate a model.
def run_demo(with_plots=True):
traj = np.array([[start_time,2.25]])
input_object = ('input_1[1]', traj)
model = load_fmu('[pyfmimodel.fmu',log_level=7)
opts = model.simulate_options ()
…

Nitin Gondule
- 21
- 2
2
votes
0 answers
Cannot run FMU in pyFMI?
I'm trying to simulate a FMU exported from OpenModelica using pyFMI:
from pyfmi import load_fmu
import os
baseDir = os.path.dirname(os.getcwd())
fmu = baseDir + '\\Woody\\woody.fmu'
model = load_fmu(fmu)
# Get the options
opts =…

jvandeweg
- 133
- 5
2
votes
0 answers
Multicore simulation of a single FMU
Is it possible to take a single FMU and simulate it via model exchange in python on multiple in parallel to speed up a simulation?
The models are created with OpenModelica, imported via PyFMI and solved with scipy.integrate.solve_ivp.

H Bode
- 165
- 7
2
votes
1 answer
How to handle unit conversions while interacting with FMUs?
I have a python script that filters and lists the parameters, their units and default values from a fmu using the read_model_description function from FMPy library and writes in an excel sheet (related discussion). Then using the simulate_fmu…

Kaustubh
- 391
- 2
- 10
2
votes
2 answers
Reinforcement Learning Agent in FMU
I want to train a reinforcement learning agent on a model which i build in OpenModelica. By using pyFMI, it is no problem to import the FMU, simulate it, and get some results.
My problem is that i don´t have a possibility to "pause" a simulation…

H Bode
- 165
- 7
2
votes
2 answers
Error while loading a fmu in python with pyfmi library
I have installed PyFMI library and trying to load a fmu created by GT-Suite in python.
I am following this tutorial of jmodelica :
https://jmodelica.org/pyfmi/tutorial.html
# Import the load function (load_fmu)
from pyfmi import load_fmu
this set…

chink
- 1,505
- 3
- 28
- 70
1
vote
0 answers
error occured when install pyfmi in pip- is there any solution?
I'd like to install pyfmi but it kept failed.. I tried solutions on internet before, but nothing works..
would you give me solutions please??
(base) C:\Users\user>pip install pyfmi
Collecting pyfmi
Using cached PyFMI-2.5.tar.gz (4.8 MB)
Preparing…

JuneL
- 11
- 1
1
vote
0 answers
Retrieving FMU co-simulation results when using Master in PyFMI
I am trying to co-simulate two Matlab-Simulink FMUs using the Master from PyFMI:
from pyfmi import Master
""" Loading FMUs, establishing connection between models, defining Master simulator and simulation options """
dummy_model =…

glitchb3rt
- 23
- 3