pypsa.pf.network_pf#
- pypsa.pf.network_pf(network, snapshots=None, skip_pre=False, x_tol=1e-06, use_seed=False, distribute_slack=False, slack_weights='p_set')#
Full non-linear power flow for generic network.
- Parameters:
snapshots (list-like|single snapshot) – A subset or an elements of network.snapshots on which to run the power flow, defaults to network.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 inslack_weights. IfFalseonly the slack generator takes up the slack.slack_weights (dict|str, default 'p_set') – Distribution scheme describing how to determine the fraction of the total slack power (of each sub network individually) a bus of the subnetwork 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 specified via a dictionary that has a key for each subnetwork index (
network.sub_networks.index) and a pandas.Series/dict with buses or generators of the corresponding subnetwork as index/keys. When specifying 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:
Dictionary with keys ‘n_iter’, ‘converged’, ‘error’ and dataframe values indicating number of iterations, convergence status, and iteration error for each snapshot (rows) and sub_network (columns)
- Return type: