You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
giving the expression zeros(size(fill(0, 0), 1) - 1) ==> zeros(-1), which is illegal (all arguments to zeros need to be >=0), or am I missing something?
The text was updated successfully, but these errors were encountered:
Just checked with OpenModelica. It generates code with zeros(0), i.e. silently corrects this during model translation. The called function doesn't use the array for n < 2.
function z_fromEqCirc "Calculates impedance matrix z from equivalent circuit"
extends Modelica.Icons.Function;
input Integer n "transient order";
...
input SIpu.Reactance[n-1] xm2_n(each unit="1") "coupling reactance";
...
output SIpu.Reactance[n+1,n+1] zx(each unit="1") "impedance matrix reactive";
algorithm
...
for k in 2:n loop
zx[1:k,1:k] := zx[1:k,1:k] + fill(xm2_n[k-1], k, k);
end for;
...
end z_fromEqCirc;
The call to
zeros(n_q - 1)
here:PowerSystems/PowerSystems/Examples/AC3ph/Precalculation.mo
Line 1142 in 69fd1e7
seems to come down to
zeros(-1)
, if we resolven_q
:PowerSystems/PowerSystems/Examples/AC3ph/Precalculation.mo
Line 1137 in 69fd1e7
PowerSystems/PowerSystems/Examples/AC3ph/Precalculation.mo
Line 1116 in 69fd1e7
giving the expression
zeros(size(fill(0, 0), 1) - 1)
==>zeros(-1)
, which is illegal (all arguments tozeros
need to be>=0
), or am I missing something?The text was updated successfully, but these errors were encountered: