Open VeikoAunapuu opened 4 months ago
Possible way to identify where the issue is
# Fix SV - Sum flow into Topological node != 0 SV_INJECTION_LIMIT = 0.1 power_flow = sv_data.type_tableview('SvPowerFlow') flow_sum_at_topological_node = power_flow.merge(terminals, left_on='SvPowerFlow.Terminal', right_on='ID', how='left').groupby('Terminal.TopologicalNode')[['SvPowerFlow.p', 'SvPowerFlow.q']].sum() mismatch_at_topological_node = flow_sum_at_topological_node[(abs(flow_sum_at_topological_node['SvPowerFlow.p']) > SV_INJECTION_LIMIT) | (abs(flow_sum_at_topological_node['SvPowerFlow.q']) > SV_INJECTION_LIMIT)] mismatch_at_equipment = data.query('KEY == "Type"')[['ID', 'VALUE']].drop_duplicates().merge(mismatch_at_topological_node.merge(terminals.reset_index(), on='Terminal.TopologicalNode'), left_on="ID", right_on="Terminal.ConductingEquipment")
Error has been caused by diverging power flow solution, by using relaxed loadflow setting the model converges and Kirchofs law error dissapear.
Possible way to identify where the issue is