Opened 10 years ago
Closed 4 years ago
#3108 closed defect (fixed)
evaluation of structural parametrers
Reported by: | Lennart Ochel | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | high | Milestone: | 1.16.0 |
Component: | New Instantiation | Version: | trunk |
Keywords: | Cc: |
Description
The following model contains two structural parameters. Unfortunately, only N
gets evaluated correctly. The other one (p
) is not evaluated correctly. That means the if-equation is not simplified and the parameter is not marked as "unchangeable" in OMEdit.
model Unnamed Real x(fixed=p, start=1); parameter Boolean p = false; parameter Integer N=2; Real r[N] = fill(0.0, N); equation if p then der(x) = time; else x = time; end if; end Unnamed;
Change History (4)
follow-up: 2 comment:1 by , 10 years ago
comment:2 by , 10 years ago
Replying to sjoelund.se:
For me the if-equation is simplified, but p is marked isValueChangeable=true.
You are right. It is the following if-expression that will not get simplified: time = if p then der(x) else x;
comment:3 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I got this trace:
addEvaluatedCref: p addEvaluatedCref: N addEvaluatedCref: N addEvaluatedCref: p Make cr final N
For both the original and the new code. In the original the if-equation is evaluated but the parameter is never marked structural. The second one is more correct (it gives correct results, but p should be evaluated; probably by the back-end).
comment:4 by , 4 years ago
Component: | Frontend → New Instantiation |
---|---|
Milestone: | Future → 1.16.0 |
Resolution: | → fixed |
Status: | assigned → closed |
The new frontend evaluates both p
and N
and sets them both to be final
.
For me the if-equation is simplified, but p is marked isValueChangeable=true.