First time here? Check our help page!
0

Python Module does not work in OpenModelica

Hello everyone, I am trying to implement a peak-shaving algorithm for a microgrid using the modelica building library on a Fedora OS. I manged to set the python path and run a very basic model, but I cannot get my module for peak-shaving to work. I am not sure how to read python error codes in openmodelica. I put my python code in the same path as the examples. Not sure why it is not working. I am attaching my .mo, .py, and .txt files a google drive. Thank you for the help. Also here is the error output:

Simulation process failed. Exited with code 255.
/tmp/OpenModelica_sigi_laptop/OMEdit/warehouse_eaxmple_version_0/warehouse_eaxmple_version_0 -port=40127 -logFormat=xmltcp -override=startTime=0,stopTime=3.1536e+07,stepSize=900,tolerance=1e-06,solver=dassl,outputFormat=mat,variableFilter=.* -r=/tmp/OpenModelica_sigi_laptop/OMEdit/warehouse_eaxmple_version_0/warehouse_eaxmple_version_0_res.mat -w -lv=LOG_STATS -inputPath=/tmp/OpenModelica_sigi_laptop/OMEdit/warehouse_eaxmple_version_0 -outputPath=/tmp/OpenModelica_sigi_laptop/OMEdit/warehouse_eaxmple_version_0
The initialization finished successfully without homotopy method.
Failed to load "peak_shaving".
This may occur if you did not set the PYTHONPATH environment variable
or if the Python module contains a syntax error.
The error message is "(null)"

Google Drive Link with files:

https://drive.google.com/drive/folder...

Thank you all for the help

grid_designer's avatar
35
grid_designer
asked 2023-05-16 21:21:40 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2023-05-17 10:45:53 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

I verified that the model Buildings.Utilities.IO.Python_3_8.Examples.KalmanFilter works on our test environment (Ubuntu 22.04) and also in the OpenModelica CI testing: https://libraries.openmodelica.org/br...

I suggest you try to get this to run on your system and then change the code to reflect your problem. See also https://simulationresearch.lbl.gov/mo... for installation and setup instructions.

Michael Wetter's avatar
1.7k
Michael Wetter
answered 2023-05-18 17:51:59 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments