Opened 7 years ago

Last modified 7 years ago

#4976 new defect

Optimization objective missing

Reported by: massimo ceraolo Owned by: Vitalij Ruge
Priority: low Milestone: Future
Component: Optimization Version:
Keywords: Cc:

Description

If we follow the instructions in the OpenModelicaUsersGuide, chapter 8, we can reproduce the users's guide plots for Batch Reactor optimisation run.

However there is something strange.
I created as prescribed a file "nmpcBatchReactor.mo" containing:

optimization nmpcBatchReactor(objective=-x2)
extends BatchReactor;
end nmpcBatchReactor;

But if I make

loadFile("nmpcBatchReactor.mo")
list(nmpcBatchReactor)

I get:

"optimization rmpcBatchReactor
  extends BatchReactor;
end rmpcBatchReactor;"

To the optimization objective is not shown. Also looking at the optimization output log, I cannot find indication that OMC has really minimised -x2 (this must be inferred from analysis of the plots).

So I see two issues here:
1) list does not show the optimisation objective
2) record SimulationResult and following log do not show the optimisation objective as well.

Change History (4)

comment:1 by massimo ceraolo, 7 years ago

Well, I've just realised that Optimica in OpenModelica does not support final constraints.
So, there is not much interest on this ticket. I'm going to change priority and target.

comment:2 by massimo ceraolo, 7 years ago

Milestone: 2.0.0Future
Priority: highlow

comment:3 by Vitalij Ruge, 7 years ago

@ceraolo Do you have chnage the gramma?

setCommandLineOptions("+g=Optimica");
getErrorString();

see. https://github.com/OpenModelica/OpenModelica-testsuite/blob/master/openmodelica/cruntime/optimization/basic/BR.mos

It's possible to use annotation approach for formlate final cosntraints

https://github.com/OpenModelica/OpenModelica-testsuite/blob/master/openmodelica/cruntime/optimization/basic/TFC.mos

in reply to:  3 comment:4 by massimo ceraolo, 7 years ago

Nice to hear you again, Vitaly.
Replying to vitalij:

@ceraolo Do you have chnage the gramma?

setCommandLineOptions("+g=Optimica");
getErrorString();

Yes I did this first, otherwise loadModel(nmpcBatchReactor.mo") would return false.
Note that I had no problem in running this optimization; I justo wanted to mention that strange error when listing.

see. https://github.com/OpenModelica/OpenModelica-testsuite/blob/master/openmodelica/cruntime/optimization/basic/BR.mos

It's possible to use annotation approach for formlate final cosntraints

https://github.com/OpenModelica/OpenModelica-testsuite/blob/master/openmodelica/cruntime/optimization/basic/TFC.mos

I like a lot this annotation approach (you gave me hints on it a few years ago). I have some difficulty with my problem, though, and I just thought to give a try to Optimica, just in case the algorithms were different.
I will give more details to you in a private mail.

Note: See TracTickets for help on using tickets.