BATTman stands for "BATTery model for arbitrage". To anyone objecting that the 'n' is missing, we shall remind that the project is still work in progress (and this applies to the name too) !
This web app optimizes the setpoint of a battery (either as a stand-alone storage unit, or embedded in a hybrid power plant e.g. including RES generation) according to different policies:
- maximizing arbitrage revenues for the whole plant first,
- minimizing spilled energy first (and then maximizing arbitrage revenues, if applicable),
- minimizing spilled energy, and shifting power injection to the nearest time step
Plant parameters can easily be customized and saved in a dedicated YAML file for later use via the app, e.g. to compare the impact of different settings on revenues. Plant parameters include the maximal power rating at the point of connection, as well as battery-specific features: efficiency, losses and simple (yet highly customizable) energy management strategies. Besides, various time-series may be loaded to represent variable power limits for the plant , energy prices or the net power injection from the plant to the network.
Results can be vizualized in interactive plots as well as in tabular format, and can easily be downloaded in both types.
Simply clone this repository where you plan to intall BATTman.
git clone https://github.com/rte-france/BATTman.gitIt is highly recommended to run BATTman in a virtual environment. It can be created using pip or conda. In both cases, do not forget to activate your environment (beware : the command is OS-specific)!
Example using pip on Linux/macOS:
cd BATTman
python -m venv .venv
source .venv/bin/activateInstall the required modules for BATTman:
pip install -r requirements.txtThis will install the following list of Python modules :
- unidecode
- numpy
- pandas
- matplotlib
- highspy
- linopy
- plotly
- streamlit
- pyyaml
- tabulate
BATTman is a web app using Streamlit. To run it, simply execute the following command (more sophisticated options are available in the Streamlit documentation if needed, e.g. to use a specific port).
streamlit run BATTman.pyIn most cases, this will open a new web page in your favorite browser. If not, then open the URL indicated in your console (most likely this one: http://localhost:8501), and off we go!
To use BATTman, input files will be needed in the study configuration tab. Example data are provided with the code to quickly get a favor of what BATTman looks like :
- an example YAML file for plant configuration is available here :
cfg_etude/example_site_configuration.yml
- an example file for electricity prices (with 168 entries) is available here :
cfg_etude/example_electricity_price_168.csv
- an example file for variable plant power limits (with 168 entries) is available here :
cfg_etude/example_power_limitations_168.csv
- an example file for PV generation in the plan (with 168 entries) is available here :
cfg_etude/example_PV_generation_168.csv
The BATTman code is provided “as is” and any express or implied warranties, including fitness for a particular purpose are disclaimed.
Besides, the early version of this code is released for French-speaking users only, as the user interface does not support other languages (yet).