
Assign a charging station to EV charging sessions
Source:R/charging_infrastructure.R
add_charging_infrastructure.RdVariable ChargingStation and Socketwill be assigned to the sessions
tibble with a name pattern being: names_prefix + "CHS" + number
Usage
add_charging_infrastructure(
sessions,
resolution = 15,
min_stations = 0,
n_sockets = 2,
names_prefix = NULL,
duration_th = 0
)Arguments
- sessions
tibble, sessions data set in standard format marked by
{evprof}package- resolution
integer, time resolution in minutes
- min_stations
integer, minimum number of charging stations to consider
- n_sockets
integer, number of sockets per charging station
- names_prefix
character, prefix of the charging station names (optional)
- duration_th
integer between 0 and 100, minimum share of time (in percentage) of the "occupancy duration curve" (see function
plot_occupancy_duration_curve). This is used to avoid sizing a charging infrastructure to host for example 100 vehicles when only 5% of time there are more than 80 vehicles connected. Then, settingduration_th = 5will ensure that we don't over-size the charging infrastructure for the 100 vehicles. It is recommended to find this value through multiple iterations.
Examples
# Assign a `ChargingStation` to every session according to the occupancy
sessions_infrastructure <- add_charging_infrastructure(
sessions = head(evsim::california_ev_sessions, 50),
resolution = 60
)
#> Warning: charging sessions have been aligned to 60-minute resolution.
#> # A tibble: 472 × 18
#> Session Timeslot Power PowerNominal EnergyRequired
#> <chr> <dttm> <dbl> <dbl> <dbl>
#> 1 S1~1 2018-10-08 06:00:00 0.6 0.6 6.31
#> 2 S1~1 2018-10-08 07:00:00 0.6 0.6 6.31
#> 3 S1~1 2018-10-08 08:00:00 0.6 0.6 6.31
#> 4 S1~1 2018-10-08 09:00:00 0.6 0.6 6.31
#> 5 S1~1 2018-10-08 10:00:00 0.6 0.6 6.31
#> 6 S1~1 2018-10-08 11:00:00 0.6 0.6 6.31
#> 7 S1~1 2018-10-08 12:00:00 0.6 0.6 6.31
#> 8 S1~1 2018-10-08 13:00:00 0.6 0.6 6.31
#> 9 S1~1 2018-10-08 14:00:00 0.6 0.6 6.31
#> 10 S1~1 2018-10-08 15:00:00 0.6 0.6 6.31
#> # ℹ 462 more rows
#> # ℹ 13 more variables: ConnectionHoursLeft <dbl>, ID <int>,
#> # ConnectionStartDateTime <dttm>, ConnectionEndDateTime <dttm>,
#> # ChargingStartDateTime <dttm>, ChargingEndDateTime <dttm>, Energy <dbl>,
#> # ConnectionHours <dbl>, ChargingHours <dbl>, ChargingStation <chr>,
#> # FlexibilityHours <dbl>, UserID <chr>, Profile <chr>
#> Discarded 0 % of sessions due to infrastructure
print(unique(sessions_infrastructure$ChargingStation))
#> [1] "CHS1" "CHS2" "CHS3" "CHS4" "CHS5" "CHS6" "CHS7" "CHS8" "CHS9"
#> [10] "CHS10" "CHS11" "CHS12" "CHS13" "CHS14"
# Now without considering the occupancy values that only represent
# a 10% of the time
sessions_infrastructure <- add_charging_infrastructure(
sessions = head(evsim::california_ev_sessions, 50),
resolution = 60, duration_th = 10
)
#> Warning: charging sessions have been aligned to 60-minute resolution.
#> # A tibble: 472 × 18
#> Session Timeslot Power PowerNominal EnergyRequired
#> <chr> <dttm> <dbl> <dbl> <dbl>
#> 1 S1~1 2018-10-08 06:00:00 0.6 0.6 6.31
#> 2 S1~1 2018-10-08 07:00:00 0.6 0.6 6.31
#> 3 S1~1 2018-10-08 08:00:00 0.6 0.6 6.31
#> 4 S1~1 2018-10-08 09:00:00 0.6 0.6 6.31
#> 5 S1~1 2018-10-08 10:00:00 0.6 0.6 6.31
#> 6 S1~1 2018-10-08 11:00:00 0.6 0.6 6.31
#> 7 S1~1 2018-10-08 12:00:00 0.6 0.6 6.31
#> 8 S1~1 2018-10-08 13:00:00 0.6 0.6 6.31
#> 9 S1~1 2018-10-08 14:00:00 0.6 0.6 6.31
#> 10 S1~1 2018-10-08 15:00:00 0.6 0.6 6.31
#> # ℹ 462 more rows
#> # ℹ 13 more variables: ConnectionHoursLeft <dbl>, ID <int>,
#> # ConnectionStartDateTime <dttm>, ConnectionEndDateTime <dttm>,
#> # ChargingStartDateTime <dttm>, ChargingEndDateTime <dttm>, Energy <dbl>,
#> # ConnectionHours <dbl>, ChargingHours <dbl>, ChargingStation <chr>,
#> # FlexibilityHours <dbl>, UserID <chr>, Profile <chr>
#> Discarded 4 % of sessions due to infrastructure
print(unique(sessions_infrastructure$ChargingStation))
#> [1] "CHS1" "CHS2" "CHS3" "CHS4" "CHS5" "CHS6" "CHS7" "CHS8" "CHS9"
#> [10] "CHS10" "CHS11" "CHS12" "CHS13"