Opened 6 years ago
Last modified 6 years ago
#5460 closed enhancement
Enhance possibilities to re-simulate — at Initial Version
Reported by: | massimo ceraolo | Owned by: | somebody |
---|---|---|---|
Priority: | normal | Milestone: | 1.14.0 |
Component: | *unknown* | Version: | |
Keywords: | Cc: |
Description
Consider the following model
model Test2 import Modelica.Constants.pi; parameter Real Ipm; parameter Real varPar (fixed=false); initial equation if Ipm>1.0 then varPar=pi/2; else varPar=asin(Ipm); end if; equation end Test2;
This model does not run under Dymola, which issues the following error message:
The following parameter doesn't have any value: Ipm
It is instead brilliantly run by OpenModelica, which uses the available start value (start=0.0) for Ipm, and also allows changing Ipm and re-simulating.
I.e., OpenModelica is able to run this is model without taking Ipm as a structural parameter.
If I change the row
parameter Real Ipm;
into
parameter Real Ipm=1.5;
OM runs it, but Ipm has become unchangeable.
I think that it is very good that OM succeeds in keeping Ipm non-structural, even though it is used in an if-clause condition. But since it is able to do so, why not allowing this also when an explicit value is given to the parameter?
I made my tests with OMEdit connected to OMC v1.14.0-dev-234-g5ef43cce8 (64-bit), under Windows.
I marked this ticket as "enhancement", but probably it requires just a very small change in what OM already does.