pyfmi

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

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

can't retrieve the results back from JModelica to Python

时光总嘲笑我的痴心妄想 提交于 2020-01-16 11:12:07
问题 Following this question, I'm trying to compile and simulate a Modelica model with JModelica. The model is: package friction1D function coulombFriction input Real relVel; input Real shearForce; input Real normalForce; input Real statfricco; input Real kinfricco; input Real inertia; input Real relAcc; output Real fricForce; algorithm if (relVel == 0) and (abs(shearForce - inertia * relAcc) < statfricco * normalForce) then fricForce := shearForce - inertia * relAcc; else fricForce := kinfricco *

OpenModelica and JModelica deliver significantly different results

孤人 提交于 2019-12-11 15:34:43
问题 Following this question, I'm trying to compare the results of the simulation between JModelica and OpenModelica. The Modelica file is identical to the above-mentioned post and the JModelica wrapper is the corrected version: #%% from pymodelica import compile_fmu from pyfmi import load_fmu import matplotlib.pylab as plt #%% model_name = 'friction1D.fricexample_1' mofile = 'friction1D.mo' #%% fmu_name = compile_fmu(model_name, mofile) sim = load_fmu(fmu_name) #%% opts = sim.simulate_options()