pymodelica

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()