Note: I have migrated my code to GitHub
This page contains some useful snippets that are available to download – including several MATLAB scripts used in academic journal articles on energy storage. Where there is only a single script it has been uploaded as a text file (.txt) so it can be viewed in the browser – the script should work immediately by simply copying and pasting the text into a new .m file. However where there is a bundle of scripts necessary the MATLAB files (.m files and .mat) are downloadable in zipped folders.
Code used to maximise energy storage revenue from arbitrage
The first MATLAB script is an extension of the optimisation code used in the paper “Towards an objective method to compare energy storage technologies: development and validation of a model to determine the upper boundary of revenue available from electrical price arbitrage” by Barbour et al., published in Energy Environ. Sci., 2012, 5.
The script was extended and used in “Maximising revenue for non-firm distributed wind generation with energy storage in an active management scheme” by Gill et al., published in IET Renewable Power Generation, 2013, Vol. 7, Iss. 5, pp. 421–430. This paper uses the full capability of the script and should be referred to for information on its full functionality.
The second script is a script based on the optimisation method described in “Practical operation strategies for pumped hydroelectric energy storage (PHES) utilising electricity price arbitrage” by Connelly et al., published in Energy Policy Volume 39, Issue 7, July 2011. It has also been used in “Can negative electricity prices encourage inefficient electrical energy storage devices?” by Barbour et. al., published in the International Journal of Environmental Studies, 2014.
A test 24 hr price time-series (24 hours of the average half-hourly UK electricity spot market prices) can also be downloaded here.
Both the methods have the same default input parameters and will run with this price time-series. It should be noted that optimisation method 1 has the capability to account for both time-dependent (self-discharge) and time-independent (i.e. a fixed round trip efficiency) losses whereas optimisation method 2 does not. Accordingly to give both methods the same default input parameters the default time constant in method 1 is equal to infinity. Method 1 takes a iterative MonteCarlo approach whereas method 2 is essentially a neat analytical method. When running method 1 over longer timeseries the number of iterations taken to converge on the maximum revenue solution is very large. In the paper by Barbour et al. 10^9 iterations were used for a 1 year timeseries.
Code used to simulate A-CAES with packed bed heat storage
This is the code used in the article Adiabatic Compressed Air Energy Storage with packed bed thermal energy storage.
3. The MATLAB script files for the A-CAES simulation with packed bed regenerators can be downloaded here.
List of Pumped Hydroelectric Energy Storage plants
The text file contains a list of the majority of globally installed PHES plants (117 GW out of a global installed capacity around 130 GW), their rated power and their commissioning dates.