Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2830 closed defect (fixed)

Override of start attributes does not work in combination with fixed=true

Reported by: Lennart Ochel Owned by: Lennart Ochel
Priority: high Milestone: 1.9.4
Component: Backend Version: trunk
Keywords: Cc: christoph.brinkrolf@…

Description

The following model can be used to explore the issue. Using the override flag changes the start value of x, but does not affect the initial solution of x.

loadString("
model foo
  Real x(start=1.0, fixed=true);
  parameter Real p=1.0;
equation
  der(x) = p;
end foo;
"); getErrorString();

simulate(foo, stopTime=0.0, simflags="-override=p=-2,x=0 -lv=LOG_SOTI"); getErrorString();

Change History (9)

comment:1 by Lennart Ochel, 10 years ago

Status: newaccepted

comment:2 by Lennart Ochel, 10 years ago

Cc: christoph.brinkrolf@… added

comment:3 by Lennart Ochel, 10 years ago

Resolution: fixed
Status: acceptedclosed

fixed in r22392

comment:4 by Lennart Ochel, 10 years ago

Resolution: fixed
Status: closedreopened

unfixed in r22403

It is not a good idea to allow to override each start value, since some start expressions in combination to fixed=true affect the initial system structure.

comment:5 by Martin Sjölund, 10 years ago

We should at least print a warning if a value cannot be overridden (or does not exist, as is also common).

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

Replying to sjoelund.se:

We should at least print a warning if a value cannot be overridden (or does not exist, as is also common).

Yes, that is actually what I want to do. But maybe there is a better solution.

comment:7 by Lennart Ochel, 9 years ago

Milestone: Future1.9.4
Resolution: fixed
Status: reopenedclosed

This is fixed with PR275.
Now, it is possible to override all kind of start values using one of the override flags or an external mat file.

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:9 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.