Learn R Programming

evsim (version 1.7.1)

adapt_charging_features: Adapt charging features

Description

Calculate connection and charging times according to energy, power and time resolution

Usage

adapt_charging_features(
  sessions,
  time_resolution = 15,
  power_resolution = 0.01
)

Value

tibble

Arguments

sessions

tibble, sessions data set in standard format marked by {evprof} package. The minimum required variables are:

  • ConnectionStartDateTime (POSIXct)

  • ConnectionHours (numeric)

  • Power (numeric)

  • Energy (numeric)

time_resolution

integer, time resolution (in minutes) of the sessions' datetime variables

power_resolution

numeric, power resolution (in kW) of the sessions' power

Details

All sessions' Power must be higher than 0, to avoid NaN values from dividing by zero. The ConnectionStartDateTime is first aligned to the desired time resolution, and the ConnectionEndDateTime is calculated according to the ConnectionHours. The ChargingHours is recalculated with the values of Energy and Power, limited by ConnectionHours. Finally, the charging times are also calculated.

Examples

Run this code
suppressMessages(library(dplyr))

sessions <- head(evsim::california_ev_sessions, 10)

sessions %>%
  select(ConnectionStartDateTime, ConnectionEndDateTime, Power)

adapt_charging_features(
  sessions,
  time_resolution = 60,
  power_resolution = 0.01
) %>%
  select(ConnectionStartDateTime, ConnectionEndDateTime, Power)

adapt_charging_features(
  sessions,
  time_resolution = 15,
  power_resolution = 1
) %>%
  select(ConnectionStartDateTime, ConnectionEndDateTime, Power)


Run the code above in your browser using DataLab