TechLabs Aachen
6 min readNov 2, 2023

SUSTAINABILITY PROJECT

SUSTAINABILITY PROJECT

“Strategic Decision for Energy Investment”

INTRODUCTION

Project Overview

Our project revolves around the critical topic of renewable energy forecasting. Specifically, we aim to provide precise predictions for various of the following aspects of renewable energy, including consumption patterns, price fluctuations, and production levels. This initiative is geared towards aiding stakeholders in making informed decisions, optimizing resource allocation, and promoting the efficient utilization of renewable energy sources.

Problem Description

One of the pressing issues in the renewable energy sector is the inherent unpredictability (fluctuations in supply and demand) that comes with it. The intermittent nature of renewable energy generation, particularly from sources like solar and wind, is heavily influenced by ever-changing weather conditions. This unpredictability poses a significant challenge, as it leads to inefficient utilization of these valuable energy sources. Businesses, governments, and individuals face difficulties in making strategic investments and ensuring a stable and reliable energy supply due to these fluctuations.

Proposed Solution

Our project’s primary goal is to provide valuable support to companies, governmental bodies, and individuals, enabling them to make well-informed and strategic decisions regarding investments in renewable energy. This will be accomplished by providing accurate forecasts for consumption, price fluctuations, and production levels for each renewable energy source (solar and wind).

By harnessing these forecasts, stakeholders can tailor their investment strategies to align with the expected trends in renewable energy. This not only minimizes the risks associated with intermittent energy production but also allows for the optimal allocation of resources. Ultimately, our project aims to contribute to the growth and development of the renewable energy sector, fostering sustainability and environmental stewardship while meeting the world’s energy needs efficiently.

METHOD

Data Collection, Cleaning and Analysis

Our first step was the definition of the required data sets regarding years, units and catagories. We performed internet research to collect and preprocess historical data on energy consumption, price fluctuations, production levels, and weather conditions from reliable sources. Furthermore, we performed data cleaning, handled missing values, and removed outliers or inconsistencies. We created data frames for the collected data and merged the data frames by firstly vertically stacking the years in the respective categories and secondly horizontal stacking. Finally, we performed comprehensive analysis and conducted exploratory data analysis (EDA) using visualizations and statistical analysis to identify patterns trends, and correlations between different variables.

Weather Forecast Integration

We obtained reliable weather forecast data and integrated weather forecast data with historical energy data, as weather conditions significantly impact renewable energy generation. The goal was to combine historical energy data with weather forecasts to identify relationships and build models that accurately predict energy generation levels.

Model Development (Model & Algorithms)

Our objective was to utilize machine learning algorithms or time series analysis techniques (e.g., ARIMA, LSTM) for forecasting renewable energy consumption, price fluctuations, and production levels. Therefore we planned to implement models using Python libraries such as scikit-learn, TensorFlow, PyTorch.statsmodels, or Prophet. We split the dataset into training and testing sets to evaluate the performance of the models and finally fine-tuned the models by adjusting hyperparameters. Therefore, we applyed the Random Forest Regressor for the prediction of temperature, windspeed, cloud cover and solar energy. For the visualisation of the data and the performance evaluation, we visually displayed the predicted data sets using subplots. This way we displayed the forecasted data as well as the difference between the root mean squared error and extended the forecast for the years 2023 and 2026.

PROJECT RESULTS

Bellow there are some visual results:

Data Collection and Analysis

Part of the initial code:

1.png
1.png

Weather Forecast Integration

2.png
2.png
3.png
3.png

Our code conducts time series forecasting using a RandomForestRegressor model. The objective is to predict temperature (temp), windspeed, cloud cover (cloudcover), and solar energy (solarenergy) based on historical data. Here’s a concise summary of the code’s essential steps and outcomes:

Our code initiates by preparing the data, converting the ‘Dates’ column to datetime format and extracting the ‘Day_of_Year,’ ensuring suitability for time series analysis. Subsequently, it splits the dataset into training and testing sets, using ‘Day_of_Year’ as the input feature (X) and storing the target variables in ‘y.’

A RandomForestRegressor model with 100 trees is constructed and trained on the training data. This model is then employed to make predictions on the test data, with the Root Mean Squared Error (RMSE) computed as an evaluation metric.

The code also features a forecasting component, where it predicts values for each year in a range. For each year, it generates a DataFrame containing dates and corresponding ‘Day_of_Year,’ conducts predictions, and appends the predictions to a DataFrame. Additionally, the model is updated with the new data for each year.

Our code employs Matplotlib to create visualizations. It generates separate subplots for temperature, windspeed, cloud cover, and solar energy, displaying the model’s predictions and incorporating shaded regions that represent RMSE. These visualizations aid in comprehending the model’s predictive capabilities.

To conclude, our code provides an overview of the time series forecasting process, encompassing data preprocessing, model training, and forecasting for future data points. The accompanying visualizations offer insight into predicted values and RMSE for both historical and future data, facilitating an understanding of the model’s predictive performance. However, it is advisable to perform a separate evaluation of the model’s accuracy on the forecasted data for future years.

4.png
4.png

PRICE PREDICTION

This Python script analyze energy-related data. Within the dataset, there are several parameters, including windspeed, temp, and solar energy, which likely influence the energy production and pricing.

First we divided the data to two components: features and target. The features are windspeed, temperature, and solar energy. these are the characteristics considered for predicting the target variable, which is the price. after that we split the data into 2 subsets, training set and testing set. In this scenario, 80% of the data is allocated for training, while remaining 20% is reserved for testing purposes.

We used linear regression model to learn the relationships between the features and the preis. to assess the model’s accuracy we use the mean squared error by quantifying the average of the squared differences between predicted and actual prices.

To visualize the result, a scatter plot is generated. with this plot we can investigate how windspeed, temperature, and solar energy influence the energy prices.

5.png
5.png

To analyze the energy prices from another point of view, we utilized random forest regression model to analyze the importance of various energy production in predicting the energy price.

Finally, an bar chart is generated. this chart visually illustrate the feature importances, providing a clear indication of which parameters have the most significant impact on predicting the energy prices.

6.png
6.png

For a user to check daily energy prices, we generated a sliders to predict the energy price based on adjustable inputs of windspeed, temperature, and solar energy. Each slider is defined with specific ranges and step sizes.

In essence, this addition facilitates a dynamic and interactive way to explore the predicted energy prices based on different combinations of windspeed, temperature, and solar energy values, providing a practical tool for analysis and decision-making.

7.png
7.png

CONCLUSION

In the end, our model is able to predict temperature, wind speed, cloud cover, solar energy and energy prices. Unfortunately, due to time constraints, it was not possible to advance further to the final stages of machine learning in this project. The next step would be the development of a model that makes investment recommendations based on the predicted energy price, consumption and weather.

Through the experience gained from this project, we were able to develop skills in data analysis and cleaning, as well as how to work effectively in remote teams, collaborate, manage projects, and develop other valuable interpersonal skills, such as communication.

TechLabs Aachen
TechLabs Aachen

Written by TechLabs Aachen

Learn Data Science, AI, Web Development by means of our pioneering Digital Shaper program that combines online learning, projects and community — Free for You!!

No responses yet