Opened 8 years ago
Closed 8 years ago
#4606 closed defect (fixed)
Wrong equation count with complex numbers
| Reported by: | massimo ceraolo | Owned by: | Per Östlund |
|---|---|---|---|
| Priority: | high | Milestone: | 1.13.0 |
| Component: | Frontend | Version: | |
| Keywords: | Cc: |
Description
After a check it seems to me that this is not a duplicate, but I'm not totally sure.
Consider the following code:
model NumOfEq
function F
input Complex Z1, Z2;
output Complex Z3;
algorithm
Z3 := Z1 + Z2;
end F;
model M4x2
parameter Complex Z1 = Complex(1, 1);
parameter Complex Z2 = Z1;
Complex Z3 = F(Z1, Z2);
end M4x2;
model M4x4
parameter Complex Z1 = Complex(1, 1);
Complex Z2 = Z1;
Complex Z3 = F(Z1, Z2);
end M4x4;
end NumOfEq;
I expect to have 4 equations and variables in model M4x4 and 2 equations and variables in model M2x2.
However OM reports in the second case 4 equations and 2 variables.
Change History (4)
comment:1 by , 8 years ago
| Component: | *unknown* → Frontend |
|---|
comment:2 by , 8 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
@perost, can this be fixed easily in the old front-end? Otherwise, we can schedule this for 2.0.0
comment:4 by , 8 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.

The flattened code looks like this:
So it seems we both evaluate the binding and move it to the equation section, resulting in duplicates :(