It is recommended to view this notebook in nbviewer for the best viewing experience.
This README covers project description, all assumptions used, directory structure, how to run the project, and all the references used.
Energy forecaster is a Python based ML project that predicts energy generation for at least 24 hours. The aim of this project is to provide reliable predictions to help an energy provider to take decisions accordingly - providing free energy in case of surplus generation.
According to the provided data [11], this energy company has 4 power plants in 2 cities in the UK. In Colchester, theres a solar and a wind power plants and likewise in Brighton.
This problem is counted as a time series problem, which means time is an essential element in predicting energy. This project tested a lot of models including CNNs and LSTMs with different combinations and picked the best to ensure the highest possible accuracy.
Since there were a lot of data missing, the following assumptions had to be made up to get a proof of concept running. All these assumptions applies for both cities unless otherwise is mentioned.
- Wind power plant
In regards to wind turbines,
1MWwind turbines ofrotor diameter 60 m[3] will be installed. Wind turbines need to be around 5 times the rotor diameter apart so that they don’t affect each other with turbulence [2]. Hence, the turbines will be spread upon a distance of 3 km. Each wind mill has3 blades, 35 mlong each [4]. The output power (in Watts) of the a turbine will be calculated using the following formula,P = 0.5 * Cp * ρ * π * R^2 * V^3[5]. WhereCpis thecoefficient of performance(efficiency factor, in percent),ρisair density(kg/m3),Ris theblade length(in meters) andVis thewind speed(m/s) [5]. The energy (Wh) generated by each turbine isP * 1, where 1 is the number of operating hours.
| variables | values |
|---|---|
| Cp | 30% |
| ρ | 1.293 kg/m3 [7] |
| R | 35 m |
Note that the wind speed is the predicted variable by the forecaster. The above formula computes the power of a given turbine. Since each turbine is operating for one hour with a certain wind speed by multiplying the power by 1 gives us energy generated per hour.
The 2 MW solar farm consists of 2667 (750 W) [9] solar panels, 4 square metres each. Covering a total distance of
4 * 8k = 10668 square metres = 2.6 acre. In fact, this solar farm is expected to have an annual energy output of 2873.4 MWh [8]. In terms of energy production, the following formula is used to determine the output energy of the farm,E = A * r * H * PR. WhereAtotal solar panel area (m2),rsolar panel yield or efficiency(%),HAnnual average solar radiationon tilted panelsPRPerformance ratio, coefficient for losses [10].
| variables | values |
|---|---|
| A | 10668 m2 |
| r | 24.16 % [9] |
| PR | 0.75 [10] |
Note that the solar radiation is the predicted variable by the forecaster. The above formula calculated the annual energy of the farm. Therefore, the energy generated per hour will be the
total_annual_energy/8760.
3. Household energy consumption
A typical household in England consumes
2,700 kWhof electricity per year[1]. That means225 kWh per monthand8 kWh per day.
In order to make things easy whilst presenting, I will assume that the CEO has a very small technical background and they're familiar with terms like LSTMs, Time Series, etc.
This project assumes that solar power plants and wind power plants serve different neighbourhoods depending on the size of the power plant. With that being said, solar farms serves a neighbourhood called
Solar Neighbourhoodwhich consists of 20 households in both Colchester and Brighton. The solar farm should produce more energy - as stated in [8] - than the actual numbers. Therefore, we limited the neighbourhood to 20 households so it can be realist whilst prototyping. However, wind power plants serve a neighbourhood known asWind Neighbourhoodwhich consists of200 householdsin bothColchesterandBrighton. The assumptions matched the given data which allowed us to increase the number of households and showcase more test cases.
The models were build and trained to predict
solar radiationandwind speedfor24 hoursat one go - this means the network uses the previous 24 hours to predict the next day. Therefore, in order to prototype the work I predicted only one day after the last day of my testing dataset - as this the only data available - and applied the decision making on this forecasted values to check for free slots. Dates are different from dataset to another.
False positivesare avoided by applying safety factor to the household consumptions. For instance, in Solar Neighbourhood there are 20 households each consumes0.00031 MWh/hour, which meanstotal_consumption = 20 * 0.00031 = 0.0062 MWh/hour for all houses. This value is then multiplied by a safety factor of1.5to be0.0093MWh/hour for all households. Then the surplus is calculated if there is any. This wayFalse positivesare avoided. Also,during weekendsif the consumptionincreasesthe safety factor will cover it which will avoid the company from losing money. During a free slot clients will have to be limited to a certain amount offreeMWh/slot to avoid consuming all energy and leaving the others with nothing. Having this safety factor will allow us to increase thelimit_per_householdon demand if the monitoring team realise there's more surplus left.
- Datasets
All datasets are located inside
./Datadirectory../Data/Colchesterand./Data/Brightoncontains all raw datasets. However, as required from the last submission,./Datanow contains all datasets (train, val, test) for all areas and energy types that is being used for training and prototyping the models.
- DataPreprocessing
./DataPreprocessing.ipnybfile is the only notebook for data preprocessing. There lives the code behind cleaning exploring and creating datasets for training, validating and testing the models.
- Energy Forecaster
./EnergyForecaster.ipnybfile is the only notebook for modeling and prototyping. All the models used were trained and prototypes in this notebook. Functions were used to avoid duplicating code as much as possible.
- Run jupyter notebook by running the following command in your terminal where this project is saved
jupyter notebook
- Open
DataPreprocessing.ipnyb
If you have visual studio code just open
DataPreprocessing.ipnyband select your environment to be Python3 and start running the notebook
Make sure to run this notebook first to generate the prepared datasets that will be used in the next notebook.
- Open
EnergyForecaster.ipnyb
If you have visual studio code just open
EnergyForecaster.ipnyband select your environment to be Python3 and start running the notebook
-
https://todayshomeowner.com/eco-friendly/guides/wind-turbine-blades-size/
-
https://www.cleanenergyreviews.info/blog/most-powerful-solar-panels
-
https://www.sunbasedata.com/how-to-calculate-solar-panel-output
-
https://www.visualcrossing.com/resources/documentation/weather-data/weather-data-documentation/