Opened 11 years ago
Closed 11 years ago
#2326 closed discussion (wontfix)
default start and nominal values
Reported by: | Vitalij Ruge | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | normal | Milestone: | 1.9.0 |
Component: | Run-time | Version: | trunk |
Keywords: | nominal, start | Cc: |
Description
I think it is better, if min and max attributes are setting and we have no start or nominal value that we set the value to 0.5*( |min| + |max|).
Example:
model default_value Real x(min = 1e6, max = 2e6); // default start/nominal value => 0.5*( |min| + |max|) initial equation (x-1)*(x-1e6) = 0; equation der(x) = -x; end default_value;
Change History (7)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Sometimes there is a problem with zero start values (division by zero, etc.)
so in this case it might be better to use some heuristic between min and max
if they are set. I wonder what other tools do :)
comment:4 by , 11 years ago
It depends. We can warn about it and try some heuristic.
We can talk about this Sep 12-13 at the meeting.
comment:5 by , 11 years ago
I agree, but
please, don't forget nominal values which are importend for scaling.
By the heuristic I have more in my mind the nominal values.
Also if |max - min| realy smaller inf then we can set defaul nominal value to
0.5*( |min| + |max|) or fmax(|min|,|max|)
???
comment:6 by , 11 years ago
Priority: | high → normal |
---|---|
Type: | task → discussion |
comment:7 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
As Martin already mentioned, a start value is always present. This is a bit different for nominal values. Therefore I introduced a Boolean attribute "useNominal" for each Real variable (some time ago). This attribute is only true if there was an explicit given nominal value.
Using this information it should be easy enough to perform your own heuristic if needed.
There is always a default start-value set in Modelica. This is 0.0 for real values and using any other value is a bad idea.
Typically, a default of
0.5*( |min| + |max|)
is infinity, so that is also a bad heuristic for nominal since it may actually be outside the min-max interval even if reasonable min/max have been chosen. We are however allowed to pick any value between min and max that we feel is appropriate.