attach_charging#

popo.scenarios.attach_charging(dss, customers, penetration, profiles, rng, kv, power_factor=0.99, connection=None)#

Give a fraction of customers a charger driven by one recorded session series.

Each vehicle is assigned its own column of profiles rather than a shared shape, because the quantity of interest at the substation is the diversified sum: one shape replicated across customers would understate coincidence at the peak and overstate it elsewhere.

Parameters:
  • dss (Any) – An opendssdirect module with a compiled circuit.

  • customers (Sequence[tuple[str, str]]) – (load name, bus) pairs eligible for installation.

  • penetration (float) – Fraction of customers to fit, in [0, 1].

  • profiles (ndarray) – Charging power, shape (intervals, vehicles).

  • rng (Generator) – Seeded generator.

  • kv (float) – Service voltage of the connection.

  • power_factor (float) – Charger power factor.

  • connection (str | None) – Bus phase suffix forced on every installation; None connects each on its customer’s own phase.

Return type:

int

Returns:

Number of installations made, which can fall short of the requested count when a drawn profile is empty.