OpenModelica / OpenModelica

OpenModelica is an open-source Modelica-based modeling and simulation environment intended for industrial and academic usage.
https://openmodelica.org
Other
814 stars 305 forks source link

OMMatlab: Documentation buggy #12688

Open AHaumer opened 2 months ago

AHaumer commented 2 months ago

Have a look at https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/ommatlab.html: grafik

  1. Isn't prefix "omc." mssing in the second and third command just before "ModelicaSystem"?
  2. I suppose the "mod" in the second and third command are wrong and should be left away?
  3. If the package is stored in a directory structure (not as one file), how can it be opened?

grafik From where do I get the "mod" in this command?

casella commented 2 months ago

@arun3688 can you please take care of this when you'll have some time?

arun3688 commented 2 months ago

@casella sure i will look into it as early as possible

arun3688 commented 2 months ago

@AHaumer you are correct the mod should be replaced to omc prefix object, it was a typo I will fix it,

3. If the package is stored in a directory structure (not as one file), how can it be opened?

Let us assume that your package is stored in a directory with top level package.mo in the following path C:/powersystem/package.mo and the model you want to simulate is test then you can load it the following way

import OMMatlab.*
omc= OMMatlab()
omc.ModelicaSystem("C:/powersystem/package.mo", "powersystem.test")
omc.simulate()
omc.getSolutions()