Study of daily solar Irradiance forecast based on chaos optimization neural networks

In this works, artificial neural network is combined with wavelet analysis for the forecast of solar irradiance. This method is characteristic of the preprocessing of sample data using wavelet transformation for the forecast, i.e., the data sequence of solar irradiance as the sample is first mapped into several time-frequency domains, and then a chaos optimization neural network is established for each domain. The forecasted solar irradiance is exactly the algebraic sum of all the forecasted components obtained by the respective networks, which correspond respectively the time-frequency domains. On the basis of combination of chaos optimization neural network and wavelet analysis, a model is developed for more accurate forecasts of solar irradiance. An example of the forecast of daily solar irradiance is presented in the paper, the historical daily records of solar irradiance in Shanghai constituting the data sample. The results of the example show that the accuracy of the method is more satisfactory than that of the methods reported before.


INTRODUCTION
The environmental conditions are an important factor in the performance of any photovoltaic module, PVM and in other fields, such as, air conditioning, the heating.An accurate measurement of effective irradiance level, Ei is needed to improve the design of PV power systems and maximum power point tracking, MPPT algorithms.And solar irradiance in moderate climates is mostly characterized by short time fluctuations [1,2].Obviously, it is necessary to carry out an investigation in the forecast of solar irradiance.
There have been many researchers engaged in the modeling of solar irradiance.The existing models established by classical approaches include, e.g., those called clear-day solar radiation, half-sine, Colares-Pereirs & Rabl, and ARIMA hourly solar irradiance [3,4,5].In fact, it is rather difficult to forecast accurately the behavior of solar irradiance by the traditional models, because they need the bases of the precise definition of problem domains as well as the identification of mathematical functions, but it is very difficult to define and identify precisely when systems are non-linear and there are parameters varying with time due to many factors.The control program often lacks the capability to adapt to the parameter changes.This is just the reason why most existing models were found with relatively big errors and sometimes difficult to use widely.With special abilities in simulating and mapping complicate systems automatically, neural networks are used to learn the behavior of solar irradiance and are subsequently used to simulate and predict this behavior [6].
The heat effect of solar radiation is an all-in effect of the whole solar spectrum, whereas the heat spectrum of solar radiation is uneven and has some difference from solar energy spectrum.It is also different in the influence of the atmospheric conditions and other environmental factors on the sunlight in different frequencies.Naturally, the observed data of solar radiation on earth reflects the difference in these influences.It is proved that the accuracy of a forecasting model could be improved remarkably if preprocessing of sample data is carried out properly.In the paper this task is performed by wavelet transforming, i.e., first to decompose the sample data sequence of solar irradiance into several components of various time-frequency domains according to wavelet analysis, then to use the chaos optimization neural networks (CONNs) particular established to make forecasts for all domains based on these components, finally to make the algebraic sum of the forecasts.Thus a relatively accurate forecast of solar irradiance could be achieved in this way.This is the basis of modeling the forecast of solar irradiance by means of the combination of artificial neural networks with wavelet analysis.

WAVELET ANALYSIS OF SOLAR IRRADIANCE
The sun radiates thermal energy to the earth through a wide spectrum from infrared to ultraviolet.The radiation flux onto the earth surface is affected by various factors such as air mass, clouds, and other environmental conditions of earth.The influence is different according to various frequencies of sunlight.Wavelet transformation is an analyzing method of time-frequency localization with fixed area window size and with changeable timewindows and frequency-windows [2,7,8,9].The components of solar irradiance corresponding to various timefrequency domains can be obtained through mapping the solar irradiance into these domains by wavelet transformation, and then to transform back to the components of various frequency domains.Better understanding of solar irradiance may be obtained through the analyses of these components, and this is just a precondition for more accurate forecast of solar irradiance.Suppose that a mother wavelet ψ(t) was chosen, a series of wavelet ψ j,k (t) can be developed through dilating and translating the ψ(t).In computer practices the ψ j,k (t) can be obtained as follows, discrete sequence of wavelet being used as a rule.
where t denotes discrete time, and A j is the scale factor, and kA j B for translation.Eq.1 becomes the series of binary wavelets when A=2 and B=1.
Suppose that φ(t) is a scale-function corresponding to ψ(t), then the series of binary scale-functions φ j,k (t) can be expressed as: If {f(t), t =0, ±1, ±2, …}denotes a data sequence of solar irradiance, and {φ 0,k } is a fundamental orthogonal canonical set in a square-integrable space, and the factors C j,k and D j,k being defined as below where "-" upon a symbol of a function indicates the complex conjugate of the function, it follows according to the theory of multi-resolution analysis that By using Mallat's pyramid algorithm, the factors in Eq.4 can be calculated forward-or backward-recursively according to Eq.5 or 6 respectively.
Mallat's decomposition: and Mallat's composition: where operators in Eq.4 is the low frequency components a j of the data sequence of solar irradiance, and the represents the high frequency components d j of the data sequence.The footnote j indicates the j-th timestep (j=1,2,…, N).Mallat's pyramid algorithm of wavelet is such a process that carries out the successive decomposition step by step, which looks like a pyramid, through repeatedly using Mallat's algorithm to decompose the low frequency components produced by the Mallat's composition in the previous step.A low frequency sequence a N and high frequency sequences d 1 , d 2 , …, d N can be obtained when N time-steps of pyramid decomposition of data sequence of solar irradiance have been completed (see Fig. 1).Thus the data sequence f(t) can be wavelet-transformed after N time-steps (expressed in Eq.7).

MODEL OF CHAOS OPTIMIZATION NEURAL NETWORK FOR SOLAR IRRADIANCE
The behavior of solar irradiance is complex: either periodic or random, and the wavelet-transformed frequency components corresponding to various time-frequency  ; finally to continue the procedure using 0 s instead of * s [10].

Model of Chaos Optimization Neural Networks
The structure of the CONN with one hidden layer can be expressed as Figure 2, when vector X={x 1 , x 2 , …, x n1 } supplied to input layer, the hidden layer produces vector M={m 1 , m 2 , …, m n2 }, and the output layer sends out vector Y={y 1 , y 2 , …, y n3 }, where n1, n2 and n3 are the neuron numbers of the input, hidden, and output layers of the network respectively.The weight matrix between input layer and the hidden is {W ij }, and the weight matrix between hidden layer and the output is {T pi }.The biases of hidden layer is θ i (i= 1, 2, 3, …, n 2 ), and that of output layer is θ p (i=1, 2, 3,…, n 3 ).Suppose {t p } denotes the expected output vector, the functions of CONN algorithm can be shown as follows: Output of neurons of hidden layer is: (8) where the activation function in Eq. 8 and in what follows takes the Sigmoid function, that is: Output of neurons of output layer is: The output error function of CONN will be calculated from equation (10): where the 1  , 2  are defined as balance control in-dexes, and ≥0.In the early stage of training procedure, updating of weight value is up to the absolute error; and in the final stage, updating of weight and bias value is mainly up to relative error.To achieve this kind of transition, the balance control indexes can be amended according to the following equation (11): where, k is number of iteration.

Chaos Variant Optimization
First chaotic variants of carrier matrix need be chosen, and the logistic model is commonly used for chaotic variants choice, that is: where, k is number of iteration, and  is control parameter.When  ＝4.0, the variant s in Eq.12 will keep in a state of chaos.

DATA PREPROCESSING FOR CHAOS OPTIMIZATION NEURAL NETWORK
It is necessary to normalize the data sequence of the frequency components of solar irradiance into the range of [-0.5,0.5] in advance due to the requirements of wavelet decomposition, so as to enhance the adaptability of the neural network.If {l(t); t=0, ±1, ±2,…} denotes a data sequence and {q(t); t=0, ±1, ±2,…} denotes a normalized data sequence, it follows that: The normalized data sequence can be restored through Eq.14.

IMPLEMENTATION OF THE ALGORITHM OF CONN FOR SOLAR IRRADIANCE
Suppose {q(t); t = 0, ±1, ±2, …} denotes a normalized and decomposed data sequence of solar irradiance.If τ denotes the day to be forecasted in a time-step of network training and {q(τ-1), q(τ-2), …, q(τ-p)} (p equals the neuron number of the input layer of neural networks) is selected from sequence {q(t); t = 0, ±1, ±2,…} as input vector X{x 1 , x 2 , …, x p } of the CONN, then the output Y{y=q'(τ)} of the CONN is the forecast of daily irradiance of the expected day τ.The structure of the CONN for forecasting solar irradiance is shown as Fig. 3.
Suppose that E, W, and θ denote the error function, the weights of the network, and the biases respectively, ZW, Zθ denote the carrier matrix of W, θ.According to Eq.12, the carrier matrix can readily be calculated as follows.
The weights and the biases will be calculated from Eq.16: Then the error function is obtained with Eq.17: where 3  is searching step length, and 3 [0,1]   .

AN EXAMPLE OF FORECASTING SOLAR IRRADIANCE
As an example, a forecast of daily solar irradiance using CONN with wavelet analysis was carried out based on the data sequence of the daily records of irradiance by Baosan Meteorological Station in Shanghai from 1995 to 2000, i.e., the records amounting to 365×6+2=2192 days' (note: the loop years of 1996 and 2000).Fig. 5 shows the historical daily solar irradiance of the 2192 days.The computer programming is based on Matlab6.5.DB7, the No.7 of Daubechies wavelet functions, was chosen to be the mother wavelet.Using Mallat's pyramid method with the mother wavelet of DB7, the low frequency sequence of a 3 and the high frequency sequences of d 3 , d 2 , and d 1 of the daily solar irradiance could be obtained (see A 3-layer CONN is constructed in the following way.The input layer has 9 neurons for the input of 9 sample records corresponding to 9 successive days just before the day being forecasted in training.The number of neurons for the hidden layer is also determined to be 4 using the trial and error method.The output layer has only one neuron for outputting the forecast results, i.e. the data corresponding to the 10 th day when in training.So the CONN could be trained in the following way using the sequence of the low frequency of a 3 , which has 1826 records decomposed from the irradiance sequence of 1826 days during years of 1995 to 1999. For the first iteration, the CONN takes the first successive 10 data as the first group from sequence a 3 that includes 1826 data, and then uses the first 9 data of the group as the input X 1 ={x 1 , x 2 , …, x 9 } of the network to get an output y 1 .The error E 1 of y 1 is calculated by comparing y 1 with the 10 th datum of the group, and the ZW 1 and Zθ 1 are calculated by Eq.15 as well.Then the updating of the weights and biases of CONN could be performed using Eq.16.The training of the network continues when successively taking the data patterns in such a way that for the second iteration the group is composed by the 2 nd to 11 th data of the 1826 data, and for the next iteration the group is composed by the 3 rd to 12 th data, and so on.The procedures circulate from the beginning when all the 1826 data of sequence a 3 has been in processing, and do not stop until any of stop conditions is reached.Table 1 shows the way to divide sequence a 3 into 1818 data groups.Fig. 8 shows the results of the algebraic sum of the forecasted low frequency sequence of a 3 and the forecasted high frequency sequences of d 3 , d 2 , and d 1 , i.e., the backtracking forecasted total daily irradiance in the period of 1995 to 1999 (Fig. 8.1) and the forecasted total day-by-day irradiance in year 2000 (Fig. 8.3).The errors are also listed in Table 2.
In order to have an example to compare with, a CONN with the same structure was also used to forecast the daily solar irradiance of the same period of time under the condition that the sample data were not handled by wavelet analysis.And the maximum training times was assigned to 10000 for this CONN.The other factors were the same as those assigned in the previous paragraphs.The errors of training and forecasting are also listed in Table 2.

DISCUSSIONS AND CONCLUSIONS
The forecast method that is presented and applied to forecasting solar irradiance in the paper combines chaos optimization neural network with wavelet transformation, and proves remarkable improvement through an example in the accuracy of the forecast for the daily solar irradiance of a year compared with that without combining wavelet transformation.The example of solar irradiance shows that the RMSEs of the training and the forecast with wavelet analysis are 0.8156 MJ/m 2 day and 0.8373 MJ/m 2 •day respectively.The MRE of the forecast with wavelet analysis accounts for 7.71%, which is about one fourth of the forecast without wavelet analysis.It is obvious that the forecasted irradiance curve is well identical to the actual one (see Fig. 8).
Because the method presented does not depend upon the intrinsic properties of the sequence of sample data, the principle of this work could be applicable to some other fields such as load forecast, pattern recognition, etc.
There are various tasks which can be used to study further the combination of neural network and wavelet transformation, e.g., the more detailed analysis of the special behavior of the objects to be forecasted, the optimal combination of wavelet analysis and neural network, the selection of mother wavelet, the optimal up-dating of weights and biases, etc.The accuracy of this method may be further improved after progress has been made in these tasks.

Figure 1 .
Figure 1.The pyramid decomposing process of the data sequence.

…,
domains of solar irradiance have similar behavior.In consideration of these special characteristics, the chaos optimization neural network (CONN) is adopted in this work.The algorithm of chaos optimization neural network combines the advantages of gradient descent method and chaos optimization to improve the optimizing search efficiency.The main opinion is: First, to search the local optimum point * old s of former numbers of N 1 and the local optimum point * s of the latter numbers of N 1 ; secondly, to compare * s with then to make linear search find the better optimum point 0 s from * s along the direction of

Figure 2 .
Figure 2. The structure of the CONN with one hidden layer.

Figure 3 .
Figure 3.The structure of the CONN for forecasting solar irradiance.

Fig. 6 )
by the 3-scale wavelet decomposition.The algebraic sum of the low frequency sequence and the high frequency sequences equals the original data sequence.Then normalize a 3 , and d 3 , d 2 , d 1 .The normalized sequences a 3 , and d 3 , d 2 , d 1 are to be used as 4 training data sets.

Figure 4 .
Figure 4. Flowchart of CONN for solar irradiance. z

y
Initialize the weights and biases, W, θGive a set of data, X, TCalculate network output and error, Z, Y, EUpdate the weights and biases by means of chaotic optimized algorithm,

Figure 5 .Figure 6 .
Figure 5.The data sample of daily total solar irradiance.

Figure 7 .Figure 8 .
Figure 7. Training and forecasting of the low-frequency sequence of a 3 .

2 )
Absolute errors of backtracking forecast (3) Forecasting for the year of 2000 (4) Absolute errors of the forecast

Table 1 .
Grouping of sequence a 3 for training.

Table 2 .
Errors of CONN training and forecasting.