1

I am trying to use OMOptim for the first time.

I want to run optimisation for code written in openmodelica that includes the following:

Modelica.Blocks.Sources.TimeTable solarThermal(table = [0:30:10800,100:10:3700]);
Modelica.Blocks.Sources.TimeTable solar(table = [0:30:10800,200:10:3800]);
Modelica.Blocks.Sources.TimeTable heatDemand(table = [0,450;3600,470;7200,400;10800,500]);
Modelica.Blocks.Sources.TimeTable electricityDemand(table =     
[0,300;3600,500;7200,400;10800,300]);

I defined in settings of omoptim that path to modelica library is C:/OpenModelica1.9.1Beta1/lib/omlibrary/Modelica 3.2.1/package.mo where TimeTable is located. Then I go Models=> Load Modelica Library.

But when it tries to load it, I get tons of error messages like this:

OMC : isClass(Modelica.SIunits.LossAngle)
[18:46:32] false
[18:46:32] OMC : isClass(Modelica.SIunits.Conductance)
[18:46:32] false
[18:46:32] OMC : isClass(Modelica.SIunits.Admittance)
[18:46:32] false
[18:46:32] OMC : isClass(Modelica.SIunits.ModulusOfAdmittance)
[18:46:32] false
[18:46:32] OMC : isClass(Modelica.SIunits.Susceptance)
[18:46:32] false
[18:46:32] OMC : isClass(Modelica.SIunits.InstantaneousPower)
[18:46:32] false
[18:46:32] OMC : isClass(Modelica.SIunits.ActivePower)
[18:46:32] false
...

It loads something like 50% of library. It doesn't load TimeTable library which I need. Am I doing something wrong and how can I solve this?

Thanks!

4

2 回答 2

1

The Modelica Standard Library has dependences to ModelicaServices. So you need also to load Modelica 3.2.1/ModelicaServices/package.mo.

于 2014-02-15T12:24:17.763 回答
0

I suspect your issue is that the Modelica path should be set to:

C:/OpenModelica1.9.1Beta1/lib/omlibrary

Although, strangely, I thought it was automatically set to that. But perhaps OMOptim or your scripts change that.

In other words, don't point it to the package.mo file and don't point it to Modelica 3.2.1. Point it to the directory that contains the Modelica 3.2.1 folder.

I hope that helps.

于 2014-02-13T23:29:15.837 回答