WPD-DS-Challenge

所属分类:能源行业(电力石油煤炭)
开发工具:Jupyter Notebook
文件大小:27500KB
下载次数:0
上传日期:2021-03-19 10:16:07
上 传 者sh-1993
说明:  该存储库包括UCL ESAIL用于向西部电力分散数据中心提交的工作流程...
(This repository includes the workflow used by the UCL ESAIL for submissions to the Western Power Distribition Data Science competition)

文件列表:
LICENSE (1069, 2021-03-19)
batch_scripts (0, 2021-03-19)
batch_scripts\bash (0, 2021-03-19)
batch_scripts\bash\setup_env.sh (105, 2021-03-19)
batch_scripts\bash\update_env.sh (63, 2021-03-19)
batch_scripts\clean_nbs.bat (58, 2021-03-19)
batch_scripts\docs_publish.bat (65, 2021-03-19)
batch_scripts\launch_lab.bat (60, 2021-03-19)
batch_scripts\pypi_publish.bat (123, 2021-03-19)
batch_scripts\serve_docs.bat (61, 2021-03-19)
batch_scripts\setup_env.bat (133, 2021-03-19)
batch_scripts\update_env.bat (88, 2021-03-19)
batopt (0, 2021-03-19)
batopt\__init__.py (22, 2021-03-19)
batopt\_nbdev.py (7059, 2021-03-19)
batopt\charge.py (12221, 2021-03-19)
batopt\christmas.py (281, 2021-03-19)
batopt\clean.py (13004, 2021-03-19)
batopt\constraints.py (5338, 2021-03-19)
batopt\discharge.py (14269, 2021-03-19)
batopt\pipeline.py (341, 2021-03-19)
batopt\pv.py (8050, 2021-03-19)
batopt\retrieval.py (1391, 2021-03-19)
batopt\tuning.py (6199, 2021-03-19)
batopt\utils.py (14655, 2021-03-19)
data (0, 2021-03-19)
data\intermediate (0, 2021-03-19)
data\intermediate\demand_set1.csv (514793, 2021-03-19)
data\intermediate\demand_set2.csv (729837, 2021-03-19)
data\intermediate\demand_set3.csv (1149611, 2021-03-19)
data\intermediate\demand_set4.csv (1443334, 2021-03-19)
data\intermediate\holidays.csv (3429933, 2021-03-19)
data\intermediate\holidays.json (16797, 2021-03-19)
data\intermediate\pv_set1.csv (689295, 2021-03-19)
data\intermediate\pv_set2.csv (972095, 2021-03-19)
data\intermediate\pv_set3.csv (1535236, 2021-03-19)
... ...

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/AyrtonB/WPD-DS-Challenge/main?urlpath=lab) [![PyPI version](https://badge.fury.io/py/batopt.svg)](https://badge.fury.io/py/batopt) [![DOI](https://zenodo.org/badge/333805281.svg)](https://zenodo.org/badge/latestdoi/333805281) # WPD-DS-Challenge This repository includes the workflow used by the UCL ESAIL team for submissions to the Western Power Distribition Data Science competition. An example charging profile from our latest submission can be seen below ![submission_timeseries](img/latest_submission.png)

### Installation You can install the battery optimisation library developed in this work using: ```bash pip install batopt ```

### Challenge Details ##### High-level Overview * A 6MWh/2.5MW battery is connected to a primary distribution substation and a 5MW solar farm in Devon, southwest England. * Design the control of a storage device to support the distribution network to: * Maximise the daily evening peak reduction. * Using as much solar photovoltaic energy as possible. * This will be done for each day for the week following the current challenge date. * In other words it is a constrained optimisation/control problem under uncertainty. * There will be four assessed weeks as part of this challenge. A recording of the kick-off meeting can also be found [here](https://www.youtube.com/watch?t=1&v=Tu1bLROBNbo&feature=youtu.be&ab_channel=EnergySystemsCatapult).
##### Battery Charging The aim of this compoennt is to maximise the proportion of the battery's charge that comes from solar PV. The total battery charge can be written as: where is the power drawn to the battery from solar generation on day , period , and is that drawn from the grid. Whenever the battery is charging, it will draw from solar PV as much as possible, and take the remainder from the grid. We can therefore express that for a period , the battery will draw from PV an amount: The remainder is drawn from the grid: The proportion of energy stored in the battery from solar PV on day is expressed as: An equivalent expression gives the proportion of energy stored in the battery that was drawn from the grid, . The scoring function is proportional to . We therefore want to maximise by coinciding our battery charging with the solar PV generation. Note that the minimum score that can be gained from this component is 1 (entirely charged from grid), and the maximum is 3 (entirely charged from solar PV).
##### Battery Discharging We'll start by defining the cost function for the demand forecasting component of the battery discharge optimisation. For each day ( = 1, , 7) the peak percentage reduction is calculated using: Where: * is the average power (in MW) over the half hour of day , where would mean the period from midnight to 00:30 AM on the current day, . * is the average power (in MW) over the half hour of day , to minimise the peak demand over the evening period (the half hours = 32 to 42) Our goal is to maximise the peak percentage reduction from 3.30PM to 9PM.
##### Constraints We also have a number of constraints. The first constraint is on the maximum import and export of energy, in this case: Secondly the battery cannot charge beyond its capacity, , (in MWh): The total charge in the battery at the next time step is related to how much is currently in the battery and how much charged within the battery at time , i.e. Finally, the battery must start empty at the start of each day in the test week. I.e. for .

### Literature The literature used in this work is being tracked using Zotero within the [ESAIL group](https://www.zotero.org/groups/273***75/esail/library), please add new papers and comment on existing ones. These should hopefully make it a lot easier down the line if we turn the work into a paper.

### Environment Set-Up The easiest way to set-up your `conda` environment is with the `setup_env.bat` script for Windows. Alternatively you can carry out these manual steps from the terminal: ```bash > conda env create -f environment.yml > conda activate batopt > ipython kernel install --user --name=batopt ```

### Nb-Dev Design Approach ##### What is Nb-Dev? > `nbdev` is a library that allows you to develop a python library in Jupyter Notebooks, putting all your code, tests and documentation in one place. That is: you now have a true literate programming environment, as envisioned by Donald Knuth back in 1***3!"
##### Why use Nb-Dev? It enables notebooks to be used as the origin of both the documentation and the code-base, improving code-readability and fitting more nicely within the standard data-science workflow. The library also provides a [several tools](https://nbdev.fast.ai/merge.html) to handle common problems such as merge issues with notebooks.
##### How to use Nb-Dev? Most of the complexity around `nbdev` is in the initial set-up which has already been carried out for this repository, leaving the main learning curve as the special commands used in notebooks for exporting code. The special commands all have a `#` prefix and are used at the top of a cell. * `#default_exp ` - the name of the sub-module that the notebook will be outputted to (put in the first cell) * `#exports` - to export all contents in the cell * `#hide` - to remove the cell from the documentation These just describe what to do with the cells though, we have to run another function to carry out this conversion (which is normally added at the end of each notebook): ```python from nbdev.export import notebook2script notebook2script() ```

### Potential Further Research Questions * How does the relative importance of the discharge and charge models change seasonally? * How much harder is it to optimise when the real-time grid carbon intensity is used?

近期下载者

相关文件


收藏者