fmi

How to access model jacobian from FMU or Dymola without analytical jacobian

喜夏-厌秋 提交于 2021-02-18 17:42:11
问题 I am trying to find a way to access the jacobian for a model in dymola either through a compiled FMU or from the exported Dymola source code. The final objective is to use the same procedure to access the jacobian for a much more complex multibody vehicle model (205 states). Using fmi2GetDirectionalDerivative() from the FMI Standard seemed promising so I made a simple linear vehicle model to test this. model Vehicle "Single-track Linear bicycle vehicle model" extends Modelica.Blocks.Icons

CVodeError while simulating with pyFMI

旧城冷巷雨未停 提交于 2021-02-07 14:44:27
问题 I try to set up the pyFMI on Anaconda (Python 3.6.8) Installed all the required packages listed on the pyFMI site. The fmu is loaded without the issue but while I try to simulate the fmu I get an error: Could not find cannot import name 'radau5' Could not find cannot import name 'dopri5' Could not find cannot import name 'rodas' Could not find cannot import name 'odassl' Could not find ODEPACK functions. Could not find RADAR5 Could not find GLIMDA. Traceback (most recent call last): File

CVodeError while simulating with pyFMI

寵の児 提交于 2021-02-07 14:43:30
问题 I try to set up the pyFMI on Anaconda (Python 3.6.8) Installed all the required packages listed on the pyFMI site. The fmu is loaded without the issue but while I try to simulate the fmu I get an error: Could not find cannot import name 'radau5' Could not find cannot import name 'dopri5' Could not find cannot import name 'rodas' Could not find cannot import name 'odassl' Could not find ODEPACK functions. Could not find RADAR5 Could not find GLIMDA. Traceback (most recent call last): File

Is there a way to list of parameters of FMU (or of submodel in FMU) using the python libraries FMPy or pyFMI?

狂风中的少年 提交于 2020-05-09 04:35:52
问题 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 of the process I have been following is to open the FMU using FMPy.gui and go through the list of parameters and then use them in the script but I would like to know if there an easier way of doing it so that I can list then in the Jupyter notebook

Using pyfmi with multiprocessing for simulation of Modelica FMUs

夙愿已清 提交于 2020-02-27 08:19:45
问题 I am trying to simulate multiple Modelica FMUs in parallel using python/pyfmi and multiprocessing. However I am not able to return any pyfmi FMI objects from the subprocesses once the FMUs are initialized. It seems that pyfmi FMI objects (e.g. pyfmi.fmi.FMUModelCS2 or pyfmi.fmi.FMUState2) are not pickable. I also tried dill to pickle, which doesn't work for me eather. With dill the objects are picklable though, meaning no error, but somehow corrupted if I try to reload them afterwards. Does

PyFMI in Python 3 environment in Ubuntu 18.04

非 Y 不嫁゛ 提交于 2020-02-26 02:37:28
问题 My goal is to be able to run FMUs produced by OpenModelica in Ubuntu 18.04 and then run these with PyFMI in Python 3 environment. I follow the outline for PyFMI installation here https://jmodelica.org/pyfmi/installation.html. So far I have using Conda managed to install Python3, Numpy, Scipy, lxml and some other packages and made it work with some of my Python examples. But I would appreciate some detailed advice how to Install FMI Library - and I do not get how to setup the flag fmil-home

Pause JModelica and Pass Incremental Inputs During Simulation

六眼飞鱼酱① 提交于 2019-12-14 01:20:36
问题 Hi Modelica Community, I would like to run two models in parallel in JModelica but I'm not sure how to pass variables between the models. One model is a python model and the other is an EnergyPlusToFMU model. The examples in the JModelica documentation has the full simulation period inputs defined prior to the simulation of the model. I don't understand how one would configure a model that pauses for inputs, which is a key feature of FMUs and co-simulation. Can someone provide me with an

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

╄→гoц情女王★ 提交于 2019-12-12 21:25:39
问题 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 below: http://www.casimages.com/img.php?i=14061806120359130.png I generate a FMU package with OpenModelica (in mode model-exchange). I manage this FMU package with python with the code below: import pyfmi, os from pyfmi import load_fmu myModel = load_fmu('PathToFolder\\test3.fmu') res1 = myModel.simulate() #

pyFMI parameter change don't change the simulation output

▼魔方 西西 提交于 2019-12-11 12:25:52
问题 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 the second variable (that is not changing in inital simulations) I can clearly see the effect on the model response. model.reset() model=load_fmu('Series_0Resistance.fmu') tstart = model.get_default_experiment_start_time() #### start time of the

FMU Variable Values Do Not Match Input

情到浓时终转凉″ 提交于 2019-12-11 06:42:34
问题 I'm getting some strange behavior in a simple co-simulation that I'm trying to configure. I setup a building energy model in EnergyPlus to test out an FMU generated from JModelica. However, the building energy model would get hung up at the co-simulation step. I then ran the FMU in JModelica and got some very strange results. The Modelica code is: model CallAdd input Real FirstInput(start=0); input Real SecondInput(start=0); output Real FMUOutput(start=0); function CAdd input Real x(start=0);