attach_generation#

popo.scenarios.attach_generation(dss, customers, penetration, profile, rng, kv, sizing=None, volt_var=None, connection=None, volt_watt=None)#

Give a fraction of customers a rooftop array driven by one profile.

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].

  • profile (ndarray) – Generation per kWp of array at each interval, in kW/kWp, e.g. a PV-Watts output divided by its array size. It is used as given, not rescaled to its own peak, so a profile peaking at 0.58 kW/kWp drives every array to 58 % of its rating at that peak, and the profile’s mean times 8,760 is the annual yield in kWh/kWp. Values above 1.2 are rejected, as they suggest kW rather than kW/kWp.

  • rng (Generator) – Seeded generator, so the same customers are chosen at every level.

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

  • sizing (ArraySizing | None) – Array size distribution; defaults to a domestic rooftop.

  • volt_var (VoltVarCurve | None) – Reactive characteristic to install; None leaves inverters at unity power factor, which decouples reactive power from voltage.

  • connection (str | None) – Bus phase suffix forced on every installation, e.g. ".1.0". None connects each on its customer’s own phase (service_connection()).

  • volt_watt (VoltWattCurve | None) – Active-power curtailment to install instead of volt_var; None installs none.

Return type:

int

Returns:

Number of installations made.

Raises:

ValueError – If both volt_var and volt_watt are given, since OpenDSS assigns each inverter to a single control, or if the profile peaks above 1.2 kW/kWp.