An ADMM solver for convex energy management problems in plug-in hybrid electric vehicles. The ADMM algorithm is explained in detail in the paper:
A preprint is also freely available here.
The code in this repository is free to use for any purpose, but if this work is helpful towards your published research I would greatly appreciate it if you cite [1].
This respository contains the following files:
- d_inputs.mat - A Matlab data file that contains the inputs for the solver
- f_ADMM.m - The ADMM energy management solver as a Matlab function file
- f_CVX.m - An equivalent CVX solver as a Matlab function file
- f_BacktrackingNewtonVector.m - A function for performing one of the ADMM variable updates
- s_run.m - A script for running both the ADMM and CVX solvers. This script will skip the CVX optimization if it is not available.
- figure.svg - A figure of the results of the optimizations
The numerical example is the FTP75 drive cycle, where the road gradient is set to two degrees uphill for the first half of the journey, and two degrees downhill for the second half of the journey. Unfortunately, I could not make the code for the entire simulations publicly available as the engine and motor data is proprietary, so the data provided in d_inputs.mat are the processed values that are provided directly to the ADMM solver (the method for generating these values from the drive cycle is detailed extensively in section 2 in [1]). The d_inputs.mat file contains the following data (where N is the duration of the FTP75 cycle in seconds):
- coeffs - A Nx6 array where the columns correspond to the alpha and beta values as 1=alpha2, 2=alpha1, 3=alpha0, 4=beta2, 5=beta1, 6=beta0.
- Elowerlim - The lower limit on the battery's energy in joules (scalar).
- Eupperlim - The upper limit on the bettery's energy in joules (scalar).
- Estart - The battery's initial energy for the energy management optimization (scalar).
- Pbmax - A Nx1 array of upper limits on battery power
- Pbmin - A Nx1 arrray of lower limits on battery power
- Pdrv - A Nx1 array of driver's demand power
- P - An array of indexes where the engine is on and delivering power
- C - An array of indexes where the engine is on but the clutch is disengaged
- R - The open circuit resistance of the battery
- V - The open circuit voltage of the battery
The figure that is generated by running the s_run.m script is shown below, where the ADMM results exactly match the CVX results. When running the script on a 2.60GHz Intel Core i7 processor, the ADMM code took approximately 0.6s, whereas CVX took approximately 800s.