OMPython Problem

asked 2024-01-18 15:40:25 -0500

grid_designer's avatar

Hello, I am new to OMPython, and not sure what I am doing wrong. I am trying to run my .mo using OMPython. I ran the bouncing ball example with no issues, however, when I try to run my .mo code it fails to import. The strange thing is my code works fine in openModelica. Do I need to convert it into an FMU or something? I believe it may be an underlying C error, but I am not sure. Note I do call external data sets and python code within the .mo file.

Thank you for the help

My .mo file https://drive.google.com/file/d/1uBki...

Error output:

from OMPython import OMCSessionZMQ
omc = OMCSessionZMQ()
model_path="filepath"
from OMPython import ModelicaSystem
mod=ModelicaSystem(model_path + "scenario_6_fists_paper_microgrid_bess_l2_l3_peak_shaving_500.mo","conf_paper_microgrid")

[/folder/subfolder/.openmodelica/libraries/Buildings 9.1.0/Electrical/Interfaces/Load.mo:19:3-22:28:writable] Warning: Parameter V_nominal has annotation(Evaluate=true) and no binding. [/folder/subfolder/.openmodelica/libraries/Buildings 9.1.0/Electrical/Interfaces/Load.mo:19:3-22:28:writable] Warning: Parameter ev_charger_level_3_load.V_nominal has no value, and is fixed during initialization (fixed=true), using available start value (start=480.0) as default value. [/folder/subfolder/.openmodelica/libraries/Buildings 9.1.0/Electrical/Interfaces/Load.mo:19:3-22:28:writable] Warning: Parameter ev_charger_level_2_load.V_nominal has no value, and is fixed during initialization (fixed=true), using available start value (start=480.0) as default value. [/folder/subfolder/.openmodelica/libraries/Buildings 9.1.0/Electrical/Interfaces/Load.mo:19:3-22:28:writable] Warning: Parameter plug_load_resitive_load.V_nominal has no value, and is fixed during initialization (fixed=true), using available start value (start=480.0) as default value. [/folder/subfolder/.openmodelica/libraries/Buildings 9.1.0/Electrical/AC/OnePhase/Storage/Battery.mo:15:3-16:39:writable] Warning: Parameter BESS.V_nominal has no value, and is fixed during initialization (fixed=true), using available start value (start=480.0) as default value. [/folder/subfolder/.openmodelica/libraries/Buildings 9.1.0/Electrical/Interfaces/Load.mo:19:3-22:28:writable] Warning: Parameter building_load.V_nominal has no value, and is fixed during initialization (fixed=true), using available start value (start=480.0) as default value. Error: Error building simulator. Build log: clang -Os -fPIC -falign-functions -mfpmath=sse -fno-dollars-in-identifiers -Wno-parentheses-equality "-I/folder/subfolder/.openmodelica/libraries/Modelica 4.0.0+maint.om/Resources/C-Sources" "-I/folder/subfolder/.openmodelica/libraries/Buildings 9.1.0/Resources/C-Sources" -I"/usr/bin/../include/omc/c" -I"/usr/bin/../include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=conf_paper_microgrid -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=3 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o conf_paper_microgrid.o conf_paper_microgrid.c clang -Os -fPIC -falign-functions -mfpmath=sse -fno-dollars-in-identifiers -Wno-parentheses-equality "-I/folder/subfolder/.openmodelica/libraries/Modelica 4.0.0+maint.om/Resources/C-Sources" "-I/folder/subfolder/.openmodelica/libraries/Buildings 9.1.0/Resources/C-Sources" -I"/usr/bin/../include/omc/c" -I"/usr/bin/../include/omc" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=conf_paper_microgrid -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=3 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o conf_paper_microgrid_functions.o conf_paper_microgrid_functions.c clang -Os -fPIC -falign-functions -mfpmath=sse -fno-dollars-in-identifiers -Wno-parentheses-equality "-I/folder/subfolder ...

(more)
edit retag flag offensive close merge delete