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

start problems and inheritance

start problems and inheritance

Hello,

I'm using OMC on Kubuntu ....

LoadModel(Modelica) returns false in QMShell-terminal.

I tried to set OPENMODELICALIBRARY, but it doesn't work...

echo $OPENMODELICAHOME                 /home/share/OpenModelicaSource/build
echo $OPENMODELICALIBRARY            /home/share/OpenModelicaSource/libraries/msl32/
I don't know, if the path of the Modelica Library is correct...

I also tried to translate dcmotor.mo via command line:

omc dcmotor.mo
The following error message appears:
Error processing file: dcmotor.mo
Error: Class Modelica.Electrical.Analog.Basic.Resistor not found in scope dcmotor while instantiating r1.
I also want to simulate some models which are inhearited from other classes. (but not Modelica classes). I don't want use 'saveTotal'. What are the necessary steps? I don't find a good example in documentation.

Thanks for your help!

Re: start problems and inheritance

You can verify what settings OMC thinks it is currently using through the command checkSettings()

You can use simulate(Name.Of.My.Model) to simulate any loaded class (using loadFile("file.mo") or loadModel(Modelica)). Or through command-line:
omc myModel.mo Modelica +i=Name.Of.My.Model

Re: start problems and inheritance

Oh yes, I forgot to add:
Use getErrorString() after loadModel(Modelica) to see if you got any lexer or parser errors...

Re: start problems and inheritance

Thank you, now

loadModel(Modelica) = true

checkSettings() returns for OPENMODELICALIBRARY = "\home\share\OpenModelicaSource\librariers\msl32"

loadFile("dcmotor.mo") is also true, but simulate returns an error!

Error: Class Modelica.Mechanics.Rotational.Inertia not found in scope dcmotor while instantiating load.
Error: Error occured while flattening model dcmotor

Did I load the wrong library?

Re: start problems and inheritance

Aha... The dcmotor example is using MSL 2.2.1, not 3.2. Also, you will get errors if you try to use MSL 3.2 since we are still working on MSL 3.1 and they introduced many new language constructs in that version.

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