Opened 8 years ago
Last modified 5 years ago
#4611 reopened defect
Wrong equation count with Complex - New case — at Version 4
| Reported by: | massimo ceraolo | Owned by: | somebody |
|---|---|---|---|
| Priority: | blocker | Milestone: | 2.0.0 |
| Component: | Backend | Version: | |
| Keywords: | Cc: | Lennart Ochel, Andreas Heuermann, Per Östlund |
Description (last modified by )
This is similar but different from #4606
I hope the solution is as straightforward as it was in that case!
Consider the following code:
package NumEqBug
model TestLineZb
parameter Real y[:] = {8, 10} ;
Complex Z[2, 2];
equation
Z =LineZb(
y=y );
end TestLineZb;
function LineZb
import Modelica.ComplexMath;
input Real y[2];
output Complex Z[2, 2];
algorithm
Z:=fill(Complex(1,1),2,2);
end LineZb;
end NumEqBug;
Checking TestLineZb I get 4 equations and 8 variables. I would expect 8 equations and 8 variables.
Note that y[] was included in the code even if it is not used because otherwise in the flattened code the function call is not included.
Tested with
v1.13.0-dev-188-g2c5818d (64-bit) for Win
Change History (4)
comment:1 by , 8 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 8 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:3 by , 8 years ago
| Component: | Frontend → Backend |
|---|---|
| Resolution: | fixed |
| Status: | closed → reopened |
Actually, this just fixes checkModel, but it seems like the backend is also wrong since it says 16 equations/8 variables when you try to compile the model. So I guess we should keep the ticket open until that's also fixed.
comment:4 by , 8 years ago
| Description: | modified (diff) |
|---|

Fixed in 193c439.