How to use the pandapower.create_transformer 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 PyPSA / PyPSA / test / test_pf_against_pandapower.py View on Github external
#can be used once the import of e.g. switches is perfected

    #create empty net
    net = pp.create_empty_network()

    #create buses
    b1 = pp.create_bus(net, vn_kv=20., name="Bus 1")
    b2 = pp.create_bus(net, vn_kv=0.4, name="Bus 2")
    b3 = pp.create_bus(net, vn_kv=0.4, name="Bus 3")

    #create bus elements
    pp.create_ext_grid(net, bus=b1, vm_pu=1.02, name="Grid Connection")
    pp.create_load(net, bus=b3, p_mw=0.1, q_mvar=0.05, name="Load")

    #create branch elements
    tid = pp.create_transformer(net, hv_bus=b1, lv_bus=b2, std_type="0.4 MVA 20/0.4 kV",
                                                            name="Trafo")
    pp.create_line(net, from_bus=b2, to_bus=b3, length_km=0.1, name="Line",
                                  std_type="NAYY 4x50 SE")

    #because of phase angles, need to init with DC
    pp.runpp(net,calculate_voltage_angles=True, init="dc")

    n = pypsa.Network()

    n.import_from_pandapower_net(net)

    #seed PF with LPF solution because of phase angle jumps
    n.lpf()
    n.pf(use_seed=True)

    #use same index for everything
github Tooblippe / pandapower_gui / _dev_branch / builder_collections.py View on Github external
pp.create_transformer(self.net, self.last_bus, idx, std_type="0.25 MVA 10/0.4 kV")
                self.last_bus = None
                self.update_trafo_collections()
                self.draw_collections()


if __name__ == '__main__':
    net = pp.create_empty_network()
    b1 = pp.create_bus(net, 10, geodata=(5,10))
    b2 = pp.create_bus(net, 0.4, geodata=(5,15))
    b3 = pp.create_bus(net, 0.4, geodata=(0,22))
    b4 = pp.create_bus(net, 0.4, geodata=(8, 20))

    pp.create_line(net, b2, b3, 2.0, std_type="NAYY 4x50 SE")
    pp.create_line(net, b2, b4, 2.0, std_type="NAYY 4x50 SE")
    pp.create_transformer(net, b1, b2, std_type="0.63 MVA 10/0.4 kV")

    app = QApplication(sys.argv)
    ex = NetworkBuilder(net)
    #self = ex
#    self.redraw_collections()
    ex.show()
    sys.exit(app.exec_())
#    main(net)
github e2nIEE / pandapower / pandapower / networks / kerber_networks.py View on Github external
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
github Tooblippe / pandapower_gui / pandapower_gui.py View on Github external
if self.create_line.isChecked():
            if self.lastBusSelected is None:
                self.lastBusSelected = index
            elif self.lastBusSelected != index:
                #pp.create_line(self.net, self.lastBusSelected, index, length_km=1.0, std_type="NAYY 4x50 SE")
                self.build_message.setText(str(self.lastBusSelected)+"-"+str(index))
                self.line_window = LineWindow(self.net,
                                              self.updateLineCollection,
                                              from_bus=self.lastBusSelected,
                                              to_bus=index)
                self.lastBusSelected = None
        elif self.create_trafo.isChecked():
            if self.lastBusSelected is None:
                self.lastBusSelected = index
            elif self.lastBusSelected != index:
                pp.create_transformer(self.net, self.lastBusSelected, index, std_type="0.25 MVA 10/0.4 kV")
                self.lastBusSelected = None
                self.updateTrafoCollections()
                self.drawCollections()
        elif self.create_load.isChecked():
            try:
                self.load_window = LoadWindow(self.net,
                                              self.updateLoadCollections,
                                              bus=index)
            except Exception as e:
                print(e)
            self.lastBusSelected = None
github e2nIEE / pandapower / pandapower / networks / create_examples.py View on Github external
net = pp.create_empty_network()

    # create buses
    bus1 = pp.create_bus(net, name="HV Busbar", vn_kv=110., type="b")
    bus2 = pp.create_bus(net, name="HV Busbar 2", vn_kv=110., type="b")
    bus3 = pp.create_bus(net, name="HV Transformer Bus", vn_kv=110., type="n")
    bus4 = pp.create_bus(net, name="MV Transformer Bus", vn_kv=20., type="n")
    bus5 = pp.create_bus(net, name="MV Main Bus", vn_kv=20., type="b")
    bus6 = pp.create_bus(net, name="MV Bus 1", vn_kv=20., type="b")
    bus7 = pp.create_bus(net, name="MV Bus 2", vn_kv=20., type="b")

    # create external grid
    pp.create_ext_grid(net, bus1, vm_pu=1.02, va_degree=50)

    # create transformer
    pp.create_transformer(net, bus3, bus4, name="110kV/20kV transformer",
                                   std_type="25 MVA 110/20 kV")
    # create lines
    pp.create_line(net, bus1, bus2, length_km=10,
                           std_type="N2XS(FL)2Y 1x300 RM/35 64/110 kV", name="Line 1")
    line2 = pp.create_line(net, bus5, bus6, length_km=2.0,
                           std_type="NA2XS2Y 1x240 RM/25 12/20 kV", name="Line 2")
    line3 = pp.create_line(net, bus6, bus7, length_km=3.5,
                           std_type="48-AL1/8-ST1A 20.0", name="Line 3")
    line4 = pp.create_line(net, bus7, bus5, length_km=2.5,
                           std_type="NA2XS2Y 1x240 RM/25 12/20 kV", name="Line 4")

    # create bus-bus switches
    pp.create_switch(net, bus2, bus3, et="b", type="CB")
    pp.create_switch(net, bus4, bus5, et="b", type="CB")

    # create bus-line switches
github e2nIEE / pandapower / pandapower / networks / dickert_lv_networks.py View on Github external
"""
    # --- 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