#3687 closed defect (fixed)
Inline module fails with protected array variables
Reported by: | Willi Braun | Owned by: | Willi Braun |
---|---|---|---|
Priority: | blocker | Milestone: | 1.9.4 |
Component: | Backend | Version: | v1.9.4-dev-nightly |
Keywords: | Cc: | Vitalij Ruge |
Description (last modified by )
Following model results into code generation issue, because of protected array variables:
model foo function f input Real z; output Real y; protected Real a[2]; algorithm a := {2 * z, z}; y := sum(a); annotation(Inline = true); end f; Real y(start = 0, fixed = true); Real z; equation z = f(5 + time); der(y) = z; end foo;
Even worse is the following example:
model foo function f input Real z; output Real y; protected Real a[2]; algorithm a := {2 * z, z}; y := sum(a)/3; annotation(Inline = true); end f; function f1 input Real z; output Real y; protected Real a[2]; algorithm a := {2 * z, z}; y := sum(a)/3; end f1; Real y(start = 0, fixed = true); Real z, z2; Real a[2] = {sin(time),cos(time)}; equation z = f(5 + time); z2 = f1(5 + time); der(y) = z; end foo;
that results into really wrong outcome for z compared to z2.
Change History (6)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|---|
Priority: | high → blocker |
comment:2 by , 9 years ago
Description: | modified (diff) |
---|
comment:3 by , 9 years ago
Milestone: | Future → 1.9.4 |
---|
Note:
See TracTickets
for help on using tickets.
There should be a milestone for blockers.