Questions tagged [pyfmi]

52 questions
1
vote
1 answer

pyFMI parameter change don't change the simulation output

I'm changing the initial 2 parameter values (over the range of possible values) with pyFMI and simulate the model response I can see that my response is affected only by 1 variable change and not by the other but if I simulate the model only with…
kelamahim
  • 577
  • 1
  • 4
  • 21
0
votes
0 answers

Pyfmi setting initial state of the model as result as previous simulation

I am trying to simulate same model multiple times but each time I would like to set initial states as the result of previous simulation. In order to do that I am using get_fmu_states and set_fmu_states functions. However I am getting a…
0
votes
0 answers

Error in initializing FMU during reset() method in PyFMI

I'm encountering an error when trying to initialize an FMU in the reset() method of a custom PyFMIEnvironment class. The error message I'm seeing is: "[ERROR][Slave] [error][FMU status:Error] fmiInitializeSlave: Could not rename the temporary input…
Elvis
  • 1
0
votes
1 answer

How to get access to how results are stored using FMPy to simulate FMU-CS?

I develop a simulation script for optimization where each function evaluation is a simulation. Usually the speed can be improved considerably by only allow the simulation to store results in the RAM memory and thus avoid writing to the hard disc.…
janpeter
  • 681
  • 8
  • 22
0
votes
0 answers

How to do give variables/schedule as input with EnergyPlus-FMU using PyFMI to run the simulation

My goal is to do HVAC related simulations in EnergyPlus. I have an .idf with which I have generated fmu. There is a schedule in .idf file which has the outdoor CO2 concentration which I want to be able to give as input to fmu instead of having it as…
0
votes
1 answer

How to make Modelica Standard Library version readable from an FMU?

I want to be able to read out the MSL version number from an FMU using PyFMI. (The "description-strings" are comments but is part of the Modelica language see specification 3.5 section 2.2). The MSL version is found in the "description-string" for…
janpeter
  • 681
  • 8
  • 22
0
votes
2 answers

Why I'm obtaining NaN in the output of a simple FMU exported from Simulink and tested in Python 3?

I'm new to the FMI standard and FMUs. I'm trying to export a FMU of a simple Simulink model, the Ohm's law in my case, to test the funcionality of the FMI standard in Python. I'm obtaining NaN in the output of this simple FMU exported from Simulink…
Jon
  • 1
  • 1
0
votes
1 answer

Python erronously adding file extension to path string

I'm currently struggling with the following problem: My folder structer looks like: master - resources customFile.fmu fileCallingFMU.py While executing the fileCallingFMU.py I pass a path string like path = "./resources/customFile.fmu" My…
Viktor Katzy
  • 162
  • 10
0
votes
0 answers

pyfmi fails with Stepsize must be non-negative and divisible by 0.2'

I did the world's simplest simulink model which sums two constants and send the result to an outport. I exported this to an fmu model and try to run it in pyfmi. I get an error with FMUException: The simulation failed. See the log for more…
bhomass
  • 3,414
  • 8
  • 45
  • 75
0
votes
1 answer

How to get the unit of a variable with FMPy?

I am trying to get the units from the model variables to store as metadata. Is there a way to get the unit of a variable?
danin
  • 3
  • 1
0
votes
1 answer

Communication frequency vs Simulation Time for FMU

Lets say we have a FMU which is getting inputs from Python and simulating at an interval of 0.001s. Does the FMI/FMU standard allow us to run the FMU multiple times for a same input (so Python provides the input at 0.01s interval and the FMU…
N kube
  • 1
0
votes
0 answers

Co-simulate two co-simulation type of FMUs in PyFMI

How to co-simulate two co-simulation type of FMUs connected in a feedback loop by using PyFMI? How does the co-simulation set-up works in PyFMI? How the connections are defined when Input is given to "y_ref" The input that goes to "u" is actually a…
Geeko
  • 29
  • 7
0
votes
1 answer

How does one solve the character encoding error in PyFMI?

I'm on Ubuntu 20.04 trying to load and run an FMU exported from OpenModelica with PyFMI. When I run the code: from pyfmi import load_fmu model = load_fmu('Model.fmu') The following error is produced: File "src/pyfmi/fmi.pyx", line 7943, in…
Mark
  • 21
  • 4
0
votes
1 answer

FMUException: Error loading the binary. Could not load the FMU binary

How do i solve this problem? The operation system environment is as follows. python 3.7.1 conda 4.5.12
0
votes
1 answer

Cannot run fmu.get_fmu_state() in pyfmi library

I am trying to understand how the method get_fmu_state works on a simple fmu in cosimulation mode example like the bouncing ball using PyFMIs(2.7.3) pre-supplied fmu. I have installed it via miniconda on a ubuntu-docker and try to execute the…
CS101
  • 444
  • 1
  • 6
  • 21