e2nIEE / pandapower

Convenient Power System Modelling and Analysis based on PYPOWER and pandas
https://www.pandapower.org
Other
885 stars 485 forks source link

Problems with 3 phase asymmetric power flow #1228

Open nuriapastorcal opened 3 years ago

nuriapastorcal commented 3 years ago

Hello everyone,

I am Nuria Pastor, I’m a student at Polytechnic University of Valencia. I am doing my end of degree project with pandapower. I am writing this post to see if someone can help me with an error that is appearing to me when I try to run a 3 phase asymmestric power flow. I leave you the code right under this message and the error that pops up to see is you can help me understand what is wrong with the power flow.

Thank you so much in advanced.

Nuria.

The code:

import numpy as np import pandapower as pp import pandas as pd

from pandapower.pf.runpp_3ph import runpp_3ph

net=pp.create_empty_network()

b1=pp.create_bus(net, 0.4) #E1 b2=pp.create_bus(net, 0.4) #EmbarradoA b3=pp.create_bus(net, 0.4) #EmbarradoB b4=pp.create_bus(net, 0.4) #EmbarradoC b5=pp.create_bus(net, 20.0) #RedMT b6=pp.create_bus(net, 0.4) #Terminal b7=pp.create_bus(net, 0.4) #Terminal1 b8=pp.create_bus(net, 0.4) #Terminal10 b9=pp.create_bus(net, 0.4) #Terminal11 b10=pp.create_bus(net, 0.4) #Terminal12 b11=pp.create_bus(net, 0.4) #Terminal13 b12=pp.create_bus(net, 0.4) #Terminal14 b13=pp.create_bus(net, 0.4) #Terminal15 b14=pp.create_bus(net, 0.4) #Terminal16 b15=pp.create_bus(net, 0.4) #Terminal17 b16=pp.create_bus(net, 0.4) #Terminal18 b17=pp.create_bus(net, 0.4) #Terminal19 b18=pp.create_bus(net, 0.4) #Terminal2 b19=pp.create_bus(net, 0.4) #Terminal20 b20=pp.create_bus(net, 0.4) #Terminal21 b21=pp.create_bus(net, 0.4) #Terminal22 b22=pp.create_bus(net, 0.4) #Terminal23 b24=pp.create_bus(net, 0.4) #Terminal25 b26=pp.create_bus(net, 0.4) #Terminal27 b28=pp.create_bus(net, 0.4) #Terminal29 b29=pp.create_bus(net, 0.4) #Terminal3

pp.create_ext_grid(net, bus=b5)

pp.create_load(net, b28, p_mw=2, q_mvar=0.0, type='wye')

pp.create_asymmetric_load(net, b28, p_a_mw=0.0, p_b_mw=0.0, p_c_mw=2, q_a_mvar=0.0, q_b_mvar=0.0, q_c_mvar=0.0)

pp.create_gen(net, b4, p_mw=0.5, name='PV1') pp.create_gen(net, b4, p_mw=0.5, name='PV2') pp.create_gen(net, b5, p_mw=0.5, name='Eólica')

pp.create_asymmetric_sgen(net, b4, name='PV1', p_a_mw=0.5, p_b_mw=0, p_c_mw=0, q_a_mvar=0, q_b_mvar=0, q_c_mvar=0) pp.create_asymmetric_sgen(net, b4, name='PV2', p_a_mw=0, p_b_mw=0.5, p_c_mw=0, q_a_mvar=0, q_b_mvar=0, q_c_mvar=0) pp.create_asymmetric_sgen(net, b5, name='Eólica', p_a_mw=0, p_b_mw=0, p_c_mw=0.5, q_a_mvar=0, q_b_mvar=0, q_c_mvar=0)

pp.create_transformer_from_parameters(net, hv_bus=b5, lv_bus=b18, sn_mva=0.25, vn_hv_kv=20.0, vn_lv_kv=0.4, vkr_percent=4.2, vk_percent=4.2, pfe_kw=0, i0_percent=0.1, vk0_percent=4.2, vkr0_percent=4.2, si0_hv_partial=0.1) pp.create_transformer_from_parameters(net, hv_bus=b5, lv_bus=b6, sn_mva=0.25, vn_hv_kv=20.0, vn_lv_kv=0.4, vkr_percent=4.2, vk_percent=4.2, pfe_kw=0, i0_percent=0.1, vk0_percent=4.2, vkr0_percent=4.2, si0_hv_partial=0.1)

pp.create_line_from_parameters(net, from_bus=b1, to_bus=b17, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b1, to_bus=b29, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b2, to_bus=b6, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b2, to_bus=b21, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b2, to_bus=b22, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b2, to_bus=b24, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b3, to_bus=b17, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b3, to_bus=b21, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b3, to_bus=b22, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b3, to_bus=b24, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b3, to_bus=b26, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b3, to_bus=b28, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b4, to_bus=b7, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b4, to_bus=b21, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b4, to_bus=b22, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b4, to_bus=b24, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b7, to_bus=b8, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b7, to_bus=b10, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b7, to_bus=b12, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b8, to_bus=b9, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b8, to_bus=b17, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b8, to_bus=b29, length_km=1, r_ohm_per_km=5.03277E+1, x_ohm_per_km=1.16828E+1, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=5.03277E+1,x0_ohm_per_km=1.16828E+1,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b9, to_bus=b10, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b9, to_bus=b10, length_km=1, r_ohm_per_km=1.00655E+2, x_ohm_per_km=2.33656E+01, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.00655E+2,x0_ohm_per_km=2.33656E+01,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b10, to_bus=b11, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b10, to_bus=b17, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b11, to_bus=b12, length_km=1, r_ohm_per_km=5.03277E+1, x_ohm_per_km=1.16828E+1, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=5.03277E+1,x0_ohm_per_km=1.16828E+1,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b12, to_bus=b13, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b12, to_bus=b17, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b13, to_bus=b15, length_km=1, r_ohm_per_km=5.03277E+1, x_ohm_per_km=1.16828E+1, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=5.03277E+1,x0_ohm_per_km=1.16828E+1,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b13, to_bus=b15, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b13, to_bus=b17, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b14, to_bus=b19, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b14, to_bus=b20, length_km=1, r_ohm_per_km=5.03277E+1, x_ohm_per_km=1.16828E+1, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=5.03277E+1,x0_ohm_per_km=1.16828E+1,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b15, to_bus=b16, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b15, to_bus=b17, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b16, to_bus=b19, length_km=1, r_ohm_per_km=1.00655E+2, x_ohm_per_km=2.33656E+01, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.00655E+2,x0_ohm_per_km=2.33656E+01,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b17, to_bus=b19, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0) pp.create_line_from_parameters(net, from_bus=b17, to_bus=b20, length_km=1, r_ohm_per_km=1.0E-6, x_ohm_per_km=1.0E-4, c_nf_per_km=0, max_i_ka=100.0, r0_ohm_per_km=1.0E-6,x0_ohm_per_km=1.0E-4,c0_nf_per_km=0)

net.ext_grid['s_sc_max_mva'] = 1000 net.ext_grid['rx_max'] = 0.1 net.ext_grid['x0x_max']=0.1 net.ext_grid['r0x0_max']=0.1

pp.add_zero_impedance_parameters(net)

runpp_3ph(net)

The error:

C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pypower\makeYbus.py:80: RuntimeWarning: divide by zero encountered in true_divide Ysf = stat / (branch[:, BR_R] + 1j branch[:, BR_X]) ## series admittance C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pypower\makeYbus.py:80: RuntimeWarning: invalid value encountered in true_divide Ysf = stat / (branch[:, BR_R] + 1j branch[:, BR_X]) ## series admittance C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pypower\makeYbus.py:93: RuntimeWarning: invalid value encountered in true_divide Yff = (Ysf + 1j Bc / 2) / (tap conj(tap)) C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pypower\makeYbus.py:94: RuntimeWarning: invalid value encountered in true_divide Yft = - Ysf / conj(tap) C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pypower\makeYbus.py:95: RuntimeWarning: invalid value encountered in true_divide Ytf = - Yst / tap C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\linalg\dsolve\linsolve.py:206: MatrixRankWarning: Matrix is exactly singular warn("Matrix is exactly singular", MatrixRankWarning) C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pf\runpp_3ph.py:499: RuntimeWarning: invalid value encountered in true_divide i_abc_it_wye = (np.divide(s_abc_pu, v_abc_it)).conjugate() C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pf\runpp_3ph.py:500: RuntimeWarning: invalid value encountered in true_divide i_abc_it_delta = np.matmul(i_del_xfmn, (np.divide(s_abc_delta_pu, np.matmul C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pf\create_jacobian.py:18: RuntimeWarning: invalid value encountered in true_divide dVm_x, dVa_x = dSbus_dV_numba_sparse(Ybus.data, Ybus.indptr, Ybus.indices, V, V / abs(V), Ibus) C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pypower\makeYbus.py:80: RuntimeWarning: divide by zero encountered in true_divide Ysf = stat / (branch[:, BR_R] + 1j branch[:, BR_X]) ## series admittance C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pypower\makeYbus.py:80: RuntimeWarning: invalid value encountered in true_divide Ysf = stat / (branch[:, BR_R] + 1j branch[:, BR_X]) ## series admittance C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pypower\makeYbus.py:93: RuntimeWarning: invalid value encountered in true_divide Yff = (Ysf + 1j Bc / 2) / (tap conj(tap)) C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pypower\makeYbus.py:94: RuntimeWarning: invalid value encountered in true_divide Yft = - Ysf / conj(tap) C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pypower\makeYbus.py:95: RuntimeWarning: invalid value encountered in true_divide Ytf = - Yst / tap C:\ProgramData\Anaconda3\lib\site-packages\pandapower\results_bus.py:54: RuntimeWarning: invalid value encountered in true_divide net["res_bus_3ph"]["unbalance_percent"] = np.abs(V012_pu[2, :]/V012_pu[1, :])*100 C:\ProgramData\Anaconda3\lib\site-packages\pandapower\auxiliary.py:837: RuntimeWarning: invalid value encountered in true_divide return np.conjugate(np.divide(S, V, out=np.zeros_like(S), where=V != 0)) # Return zero if div by zero C:\ProgramData\Anaconda3\lib\site-packages\pandapower\results_gen.py:190: ComplexWarning: Casting complex values to real discards the imaginary part V012[:, gen_is_idx] = np.array([ppc["bus"][gen_bus_idx_ppc, VM] C:\ProgramData\Anaconda3\lib\site-packages\pandapower\results_gen.py:195: ComplexWarning: Casting complex values to real discards the imaginary part S012[:, gen_is_idx] = np.array(

KeyError Traceback (most recent call last)

in ----> 1 runpp_3ph(net) C:\ProgramData\Anaconda3\lib\site-packages\pandapower\pf\runpp_3ph.py in runpp_3ph(net, calculate_voltage_angles, init, max_iteration, tolerance_mva, trafo_model, trafo_loading, enforce_q_lims, numba, recycle, check_connectivity, switch_rx_ratio, delta_q, v_debug, **kwargs) 596 ppc2 = _copy_results_ppci_to_ppc(ppci2, ppc2, mode=mode) 597 --> 598 _extract_results_3ph(net, ppc0, ppc1, ppc2) 599 600 # Raise error if PF was not successful. If DC -> success is always 1 C:\ProgramData\Anaconda3\lib\site-packages\pandapower\results.py in _extract_results_3ph(net, ppc0, ppc1, ppc2) 41 # _get_shunt_results(net, ppc, bus_lookup_aranged, bus_pq) 42 _get_branch_results_3ph(net, ppc0, ppc1, ppc2, bus_lookup_aranged, bus_pq) ---> 43 _get_gen_results_3ph(net, ppc0, ppc1, ppc2, bus_lookup_aranged, bus_pq) 44 _get_bus_results_3ph(net, bus_pq) 45 C:\ProgramData\Anaconda3\lib\site-packages\pandapower\results_gen.py in _get_gen_results_3ph(net, ppc0, ppc1, ppc2, bus_lookup_aranged, pq_bus) 57 # get results for gens 58 if gen_end > eg_end: ---> 59 b, pA, qA, pB, qB, pC, qC = _get_pp_gen_results_3ph(net, ppc0, ppc1, ppc2, b, pA, qA, pB, qB, pC, qC) 60 61 if not ac: C:\ProgramData\Anaconda3\lib\site-packages\pandapower\results_gen.py in _get_pp_gen_results_3ph(net, ppc0, ppc1, ppc2, b, pA, qA, pB, qB, pC, qC) 292 293 def _get_pp_gen_results_3ph(net, ppc0, ppc1, ppc2, b, pA, qA, pB, qB, pC, qC): --> 294 pA_gen, qA_gen, pB_gen, qB_gen, pC_gen, qC_gen = _get_p_q_gen_results_3ph(net, ppc0, ppc1, ppc2) 295 _get_v_gen_results_3ph(net, ppc0, ppc1, ppc2) 296 C:\ProgramData\Anaconda3\lib\site-packages\pandapower\results_gen.py in _get_p_q_gen_results_3ph(net, ppc0, ppc1, ppc2) 204 qA, qB, qC = map(lambda x: x.flatten(), np.imag(Sabc)) 205 --> 206 net["res_gen_3ph"]["p_a_mw"] = pA 207 net["res_gen_3ph"]["p_b_mw"] = pB 208 net["res_gen_3ph"]["p_c_mw"] = pC KeyError: 'res_gen_3ph'
rbolgaryn commented 3 years ago

Hi @nuriapastorcal ,

Can you narrow the error down with a more minimalistic example?

Roman

SteffenMeinecke commented 3 years ago

Close this issue due to inactivity.

pljavals commented 1 year ago

I had the same problem when I tried to run a 3 phase power flow, if someone could help me, this is my code: (when I don't put the Controlled Voltage Generator, it's works).

import pandapower as pp

net = pp.create_empty_network()

bus1 = pp.create_bus(net, name="Birch", vn_kv=138) bus2 = pp.create_bus(net, name="Maple", vn_kv=138)

pp.create_ext_grid(net, bus1, vm_pu=1.00, va_degree=0, s_sc_max_mva=1000, rx_max=0.1, x0x_max=1.0, r0x0_max=0.1)

line1 = pp.create_line_from_parameters(net, bus1, bus2, length_km=1, r_ohm_per_km=1.777, x_ohm_per_km=8.887, c_nf_per_km=0, g_us_per_km=0.002, g0_us_per_km=0.002, r0_ohm_per_km=1.777, x0_ohm_per_km=8.887, c0_nf_per_km=0, max_i_ka=None, name="Line 1")

load1 = pp.create_load(net, bus1, p_mw=50, q_mvar=30.99, name="load 1") load2 = pp.create_load(net, bus2, p_mw=80, q_mvar=49.58, name="load 2")

pp.create_gen(net, bus2, p_mw=318, vm_pu=1.02, name="generator")

pp.runpp_3ph(net)