-
Notifications
You must be signed in to change notification settings - Fork 518
Description
Bug report checklis
-
Searched the issues page for similar reports
-
Read the relevant sections of the documentation
-
Browse the tutorials and tests for usefull code snippets and examples of use
-
Reproduced the issue after updating with
pip install --upgrade pandapower
(orgit pull
) -
Tried basic troubleshooting (if a bug/error) like restarting the interpreter and checking the pythonpath
Reproducible Example
from pandapower.shortcircuit import calc_sc
import pandapower as pp
# Function to create a test network
def create_test_network():
"""
Create the CIGRE HV Grid from final Report of Task Force C6.04.02: Benchmark Systems for
Network Integration of Renewable and Distributed Energy Resources, 2014.
The function is based on pandapower's function create_cigre_network_hv.
"""
# Initialize an empty pandapower network
net = pp.create_empty_network()
# Add buses to the network
bus1 = pp.create_bus(net, name='Bus 1', vn_kv=220)
bus2 = pp.create_bus(net, name='Bus 2', vn_kv=220)
bus3 = pp.create_bus(net, name='Bus 3', vn_kv=220)
bus4 = pp.create_bus(net, name='Bus 4', vn_kv=220)
bus5 = pp.create_bus(net, name='Bus 5', vn_kv=220)
bus6a = pp.create_bus(net, name='Bus 6a', vn_kv=220)
bus6b = pp.create_bus(net, name='Bus 6b', vn_kv=220)
bus7 = pp.create_bus(net, name='Bus 7', vn_kv=380)
bus8 = pp.create_bus(net, name='Bus 8', vn_kv=380)
bus9 = pp.create_bus(net, name='Bus 9', vn_kv=22)
bus10 = pp.create_bus(net, name='Bus 10', vn_kv=22)
bus11 = pp.create_bus(net, name='Bus 11', vn_kv=22)
bus12 = pp.create_bus(net, name='Bus 12', vn_kv=22)
# Define the 220 kV line type and add it to the standard types
line_data = {
'r_ohm_per_km': 0.06534,
'x_ohm_per_km': 0.39785,
'c_nf_per_km': 9.07578,
'r0_ohm_per_km': 0.21344,
'x0_ohm_per_km': 1.31648,
'c0_nf_per_km': 5.30078,
'max_i_ka': 0.65608,
'type': 'ol'
}
pp.create_std_type(net, line_data, name='220 kV line', element='line')
# Define the 380 kV line type and add it to the standard types
line_data = {
'r_ohm_per_km': 0.03278,
'x_ohm_per_km': 0.31190,
'c_nf_per_km': 11.48473,
'r0_ohm_per_km': 0.1805,
'x0_ohm_per_km': 1.1552,
'c0_nf_per_km': 8.02388,
'max_i_ka': 0.75967,
'type': 'ol'
}
pp.create_std_type(net, line_data, '380 kV line', element='line')
# Add power lines to the network
pp.create_line(net, bus1, bus2, length_km=100,
std_type='220 kV line', name='Line 1-2')
pp.create_line(net, bus1, bus6a, length_km=300,
std_type='220 kV line', name='Line 1-6a')
pp.create_line(net, bus2, bus5, length_km=300,
std_type='220 kV line', name='Line 2-5')
pp.create_line(net, bus3, bus4, length_km=100,
std_type='220 kV line', name='Line 3-4')
pp.create_line(net, bus3, bus4, length_km=100,
std_type='220 kV line', name='Line 3-4_2')
pp.create_line(net, bus4, bus5, length_km=300,
std_type='220 kV line', name='Line 4-5')
pp.create_line(net, bus4, bus6a, length_km=300,
std_type='220 kV line', name='Line 4-6a')
pp.create_line(net, bus7, bus8, length_km=600,
std_type='380 kV line', name='Line 7-8')
pp.create_line(net, bus6a, bus6b, length_km=80,
std_type='220 kV line', name='Line 6a-6b')
# Add two-winding transformers to the network
pp.create_transformer_from_parameters(net, bus7, bus1, sn_mva=1000,
vn_hv_kv=380, vn_lv_kv=220, vkr_percent=0.5,
vk_percent=13.0, pfe_kw=50, i0_percent=1,
shift_degree=0, vk0_percent=13.0, vkr0_percent=0.5,
name='Trafo 1-7', vector_group='YNyn', mag0_percent=0.5,
mag0_rx=0.05, si0_hv_partial=0.9)
pp.create_transformer_from_parameters(net, bus8, bus3, sn_mva=1000,
vn_hv_kv=380, vn_lv_kv=220, vkr_percent=0.5,
vk_percent=13.0, pfe_kw=50, i0_percent=1,
shift_degree=0, vk0_percent=13.0, vkr0_percent=0.5,
name='Trafo 3-8', vector_group='YNyn', mag0_percent=0.5,
mag0_rx=0.05, si0_hv_partial=0.9)
pp.create_transformer_from_parameters(net, bus1, bus9, sn_mva=1000,
vn_hv_kv=220, vn_lv_kv=22, vkr_percent=0.5,
vk_percent=13.0, pfe_kw=50, i0_percent=1,
shift_degree=330.0, vk0_percent=13.0, vkr0_percent=0.5,
name='Trafo 9-1', vector_group='YNd', mag0_percent=0.5,
mag0_rx=0.05, si0_hv_partial=0.9)
pp.create_transformer_from_parameters(net, bus2, bus10, sn_mva=1000,
vn_hv_kv=220, vn_lv_kv=22, vkr_percent=0.5,
vk_percent=13.0, pfe_kw=50, i0_percent=1,
shift_degree=330.0, vk0_percent=13.0, vkr0_percent=0.5,
name='Trafo 10-2', vector_group='YNd', mag0_percent=0.5,
mag0_rx=0.05, si0_hv_partial=0.9)
pp.create_transformer_from_parameters(net, bus3, bus11, sn_mva=1000,
vn_hv_kv=220, vn_lv_kv=22, vkr_percent=0.5,
vk_percent=13.0, pfe_kw=50, i0_percent=1,
shift_degree=330.0, vk0_percent=13.0, vkr0_percent=0.5,
name='Trafo 11-3', vector_group='YNd', mag0_percent=0.5,
mag0_rx=0.05, si0_hv_partial=0.9)
pp.create_transformer_from_parameters(net, bus6b, bus12, sn_mva=500,
vn_hv_kv=220, vn_lv_kv=22, vkr_percent=0.5,
vk_percent=13.0, pfe_kw=50, i0_percent=1,
shift_degree=330.0, vk0_percent=13.0, vkr0_percent=0.5,
name='Trafo 12-6b', vector_group='YNd', mag0_percent=0.5,
mag0_rx=0.05, si0_hv_partial=0.9)
# Add loads to the network
pp.create_load(net, bus2, p_mw=285, q_mvar=200, name='Load 2')
pp.create_load(net, bus3, p_mw=325, q_mvar=244, name='Load 3')
pp.create_load(net, bus4, p_mw=326, q_mvar=244, name='Load 4')
pp.create_load(net, bus5, p_mw=103, q_mvar=62, name='Load 5')
pp.create_load(net, bus6a, p_mw=435, q_mvar=296, name='Load 6a')
# Add the external grid to the network
pp.create_ext_grid(net, bus9, vm_pu=1.03, va_degree=0, name='Generator 9',
s_sc_max_mva=2397.26027, rx_max=0.057157, x0x_max=0.375,
r0x0_max=0.152418)
# Add generators to the network
pp.create_gen(net, bus10, vn_kv=22, sn_mva=700, vm_pu=1.03, p_mw=500, name='Generator 10',
xdss_pu=0.292, rdss_ohm=0.011534, cos_phi=0.9)
pp.create_gen(net, bus11, vn_kv=22, sn_mva=500, vm_pu=1.03, p_mw=200, name='Generator 11',
xdss_pu=0.233, rdss_ohm=0.01153, cos_phi=0.9)
pp.create_gen(net, bus12, vn_kv=22, sn_mva=500, vm_pu=1.03, p_mw=300, name='Generator 12',
xdss_pu=0.292, rdss_ohm=0.01153, cos_phi=0.9)
# Add shunts
pp.create_shunt(net, bus4, p_mw=0.0, q_mvar=-160, name='Shunt 4')
pp.create_shunt(net, bus5, p_mw=0.0, q_mvar=-80, name='Shunt 5')
pp.create_shunt(net, bus6a, p_mw=0.0, q_mvar=-180, name='Shunt 6a')
# Return the network
return net
# Initialize the CIGRE high-voltage transmission network
net = create_test_network()
calc_sc(net, case="max", bus=6, fault="1ph", branch_results=True)
print(net.res_line_sc)
Issue Description and Traceback
When performing a single-phase short-circuit calculation, line short-circuit currents are calculated, but the phase to ground bus voltages are NaN.
Expected Behavior
I would expect to see floating point values for bus voltage magnitudes and voltage phase angles.
Installed Versions
python : 3.12.0
pandas : 2.3.0
numpy : 2.3.1
pytz : 2025.2
dateutil : 2.9.0.post0
pip : 25.1.1
lxml.etree : 5.4.0
scipy : 1.16.0
tzdata : 2025.2
colorama==0.4.6
deepdiff==8.5.0
geojson==3.2.0
lxml==5.4.0
networkx==3.5
numpy==2.3.1
orderly-set==5.4.1
packaging==25.0
pandapower==3.1.2
pandas==2.3.0
python-dateutil==2.9.0.post0
pytz==2025.2
scipy==1.16.0
six==1.17.0
tqdm==4.67.1
typing_extensions==4.14.0
tzdata==2025.2
Label
- Relevant labels are selected