pypsa.Network.add

Contents

pypsa.Network.add#

Network.add(class_name, name, **kwargs)#

Add a single component to the network.

Adds it to component DataFrame.

Any attributes which are not specified will be given the default value from Components.

This method is slow for many components; instead use madd or import_components_from_dataframe (see below).

Parameters:
  • class_name (string) – Component class name in (“Bus”, “Generator”, “Load”, “StorageUnit”, “Store”, “ShuntImpedance”, “Line”, “Transformer”, “Link”).

  • name (string) – Component name

  • kwargs – Component attributes, e.g. x=0.1, length=123

Examples

>>> network.add("Bus", "my_bus_0")
>>> network.add("Bus", "my_bus_1", v_nom=380)
>>> network.add("Line", "my_line_name", bus0="my_bus_0", bus1="my_bus_1", length=34, r=2, x=4)