Professional Documents
Culture Documents
Neuro-Fuzzy Dynamic Model With Kalman Filter To Forecast Irradiance
Neuro-Fuzzy Dynamic Model With Kalman Filter To Forecast Irradiance
Review
Abstract
This paper introduces a dynamic forecasting of irradiance and ambient temperature. The medium term forecasting (MTF) gives a daily
meteorological behaviour. It consists of a neuro-fuzzy estimator based on meteorological parameters’ behaviours during the days before,
and on time distribution models. As for the short term forecasting (STF), it estimates, for a 5 min time step ahead, the meteorological
parameters evolution. It is ensured by the Auto-Regressive Moving Average (ARMA) model of the MTF associated to a Kalman filter.
STF uses instantaneous measured data, delivered by a data acquisition system, so as to accomplish the forecast. Herein we describe our
method and we present forecasting results. Validation is based on measurements taken at the Energy and Thermal Research Centre
(CRTEn) in the north of Tunisia. Since our work delivers accurate meteorological parameters forecasting, the obtained results can be
easily adapted to forecast any solar conversion system output.
r 2007 Elsevier Ltd. All rights reserved.
Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1436
2. The estimator principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1436
3. The MTF model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1437
3.1. The neuro-fuzzy estimator approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1437
3.2. Meteorological behaviour estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1438
3.3. Irradiance distribution model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1439
3.4. Ambient temperature distribution model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1439
4. Short term forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1439
4.1. Kalman filter approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1439
4.2. Application to meteorological parameter forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1440
5. Results and discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1441
6. Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1443
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1443
Corresponding author. Rte Mahdia Km 2, BP88A, ElBustan 3099-Sfax, Tunisia. Tel.: +216 74431425; fax: +216 74431386.
E-mail address: maher.chaabane@isetsf.rnu.tn (M. Chaabene).
0960-1481/$ - see front matter r 2007 Elsevier Ltd. All rights reserved.
doi:10.1016/j.renene.2007.10.004
ARTICLE IN PRESS
1436 M. Chaabene, M. Ben Ammar / Renewable Energy 33 (2008) 1435–1443
Meteorological station
( d − 1) G1 Tmin 1 Tmax 1
DB(d − 1) = (d −2) G2 Tmin 2 Tmax 2
..., I ( d , k − 1 ), I ( d , k )
Y( d ,k ) =
( d − 20 ) G20 Tmin 20 Tmax 20 ...,T ( d , k − 1 ),T ( d , k )
3. The MTF model Takagi and Sugeno model, ANFIS uses the least-squares
method to identify these parameters. The main objective of
Three meteorological parameter amounts are estimated ANFIS is to optimize the parameters of a given fuzzy
for the day d: the cumulated irradiance, the minimal inference system by applying a learning procedure using a
ambient temperature and the maximal one. The estimation set of input–output data pairs (training data). The
is based on the ANFIS neuro-fuzzy estimator. The parameter optimization is done in a way such that the
obtained amounts are exploited so as to determine a time error measure between the desired and the actual output is
function for each meteorological parameter using two time minimized [11,13].
distribution models [11,12]. Fig. 2(a) illustrates graphically the fuzzy reasoning
mechanism to derive an output f from a given input [x,y].
The firing strengths w1 and w2 are usually obtained as the
3.1. The neuro-fuzzy estimator approach
product of the membership grades of the premise part, and
the output f is the weighted average of each rule’s output.
The Takagi and Sugeno model uses fuzzy inputs and rules
ANFIS (Fig. 2(b)) is composed of five layers. Each layer
so as to provide a powerful tool for modelling complex non-
contains several nodes described by the node function.
linear problems when combined with a network structure as
Adaptive nodes, denoted by squares, represent the para-
in the adaptive network fuzzy inference system or ANFIS
meter sets that are adjustable in these nodes, whereas fixed
[10]. ANFIS is a class of adaptive multi-layer feed-forward
nodes, denoted by circles, represent the parameter sets
networks, applied to non-linear forecasting where past
that are fixed in the system. The output data from the
samples are used to forecast the sample ahead. It generates
nodes in the previous layers will be the input in the present
fuzzy rules from an input–output data set (called training
layer. Fig. 2(b) shows the corresponding ANFIS structure
data). A typical fuzzy rule in a Takagi and Sugeno fuzzy
where nodes within the same layer perform functions of the
model has the format: If x is Ai and y is Bi then z ¼ f ðx; yÞ
same type. Note that Oji denotes the output of the ith node
where Ai and Bi are fuzzy sets in the antecedent; z ¼ f ðx; yÞ
in jth layer. To illustrate the ANFIS procedures, we
takes usually a polynomial form. Consider such a model that
consider the above system having two inputs [x,y] and one
contains two rules:
output f. The node function in each layer is described
below.
Rule 1: If X is A1 and Y is B1 ; then f 1 ¼ p1 x þ q1 yþ r1 ,
Layer 1: Each node in this layer generates a membership
Rule 2: If X is A2 and Y is B2 ; then f 2 ¼ p2 x þ q2 yþ r2 ,
grade of a linguistic label. The node function of the ith
node is a generalized bell membership function:
where fpi ; qi ; ri g are the consequent parameters that are
determined during the training process. According to O1i ¼ mAi ðxÞ ¼ 1=f1 þ jðx ci Þ=ai j2bi g,
A1 B1
w1 f1 = p1 x + q1 y + r1
X Y
A2 B2
w2 f2 = p2 x + q2 y + r2
X Y
x y
x y
A1
w1 w1 w1 f1
x
Π N
A2
w1 f1 + w2 f2
Σ f=
w1 + w2
B1
y Π N = w1 f1 + w2 f2
w2 w2 w1 f2
B2
x y
where x is the input to node i; Ai the linguistic label (small, differences between model predictions and training data
large, etc.) associated with this node; and fai ; bi ; ci g the values. Once the training output model f is determined, a
parameter set that changes the shapes of the membership set of testing input–output data is applied to this model in
function, ANFIS employs gradient descent to fine-tune order to compute the ANFIS prediction output.
them during the training process. Parameters in this layer
are referred to as the premise parameters. 3.2. Meteorological behaviour estimation
Layer 2: Each node in this layer calculates the firing
strength of a rule via multiplication: Time series modelling is fundamentally different from
O2i ¼ wi ¼ mAi ðxÞmBi ðyÞ; i ¼ 1; 2 the conceptual modelling of systems because a time series is
interpreted as an output of an unknown system. Neither
Layer 3: Node i in this layer calculates the ratio of the ith the system characteristics nor the input functions are
rule’s firing strength to the total of all firing strengths: known. Consequently time series analysis must content
wi itself with estimating future output values by means of their
O3i ¼ wi ¼ ; i ¼ 1; 2
ðw1 þ w2 Þ own past values. The principle consists of using a time
series, with a time step p, of n last measurements up to time
Layer 4: Node i in this layer computes the contribution
t, ½mðt ðn 1ÞpÞ; . . . ; mðt pÞ; mðtÞ as training data and
of ith rule towards the overall output using the node
½mðt ðn 2ÞpÞ; . . . ; mðtÞ; mðt þ 1Þ as testing data, to
function:
estimate during a sliding time interval the p step ahead
O4i ¼ wi f i ¼ wi ðpi x þ qi y þ ri Þ, future values of the time series ½mðt ~ ðn 2ÞpÞ; . . . ; mðtÞ;
~
~ þ 1Þ. Here mðt þ 1Þ is fixed arbitrarily at any value so
mðt
where w̄i is the output of layer 3 and fpi ; qi ; ri g is the
as to achieve the ANFIS testing process. Thus, the retained
consequent parameter set to be determined during the
output estimated value p step ahead is mðt ~ þ 1Þ. In our case
training process.
we consider, for the training phase, the day as time unit
Layer 5: The single node in this layer computes the
(t ¼ d 1: ending day), n ¼ 20 (20 days ago), and p ¼ 1
overall output as the summation of contribution from each
(each day). In order to estimate the meteorological
rule:
P behaviour characterizing the day d, we consider the base
X wi f of measurements DBðd 1Þ as training data and DBðdÞ as
O5i ¼ wi f i ¼ Pi .
i i wi testing data:
2 3
ANFIS in Fig. 2(b) has, as the basic learning rule, the ðd 1Þ G 1 T min1 T max1
backpropagation gradient descent algorithm (the same 6 7
6 ðd 2Þ G 2 T min2 T max2 7
used in feed-forward neural nets) which calculates recur- 6 7
DBðd 1Þ ¼ 6 6 .. .. .. .. 7
7
sively the error signals from the output layer backward to 6 . . . . 7
the input nodes [13]. From this architecture, it is seen that 4 5
given the values of premise parameters, the overall output ðd 20Þ G 20 T min20 T max20
function can be expressed as a linear combination of the ¼ ½V 1 V2 V3 V 4 ,
consequent parameters:
2 3
f ¼ w1 f 1 þ w2 f 2 ¼ ðw1 xÞp1 þ ðw1 yÞq1 þ ðw1 Þr1 ðdÞ G T min T max
6 7
þ ðw2 xÞp2 þ ðw2 yÞq2 þ ðw2 Þr2 . 6 ðd 1Þ G 1 T min2 T max1 7
6 7
DBðdÞ ¼ 6 .. .. .. .. 7,
Thus, ANFIS uses a mixture of least mean squares 6 . . . . 7
4 5
estimation (to determine consequent parameters) and ðd 19Þ G 19 T min19 T max19
backpropagation (to learn the premise parameters). A step
in the learning process has two passes: In the first pass where V1 is the day order vector and V2–V4 are,
training data is brought to the inputs, the premise respectively, the measured vectors during the last 20 last
parameters are assumed to be fixed and the optimal days of the cumulated solar radiations, the minimal
consequent parameters are estimated by an iterative least temperatures and the maximal ones. G; T min ; T max are
mean squares procedure. In the second pass the patterns supposed as the measured values of climatic parameters
are propagated again, but this time the consequent during the day d; they take any values in order to
parameters are assumed to be fixed and backpropagation accomplish the ANFIS testing process.
is used to modify the premise parameters [13]. Considering the neuro-fuzzy estimator approach
In time series estimation with ANFIS, two data sets are (Section 3.1), the ANFIS architecture applied to our case
required so as to predict one step ahead: ‘‘training’’ and is given by Fig. 3. In order to increase the prediction
‘‘test’’ data. Sub-clustering is used to generate ANFIS accuracy, 10 partitions are fixed, which select 10 member-
structure automatically. Training phase involves an itera- ship functions, for each input. In view of Fig. 3, 20 rules are
tive procedure, which seeks to calculate optimum values of delivered by layer 4 to layer 5 in an attempt to determine
system parameters by minimizing the sum of squared the ANFIS output f V i . In Fig. 3, ANFIS is executed
ARTICLE IN PRESS
M. Chaabene, M. Ben Ammar / Renewable Energy 33 (2008) 1435–1443 1439
separately for each vector of measure Vi (as a training data) dðdÞ ¼ 23:45 cosðNðdÞ þ 10Þ, (7)
to calculate its relative model f V i . Consequently, the
NðdÞ ¼ 0:988½DðdÞ þ 30:3ðMðdÞ 1Þ, (8)
estimated value of each climatic parameter is computed
using its specific testing data vector in DBðdÞ and the where GMTðdÞis the sunset and sunrise hours of the day d
ANFIS model f V i . Following the training and the testing with ¼ 1 for sunset and ¼ þ1 for sunrise, L the
process, ANFIS delivers the estimated matrix: longitude, f the latitude, TeðdÞ the time equation (in hour),
2 3 dðdÞ the declination (in degree), DðdÞ the day of the month,
ðdÞ G~ T~ min T~ max
6 7 MðdÞ the month number (January ¼ 1) and NðdÞ the
6 ðd 1Þ G~ 1 T~ min2 T~ max1 7 number of the day for the year.
~ 6 7
DBðdÞ ¼ 6 .. .. .. .. 7 ,
6 . . . . 7
4 5 3.4. Ambient temperature distribution model
ðd 19Þ G~ 19 T~ min19 T~ max19
from which the first line vector EðdÞ, ~ representing the The MTF of the ambient temperature (T~ mf ðd; tÞ) for the
climatic parameters estimated behaviour for the day d, is day d is computed using the following sinusoidal distribu-
deduced: tion [12]:
h i T~ max ðdÞ þ T~ min ðdÞ
~
EðdÞ ~
¼ GðdÞ T~ min ðdÞ T~ max ðdÞ , T~ mf ðd; tÞ ¼
2
~
where GðdÞ is the estimated amount of cumulated T~ max ðdÞ T~ min ðdÞ pðt 1Þ
þ sin , ð9Þ
irradiance, T~ min ðdÞ and T~ max ðdÞ are, respectively, the 2 12
estimated minimal and maximum ambient temperatures.
where t is the time in decimal hours since sunrise (t ¼ 0 at
The ANFIS computation was conducted using the
sunrise, Eq. (5)) for day d and T~ min ðdÞand T~ max ðdÞ are
Matlab software. The ANFIS training algorithms, includ-
estimated by the neuro-fuzzy meteorological behaviour
ing the gradient method and the least-squares method, ~
estimation vector EðdÞ.
were embedded in the software of Matlab’s fuzzy inference
toolbox. After training, the ANFIS model with forecasting
4. Short term forecasting
function is applied to testing data to obtain the output
forecasting.
4.1. Kalman filter approach
3.3. Irradiance distribution model The dynamic behaviour of a stochastic system is
described by the discrete state equation (Eq. (10)) and the
The MTF of irradiance for the day d is computed using a discrete output equation (Eq. (11)) [14]:
Gaussian distribution:
X ðk þ 1Þ ¼ AX ðkÞ þ V 1 ðkÞ, (10)
pt
I~mf ðd; tÞ ¼ I~max ðdÞ sin , (1)
DLðdÞ Y ðkÞ ¼ CX ðkÞ þ V 2 ðkÞ, (11)
where t is the time in decimal hours since sunrise (t ¼ 0 at where k is the discrete step, X the variable vector of the
sunrise), DLðdÞ the day length of day d and I~max ðdÞ the system state, Y the output variable vector, A and C are the
value of I~mf ðd; tÞ at t ¼ DLðdÞ=2. Since the estimated ARMA model coefficients which are computed by Eq. (12),
~
amount of solar energy GðdÞ ~
is obtained by integrating IðdÞ V1 and V2 are independent zero mean stochastic noises for
ARTICLE IN PRESS
1440 M. Chaabene, M. Ben Ammar / Renewable Energy 33 (2008) 1435–1443
which covariance matrix is given by (Eq. (13)): The kth vector of meteorological parameter measure-
ments delivered by the meteorological station during
Aðq1 ÞY ðtÞ ¼ Cðq1 ÞeðtÞ, (12)
day d.
1 1 2 nA
with Aðq Þ ¼ 1 þ a1 q þ a2 q þ anA q , Cðq Þ ¼ 1 " #
AI ðq1 Þ 0
1 þ c1 q1 þ c2 q2 þ cnC qnC , eðtÞ is the zero mean 1
Aðq Þ ¼ ; and
independent stochastic sequence of variables (white noise), 0 AT ðq1 Þ
q the time series variable, nA and nC are the orders of " #
ARMA model. 1
C I ðq1 Þ 0
" ! # Cðq Þ ¼ .
0 C T ðq1 Þ
V 1 ðkÞ T T
Q S
E ðV 1 ðlÞ; V 2 ðlÞÞ ¼ dkl , (13)
V 2 ðkÞ ST R The ARMA models matrixes of MTF vector X~ mf ðd; tÞ
for day d computed by Eq. (12).
where E is the covariance, Q; R; S are elements of the noise " #
covariance matrix. dkl is the Kronecker delta, which is 1 for K I ðkÞ 0
k ¼ l and 0 otherwise.
KðkÞ ¼ :
0 K T ðkÞ
T
The filtering principle consists of two computation steps:
he matrix of the Kalman filter gain computed using
the measurement update equations and the time update
Eq. (15).
equations. The first step estimates X ðkÞ using measure-
ments up to k (denoted X^ kjk ) then using measurements up
The estimation of the vector
2 3
to k1 (denoted X^ kjk1 ) by computing the covariance I^sf ðdÞkjk
E½X ðkÞjY ð0Þ; Y ð1Þ; . . . ; Y ðkÞ. The solution of this filtering X^ sf ðdÞkjk ¼ 4 ^ 5
problem is now given as T sf ðdÞkjk
J Estimate X^ sf ðdÞkjk . Since measurement errors are not significant, they were
J Estimate X^ sf ðdÞkþ1jk . neglected when minimizing the Kalman Filter errors. Thus,
Until sunset. data were modelled independently of measurement errors.
. Forecasting models have been tested during daylight
5. Results and discussion since July 2006. In order to evaluate models’ performances,
daily estimated and measured data were analysed by
The MTF and STF algorithms were implemented at computing the NRMSE and the NMBE factors [2] for
CRTEn which is equipped by a meteorological station. each forecasting type
Measurements are delivered by means of a data acquisition qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
system connected to two meteorological sensors. The 1
PN 2
N i¼1 ðestimated value measured valueÞ
station technical characterization is NRMSE% ¼ 1
P N
100,
N 1 measured value
Temperature sensor: type PT100 with accuracy error of
0.5%. PN
Global irradiation sensor: type CIMEL/CEI180 with i¼1 ðestimated value measured valueÞ
NMBE% ¼ PN 100,
accuracy error of 1%. 1 measured value
The station overall estimated uncertainties in the
measurements is 1.2%. where N is the number of reading points. The NMBE
The time step of measured data is instantaneous one provides information on the MTF performance. As for
sample every 5 min. NRMSE, it gives information on the STF performance.
8000
7000
Solar Irradiation [W/m2]
6000
5000
4000
3000
NMBE=0.22%
2000 G:measured
G:estimated
1000
180 200 220 240 260 280 300
Day of the year
45
Tmax-measured
Tmin-measured
40 Tmax-estimated
Tmin-estimated
NMBE Tmax=0.04%
35
Temperature [°C]
30
20
15
10
180 200 220 240 260 280 300
Day of the year
Fig. 4. Estimated and measured data of the (a) cumulated irradiance and (b) ambient temperature.
ARTICLE IN PRESS
1442 M. Chaabene, M. Ben Ammar / Renewable Energy 33 (2008) 1435–1443
Figs. 4(a) and (b) give the estimated and measured good concordance (NMBE ffi 0:2%). The estimated vector
amounts for the cumulated irradiance and the minimal ~
EðdÞ is used to hold MTF and STF. For clarity, forecasts
and maximal ambient temperatures during the test period. are analysed over three arbitrary chosen days. Estimated
It can be seen that estimated and measured values present values and measured data of both irradiance and ambient
600
400
200
0
6 8 10 12 14 16 18
40
NMBE=2.2%
35 NRMSE=0.87%
T (°C)
30
Day: Auguest, 18, 2006
25
20
6 8 10 12 14 16 18
Time (hour)
1200
1000 NMBE=1.8%
NRMSE=7.42%
800
I (W/m2)
600
400
200
0
6 8 10 12 14 16 18
40
NMBE=-8.17%
35
NRMSE=2.28%
T (°C)
30
25
Day: September, 15,2006
20
15
6 8 10 12 14 16 18
Time (hour)
1000
NMBE=5.4%
800
NRMSE=8.22%
I (W/m2)
600
400
200
0
6 8 10 12 14 16 18
35
NMBE=3.97%
30
NRMSE=2.1%
T (°C)
25
20
Day: October, 22, 2006
15
10
6 8 10 12 14 16 18
Time (hour)
Fig. 5. MTF, STF and measurements of irradiance and ambient temperature during 3 days.
ARTICLE IN PRESS
M. Chaabene, M. Ben Ammar / Renewable Energy 33 (2008) 1435–1443 1443