Questions tagged [fmi]

FMI stands for Functional Mockup Interface. It is a standard for model exchange and co-simulation.

Functional Mock-up Interface (FMI) is a tool independent standard to support both model exchange and co-simulation of dynamic models using a combination of xml-files and compiled C-code (see overview in PDF or PPT format). The first version, FMI 1.0, was published in 2010. The FMI development was initiated by Daimler AG with the goal to improve the exchange of simulation models between suppliers and OEMs. As of today, development of the standard continues through the participation of 16 companies and research institutes. FMI is supported by over 50 tools and is used by automotive and non-automotive organizations throughout Europe, Asia and North America.

Additional information can be found at the FMI website.

191 questions
2
votes
1 answer

How to export c file/function to FMU using fmusdk

This is my function. I am trying to export this code to fmu. I am using fmusdk. For each cycle(time step), my input should be changed to the value given during simulation. myexecute() should be called. the values of input and pout should be stored…
Nandha
  • 752
  • 1
  • 12
  • 37
2
votes
2 answers

Jupyter notebook hiding the code and other files

I have an ongoing project in which a physical modelling in Modelica is as FMU extracted. These functional mock-up units are used with PyFMI to realize simulations. To this purpose, I wrote some Python modules as well. What I want to do is showing…
falsterbo
  • 520
  • 1
  • 3
  • 15
2
votes
0 answers

Count number of nonlinear iterations in FMU

Hello I'm running an FMU model using FMILibrary directly. The model has a certain size of non-linear system. I would like to get the information of how many non-linear iteration were needed at every time step. Something similar what Dymola returns…
AdamKe
  • 63
  • 4
2
votes
1 answer

FMI (Functional Mock-up Interface): Matlab / Simulink import/export

I would like to use the FMI interface for coupling Matlab and Simulink with other programs. My question: are there openSource FMU import/export packages available? I just find https://www.fmi-standard.org/tools. Thank you vey much!
lars111
  • 1,233
  • 4
  • 12
  • 21
2
votes
3 answers

FMU FMI simulation, no modification of results when setting certain type of parameter

I developed for the example a simple Modelica model based on the fluid library of the MSL. I connected a MassFlowSource with a pipe and a Boundary_PT as sink function as in the picture…
Roland
  • 135
  • 1
  • 6
2
votes
2 answers

C/C++ library to handle FMU

Do you know if there is a C library to handle FMU and run simulations including a good solver? As far as I know there are: FMUSDK from QTronic FMI Library from Modelon Both can open FMUs, but only let running FMU for co-simulation with a simple…
Koldo
  • 43
  • 1
  • 6
1
vote
0 answers

Issues with OpenModelica FMU export

My model works as expected in OMEdit using DASSL, Euler and CVODE solvers. However after exporting it to a FMU, I get error messages and the simulation fails. I am using OMEdit v1.21.0 (64-bit). My model is as follows: model experiment import…
1
vote
0 answers

OpenModelica simulation with CVODE gives different result than equivalent FMU

I want to simulate an OpenModelica model from within Python using an FMU. When the model is simulated in OMEdit, the results are correct. When the corresponding FMU is simulated using FMPy, the results are not correct. I am trying to find out if I…
1
vote
2 answers

Calling FMU's generated by Dymola in visual studio

If you create an FMU using Dymola and extract what is within the FMU, you would get something like this: enter image description here enter image description here I used the following settings in Dymola: enter image description here The FMU is…
1
vote
2 answers

How to create FMU slave and initialise FMU in C using Modelica's fmi headers

I'm creating a simple FMI demo system to try out FMI where I have 1 simulator connected to an FMU which computes the state of the system (represented as a number calculated from a closed-form equation) and another FMU that controls the system via a…
1
vote
2 answers

Resetting FMU after simulation with PyFMI

I'm trying to simulate my Dymola FMU multiple times with PyFMI and the function do_step() after each run it is supposed to start from the beginning. The first simulation runs as expected, but afterwards, the initialization fails / is stuck and…
Phil
  • 624
  • 7
  • 19
1
vote
1 answer

Compile modelica to FMU in (open-source and in batch)

A long time ago, I used JModelica/pymodelica to compile modelica models into FMUs, using a simple python script. Now I learn that JModelica is discontinued as an open-source project. (The libraries to run an FMU seems to have been branched out into…
George
  • 11
  • 3
1
vote
0 answers

Evaluating state derivatives for Model Exchange FMU within the same step

I am trying to create a custom solver for a Model Exchange (ME) FMU, using the fmilib in C, tag 2.3. The solver I am trying to implement is a Runge-Kutta order 2, The Heun method, as seen in the formulas given in the picture: Heun Method Order 2. I…
bruaug
  • 11
  • 3
1
vote
1 answer

PyFMI multiple inputs in Master simulation

I am trying to simulate two FMUs with the one having inputs as CSV files by using the Master. What I have tried is the following: from pyfmi import load_fmu from pyfmi import Master import pandas as pd electricity_network =…
Kosmylo
  • 436
  • 1
  • 6
  • 20
1
vote
0 answers

Error when trying to simulate one FMU with 4 inputs from csv files

I have a single FMU and with 4 inputs, which I want to feed them with csv files. I did the following: from pyfmi import load_fmu import pandas as pd electricity_network = load_fmu(r"C:\Users\kosmy\Pandapower.fmu") load_file =…
Kosmylo
  • 436
  • 1
  • 6
  • 20