pypsa.SubNetwork.pf

Contents

pypsa.SubNetwork.pf#

SubNetwork.pf(snapshots: Sequence | None = None, skip_pre: bool = False, x_tol: float = 1e-06, use_seed: bool = False, distribute_slack: bool = False, slack_weights: pd.Series | dict | str = 'p_set') tuple[pd.Series, pd.Series, pd.Series]#

Non-linear power flow for connected sub-network.

Parameters:
  • snapshots (list-like|single snapshot) – A subset or an elements of n.snapshots on which to run the power flow, defaults to n.snapshots

  • skip_pre (bool, default False) – Skip the preliminary steps of computing topology, calculating dependent values and finding bus controls.

  • x_tol (float) – Tolerance for Newton-Raphson power flow.

  • use_seed (bool, default False) – Use a seed for the initial guess for the Newton-Raphson algorithm.

  • distribute_slack (bool, default False) – If True, distribute the slack power across generators proportional to generator dispatch by default or according to the distribution scheme provided in slack_weights. If False only the slack generator takes up the slack.

  • slack_weights (pandas.Series|str, default 'p_set') – Distribution scheme describing how to determine the fraction of the total slack power a bus of the sub-network takes up. Default is to distribute proportional to generator dispatch (‘p_set’). Another option is to distribute proportional to (optimised) nominal capacity (‘p_nom’ or ‘p_nom_opt’). Custom weights can be provided via a pandas.Series/dict that has the buses or the generators of the sub-network as index/keys. When using custom weights with buses as index/keys the slack power of a bus is distributed among its generators in proportion to their nominal capacity (p_nom) if given, otherwise evenly.

Returns:

  • Tuple of three pandas.Series indicating number of iterations,

  • remaining error, and convergence status for each snapshot