## 3 Materials and Methods
### Modeling
#### 3.3.1 Estimation of Incoming Water  
In the first part of this study, a multi-layer perceptron ANN was used with the Levenberg-Marquardt (LM) learning algorithm to estimate the incoming water to the dam reservoir. The best results were found using an ANN with a structure of 2 hidden layers with 10 nodes in each layer. The ANN structure is shown in Figure 5.  
In this study, hourly water inflow data and daily weather forecast data were utilized as inputs. The output was the estimation of the reservoir's active volume. Data sets were created for the training and testing of artificial neural networks in MATLAB License No:40905630 ([[https://www2.mathworks.cn](https://www2.mathworks.cn)]([https://www2.mathworks.cn](https://www2.mathworks.cn))). During the creation of the data set, the water inflow to the dam reservoir was processed using the time series method and used as input. One input data set was created with a backward 4-h data. The input of the incoming water was created in a time series format, as follows: for the nth hour, the input consisted of (n-1), (n-2), (n-3), (n-4). In order for the reservoir to be operated with maximum efficiency, the ANN needs to be able to predict the reservoir's capacity.  
By predicting the active volume of the reservoir, the single variable Q can be obtained from Equation (1), and thus, the estimation of the hydroelectric power plant's production capacity is achieved. With a total of 45 months of real input data, the ANN was trained to learn the variations in water inflow. The production capacity of the hydroelectric power plant (HEPP) was determined from Equation (1). The production equivalents of the data sets used for training and testing are illustrated in Figure 4a,b. The ANN was trained using the nine-month test data to make predictions. According to the test conducted with nine months of data, the model output was found to predict the electricity production capacity with 93.4% accuracy. The alignment in the graph indicates that the ANN provided high accuracy in its prediction forecasts.  
Figure 5: Neural network structure to estimate the possible energy generation capacity for the next day.  
The Mean Squared Error (MSE) for the MLP was 0.27, which shows that the model is accurate and reliable in forecasting the hourly incoming water and the corresponding hourly power generation capacity.  
An ANN model was developed to plan the daily energy production of the HEPP Figure 6 compares the actual generation with the predicted generation capacity of the ANN MLP algorithm. In the study, the ANN estimated how much energy can be produced with the water accumulated in the dam. The amount of energy that can be produced with the existing power plant data and the amount of energy that can be produced as estimated by the ANN were plotted on the same graph in Figure 6. As a result, it was seen that the ANN prediction was in parallel with the real situation and produced very close results. However, sudden precipitation and unpredictable seasonal changes will affect the accuracy of the model.  
The consistency between the MLP model and the output  
The results from the nine-month data show that the model for estimated water and electricity production capacity had an accuracy of 93.4%. Figure 8 shows the performance of the ANN during the training and test stages.  
The first part of the study showed that the neural network model of a HEPP can provide an accurate estimate of the volume of incoming water and the energy production for the next day. MCP estimation was also performed to determine the hours when energy is most needed and energy prices are the highest for the most efficient evaluation of the estimated energy production capacity.