attach_ev_storage#

popo.scenarios.attach_ev_storage(dss, customers, penetration, profiles, rng, kv, battery=None, schedule=None, controller=None, power_factor=0.99, connection=None, interval_hours=0.5)#

Give a fraction of customers an electric vehicle that can discharge to the network.

Each vehicle is a Load following its recorded charging sessions, as in popo.scenarios.attach_charging() (same customers and vehicles for the same seed), plus a Storage element on the same phase for the vehicle-to-grid exchange: a fixed V2GSchedule by default, or an OpenDSS StorageController with controller.

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

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

  • penetration (float) – Fraction of customers given a vehicle, in [0, 1].

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

  • rng (Generator) – Seeded generator.

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

  • battery (EVBattery | None) – The vehicles’ battery; defaults to EVBattery.

  • schedule (V2GSchedule | None) – Fixed exchange schedule; defaults to V2GSchedule when controller is None.

  • controller (EVPeakShave | None) – Dispatch the exchange with a StorageController instead of a schedule.

  • power_factor (float) – Power factor of the charging load.

  • connection (str | None) – Bus phase suffix forced on every vehicle; None uses each customer’s own phase (popo.scenarios.service_connection()).

  • interval_hours (float) – Length of one interval of profiles.

Return type:

int

Returns:

Number of vehicles installed.

Raises:

ValueError – If both schedule and controller are given.