Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

External library

External library

How to load external files? Loading a file in OpenModelica succeeded, but OMPython.execute('loadFile("/home/ubuntu/miglu/Buildings/Airflow/Multizone/Orifice.mo")') failed.
I also tried adding Buildings to openmodelica-21495/libraries and doing OMPython.loadModel(Buildings), which failed.

Edited by: Miglu - Jul-21-14 10:29:28

Re: External library

Run checkSettings(); it will tell you the paths you need to install libraries into. apt-get install omlib-buildings-latest should install a working Buildings version. Run getErrorString() after the loadFile command to find out why you could not load it. You wanted to run loadFile("/home/ubuntu/miglu/Buildings/package.mo").

Re: External library

I installed using apt-get, and OMPython.execute('loadModel(Buildings)") and OMPython.execute('loadFile("/home/ubuntu/miglu/Buildings/Airflow/Multizone/Examples/Validation3Rooms.mo")') now return true. However, when I do OMPython.execute('simulate(Validation3Rooms)'), I get "Model: Validation3Rooms does not exist! Please load it first before simulation." Thus I tried OMPython.execute('loadModel(Buildings.Validation3Rooms)'), which returns true, but simulation still fails.
What is the solution?

Re: External library

I would guess simulate(Buildings.Airflow.Multizone.Examples.Validation3Rooms) ...

Re: External library

That works, thanks. I suggest adding a section about using external libraries into OMPython's guide.

Re: External library

It's the same interface as regular omc, so read the documentation for those current/smile

There are 0 guests and 0 other users also viewing this topic