PYPOWER

The following functions are provided to enable a network data exchange with PYPOWER.

pandapower.converter.from_ppc(ppc, f_hz=50, validate_conversion=False)

This function converts pypower case files to pandapower net structure.

INPUT:

ppc - The pypower case file.

OPTIONAL:

f_hz - The frequency of the network.

OUTPUT:

net

EXAMPLE:

import pandapower.converter as pc

from pypower import case4gs

ppc_net = case4gs.case4gs()

pp_net = cv.from_ppc(ppc_net, f_hz=60)

pandapower.converter.validate_from_ppc(ppc_net, pp_net, max_diff_values={'p_gen_kw': 0.001, 'q_branch_kvar': 0.001, 'va_degree': 1e-05, 'q_gen_kvar': 0.001, 'p_branch_kw': 0.001, 'vm_pu': 1e-06})

This function validates the pypower case files to pandapower net structure conversion via a comparison of loadflow calculations.

INPUT:

ppc_net - The pypower case file.

pp_net - The pandapower network.

OPTIONAL:

max_diff_values - Dict of maximal allowed difference values. The keys must be
‘vm_pu’, ‘va_degree’, ‘p_branch_kw’, ‘q_branch_kvar’, ‘p_gen_kw’ and ‘q_gen_kvar’ and the values floats.

OUTPUT:

conversion_success - conversion_success is returned as False if pypower or pandapower
cannot calculate a power flow or if the maximum difference values (max_diff_values ) cannot be hold.

EXAMPLE:

import pandapower.converter as pc

from pypower import case4gs

ppc_net = case4gs.case4gs()

pp_net = cv.from_ppc(ppc_net, f_hz=60)

cv.validate_from_ppc(ppc_net, pp_net)

pandapower.converter.to_ppc(net, calculate_voltage_angles=False, trafo_model='t', r_switch=0, check_connectivity=True)
This function converts a pandapower net to a pypower case file.

INPUT:

net - The pandapower net.

OUTPUT:

ppc - The Pypower casefile for usage with pypower

EXAMPLE:

import pandapower.converter as pc

import pandapower.networks as pn

net = pn.case9()

ppc = pc.pp2ppc(net)