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

New User Support - OMEdit. Modelica Library , failed to load package

New User Support - OMEdit. Modelica Library , failed to load package

Hi I am a brand new user to Modelica and OMEdit, so apologies  in advance for basic questions.
I downloaded OpenModelica yesterday and after many reinstalls, reading the forum etc I have got OMEdit running, and I am trying to work through the tutorials.

I cannot run any basic simulations, probably because I have butchered the installation.

I am running OpenModelica on a Mac OSX 10.9.2

When I try to run the introductory tutorial for Resistor , Inductor circuit, I get the error

"[/opt/local/lib/omlibrary/Modelica 3.2.1/Constants.mo:19:3-19:98:readonly] Error: Variable ModelicaServices.Machine.eps not found in scope Modelica.Constants.
[/opt/local/lib/omlibrary/Modelica 3.2.1/Blocks/Sources.mo:567:5-567:43:readonly] Error: Variable Modelica.Constants.pi not found in scope Modelica.Blocks.Sources.Sine.
Error: Error occurred while flattening model RLCCircuitTest
"

Following the forum discussions on these sorts of errors it looks like I have not installed a library correctly.

I have tried
loadModel(Modelica)
from OMShell

and got

Error: Failed to load package Complex (3.2.1,default) using MODELICAPATH /opt/local/lib/omlibrary:/Users/terrysnow/.openmodelica/libraries/.

So I guess I am missing the Complex Package,
I thought that I could load the library, using OMEdit File>Load Library, and was able to navigate to where I thought the library would be

opt\openmodelica\lib\omlibrary\Modelica_LinearSystems2 2.3.1\WorkInProgress\Math\Complex

but I can't see a library to load from.

Sorry , this is a probably a basic error, but the tutorial and forum threads are more advanced than my current level of competence.
Any guidance is appreciated

thanks
Terry

Re: New User Support - OMEdit. Modelica Library , failed to load package

Update, I have done a
port self update
port upgrade outdated
port upgrade openmodelica-devel

I have confirmed Xcode is installed as per macports

When I first launch OMEdit I get two scripting errors reported

"Error: Failed to load package Complex (3.2.1,default) using MODELICAPATH /opt/local/lib/omlibrary:/Users/terrysnow/.openmodelica/libraries/."

and

"Error: Failed to load package ModelicaReference (default) using MODELICAPATH /opt/local/lib/omlibrary:/Users/terrysnow/.openmodelica/libraries/."

Re: New User Support - OMEdit. Modelica Library , failed to load package

Code:

$ port variant openmodelica-devel

openmodelica-devel has the variants:
   ...
   libraries: installs the complete Modelica library collection

Or just port install openmodelicalibraries. The dependency omlib-complex-3.2.1 should contain /opt/local/lib/omlibrary/Complex 3.2.1.mo

Re: New User Support - OMEdit. Modelica Library , failed to load package

thank you that worked
Took about 30 minutes to install whole library

Now no errors , and tutorial simulation is running

Re: New User Support - OMEdit. Modelica Library , failed to load package

Hello Everyone,

I want to load a library package which is developed by another person. I have the "package.mo" file but I do not know exactly in which directory I have to put this file and how I can open this library file. I am receiving errors for opening this file by using the file--> open model/library file(s).

I really appreciate your help.

Thanks,
Pouya

Re: New User Support - OMEdit. Modelica Library , failed to load package

What kind of errors do you get?

Re: New User Support - OMEdit. Modelica Library , failed to load package

I get the following error which is related to the path that I should put my file in it:

Failed to load package compartments () using MODELICAPATH C:\OpenModelica1.9.3\lib\BioChem\compartments\;C:/OpenModelica1.9.3/lib/omlibrary.

That would be great if you can help me with that. In what path I should put my "package.mo" file?


Thanks in advance,
Pouya

Re: New User Support - OMEdit. Modelica Library , failed to load package

It should not matter where you put the package.mo file. But it looks like you are trying to insert into the middle of BioChem? That should not be possible. Or you could try to open BioChem/package.mo perhaps?

Re: New User Support - OMEdit. Modelica Library , failed to load package

Yes I located the file in BioChem. Just as a test, I located the package.mo file in the Desktop and tried to open it in OMEdit but still I get error. The error is this:

Failed to load package Desktop () using MODELICAPATH C:\Users\pouya\;C:/OpenModelica1.9.3/lib/omlibrary.

The package file is developed by some other people and it is supposed to work.

Thanks for your attention,
Pouya

There are 0 guests and 0 other users also viewing this topic
You are here: