Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#3050 closed defect (fixed)

override values for parameters are ignored by the generated executable (same problem also from OMEdit)

Reported by: anonymous Owned by: Lennart Ochel
Priority: high Milestone: 1.9.4
Component: *unknown* Version: trunk
Keywords: Cc:

Description

I've been using the nightly build of OpenModelica on Ubuntu for a few months now.

Recently (after revision 238??, can't remember exactly) I can't set seem to set override values for parameters when calling the generated executable. I have been using the same model all this time, so I know this worked in the past.

I observe the same problem when I try to re-simulate the model from OMEdit. I can update the parameter values in the variables browser, but they are not actually updated in the simulation.

Attachments (1)

Test.mo (907 bytes ) - added by anonymous 10 years ago.
Simple exponential decay model

Download all attachments as: .zip

Change History (14)

comment:1 by anonymous, 10 years ago

I forgot to add, I've tried today with revision 23888 from the repository, same problem.

comment:2 by Lennart Ochel, 10 years ago

Can you share an example model?

by anonymous, 10 years ago

Attachment: Test.mo added

Simple exponential decay model

in reply to:  2 comment:3 by anonymous, 10 years ago

Replying to lochel:

Can you share an example model?

I have attached a simple exponential decay model (Test.mo):

model Test
  Modelica.Blocks.Continuous.Integrator integrator1(y_start = 1) annotation(Placement(visible = true, transformation(origin = {-42, 48}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Math.Gain gain1(k = -1) annotation(Placement(visible = true, transformation(origin = {0, 48}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(gain1.y, integrator1.u) annotation(Line(points = {{11, 48}, {22, 48}, {22, 72}, {-64, 72}, {-64, 48}, {-54, 48}, {-54, 48}}, color = {0, 0, 127}));
  connect(integrator1.y, gain1.u) annotation(Line(points = {{-31, 48}, {-12, 48}}, color = {0, 0, 127}));
  annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
end Test;

I've upgraded to r23899 and the problem persists. I can't override the parameter values (integrator1.y_start and gain1.k) neither through:

  • OMEdit variables browser and re-simulate
  • executable -override setting:
    > ./Test -output=integrator1.y
    time=1,integrator1.y=0.36787945153397683118
    
    > ./Test -output=integrator1.y -override="gain1.k=-2"
    time=1,integrator1.y=0.36787945153397683118
    

comment:4 by Lennart Ochel, 10 years ago

Owner: changed from somebody to Lennart Ochel
Status: newaccepted

comment:5 by anonymous, 10 years ago

I've made a bisection of revisions from 23815 to 23899. The problem with overriding appears from changeset r23848 onwards.

The issue also seems related to ticket #3055.

comment:6 by anonymous, 10 years ago

I've also made a "hybrid" version by checking out the latest revision (23921), but taking the following files from 23847 (last known working):

  • Compiler/BackEnd/Initialization.mo
  • Compiler/SimCode/SimCodeUtil.mo

This hybrid version works as it should.

in reply to:  6 comment:7 by Lennart Ochel, 10 years ago

Thanks for investigating the issue.

Replying to anonymous:

I've also made a "hybrid" version by checking out the latest revision (23921), but taking the following files from 23847 (last known working):

  • Compiler/BackEnd/Initialization.mo
  • Compiler/SimCode/SimCodeUtil.mo

This hybrid version works as it should.

Well, that is not a suitable solution, since it break other stuff. I will have a look next week. I think I knew the reason for the wrong behaviour already, but I cannot remember right now.

comment:8 by Lennart Ochel, 10 years ago

The initialization overwrites primary parameters after the overwrite-rules were applied. I am testing a patch for this right now.

comment:9 by Lennart Ochel, 10 years ago

I fixed at least one issue with primary parameters in r23934. Maybe there is even more wrong. Can you please check if your stuff is working properly again?

comment:10 by anonymous, 10 years ago

I have tested now all my use cases and it works. Thank you!

comment:11 by Lennart Ochel, 10 years ago

Resolution: fixed
Status: acceptedclosed

comment:12 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

comment:13 by Martin Sjölund, 7 years ago

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.