#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)
Change History (14)
comment:1 by , 10 years ago
comment:3 by , 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 , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → accepted |
comment:5 by , 10 years ago
follow-up: 7 comment:6 by , 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.
comment:7 by , 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 , 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 , 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:11 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
comment:12 by , 9 years ago
Milestone: | Future → pre1.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 , 7 years ago
Milestone: | pre1.9.4 → 1.9.4 |
---|
Removing the pre1.9.4 milestone in favor of 1.9.4.
I forgot to add, I've tried today with revision 23888 from the repository, same problem.