# Logbook for Vattenfall project
+++
---

### Participants
* <span style = "color: blue; font-weight: 400; font-size:20px">Håkan Nilsson, Chalmers (project leader and supervisor) <br /></span>

> * Xiao Lang, Chalmers (most active)  
> * Wengang Mao, Chalmers (supervisor) 
> * Carl-Maikel Högström, Vattenfall (active collaboration partner) 
> * Berhanu Mulu, Vattenfall (active collaboration partner)
>
    
---
  
### General update: October 2021
So far, we test the Tensorflow deep learning model, which seems work well for the prediction the dynamics of normalized $head_{gross}$ as shown below


|Optimised Linear model| Multi-step dense model | CNN model wider window|
|:----:|:----:|:----:|
|![linear](./images/optimised_linear_model.png)|![linear](./images/multi_step_dense_model.png)|![linear](./images/cnn_wide_window.png)|    

**Prediction of normlized $head_{gross}$ by various deep learning models on Google Tensorflow**

    
```{admonition}  <span style = "color: blue; font-weight: 600; font-size: 25px">Remarks</span>
*  <span style = "color: blue; font-weight: 400; font-size: 20px">The $Head_{gross}$ is more autocorrelated rather than correlated with other parameters</span><br />
*  <span style = "color: blue; font-weight: 400; font-size: 20px">Worth to revisit the standard ML models treating data as indepdent</span><br />
*  <span style = "color: blue; font-weight: 400; font-size: 20px">The strong autocorrelation structure of $Head_{gross}$ may suggest a statistical ARIMA model for fast estimation</span><br />
*  <span style = "color: blue; font-weight: 400; font-size: 20px">More thorough check when more data is available</span><br />
*  <span style = "color: red; font-weight: 500; font-size: 20px">Maybe an issue for signals of transients lasting very short time (e.g., caused by cavitation, ...) </span><br />



```



### Project objectives
The long-term goal and objective with the project are to demonstrate machine learning techniques and their ability to be used in hydropower for 1) predictive maintenance and 2) optimization of transient turbine operation with respect to fatigue loads to minimize costs and consumption of technical service lifetime.

In this short pilot project, concerning that the pump operation is crucial to maintain a constant head during transient operation of the rig, various machine learning techniques will be applied for optimization of pump operation under transients in the Vattenfall hydraulic turbine rig. A lot of data has already been collected during the operation of Vattenfall hydraulic turbine and can be made available to this pilot project. Machine learning methods to analyze those data is also a direct gain in the outcomes of the project. 

The experiences gained during this pilot project can later be used to address other situations and applications in hydropower, since machine learning techniques are of general character.


### Project background
Due to the deregulation of the electricity market and the expansion of wind and solar power, the operation of hydropower plants has changed significantly over the last two decades. As a result, hydropower plants are increasingly used for control and balance of the electrical grid which causes more wear and tear and therefore reduces the lifetime of the machines. Techniques that can help the industry to better forecast the need of maintenance rather than performing periodic maintenance and further minimize fatigue loads during transient operation, is therefore requested to minimize costs and optimize availability of the machines. Machine learning is such a technique, which can be applied in many different ways and for many different purposes.

The ongoing digitalization of hydropower industry has created a large amount of data and information to allow for real-time monitoring of the working status and performance of the hydropower plants. However, because interpretation and understanding of the data poses a lot of demands to hydropower plant operators, the collected large dataset does not automatically lead to optimal control and operation of these hydropower plants. The machine learning techniques have already demonstrated their great possibilities to learn and model the working status and performance of different engineering systems both in terms of their correlated working variables (as a quasi-static system) and service time (as a dynamic/transient system). In this project, we will exploit various machine learning methods aiming to construct models to describe both the quasi-static and dynamic performance of hydropower turbines, with the intention to have a more rational maintenance prediction and optimized transient turbine operation.
Machine learning needs a lot of data for the training of the models, and it is important to learn more about the requirement of that data from a hydropower perspective. An ideal way to gain experience is to use large datasets from well-known sources. The hydropower rig at Vattenfall in Älvkarleby can deliver such data, to be used to gain such experience. At the same time, there is an urgent need to optimize the operation of the pumps in the rig for maintaining a constant head while doing investigations under transient operation. Thus, the present pilot project will develop a machine learning methodology that can be used to improve the quality of experimental studies of transient operation of water turbines, while also giving experience on how machine learning can be used in hydropower. It is expected that this experience can be used in the future also for other applications in hydropower.

### Project tasks

1. Based on received hydropower turbine operation data from Vattenfall, investigate statistical properties of the turbine operation conditions covered by the data to formulate criteria that can determine measurement noise and abnormal operation/measurement signals.
2. Implement algorithms of moving average or Kalmar filter to clean the measurement noise and delete piece of signals of abnormal turbine operation conditions.
3. Develop algorithms to automatically identify quasi-static turbine operational conditions for machine learning pattern recognition. For each quasi-static condition, collect and organize all relevant variables that may influence a turbine’s head and pump operations.
4. Based on the above chosen variables, build quasi-static models to describe the turbine performance in terms of the head angle of turbine wicket gate (head), pump pressure, waterflow speed, pressures at different tanks, etc., by using various machine learning methods. 
5.	Considering the dynamic properties of transient turbine operation, develop LSTM deep learning algorithms or ARIMA (AutoRegressive integrated Moving Average) models to describe the dynamic variation of head angle for various transient operation conditions, which contains various control and response variables.
6.	Develop an optimal controller for hydropower turbine transient operation based on the above quasi-static and dynamic turbine models to maintain wicket gate head by adjusting pump pressure during the transient turbine operations.
7.	Development of technical report and scientific publications based on the above investigation. 

Expected results: 
1.	A quasi-static machine learning model to describe the head angle of turbine wicket gate in terms of various operational parameters, such as water flow, pump pressure, shaft force, power, etc. 
2.	A transient/dynamic deep learning model and an ARIMA model to describe the dynamic variation of the head angle during various transient operations. 
3.	A demo example to illustrate the application of above models to design an optimal controller to maintain constant head angle by adjusting pump pressure during transient operations.
4.	Open-source codes to implement the above models and optimization framework
5.	High-quality scientific journal and conference publications. 