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

Unable to recreate optimization example: 14.1.6 Example 2 / Example 3

Unable to recreate optimization example: 14.1.6 Example 2 / Example 3

Hi everyone,

I am kind of new to OpenModelica and am trying to recreate example 2/3 from chapter 14.1.6 : Hybrid vehicle minimum consumption, in the OpenModelicaUserGuide.

I am, however, unable to do so, and was wondering if anyone has the complete model working and would be so kind to share it.

Thanks current/smile

Re: Unable to recreate optimization example: 14.1.6 Example 2 / Example 3

somehow I got it working, but results look different; nevertheless, hopefully a first and helpful step...

think the key is to add
__OpenModelica_simulationFlags(s="optimization", optimizerNP="1"),
__OpenModelica_commandLineOptions="+g=Optimica");
to the model annotation.
(see: https://www.openmodelica.org/doc/OpenMo … imization)

fuel consumption map will need some finetuning.

Example-14-1-6-2.mo

simulation settings: start time: 0
                                stop time: 20
                                number of steps: 100
                                integration method: optimization

Edited by: glang - Mar-31-22 07:59:08

Re: Unable to recreate optimization example: 14.1.6 Example 2 / Example 3

following bsfc map (toGperkWh) should be quite close to the map used in the example from the manual;
except I've dismissed gain1, and factored it into the map
Interpolation = ContinuousDerivative

load     bsfc
0.00    750
0.04    500
0.20    350
0.40    290
0.60    230
0.77    210
0.80    212
0.90    223
1.00    300

[0, 750; 0.04, 500; 0.2, 350; 0.4, 290; 0.6, 230; 0.77, 210; 0.8, 212; 0.9, 223; 1, 300]

bsfc-map.mo

Edited by: glang - Mar-31-22 09:37:03
Attachments:
There are 0 guests and 0 other users also viewing this topic
You are here: