Several phasor dynamics models currently use != 0, == 0, != ZERO<RealT> or == ZERO<RealT> for some input parameters to enable/disable some features. This is ill advised for floating point values.
The models currently affected are:
isEqual with a tolerance or splitting == into isfinite(), <= and >= are inadequate here. The desired behavior really is to check if the value is zero, and the underlying purpose is to enable/disable some options.
One proposed solution is to expose the enabled/disabled options directly as integers (e.g., order for a stabilizer or booleans (e.g. saturation_disabled for an exciter). While this duplicates some information in the input file, this should make the model implementation cleaner. As long as the enabled/disabled features don't change during the simulation, it can be argued that we are mathematically dealing with different models.
cc @pelesh @superwhiskers
Several phasor dynamics models currently use
!= 0,== 0,!= ZERO<RealT>or== ZERO<RealT>for some input parameters to enable/disable some features. This is ill advised for floating point values.The models currently affected are:
isEqualwith a tolerance or splitting==intoisfinite(),<=and>=are inadequate here. The desired behavior really is to check if the value is zero, and the underlying purpose is to enable/disable some options.One proposed solution is to expose the enabled/disabled options directly as integers (e.g.,
orderfor a stabilizer or booleans (e.g.saturation_disabledfor an exciter). While this duplicates some information in the input file, this should make the model implementation cleaner. As long as the enabled/disabled features don't change during the simulation, it can be argued that we are mathematically dealing with different models.cc @pelesh @superwhiskers