powergrid_synth.distribution.distribution_synthesis

Schweitzer et al. (2017) distribution feeder synthesis algorithm.

Implements the five-step pipeline:

  1. Node generation — Negative Binomial hop distances, power factor CDF.

  2. Feeder connection — bimodal Gamma degrees, bottom-up predecessor matching.

  3. Node properties — intermediate / injection / load assignment.

  4. Cable type — Exponential current-ratio sampling with cable library.

  5. Cable length — modified Cauchy distribution with hop-dependent clipping.

Returns an annotated networkx.Graph.

Module Contents

class powergrid_synth.distribution.distribution_synthesis.SchweetzerFeederGenerator(params=None, seed=None)[source]

Generate a single MV radial distribution feeder.

Parameters:
  • params (DistributionSynthParams, optional) – All distribution parameters. Defaults to Table III values.

  • seed (int or None, optional) – Random seed for reproducibility.

_assign_cable_lengths(G)[source]

Assign lengths from modified Cauchy and compute impedance.

Parameters:

G (networkx.Graph)

Return type:

None

_assign_cable_types(G, v_nom_kv)[source]

Assign cable types from the library using I_est / I_nom ratio.

Parameters:
  • G (networkx.Graph)

  • v_nom_kv (float)

Return type:

None

_assign_injection(G, total_gen_mw)[source]

Assign power injection to a fraction of nodes.

Parameters:
  • G (networkx.Graph)

  • total_gen_mw (float)

Return type:

None

_assign_intermediate(G)[source]

Mark a fraction of nodes as intermediate (zero load).

Parameters:

G (networkx.Graph)

Return type:

None

_assign_load(G, total_load_mw)[source]

Assign positive load to all remaining (non-intermediate, non-inj) nodes.

Parameters:
  • G (networkx.Graph)

  • total_load_mw (float)

Return type:

None

_assign_node_properties(G, total_load_mw, total_gen_mw)[source]

Assign intermediate / injection / load node types and powers.

Parameters:
  • G (networkx.Graph)

  • total_load_mw (float)

  • total_gen_mw (float)

Return type:

None

_compute_downstream_power(G)[source]

Compute total downstream apparent power for each node.

Returns dict mapping node → downstream S (MVA).

Parameters:

G (networkx.Graph)

Return type:

Dict[int, float]

_connect_nodes(G)[source]

Connect nodes into a radial tree using bimodal-Gamma degrees.

Parameters:

G (networkx.Graph)

Return type:

None

_fill_hop_gaps(G)[source]

Compress hop distances so every level from 0 to max has ≥1 node.

Gaps are removed by decrementing hop values above each gap, ensuring a contiguous sequence of hop levels.

Parameters:

G (networkx.Graph)

Return type:

None

_generate_nodes(G, n_nodes)[source]

Create n_nodes nodes with hop-distance and power-factor attrs.

Parameters:
  • G (networkx.Graph)

  • n_nodes (int)

Return type:

None

_pick_cable_by_capacity(i_nom_target, h, library, threshold)[source]

Pick cable from library closest to target I_nom, respecting threshold.

Parameters:
Return type:

powergrid_synth.distribution.distribution_params.CableLibraryEntry

generate_feeder(n_nodes, total_load_mw, total_gen_mw=0.0, v_nom_kv=10.0, assign_cable_types=True, assign_cable_lengths=True)[source]

Generate a complete MV distribution feeder.

Parameters:
  • n_nodes (int) – Total number of nodes in the feeder (including source and root).

  • total_load_mw (float) – Total real-power load (MW) to be distributed across load buses.

  • total_gen_mw (float, optional) – Total real-power generation/injection (MW). Default 0.

  • v_nom_kv (float, optional) – Nominal MV voltage in kV. Default 10.

  • assign_cable_types (bool, optional) – Whether to run Step 4 (cable type assignment). Default True.

  • assign_cable_lengths (bool, optional) – Whether to run Step 5 (cable length and impedance assignment). Default True.

Returns:

Annotated graph with node attributes (h, P_mw, Q_mvar, pf, node_type) and, when enabled, edge attributes (cable_type, length_km, r_ohm, x_ohm, max_i_ka, I_est_ka).

Return type:

nx.Graph