With multi-period power flow in the loop, how should we handle non-convergence?
Right now, solve_power_flow! in power_flow_evaluation.jl sets pf_e_data.is_solved to true, even if some (or all) time steps failed to converge. PowerFlows.jl writes NaNs to certain fields when the power flow fails to converge. Side effects:
- The
NaNs in the bus_angle and bus_magnitude fields infect power flows in subsequent simulation steps: PSI re-uses the same PowerFlowData object and clear_injection_data! only zeroes out the power-related fields.
calculate_aux_variable_value! on the power flow related variables produces NaNs. The code fetches the values from the most recent simulation step for which is_solved == true, but that's all of them.
PSI has a single variable: pf_e_data.is_solved. PF has pf_data.converged::Vector{Bool}, with one true/false per time step. What should be the relationship between the two? is_solved = all(converged)? is_solved = any(converged)?
With multi-period power flow in the loop, how should we handle non-convergence?
Right now,
solve_power_flow!inpower_flow_evaluation.jlsetspf_e_data.is_solvedtotrue, even if some (or all) time steps failed to converge.PowerFlows.jlwritesNaNs to certain fields when the power flow fails to converge. Side effects:NaNs in thebus_angleandbus_magnitudefields infect power flows in subsequent simulation steps: PSI re-uses the samePowerFlowDataobject andclear_injection_data!only zeroes out the power-related fields.calculate_aux_variable_value!on the power flow related variables producesNaNs. The code fetches the values from the most recent simulation step for whichis_solved == true, but that's all of them.PSI has a single variable:
pf_e_data.is_solved. PF haspf_data.converged::Vector{Bool}, with one true/false per time step. What should be the relationship between the two?is_solved = all(converged)?is_solved = any(converged)?