Professional Documents
Culture Documents
Vladimir LAZAROV
Department of Electrical machines,
Faculty of Electrical engineering,
Technical University of Sofia,
Sofia, Bulgaria
e-mail: vl_lazarov@tu-sofia.bg
2
IV. TRAINING A NEURAL NETWORK Calculates ∆ ;
The most important steps to create accurate forecasting
model are presented on Figure 5. =∑ ( +∆ ) ( +∆ ) (3)
An important aspect of development of artificial neural
If ≤ then µ=µxβ, otherwise go to the next
network is the correct selection of the input data. The forecast
step
accuracy depends on the type and number of the input data,
number of the hidden layers and respective neurons, activation If < go to step 3 otherwise µ=µ/β; =
function, learning algorithm. + ∆ go to step 6
Once the input data were selected the second important If ≤ fixed error or number iteration is
step is the data pre-processing. Different values may be used achieved then
as an input data such as: day, hour, the declination δ, zenith
angle , horizontal global irradiation I, horizontal diffuse After the ANN training a post-processing of data is
irradiation Id horizontal extra-terrestrial irradiation Io , solar necessary.
irradiance on a tilt plane. The data may contain several To judge the accuracy of the model were used the
missing data or either incorrect records. The cleaning of the following formulas [10], where yi and xi are the estimated and
missing records and zero values will lead to positive effect of the measured value, ̅ the respective average value and N is
the ANN performance. After that, the historical data are the data number:
divided into testing and training set. At least the historical data
are normalized between 0 and 1. This process adjust the The absolute value of mean absolute error (MAE) and its
measured data with different scales and convert them in relative value RMAE are calculated by:
common size, using the following equation:
=∑ | − |/N (4)
= (1)
=∑ | − | . ̅ (5)
Where, xmax and xmin are the maximum and minimum The mean bias error (MBE) and its relative value RMBE
values of the series, x is assumed as real value, x normalized is the are expressed by:
normalized value.
The next step is to adjust the neural network with different =∑ ( − )/ (6)
layers and number of neurons.
The choice of training algorithm is essential for ANN =∑ ( − )/ . ̅ (7)
training. The most widely used optimization algorithm is
Levenberg-Marquardt algorithm (LM). It is an approximation The root means square error RMSR and its relative value
of Newton algorithm. Levenberg-Marquardt algorithm RRMSE are given by:
perform the steps as follows [9]:
= ( − ) / (8)
Randomly select the initial value of the weight
vectors w
( )
Calculates Ep for each pattern p: = / (9)
3
As mentioned, Multilayer perceptron (MLP) networks is because of the climate variations. This is the reason to show
used to develop the model for solar irradiance forecasting for the results from the testing period from January to April. The
day ahead. The model consists of one input layer, one hidden errors for this test are shown in Table 3. The RRMES for this
layer and one output layer. The input layer receives as period varies from 4% to 25%. The best error is obtained again
parameters the measured daily solar irradiance of six previous for the model with 20 hidden neurons. The real measured data
days, while the output layer gives as output the 24 h evolution for one arbitrary day from the testing period is compared with
of solar irradiance at the next day. The number of the neurons the simulated values on Figure 9. In clear sky day, with
in the hidden layer varies from 5 to 35 and is optimized during absence of clouds the model perturbance in the morning is
the learning steps of the neural network. The neural network evident. However, the accuracy of the prediction is satisfying.
structure is present in Figure 6.
Another illustration of the obtained model performance is
The available measured data are divided in two periods. realized on Figure 10. This figure shows comparison between
The data from the first three years are used for ANN training,
while the data from last two years are used to test the
performance of the model. On the other hand, when such TABLE II. ERRORS FOR THE TRAINING PERIOD FROM
MAY TO AUGUST
number of the data is used, the input is too large. This is the
reason to divide the year on 3 periods from 4 months each. All number of
data is pre-processed and the incorrect and zero values are MAE RMAE MBE RMBE RMSE RRMSE
neurons
cleaned to achieve better results.
Wh/m2 [%] Wh/m2 [%] Wh/m2 [%]
The software Matlab is used for forecasting of hourly solar N_5 197,27 45% -0,93 -20,98% 0,97 29,22%
irradiance. The weights of the neurons are adjusted by N_10 190,45 43% 0,82 18,46% 1,30 25,52%
Levenberg-Marquardt algorithm, so that the neural network N_15 191,97 43% 0,80 18,23% 1,37 25,10%
produces the required output for the given input data. N_20 182,94 41% 0,18 4,03% 2,02 5,62%
N_25 186,67 42% 0,83 18,76% 2,05 25,75%
From the results it is evident that the number of hidden 182,45 41% -1,10 -24,97% 1,89 35,01%
N_30
neurons is essential for neural networks performance. First,
N_35 177,67 40% -2,21 -50,14% 0,73 70,15%
are presented the results during the training period. Two
periods are presented – from May to August and from
TABLE III. ERRORS FROM THE TEST FOR THE PERIOD
September to December. All errors for the first four months FROM JANUARY TO APRIL
period are presented in Table 2. The most important error to
judge the trained model accuracy is the relative root means number MAE RMAE MBE RMBE RMSE RRMSE
of
square (RRMSE). The calculated error for the considered neurons
training period is between 6% and 70%. Similar errors are Wh/m2 [%] Wh/m2 [%] Wh/m2 [%]
obtained for the other periods. The best results are obtained N_5 187,79 46% -0,82 -20,02% 0,82 16,25%
for ANN with 20 hidden neurons. The results from neural N_10 188,49 46% 1,00 24,50% 1,00 19,89%
network architecture with 20 hidden neurons are highlighted N_15 175,33 43% -1,14 -27,98% 1,14 22,71%
in Table 2. To illustrate the results during the training period N_20 183,59 45% -0,22 -5,40% 0,22 4,38%
Figure 7 and 8 show comparison between the real measured N_25 174,58 43% -1,19 -29,01% 1,19 23,55%
N_30 164,96 40% -1,28 -31,31% 1,28 25,42%
data and the obtained trained simulation result for two
N_35 166,04 41% 1,22 29,93% 1,22 24,30%
arbitrary days. We observe that the simulation is with
satisfying accuracy.
To affirm the model accuracy, it was decided to test the 1200
mesured
performance of the ANN architecture with 20 hidden neurons 1000
simulation
with different input data. According to the authors’ experience 800
in Bulgaria the spring season is most difficult to predict
600
400
200
0
7:30:00
7:50:00
8:10:00
8:30:00
8:50:00
9:10:00
9:30:00
9:50:00
10:10:00
10:30:00
10:50:00
11:10:00
11:30:00
11:50:00
12:10:00
12:30:00
12:50:00
13:10:00
13:30:00
13:50:00
14:10:00
14:30:00
14:50:00
15:10:00
15:30:00
15:50:00
16:10:00
16:30:00
16:50:00
17:10:00
17:30:02
17:50:00
18:10:00
18:30:00
18:50:00
19:10:00
1200
mesured simulation
1000
800
600
400
200
0
07 :4 0 :0 0
08 :0 0 :0 0
08 :2 0 :0 0
08 :4 0 :0 0
09 :0 0 :0 0
09 :2 0 :0 0
09 :4 0 :0 0
10 :0 0 :0 0
10 :2 0 :0 0
10 :4 0 :0 0
11 :0 0 :0 0
11 :2 0 :0 0
11 :4 0 :0 0
12 :0 0 :0 0
12 :2 0 :0 0
12 :4 0 :0 0
13 :0 0 :0 0
13 :2 0 :0 0
13 :4 0 :0 0
14 :0 0 :0 0
14 :2 0 :0 0
14 :4 0 :0 0
15 :0 0 :0 0
15 :2 0 :0 0
15 :4 0 :0 0
16 :0 0 :0 0
16 :2 0 :0 0
16 :4 0 :0 0
17 :0 0 :0 0
17 :2 0 :0 0
17 :4 0 :0 0
18 :0 0 :0 0
18 :2 0 :0 0
18 :4 0 :0 0
Fig. 8. ANN with input data for six days measured solar irradiance,
output 24-h day ahed forecast
4
1000
measured data is used for the ANN training and testing. The
900 mesured input layer of the ANN accepts as parameters the measured
800 simulation daily solar irradiance for six previous days. After data
700
600
preprocessing and the training procedure, it has been found
500 that the artificial network with 20 hidden neurons shows the
400 best performance compared to the other structures. The
300
200
average calculated relative root means square error is between
100 4% and 5%. More in-depth analysis of the comparison
0 between measured and forecasted solar radiation shows that
07:40:00
08:00:00
08:20:00
08:40:00
09:00:00
09:20:00
09:40:00
10:00:00
10:20:00
10:40:00
11:00:00
11:20:00
11:40:00
12:00:00
12:20:00
12:40:00
13:00:00
13:20:00
13:40:00
14:00:00
14:20:00
14:40:00
15:00:00
15:20:00
15:40:00
16:00:00
16:20:00
16:40:00
17:00:00
17:20:00
during the clear sunny days the model accuracy is higher,
meanwhile in presence of could the model performance is less
Fig. 9. Comparison of the measured and simulated day ahead solar precise.
radiance during testing for 17.02.2018 for N=20
Further researches will be proposed forecast models with
1200
mesured simulation
different ANN typologies and different input data.
1000
ACKNOWLEDGMENT
800
The authors would like to thank the Research and
600 Development Sector at the Technical University of Sofia for
400 the financial support.
200
REFERENCES
0 [1] Kopp G, Lean JL. A new, lower value of total solar irradiance:
10:20:00
11:50:00
13:20:00
14:50:00
16:20:00
17:50:00
10:10:00
11:40:00
13:10:00
14:40:00
16:10:00
17:40:00
10:10:00
11:40:00
13:10:00
14:40:00
16:10:00
17:40:00
10:10:00
11:40:00
13:10:00
14:40:00
16:10:00
17:40:00
19:10:00
7:20:00
8:50:00
7:10:00
8:40:00
7:10:00
8:40:00
7:10:00
8:40:00