We're only contracting DiscreteControlledACBranch components, not other lines with very small r and x. Is this a purposeful design choice?
It's causing loss of precision when running power flows: I'm seeing |y[i,j]| ~ 1e4 with a voltage difference of about 1e-4 across the line, so then I get a discrepancy of about Y * ΔV ~ 1e0 in the KCL calculation. And so I get a non-zero residual at the bus, on the order of mangitude of a couple p.u.
edit: I'm not sure the above accounting is quite right, but basically...small x and r -> huge y -> loss of precision, from 1e5 - 1e5 = 0±1e-2, since Float32 only has 7 decimal places of precision.
I guess another fix would be to allow for the user to specify the ZIL threshold.
We're only contracting
DiscreteControlledACBranchcomponents, not other lines with very smallrandx. Is this a purposeful design choice?It's causing loss of precision when running power flows: I'm seeing
|y[i,j]| ~ 1e4with a voltage difference of about1e-4across the line, so then I get a discrepancy of aboutY * ΔV ~ 1e0in the KCL calculation. And so I get a non-zero residual at the bus, on the order of mangitude of a couple p.u.edit: I'm not sure the above accounting is quite right, but basically...small
xandr-> hugey-> loss of precision, from1e5 - 1e5 = 0±1e-2, sinceFloat32only has 7 decimal places of precision.I guess another fix would be to allow for the user to specify the ZIL threshold.