How to use the pandapower.create_std_type function in pandapower

To help you get started, we’ve selected a few pandapower examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github e2nIEE / pandapower / Verification of Y bus.py View on Github external
net.ext_grid["x0x_max"] = 1.0

pp.create_std_type(net, {"r0_ohm_per_km": 0.0848, "x0_ohm_per_km": 0.4649556, "c0_nf_per_km":  230.6,
             "max_i_ka": 0.963, "r_ohm_per_km": 0.0212, "x_ohm_per_km": 0.1162389,
             "c_nf_per_km":  230}, "example_type1")

pp.create_std_type(net, {"r0_ohm_per_km" : .3048, "x0_ohm_per_km" : 0.6031856, 
                         "c0_nf_per_km" : 140.3, "max_i_ka": 0.531, 
                          "r_ohm_per_km" : .0762, "x_ohm_per_km" : 0.1507964
                        , "c_nf_per_km" : 140}, "example_type2")
pp.create_std_type(net, {"r0_ohm_per_km" : .154, "x0_ohm_per_km" : 0.5277876
                         , "c0_nf_per_km" : 170.4, "max_i_ka": 0.741, 
                          "r_ohm_per_km" : .0385, "x_ohm_per_km" : 0.1319469
                         , "c_nf_per_km" : 170}, "example_type3")

pp.create_std_type(net, {"r0_ohm_per_km" : .1005, "x0_ohm_per_km" : 0.4900884
                         , "c0_nf_per_km":  200.5, "max_i_ka" : 0.89
                         , "r_ohm_per_km": .0251, "x_ohm_per_km" : 0.1225221
                         , "c_nf_per_km" : 210}, "example_type4")

pp.create_line(net, from_bus = busn, to_bus = busm, length_km = 1.0, std_type="example_type3")
pp.create_line(net, from_bus = busn, to_bus = busp, length_km = 1.0, std_type="example_type3")
pp.create_line(net, from_bus = busn, to_bus = busk, length_km = 1.0, std_type="example_type4")
pp.create_line(net, from_bus = busk, to_bus = busm, length_km = 1.0, std_type="example_type1")
pp.create_line(net, from_bus = busk, to_bus = busp, length_km = 1.0, std_type="example_type2")
pp.add_zero_impedance_parameters(net)

net._options = {'calculate_voltage_angles': 'auto', 'check_connectivity': True, 'init': 'auto',
    'r_switch': 0.0,'voltage_depend_loads': False, 'mode': "pf",'copy_constraints_to_ppc': False}
_, ppci1 = _pd2ppc(net)

_, ppci2 = _pd2ppc(net)
github e2nIEE / pandapower / pandapower / networks / dickert_lv_networks.py View on Github external
'long': {'cable': {'multiple': {'good': [30, 30, False, True, True],
                                                  'average': [30, 40, False, True, True],
                                                  'bad': [30, 50, False, True, True]}},
                           'C&OHL': {'multiple': {'good': [40, 20, False, True, True],
                                                  'average': [40, 30, False, True, True],
                                                  'bad': [40, 40, False, True, True]}}}}
    # process network choosing input data
    try:
        net_data = parameters[feeders_range][linetype][customer][case]
    except KeyError:
        raise ValueError("This combination of 'feeders_range', 'linetype', 'customer' and 'case' "
                         "is no dickert network.")

    # add missing line types
    if 'NFA2X 4x70' not in net.std_types['line'].keys():
        pp.create_std_type(net, {"c_nf_per_km": 12.8, "r_ohm_per_km": 0.443, "x_ohm_per_km": 0.07,
                                 "max_i_ka": 0.205, "type": "ol"}, name='NFA2X 4x70',
                           element="line")
    # determine low voltage vn_kv
    lv_vn_kv = net.bus.vn_kv.at[busbar_index]

    # feeder without branch line
    _create_feeder(net, net_data, 0, busbar_index, linetype, lv_vn_kv)
    # feeder with one branch line
    if net_data[2]:
        _create_feeder(net, net_data, 1, busbar_index, linetype, lv_vn_kv)
    # feeder with two branch lines
    if net_data[3]:
        _create_feeder(net, net_data, 2, busbar_index, linetype, lv_vn_kv)
    # feeder with three branch lines
    if net_data[4]:
        _create_feeder(net, net_data, 3, busbar_index, linetype, lv_vn_kv)
github e2nIEE / pandapower / pandapower / networks / dickert_lv_networks.py View on Github external
net = pn.create_dickert_lv_network()
    """
    # --- create network
    net = pp.create_empty_network(name='dickert_lv_network with' + feeders_range +
                                  '-range feeders, ' + linetype + 'and ' + customer +
                                  'customers in ' + case + 'case')
    # assumptions
    mv_vn_kv = 20
    lv_vn_kv = 0.4

    # create mv connection
    mv_bus = pp.create_bus(net, mv_vn_kv, name='mv bus')
    busbar_index = pp.create_bus(net, lv_vn_kv, name='busbar')
    pp.create_ext_grid(net, mv_bus)
    if trafo_type_name not in net.std_types['trafo'].keys():
        pp.create_std_type(net, trafo_type_data, name=trafo_type_name, element="trafo")
    pp.create_transformer(net, mv_bus, busbar_index, std_type=trafo_type_name)

    # create feeders
    create_dickert_lv_feeders(net=net, busbar_index=busbar_index, feeders_range=feeders_range,
                              linetype=linetype, customer=customer, case=case)

    return net
github e2nIEE / pandapower / Verification of Y bus.py View on Github external
# Y Bus formation for  Network
# =============================================================================
net = pp.create_empty_network(sn_kva = kVA_base )
busn  =  pp.create_bus(net, vn_kv = V_base, name = "busn")
busk  =  pp.create_bus(net, vn_kv = V_base, name = "busk")
busm =  pp.create_bus(net, vn_kv = V_base, name = "busm")
busp =  pp.create_bus(net, vn_kv = V_base, name = "busp")
pp.create_ext_grid(net, bus=busn, vm_pu=1.0, name="Grid Connection", s_sc_max_mva=5000/3, rx_max=0.1)
net.ext_grid["r0x0_max"] = 0.1
net.ext_grid["x0x_max"] = 1.0

pp.create_std_type(net, {"r0_ohm_per_km": 0.0848, "x0_ohm_per_km": 0.4649556, "c0_nf_per_km":  230.6,
             "max_i_ka": 0.963, "r_ohm_per_km": 0.0212, "x_ohm_per_km": 0.1162389,
             "c_nf_per_km":  230}, "example_type1")

pp.create_std_type(net, {"r0_ohm_per_km" : .3048, "x0_ohm_per_km" : 0.6031856, 
                         "c0_nf_per_km" : 140.3, "max_i_ka": 0.531, 
                          "r_ohm_per_km" : .0762, "x_ohm_per_km" : 0.1507964
                        , "c_nf_per_km" : 140}, "example_type2")
pp.create_std_type(net, {"r0_ohm_per_km" : .154, "x0_ohm_per_km" : 0.5277876
                         , "c0_nf_per_km" : 170.4, "max_i_ka": 0.741, 
                          "r_ohm_per_km" : .0385, "x_ohm_per_km" : 0.1319469
                         , "c_nf_per_km" : 170}, "example_type3")

pp.create_std_type(net, {"r0_ohm_per_km" : .1005, "x0_ohm_per_km" : 0.4900884
                         , "c0_nf_per_km":  200.5, "max_i_ka" : 0.89
                         , "r_ohm_per_km": .0251, "x_ohm_per_km" : 0.1225221
                         , "c_nf_per_km" : 210}, "example_type4")

pp.create_line(net, from_bus = busn, to_bus = busm, length_km = 1.0, std_type="example_type3")
pp.create_line(net, from_bus = busn, to_bus = busp, length_km = 1.0, std_type="example_type3")
pp.create_line(net, from_bus = busn, to_bus = busk, length_km = 1.0, std_type="example_type4")
github e2nIEE / pandapower / 4_bus_Unbalanced_values.py View on Github external
# =============================================================================
# Main Program
# =============================================================================
busn  =  pp.create_bus(net, vn_kv = V_base, name = "busn")
busk  =  pp.create_bus(net, vn_kv = V_base, name = "busk")
busm =  pp.create_bus(net, vn_kv = V_base, name = "busm")
busp =  pp.create_bus(net, vn_kv = V_base, name = "busp")
pp.create_ext_grid(net, bus=busn, vm_pu=1.0, name="Grid Connection", s_sc_max_mva=5000, rx_max=0.1)
net.ext_grid["r0x0_max"] = 0.1
net.ext_grid["x0x_max"] = 1.0

pp.create_std_type(net, {"r0_ohm_per_km": 0.0848, "x0_ohm_per_km": 0.4649556, "c0_nf_per_km":  230.6,
             "max_i_ka": 0.963, "r_ohm_per_km": 0.0212, "x_ohm_per_km": 0.1162389,
             "c_nf_per_km":  230}, "example_type1")

pp.create_std_type(net, {"r0_ohm_per_km" : .3048, "x0_ohm_per_km" : 0.6031856, 
                         "c0_nf_per_km" : 140.3, "max_i_ka": 0.531, 
                          "r_ohm_per_km" : .0762, "x_ohm_per_km" : 0.1507964
                        , "c_nf_per_km" : 140}, "example_type2")
pp.create_std_type(net, {"r0_ohm_per_km" : .154, "x0_ohm_per_km" : 0.5277876
                         , "c0_nf_per_km" : 170.4, "max_i_ka": 0.741, 
                          "r_ohm_per_km" : .0385, "x_ohm_per_km" : 0.1319469
                         , "c_nf_per_km" : 170}, "example_type3")

pp.create_std_type(net, {"r0_ohm_per_km" : .1005, "x0_ohm_per_km" : 0.4900884
                         , "c0_nf_per_km":  200.5, "max_i_ka" : 0.89
                         , "r_ohm_per_km": .0251, "x_ohm_per_km" : 0.1225221
                         , "c_nf_per_km" : 210}, "example_type4")

pp.create_line(net, from_bus = busn, to_bus = busm, length_km = 1.0, std_type="example_type3")
pp.create_line(net, from_bus = busn, to_bus = busp, length_km = 1.0, std_type="example_type3")
pp.create_line(net, from_bus = busn, to_bus = busk, length_km = 1.0, std_type="example_type4")
github e2nIEE / simbench / simbench / converter / csv_pp_converter.py View on Github external
"line": ["r_ohm_per_km", "x_ohm_per_km", "c_nf_per_km", "g_us_per_km", "max_i_ka"],
        "trafo": ["sn_mva", "vn_hv_kv", "vn_lv_kv", "vk_percent", "vkr_percent", "pfe_kw",
                  "i0_percent", "shift_degree"],
        "trafo3w": ["sn_hv_mva", "sn_mv_mva", "sn_lv_mva", "vn_hv_kv", "vn_mv_kv", "vn_lv_kv",
                    "vk_hv_percent", "vk_mv_percent", "vk_lv_percent",
                    "vkr_hv_percent", "vkr_mv_percent", "vkr_lv_percent",
                    "pfe_kw", "i0_percent", "shift_mv_degree", "shift_lv_degree"],
        "dcline": ["p_mw", "loss_percent", "loss_mw", "vm_from_pu", "vm_to_pu"]}
    for elm in type_params.keys():
        elms_without_type = net[elm][pd.isnull(net[elm].std_type)]
        uni_dupl_dict = get_unique_duplicated_dict(elms_without_type, subset=type_params[elm])
        for uni, dupl in uni_dupl_dict.items():
            new_typename = net[elm].name.loc[uni] + '_type'
            net[elm].std_type.loc[[uni]+dupl] = new_typename
            if elm in ["line", "trafo", "trafo3w"]:
                pp.create_std_type(net, dict(net[elm].loc[uni, type_params[elm]].T), new_typename,
                                   element=elm, overwrite=False)

    # --- determine line, trafo and trafo3w typenames to be converted,
    # --- considering export_pp_std_types. changes net.std_types dicts into dataframes
    dummy_net = pp.create_empty_network()
    pp_elms_with_type = ["line", "trafo", "trafo3w"]
    for elm in pp_elms_with_type:
        if export_pp_std_types:
            typenames2convert = set(net.std_types[elm].keys())
        else:
            pp_typenames = set(dummy_net.std_types[elm].keys())
            unused_pp_typenames = pp_typenames - set(net[elm].std_type.unique())
            typenames2convert = set(net.std_types[elm].keys()) - unused_pp_typenames
        net.std_types[elm] = pd.DataFrame(net.std_types[elm]).T.loc[typenames2convert].reset_index()
        net.std_types[elm].rename(columns={"index": "std_type"}, inplace=True)
github e2nIEE / pandapower / pandapower / networks / cigre_networks.py View on Github external
raise ValueError("'with_der=True' is deprecated. Please use 'with_der=pv_wind'")
    if with_der not in [False, "pv_wind", "all"]:
        raise ValueError("'with_der' is unknown. It should be in [False, 'pv_wind', 'all'].")

    net_cigre_mv = pp.create_empty_network()

    # Linedata
    line_data = {'c_nf_per_km': 151.1749, 'r_ohm_per_km': 0.501,
                 'x_ohm_per_km': 0.716, 'max_i_ka': 0.145,
                 'type': 'cs'}
    pp.create_std_type(net_cigre_mv, line_data, name='CABLE_CIGRE_MV', element='line')

    line_data = {'c_nf_per_km': 10.09679, 'r_ohm_per_km': 0.510,
                 'x_ohm_per_km': 0.366, 'max_i_ka': 0.195,
                 'type': 'ol'}
    pp.create_std_type(net_cigre_mv, line_data, name='OHL_CIGRE_MV', element='line')

    # Busses
    bus0 = pp.create_bus(net_cigre_mv, name='Bus 0', vn_kv=110, type='b', zone='CIGRE_MV')
    buses = pp.create_buses(net_cigre_mv, 14, name=['Bus %i' % i for i in range(1, 15)], vn_kv=20,
                            type='b', zone='CIGRE_MV')

    # Lines
    pp.create_line(net_cigre_mv, buses[0], buses[1], length_km=2.82,
                   std_type='CABLE_CIGRE_MV', name='Line 1-2')
    pp.create_line(net_cigre_mv, buses[1], buses[2], length_km=4.42,
                   std_type='CABLE_CIGRE_MV', name='Line 2-3')
    pp.create_line(net_cigre_mv, buses[2], buses[3], length_km=0.61,
                   std_type='CABLE_CIGRE_MV', name='Line 3-4')
    pp.create_line(net_cigre_mv, buses[3], buses[4], length_km=0.56,
                   std_type='CABLE_CIGRE_MV', name='Line 4-5')
    pp.create_line(net_cigre_mv, buses[4], buses[5], length_km=1.54,
github e2nIEE / pandapower / pandapower / networks / kerber_networks.py View on Github external
"max_i_ka": 0.313, "type": "cs", "q_mm2": 185}
    NYY4x35 = {"c_nf_per_km": 0, "r_ohm_per_km": 0.5240284, "x_ohm_per_km": 0.08513716,
               "max_i_ka": 0.156, "type": "cs", "q_mm2": 35}
    pp.create_std_type(net=pd_net, data=NFA2X4x70, name="NFA2X 4x70", element="line")
    pp.create_std_type(net=pd_net, data=NAYY4x50, name="NAYY 4x50", element="line")
    pp.create_std_type(net=pd_net, data=NAYY4x150, name="NAYY 4x150", element="line")
    pp.create_std_type(net=pd_net, data=NAYY4x185, name="NAYY 4x185", element="line")
    pp.create_std_type(net=pd_net, data=NYY4x35, name="NYY 4x35", element="line")
    T100kVA = {"sn_mva": 0.100, "vn_hv_kv": 10, "vn_lv_kv": 0.4, "vk_percent": 4,
               "vkr_percent": 1.2, "pfe_kw": 0.45, "i0_percent": 0.25, "shift_degree": 150,
               "vector_group": "Dyn5"}
    T160kVA = {"sn_mva": 0.160, "vn_hv_kv": 10, "vn_lv_kv": 0.4, "vk_percent": 4,
               "vkr_percent": 1.2, "pfe_kw": 0.38, "i0_percent": 0.26, "shift_degree": 150,
               "vector_group": "Dyn5"}
    pp.create_std_type(net=pd_net, data=T100kVA, name="0.1 MVA 10/0.4 kV", element="trafo")
    pp.create_std_type(net=pd_net, data=T160kVA, name="0.16 MVA 10/0.4 kV", element="trafo")

    busnr1 = pp.create_bus(pd_net, name="Trafostation_OS", vn_kv=V_OS)
    pp.create_ext_grid(pd_net, bus=busnr1)
    main_busbar_nr = pp.create_bus(pd_net, name="main_busbar", vn_kv=V_US, type="b")
    pp.create_transformer(pd_net, hv_bus=busnr1, lv_bus=main_busbar_nr, std_type=trafotype,
                          name="trafo 1")
    return pd_net, main_busbar_nr