Learn R Programming

evprof

Overview

evprof is part of a suite of packages to analyse, model and simulate the charging behavior of electric vehicle users:

  • evprof: Electric Vehicle PROFiling
  • evsim: Electric Vehicle SIMulation

evprof aims to provide tools for classifying EV charging sessions into generic groups with similar connection patterns named “user profiles”, using the Gaussian Mixture Models (GMM) clustering method. Moreover, functions to build stochastic models (based on GMM) for every user profile are also provided in order to simulate new EV sessions.

The Gaussian Mixture Models clustering technique used in this package aims to accomplish two different tasks that can be useful for multiple purposes:

  1. Classification of EV charging sessions into generic user profiles (e.g. working time, dinner, commuters, etc.), allowing to:
  • Increase the knowledge on the different flexibility potential patterns from a real data set
  • Define accurate tariffs according to the flexibility potential (implicit demand response scenario)
  • Reduce the uncertainty of flexibility offers when participating in flexibility markets (explicit demand response scenario)
  1. Modeling every user profile with stochastic models, allowing to:
  • Simulate high penetration of EV to estimate when an existing charging infrastructure will be saturated
  • Simulate different scenarios of charging rates to analyse the impact of fast charging
  • Size and plan a public charging infrastructure

Usage

To use this package you will need a data set of EV charging sessions with at least two fundamental variables: connection start time and connection duration. With these two variables you will be able to classify the sessions into different user profiles, but to generate the EV Gaussian Models you will also need the energy values.

The package also provides an example open data set of EV charging sessions from the California Technological Institute (Caltech), which can be downloaded from the ACN-Data website. For more information about this data set and how to use it, visit the ACN documentation. Moreover, an example evmodel object (EV Gaussian Mixture Models) built with evprof functions and the California open data set (see the California case study article) is also provided. These two demo data objects are provided together with package functions for a better interactive user experience.

If you have your own data set, the best place to start is the Get started chapter in the package website.

Installation

You can install the package from CRAN or the development version from GitHub:

# CRAN stable release
install.packages("evprof")

# Latest development version
# install.packages("devtools")
devtools::install_github("mcanigueral/evprof")

Getting help

If you encounter a clear bug, please open an issue with a minimal reproducible example on GitHub. For questions and other discussion, please send me a mail to marc.canigueral@udg.edu.

For further technical details, you can read the following academic articles about the methodology used in this paper:

  • Electric vehicle user profiles for aggregated flexibility planning. IEEE PES Innovative Smart Grid Technologies Europe (ISGT Europe). IEEE, Oct. 18, 2021. DOI link.
  • Flexibility management of electric vehicles based on user profiles: The Arnhem case study. International Journal of Electrical Power and Energy Systems, vol. 133. Elsevier BV, p. 107195, Dec. 2021. DOI link.
  • Potential benefits of scheduling electric vehicle sessions over limiting charging power. CIRED Porto Workshop 2022: E-mobility and power distribution systems. Institution of Engineering and Technology, 2022. DOI link.
  • Assessment of electric vehicle charging hub based on stochastic models of user profiles. Expert Systems with Applications (Vol. 227, p. 120318). Elsevier BV. May 2023. DOI link.

Acknowledgements

This work has been developed under a PhD program in the eXiT research group from the University of Girona (Catalonia) in collaboration with Resourcefully, an energy transition consulting company based in Amsterdam, The Netherlands.

Copy Link

Version

Install

install.packages('evprof')

Monthly Downloads

492

Version

1.1.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Marc Cañigueral

Last Published

March 14th, 2024

Functions in evprof (1.1.2)

get_connection_model_mclust_object

Perform mclust::Mclust clustering for multivariate GMM
get_ev_model

Get the EV model object of class evmodel
plot_histogram_grid

Grid of multiple variable histograms
plot_histogram

Histogram of a variable from sessions data set
get_energy_models

Get a tibble of energy GMM for every user profile
choose_k_GMM

Visualize BIC indicator to choose the number of clusters
california_ev_model

EV model example
california_GMM

Gaussian Mixture Models examples
cluster_sessions

Cluster sessions with mclust package
drop_outliers

Drop outliers
mutate_to_log

Logarithmic transformation to ConnectionStartDateTime and ConnectionHours variables
divide_by_timecycle

Divide sessions by time-cycle
get_dbscan_params

Get the minPts and eps values for DBSCAN to label only a specific percentage as noise
plot_bivarGMM

Plot Bivariate Gaussian Mixture Models
summarise_sessions

Statistic summary of sessions features
set_profiles

Classify sessions into user profiles
get_division_line

ggplot2 type function to plot a division line
plot_density_2D

Density plot in 2D, considering Start time and Connection duration as variables
plot_density_3D

Density plot in 3D, considering Start time and Connection duration as variables
plot_energy_models

Compare density of estimated energy with density of real energy vector
plot_division_lines

Iteration over evprof::plot_division_line function to plot multiple lines
plot_kNNdist

Plot kNNdist
plot_model_clusters

Plot all bi-variable GMM (clusters) with the colors corresponding to the assigned user profile. This shows which clusters correspond to which user profile, and the proportion of every user profile.
print.evmodel

print method for evmodel object class
round_to_interval

Round to nearest interval
read_ev_model

Read an EV model JSON file and convert it to object of class evmodel
detect_outliers

Detect outliers
round_to_half

Round numeric time value to half hour basis.
convert_time_dt_to_plot_dt

Modify datetime values according evprof.start.hour
convert_time_dt_to_plot_num

Convert datetime values to sorted numeric values considering a start time
cut_sessions

Cut outliers based on minimum and maximum limits of ConnectionHours and ConnectionStartDateTime variables
define_clusters

Define each cluster with a user profile interpretation
get_energy_model_parameters

Get energy univariate Gaussian Mixture Model
save_ev_model

Save the EV model object of class evmodel to a JSON file
get_energy_model_mclust_object

Get Mclust object of univariate Gaussian Mixture Models
save_clustering_iterations

Save iteration plots in PDF file
divide_by_disconnection

Divide sessions by disconnection day
get_daily_avg_n_sessions

Get the daily average number of sessions given a range of years, months and weekdays
plot_points

Scatter plot of sessions
get_daily_n_sessions

Get daily number of sessions given a range of years, months and weekdays
plot_outliers

Plot outlying sessions
sessions_feature_names

Names of standard features of a sessions dataset
sessions_summary_feature_names

Names of features to summarise in evprof functions
convert_time_num_to_chr

Convert numeric time value (hour-based) to character hour in %H:%M format
get_charging_rates_distribution

Get charging rates distribution in percentages
get_connection_models

Get a tibble of connection GMM for every user profile
convert_time_num_to_period

Convert numeric time value to a datetime period (hour-based)
california_ev_sessions_profiles

Clustered EV charging sessions example
get_connection_model_params

Extract models parameters from mclust object
california_ev_sessions

EV charging sessions example