Package: datafev
datafevPython package datafev is a framework for the development, testing, and assessment of managemant algorithms for EV charging scenarios. The framework allows to develop scenario-oriented management strategies. It includes a portfolio of optimization- and rule-based algorithms to coordinate charging and routing operations in clustered charging systems. Furthermore, it provides statistical scenario generation tool to create EV fleet demand profiles.
Its target users are researchers in the field of smart grid applications and the deployment of operational flexibility for local energy systems.ContributionClone repository via SSH (git clone git@github.com:erdemgumrukcu/datafev.git) or clone repository via HTTPS (git clone https://github.com/erdemgumrukcu/datafev.git)Open an issue athttps://github.com/erdemgumrukcu/datafev/issuesCheckout the development branch:git checkout developmentUpdate your local development branch (if necessary):git pull origin developmentCreate your feature/issue branch:git checkout -b issueXY_explanationCommit your changes:git commit -m "Add feature #XY"Push to the branch:git push origin issueXY_explanationSubmit a pull request from issueXY_explanation to development branch viahttps://github.com/erdemgumrukcu/datafev/pullsWait for approval or revision of the new implementations.Installationdatafev requires at least the following Python packages:matplotlib>=3.5.1numpy>=1.21.5openpyxl>=3.0.9pandas>=1.4.2pyomo>=6.4.1as well as the installation of at least one mathematical programming solver for convex and/or non-convex problems, which is supported by thePyomooptimisation modelling library.
We recommend one of the following solvers:Gurobi (gurobipy)(default)IBM ILOG CPLEXGLPK (GNU Linear Programming Kit)If all the above-mentioned dependencies are installed, you should be able to install package datafev viaPyPI(using Python 3.X) as follows:pip install datafevor:pip install -e '<your_path_to_datafev_git_folder>/src'or:<path_to_your_python_binary> -m pip install -e '<your_path_to_datafev_git_folder>/src'Another option rather than installing via PyPI would be installing via setup.py:py <your_path_to_datafev_git_folder>/setup.py installor:pyton <your_path_to_datafev_git_folder>/setup.py installYou can check if the installation has been successful by trying to import package datafev into your Python environment.
This import should be possible without any errors.import datafevDocumentationThe documentation for the latest datafev release can be found in folder ./docs and onthisGitHub page.For further information, please also visit theFEIN Aachen association website.Example usageimportosfromdatetimeimportdatetime,timedeltaimportmatplotlib.pyplotaspltfrompyomo.environimportSolverFactoryfromdatafev.data_handling.fleetimportEVFleetfromdatafev.data_handling.clusterimportChargerClusterfromdatafev.data_handling.multi_clusterimportMultiClusterSystemfromdatafev.routines.arrivalimport*fromdatafev.routines.departureimport*fromdatafev.routines.charging_control.decentralized_fcfsimportcharging_routinedefmain():"""This tutorial aims to show the use of datafev framework in a small example scenarioin the following the steps to set up a simulation instance will be given."""################################################################################################################################################################################################################################################# SIMULATION SET-UP# Simulation inputsinput_file=pd.ExcelFile("inputs/example_01.xlsx")input_fleet=pd.read_excel(input_file,"Fleet")input_cluster1=pd.read_excel(input_file,"Cluster1")input_capacity1=pd.read_excel(input_file,"Capacity1")# Getting the path of the input excel fileabs_path_input=os.path.abspath(input_file)print("Scenario inputs are taken from the xlsx file:",abs_path_input)print()#Printing the input parameters related to the EV fleetprint("The charging demands of the EVs in the simulation scenario are given in the following:")print(input_fleet[["Battery Capacity (kWh)","Real Arrival Time","Real Arrival SOC"]])print()# Printing the input parameters of the charging infrastructureprint("The system consists of one charger cluster with the following chargers:")print(input_cluster1)print()print("Aggregate net consumption of the cluster is limited in the scenario (i.e., LB-UB indicating lower-upper bounds)")print(input_capacity1)print()print()# Simulation parameterssim_start=datetime(2022,1,8,7)sim_end=datetime(2022,1,8,9)sim_length=sim_end-sim_startsim_step=timedelta(minutes=5)sim_horizon=[sim_start+t*sim_stepfortinrange(int(sim_length/sim_step))]print("Simulation starts at:",sim_start)print("Simulation fininshes at:",sim_end)print("Length of one time step in simulation:",sim_step)print()print()################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################# INITIALIZATION OF THE SIMULATIONcluster1=ChargerCluster("cluster1",input_cluster1)system=MultiClusterSystem("multicluster")system.add_cc(cluster1)fleet=EVFleet("test_fleet",input_fleet,sim_horizon)cluster1.enter_power_limits(sim_start,sim_end,sim_step,input_capacity1)print("Simulation scenario has been initalized")print()################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################# DYNAMIC SIMULATIONprint("Simulation started...")fortsinsim_horizon:print("     Simulating time step:",ts)# The departure protocol for the EVs leaving the charger clustersdeparture_routine(ts,fleet)# The arrival protocol for the EVs incoming to the charger clustersarrival_routine(ts,sim_step,fleet,system)# Real-time charging control of the charger clusterscharging_routine(ts,sim_step,system)print("Simulation finished...")print()print()################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################# ANALYSIS OF THE SIMULATION RESULTS# Displaying connection data of clusterprint("Connection data")print(cluster1.cc_dataset[["EV ID","Arrival Time","Leave Time"]])print()# Printing the results to excel filessystem.export_results_to_excel(sim_start,sim_end,sim_step,"results/example01_clusters.xlsx")fleet.export_results_to_excel(sim_start,sim_end,sim_step,"results/example01_fleet.xlsx")# Path of the output excel fileabs_path_output_cluster=os.path.abspath("results/example01_clusters.xlsx")abs_path_output_fleet=os.path.abspath("results/example01_fleet.xlsx")print("Scenario results are saved to the following xlsx files:")print(abs_path_output_cluster)print(abs_path_output_fleet)print()#Line charts to visualize cluster loading and occupation profilesfig1=system.visualize_cluster_loading(sim_start,sim_end,sim_step)fig2=system.visualize_cluster_occupation(sim_start,sim_end,sim_step)plt.show()################################################################################################################################################################################################################################################if__name__=="__main__":main()LicenseThe datafev package is released by the Institute for Automation of Complex Power Systems (ACS), E.ON Energy Research Center (E.ON ERC), RWTH Aachen University under theMIT License.ContactErdem Gumrukcu, M.Sc.erdem.guemruekcue@eonerc.rwth-aachen.deAmir Ahmadifar, M.Sc.aahmadifar@eonerc.rwth-aachen.deAytug Yavuzer, B.Sc.aytug.yavuzer@rwth-aachen.deUniv.-Prof. Antonello Monti, Ph.D.post_acs@eonerc.rwth-aachen.deInstitute for Automation of Complex Power Systems (ACS)E.ON Energy Research Center (E.ON ERC)RWTH Aachen University, Germany