FPGA-based implementation of intelligent ... - Semantic Scholar

25 downloads 0 Views 2MB Size Report
The developed hardware devices permit the prediction of global solar irradiation using available air temperature, relative humidity and sunshine duration; ...
Expert Systems with Applications 38 (2011) 2668–2685

Contents lists available at ScienceDirect

Expert Systems with Applications journal homepage: www.elsevier.com/locate/eswa

FPGA-based implementation of intelligent predictor for global solar irradiation, Part I: Theory and simulation A. Mellit a,⇑, H. Mekki b, A. Messai b, S.A. Kalogirou c a

Faculty of Sciences & Technology, Department of Electronics, LAMEL, Jijel University, P.O. Box 98 Ouled Aissa, Jijel 18000, Algeria CRNB Ain Oussera, P.O. Box 180, 17200 Djelfa, Algeria c Department of Mechanical Engineering and Materials Science and Engineering, Cyprus University of Technology, P.O. Box 50329, Limassol 3603, Cyprus b

a r t i c l e

i n f o

a b s t r a c t

Keywords: Solar irradiation Intelligent predictor MLP VHDL FPGA

Recent advances in artificial intelligent techniques embedded into a Field Programmable Gate Array (FPGA) allowed the application of such technologies in real engineering problems (robotic, image and signal processing, control, power electronics, etc.), however, the application of such technologies in the solar energy field is very limited. The embedded intelligent algorithm into FPGA can play a very important role in energy and renewable energy systems for control, monitoring, supervision, etc. In this paper, the software as well as the implementation of intelligent predictors for solar irradiation on reconfigurable FPGA is described. FPGA technology was employed due to its development, flexibility and low cost. An experimental dataset of air temperature, solar irradiation, relative humidity and sunshine duration in a specific area is used; this database has been collected from 1998 to 2002 at Al-Madinah (Saudi Arabia). Initially, a MultiLayer Perceptron (MLP) is trained by using a set of 1460 patterns and then a set of 365 patterns are used for testing and validating the MLP-predictor. Six MLP-predictors (configurations) are proposed and developed by varying the MLP inputs data, while the output is always the global solar irradiation for different configurations ½G ¼ ~f ðt; T; S; RHÞ; G ¼ ~f ðt; T; SÞ; G ¼ ~f ðt; T; RHÞ; G ¼ ~f ðt; S; RHÞG ¼ ~f ðt; TÞ and G ¼ ~f ðt; SÞ. Subsequently, the different MLP-predictors developed are written and simulated under the Very High Speed Integrated Circuit Hardware Description Language (VHDL) and ModelSimÒ. The best designed architecture for different MLP-predictors is then implemented under the XilinxÒ Virtex-II FPGA (XC2v1000). The developed hardware devices permit the prediction of global solar irradiation using available air temperature, relative humidity and sunshine duration; therefore, the designed configurations are very suitable especially in areas, where there are no instruments for measuring the solar irradiation data. Ó 2010 Elsevier Ltd. All rights reserved.

1. Introduction

these data (measured data) are not always available, especially in remote areas because of the absence of meteorological stations or measuring instruments. For this purpose, several models have been developed in order to generate these data based on stochastic models such as AR (auto-regressive), ARMA (AR-moving average), ARIMA (AR integrated MA) and Markov chain (Aguiar & CollaresPerreira, 1992; Maafi & Adane, 1989; Mora-Lopez & Sidrachde-Cardona, 1998; Santos & Pinazo, 2003;). However, these models are based on the probability estimation, which do not always give good generation of the data. Therefore, in order to overcome this problem, Artificial Intelligence (AI) techniques (neural networks, fuzzy logic and hybrid neural networks) have been applied with success for the modelling, prediction and forecasting of solar radiation data (Mellit & Kalogirou, 2008). The advantage of these techniques over standard mathematical models is that they do not require the knowledge of internal system parameters, involve less computational effort, and offer a compact solution for multi-variable problems (Mellit & Kalogirou, 2008). In this context, several studies on the use of

Global solar irradiation is considered as the most important parameter in the design of renewable and solar energy systems, particularly for the sizing of photovoltaic (PV) systems. Numerous studies in the literature have shown the possibility to find a correlation between solar irradiation and other meteorological parameters such as air temperature, sunshine duration, relative humidity and cloud cover (Angstrom, 1924; Allen, 1997; Bristow & Campbell, 1984; Chandel, Agarwal, & Pandey, 2005; Mehreen, Muneer, & Kambezidis, 1998; Prieto, Martınez-Garcıa, & Garcıa, 2009; Tymvios, Jacovides, Michaelides, & Scouteli, 2005). Global solar irradiation is usually presented as a time series and is especially challenging to predict its values in situations where an underlying model for generating data is not known. Frequently, ⇑ Corresponding author. Address: Junior associate at The International Centre for Theoretical Physics (ICTP), www.ictp.it, Trieste, Italy. Tel.: +213 551 998 982. E-mail addresses: [email protected], [email protected] (A. Mellit). 0957-4174/$ - see front matter Ó 2010 Elsevier Ltd. All rights reserved. doi:10.1016/j.eswa.2010.08.057

2669

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

Nomenclature ADR0, ADR1 address signals CE0, CE1 the control signals G global solar irradiation (Wh/m2/day) G0 extraterrestrial solar irradiation (Wh/m2/day) Kt clearness index RH relative humidity (%) RHmax maximum relative humidity (%) S sunshine duration (h) SEL0, SEL1 signals for data selection S0 extraterrestrial sunshine duration (h) S fraction of sunshine duration T air temperature (°C) Tmax maximum temperature (°C)

FPGA CLK IOB JTAG LC LUT MBE MLP MULT r RMSE VHDL

Field Programmable Gate Array Clock Input Output Bonded Joint Test Action Group Logic Cell Look-Up Table Mean Bias Error MultiLayer Perceptron Multiplexer correlation coefficient Root Mean Square Error Very High speed integrated Description Language

circuit

hardware

Abbreviations CLB Configurable Logic Block

neural networks have been published in the literature (Adnan, Arcakly´ogclu, Ozalp, & Agclar, 2005; Cao & Cao, 2006; Hontoria, Aguilera, & Zufiria, 2005; Mellit, Benghanem, Hadj Arab, & Guessoum, 2005; Mellit, Benghanem, & Kalogirou, 2006; Mellit, Kalogirou, Shaari, Salhi, & Hadj Arab, 2008; Sozen, Arcakly´ogclu, & Ozalp, 2004). Additionally, fuzzy logic has been used for estimation and prediction of solar irradiation. Sen (1998) used a fuzzy logic for estimating solar radiation from sunshine duration measurements. The fuzzy approach is applied for three sites with monthly average daily irradiances in the western part of Turkey. A fuzzy model of solar irradiance on inclined surfaces has been developed by Gomez and Casanovas (2003). The fuzzy model includes concepts from earlier models, though unlike these, it considers non-disjunctive sky categories. The proposed model offers performance similar to that of the models with the best results in the comparative analysis of the literature, such as the Perez model. David and Atsu (1999) used several expressions to estimate global solar radiation from sunshine hours for weather stations in Oman; these include linear, modified linear algorithm, Angstrom-Black type regression, a quadratic function and a new Angstrom-Black type algorithm. A linear model for estimating clear-sky beam radiation from observed radiation and sunshine duration is proposed by Helen (2007). Mellit, Benghanem, Hadj Arab A, and Guessoum (2004, 2007) applied the ANN and ANFIS (Adaptive Neuro-Fuzzy Scheme) for the prediction of daily solar radiation from mean temperature and sunshine duration. An extended survey of the application of artificial intelligence techniques for modelling and forecasting solar radiation can be found in Mellit et al. (2004). Rehman and Mohandes (2008) used an ANN for the estimation of daily solar radiation from air temperature and relative humidity at Abha City (Saudi Arabia). A set of four years are used for training the network, while a set of one year is used for testing and validating the model. The absolute mean percentage error for the case when only day of the year and mean temperature were used as inputs was 11.8%. This error reduces to about 10.3% when maximum temperature is used instead of mean temperature. Results show that using the relative humidity along with daily mean temperature outperforms the other cases with absolute mean percentage error of 4.49%. Recently, a comparison between different linear, polynomial regression and MLP-models for estimating the global solar radiation at Al-Madinah city was presented by Benghanem, Mellit, and Alamri (2009). The data used in this work are the global irradiation (G), diffuse irradiation (HD), air temperature (T) and relative humidity (RH). Results show that the model using as inputs the sunshine duration and air temperature, gives the most accurate results with a correlation coefficient of 97.65%.

It can be concluded from above mentioned results that it is possible to find a suitable model for the prediction of solar radiation based on some available parameters (air temperature, relative humidity and sunshine duration) by using AI techniques. Additionally, it should be noted that many ANN applications in solar irradiation are oriented solely towards the use of software solutions, whereas the use of ANN hardware implementation is less common (Mellit, 2008; Mellit et al., 2008). Therefore, in the present study we investigate the possibility of implementing MLP-predictors (MultiLayer Perceptron) into reconfigurable digital devices such as Field Programmable Gate Array (FPGA) in order to develop a hardware board which can be used for real-time prediction of solar irradiation in areas where there are no meteorological stations. This device (FPGA) allows the implementation of the neural network designs in parallel architectures in order to be used in real-time applications. FPGA technology is employed due to its development, flexibility and low cost. In fact, we have chosen the MLP because its architecture is not complicated and it can be implemented easily on FPGA than on any other ANN architectures or hybrid systems (ANFIS, GA-ANN, etc.) (Mellit, Shaari, & Mekki, 2008). ANN is a parallel and distributed network of simple nonlinear processing units interconnected in a layered arrangement. Parallelism, modularity and dynamic adaptation are the three computational characteristics typically associated with ANNs. FPGA-based reconfigurable computing architectures are well suited to implement ANNs as can be exploited concurrently and rapidly to reconfigure and adapt the weights and topologies of an ANN. The hardware implementations are essential for applicability and for taking the advantage of ANN’s inherent parallelism. Compared to traditional microprocessor-based systems, fast growing FPGA technology offers a more powerful, efficient and flexible hardware platform including on-site (field-programmable) reconfiguration capability of hardware. The main objective of this work is to develop and implement a suitable intelligent predictors for global solar irradiation in reconfigurable FPGA hardware XilinxÒ Virtex-II FPGA (XC2v1000). Firstly, the different proposed ANN configurations ½G ¼ ~f ðt; T; S; RHÞ; G ¼ ~f ðt; T; SÞ; G ¼ ~f ðt; T; RHÞ; G ¼ ~f ðt; S; RHÞG ¼ ~f ðt; TÞ and G ¼ ~f ðt; SÞ will be simulated under MatlabÒ and then written by using the Very High Description Language (VHDL). Once the best architectures are written in VHDL, the next step is to simulate and test these configurations under ModelSimÒ. The final step is to implement the best configurations into FPGA and develop the hardware boards. The implemented hardware MLP-predictors can present a real-time application for predicting and measuring the daily global

2670

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

solar irradiation from other meteorological parameters such as air temperature, relative humidity and sunshine duration which are always available, since these are probably the most registered meteorological variables. This paper is organized as follows: next section introduces the database used in this study; Section 3 provides the correlation between the solar irradiation and other meteorological data (air temperature, sunshine duration and relative humidity). MLP architectures used for predicting of the global solar irradiation as well as the developed architectures based on the VHDL are presented in Section 4, while Section 4.3.4, describes the methodology and the implementation of the different solar irradiation predictors. Section 5 gives the simulation results of the developed MLP models on MatLabÒ, ModelSimÒ, and FPGA for future experimental realization.

Renewable Energy Laboratory (NREL) (1998). Fig. (1a) shows the daily evolution of global solar irradiation received on a horizontal surface and sunshine duration whereas Fig. (1b) shows the daily evolution of air temperature and relative humidity. These data correspond to Al-Madinah city (Latitude: 24.55 N° Longitude: 39.70 E°), Saudi Arabia. Fig. 2(a) illustrates the daily evolution of irradiation for the year 2002 at Al- Madinah site. It also shows the values of G0, which represents the extraterrestrial radiation. Fig. 2(b) shows the daily evolution of sunshine duration for the year 2002. This figure shows clearly that there is seasonal trend, which is similar to that of the daily values of solar irradiation data. Corresponding curves of clearness indexes (Kt = G/G0) values and sunshine duration fraction (SS = S/S0) are presented in Fig. 2(c). Sunshine

Al-Madinah Lat. :24.55 N° Lon. :39,70 E° Year : 2002

10000

2

2. Available data description

Daily irradiation (Wh/m /day)

12000

The experimental data used in this work are the global solar irradiation, sunshine duration, air temperature and relative humidity. These data are available from 1998 to 2002 by the National

8000 6000 4000 2000 0

(G) Daily irradiation (HG) Extraterrestrial irradiation (H0) (G0)

0

50

100

150

200 Days

250

300

350

400

(a)

Daily sunshine duration (h)

14 Al-Madinah Lat. :24.55 N ° Lon. :39,70 °E Year : 2002

13 12 11 10 9 8 7 6 5 4

Fig. (1a). Daily evolution of global horizontal radiation and sunshine duration for Al-Madinah. (Saudi Arabia) for the years 1998–2002.

Daily sunshine duration (S) Extraterrestrial irradiation (S0)

0

50

100

150

200 Days

250

300

350

400

Fraction of sunshine duration, SS

Clearness index, Kt

(b) 1

0.5

0

0

50

100

150

200 Days

250

300

350

400

0

50

100

150

200 Days

250

300

350

400

1

0.8 0.6 0.4 0.2

(c) Fig. (1b). Daily evolution of air temperature and relative humidity for Al-Madinah (Saudi Arabia) for the years 1998–2002.

Fig. 2. Daily evolution of (a) global solar radiation and extraterrestrial global radiation, (b) sunshine duration and extraterrestrial sunshine duration, and (c) clearness index and fraction of sunshine at Al-Madinah, for the year 2002.

2671

Global horizontal irradiation (W/m 2/day)

r =94%

8000 7000 6000 5000 4000 3000 2000 1000 0

0

2

4

6 8 Sunshine duration (h)

10

duration is defined by WMO as the time during which the direct solar radiation is above 120 W/m2. The distribution of clearness index Kt is around the yearly average clearness index of 0.7281. This shows that the global radiation at Al-Medina site is higher and many solar energy applications will have good prospects for success. 3. Correlation between solar irradiation, sunshine duration, air temperature and relative humidity In the present section, we will present the different classical, linear and polynomial regression models between solar irradiation and sunshine duration, air temperature, and relative humidity. In addition, we will calculate the correlation coefficient between different regression models. 3.1. Correlation between global solar irradiation and sunshine duration

8000

r =68%

7000 6000 5000 4000 3000 2000 1000 0 10

12

Fig. (3a). Correlation between daily global horizontal radiation and sunshine duration for Al-Madinah (Saudi Arabia) for the years 1998–2002.

9000

15

20

25 30 Air temperature (C)

35

40

45

Fig. (3b). Correlation between daily global horizontal radiation and air temperature for Al-Madinah (Saudi Arabia) for the years 1998–2002.

9000

r =-72%

8000

2

9000

Global horizontal irradiation (W/m /day)

Global horizontal irradiation (W/m 2/day)

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

7000 6000 5000 4000 3000 2000 1000 00

20

40 60 80 Relative humidity (%)

100

120

Fig. (3c). Correlation between daily global horizontal radiation and relative humidity for Al-Madinah (Saudi Arabia) for the years 1998–2002.

The relations between the fraction (G/G0) and sunshine duration (S/S0) are (Zekai, 2008):

  G S ¼ aþb G0 S0    2 G S S þc ¼ aþb G0 S0 S0

3.3. Correlation between global irradiation and relative humidity

ð1Þ ð2Þ

where a, b and c are the regression coefficients. Fig. (3a) shows the correlation between daily global radiation and sunshine duration for Al-Madinah location. The correlation coefficient is 94%.

Fig. (3c) shows the correlation between the global solar irradiation and the relative humidity at Al-Madinah site. The correlation model is given by the following formula:

  G RH ¼ a2 þ b2 G0 RHmax

ð4Þ

where a2 and b2 are the coefficients of linear regression. The correlation coefficient is 72%.

3.2. Correlation between global solar irradiation and air temperature Fig. (3b) shows the correlation between the global solar irradiation and the air temperature at Al-Madinah. In order to evaluate the correlation model between the air temperature and the global solar irradiation received on a horizontal surface, we have considered the data measured from sunrise until midday and the data from midday until sunset. The linear regression for the experimental data is given by:

  G T ¼ a1 þ b1 G0 T max

ð3Þ

where a1 and b1 are the coefficients of linear regression. The correlation coefficient is 68%, which is less than that mentioned above (in the case of global solar irradiation and sunshine duration).

4. Artificial neural network and FPGA In this section, a brief introduction to artificial neural network, FPGA and the different steps for implementing the MultiLayer Perceptron on FPGA, which will be used in this work is presented. 4.1. Artificial neural network ANNs have been used in many applications in science and engineering. An ANN is a parallel and distributed network of simple nonlinear processing units interconnected in a layered arrangement. Parallelism, modularity and dynamic adaptation are the three computational characteristics typically associated with ANNs (Zhu & Sutton, 2003).

2672

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

Input layer

Hidden ayers

"

Output layer

yj ¼ f

X

! wij :xij

# þ bj

ð5Þ

i

2 1 ð1 þ e2yi Þ

x1

y1

f ðyi Þ ¼

x2

y2

x3

y3

xn

yn

where yj is the output of the processing unit, wij the synaptic weight coefficient of the ith input of the processing unit, bj is the bias. The sigmoid function generates a continuous output between 0 and 1 as the neuron’s net input goes from negative to positive infinity. It is defined as a strictly increasing function that exhibits smoothness and asymptotic properties. The sigmoid function is differentiable, which is an important feature of neural network theory, as will be described later.

Fig. (4a). Schematic diagram of a multi-layer feed-forward neural network.

x1j x1j xij

w1j w1j wij

∑ ∫

yj Activation function

Weights adder

Fig. (4b). Information processing in a neural network unit.

Back-propagation (BP) has been widely adopted as a successful learning rule to find the appropriate values of the weights for NNs. The MLP consists of various layers: an input and output ones and between of them lie one or several hidden ones whose outputs are not observable. These layers are based on some processing unit (neurons) interconnected by means of feed-forward pondered links as shown in Fig. (4a). All these processing units carry out the same operation as shown in Fig. (4b), i.e., the sum of their weight inputs (see Eq. 5). Then they apply the result to a nonlinear function, named, activation function, which is generally based on the tangent sigmoid function (see Eq. 6) and is the most frequently used in the feed-forward type of ANN.

ð6Þ

4.2. Filed Programmable Gate Array (FPGA) FPGAs are a form of programmable logic (Amos, Omondi, & Aajapakse, 2006), which offer flexibility in design like software, but with performance speeds closer to Application-Specific Integrated Circuits (ASICs). With the ability to be reconfigured an endless number of times after having been manufactured, FPGAs have traditionally been used as a prototyping tool for hardware designers. However, as growing capacities of FPGAs have increased over the years, so has their use in reconfigurable computing applications. The fundamental architecture of Xilinx FPGAs consists of a twodimensional array of programmable logic blocks, referred to as Configurable Logic Blocks (CLBs). Fig. 5 shows the architecture of a CLB from the Xilinx Virtex-E family of FPGAs, which contains four logic cells (LCs) and is organized in two similar slices. Each LC includes a 4-input lookup table (LUT), dedicated to fast carry-look ahead logic for arithmetic functions, and a storage element (i.e., a flip-flop). A CLB from the Xilinx Virtex-II family of FPGAs, on the other hand, contains eight 4-input LUTs, and is over twice the amount of logic as a Virtex-E CLB. As we will see, the discrepancies in CLB architecture from one family to another are important factors to take into consideration when comparing the spatial requirements (in terms of CLBs) for circuit designs which have been implemented on different Xilinx FPGAs (Amos et al., 2006). 4.3. FPGA-based implementation of MLP Neural network implementations on FPGAs have to deal with the usual issues of digital hardware implementations of neural network applications. But these issues become more acute because of

Fig. 5. Virtex-E configurable logic block.

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

Weight w

x

Output data (wk*xk+ wk-1*xk-1+,…)

Input data x

+

Fig. (6a). Multiply-accumulate module (MAC).

the specific constraints of FPGAs: this is particularly obvious when it is a matter of area consumption. Even if the software-like use of FPGAs is simple, the user should not forget that the compiler has to deal with these strong constraints. Nowadays, several techniques have been proposed for implementing the MLP on the FPGA; most of them can be found in Amos et al. (2006). The different steps for the implementation of the MLP on FPGA are presented in the following subsection. 4.3.1. Elementary neuron implementation The neuron function consists in calculating the pondered sum P  function wij xi and updating the state of the neuron by applying the activation function. The basic units of the neuron are:  Calculation unit of the pondered sum (MAC) Several types of adders can be used to achieve the states of the pondered sum: combinative, in series, dynamic, etc. (Pedroni, 2004). In the same way, there are several ways to realize the multiplication; the most classical are: in series, series/parallel and completely parallel. However, the use of the FPGA technology imposes constraints on surface (size). In order to decrease the area (or surface) needed by a numeric multiplier, various methods are presented in the literature. As an example, we can mention the possibility to use arithmetic units of calculation ‘series’. This technique needs registers of transformation series/parallel, which permits the elimination of the coding buses of information and therefore the clutter. Considering the number of calculations necessary for the simulation of the MLP network and the time granted to do these calculations, we did not consider it necessary to use this last technique. The multiplier of 18 bits optimized for the Xilinx bookstore proved to be quite sufficient (Mekki, Mellit, Salhi, & Khaled, 2008). Thus, this MAC (Multiply-Accumulate) is used which in our case has been realized by a multiplier of 18 bits associated to an adder smoothed on it in order to get an accumulation as shown in Fig. (6a).  Approximation unit for the activation function (AF)

proaches to approximate the sigmoid function with simple FPGA designs. The first one is linear approximation described by a combination of lines in the form y = ax + b which is used to approximate the sigmoid function. Note that if the coefficients for the lines are chosen to be of the power of two, the sigmoid functions can be realized by a series of shift and add operations. Many implementations of neuron transfer functions use such linear approximations. The second method is look-up tables, in which uniform samples taken from the centre of a sigmoid function can be stored in a table for lookup. The regions outside the centre of the sigmoid function are still approximated in a linear segment. In our study we have chosen the first approach, so in order to simplify the function expression, this was linearized on several intervals [Ci, Ci+1] and its values are evaluated using two constants (ai and bi) corresponding to this intervals (Amos et al., 2006; Mekki et al., 2008), so:



f ðxi Þ ¼ ai xi þ bi

if xi 2 ½ci ; ciþ1 :

f ðxÞ ¼ 1

if x > 3:

Selecting weights precision is one of the important choices when implementing ANNs on FPGAs. Weight precision is used to trade-off the capabilities of the realized ANNs against the implementation cost. A higher weight precision means fewer quantization errors in the final implementations, while a lower precision leads to simpler designs, greater speed and reductions in area requirements and power consumption (Pedroni, 2004). In the function neuron, the weights are saved in a ROM memory; the size of this memory will be defined according to the position of the neuron in the network (i layer), and the number of inputs. Therefore, the ROM of the input neuron store only two weights (w1, w2) and the bias b (see Fig. (6b)). where i is the number of layers and i = 1 is the input layer. For i > 1:

T ROMðiÞ ¼ Nneuronði1Þ þ 1

4.3.2. Techniques used in the numeric neural calculator The neural networks are especially adapted to the parallel calculation. In the working phase, for a multilayer network, different possibilities of parallelism can be exploited. We present two of them: – Parallelism in the layers. – Parallelism in the calculation of the product and the sum of the product.

w1 w2

d 18

b Fig. (6b). ROM module for the neuron in the input layer.

ð8Þ

where: TROM(i) the size of the ROM of the layer i. Nneurone(i1) is the number of neurons in the layer i  1. By using the developed three units (MAC, AF and ROM unit), we can construct the elementary neuron which is shown in Fig. 7.

ROM

2

ð7Þ

 Storage unit of the weights and bias (ROM)

The activation function used is Tangent-sigmoid (Eq. 7) which is very difficult and direct implementation for nonlinear sigmoid transfer functions is very expensive. There are two practical ap-

adr

2673

Fig. 7. Neural processor architecture (the elementary neuron).

2674

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

Fig. 8. Parallelism of pipe-line.

T

T

S

G

RH

S

G

t

t

(a)

(b)

T

RH

RH

G

t

S

G

t

(c)

T

(d)

G

t

S

G

t

(e)

(f)

Fig. 9. The different MLP-predictors: (a) G ¼ ~f ðt; S; T; RHÞ, (b) G ¼ ~f ðt; T; SÞ, (c) G ¼ ~f ðt; T; RHÞ, (d) G ¼ ~f ðt; S; RHÞ, (e) G ¼ ~f ðTÞ, and (f) G ¼ ~f ðSÞ.

4.3.3. Pipeline technique The inter-layers parallelism consists in exploiting the flood of data. The relaxation time is generally obtained by measuring the

separating time of the presentation from a stimulus in input and the evaluation at the output of the network (i.e., the propagation time in the network). The calculations set is divided in different

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

modules of treatment (layers) put tip-to-tip. This technique, named ‘pipe-line’, permits the decrease of length of the calculation cycle (Pedroni, 2004). In the case of neural networks, each module can be made up of one or several layers of the network and the objective is to separate the calculation quantity in autonomous tasks, so that the computing time of each task is less than the total cycle time. Fig. 8 shows the pipe-line technique for a network of three layers with a separation following every layer. It represents the three steps of time and propagation of the calculations corresponding to different stimuli. 4.3.4. Coding data According to the literature research on the implementation of the different types of numeric applications in VLSI technology, it was noted that the representation in fixed-point is the more widely used because it is very easy to be implemented than the representation in floating-point and most digital computers support only this type of representation (Nelson & Marcelo, 2002). In our study, a representation in fixed-point on 18 bits is chosen (9 bits for the integer part and 9 bits for real part), because the FPGA circuits used in this study contain multipliers of 18 bits, which facilitate the realization of the MAC (multiply-accumulate) that represents the main element of the neuron (Mekki et al., 2008).

2675

3. Design the developed configuration through hardware description languages (VHDLs), which is chosen in this study. 4. Test and simulate the developed configuration using ModelSimÒ. 5. Design implementation consisting of: (a) Mapping: conversion of the VHDL representations into the structures which the target device will consist of. (b) Placement: the mapped logic blocks are settled into specific configurable logic blocks of the target device. (c) Routing: connection between the selected configurable logic blocks by means of routing resources provided by the adapted FPGA XilinxÒ Virtex-II (XC2v1000) device. (d) Back annotation: a representation of the place and routed design is produced including timing data for logic and routing delays. 6. Timing simulation for assessing design performance taking into account back annotation results. 7. Download the bit-stream file into the target device to make it operative. 5.1. MLP-based prediction of global solar irradiation A MLP is employed for prediction of global solar irradiation from other meteorological data. The different MLP-configurations used are:

5. Methodology and implementation In this section, the different steps for implementing an intelligent predictor for solar irradiation from other meteorological parameters are presented. The procedure can be summarized as follows: 1. Define the inputs and the output of the employed MLP for different proposed configurations: ½G ¼ ~f ðt; T; S; RHÞ; G ¼ ~f ðt; T; SÞ; G ¼ ~f ðt; T; RHÞ; G ¼ ~f ðt; S; RHÞG ¼ ~f ðt; TÞ and G ¼ ~f ðt; SÞ. Where t is the time (day of year). 2. Select the best configurations according the simulation results carried out in MatlabÒ, based on the accuracy of the results compared with measured data as well as the economic confiscation (i.e., the configuration which does not need several sensors in its inputs for predicting and measuring irradiation, and simple MLP architecture).

Fig. (10b). Comparison between the activation function calculated by MatLab and simulated by VHDL.

Fig. (10a). Simulation results of the activation function in ModelSim.

2676

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

Fig. 11. The ROM simulation in ModelSim.

5.2. FPGA- based implementation

(1) G ¼ ~f ðt; T; S; RHÞ has as input parameters the air temperature, sunshine duration, relative humidity and the day of year, while the output is the global solar irradiation, shown in Fig. 9(a). (2) G ¼ ~f ðt; T; SÞ has as input parameters the air temperature,

(3)

(4)

(5)

(6)

Before starting the implementation of the developed best configurations (MLP-predictors) on FPGA, the elementary neuron, which can be used for construction of the network (MLP) is initially presented. The mathematical function expressed by a neuron must be formulated by simple elementary calculations (addition and multiplication), which allow the possibility to synthesize the neuron by the VHDL. The structural description of the neuron permits to specify some features, as the number of inputs and outputs, the activation function, and the size of the binary words (weight, word memory, etc.). As shown above, the elementary neuron is composed of three main elements which are; the MAC, the unit which allows the approximation of the activation function (AF), and the unit of the storage of weights and bias (ROM). As presented in Section 4.3, the MAC is the unit of the calculation which allows the calculation of the pondered

sunshine duration, and day of year, while the global solar irradiation in the output, shown in Fig. 9(b). G ¼ ~f ðt; T; RHÞ has as input parameters the air temperature, relative humidity, and day of year, while the output is the global solar irradiation, shown in Fig. 9(c). G ¼ ~f ðt; RH; SÞ has as input parameters the relative humidity, sunshine duration and day of year, while the output is the global solar irradiation, shown in Fig. 9(d). G ¼ ~f ðt; TÞ has as input parameters the air temperature and day of year, while the output is the global solar irradiation, shown in Fig. 9(e). G ¼ ~f ðt; SÞ has as input parameters only the sunshine duration and the day of year while the output is the global solar irradiation, shown in Fig. 9(f).

Table 1 Statistical test between measured and predicted global solar irradiation by MLP for different configurations.

Therefore, the inputs and output are fixed initially for each configuration; however, the number of hidden layers and the neurons within these layers are optimized during the learning process based on the value of the Root Mean Square Error (RMSE). A database of 1825 patterns is divided into two parts, a dataset of 1460 (4-years) patterns used for training the different MLP-predictors (configuration) and a dataset of 365 (1-year) patterns used for testing and validating each configuration. A soft computing program has been implemented for the prediction of the global solar irradiation based on the Levenberg–Marquardt (LM) algorithm (Haykin, 1999); MatLabÒ Ver. 7.5 is used in this simulation.

MLP-configuration

Architecture: input/hidden/output

RMSE

MBE

r

(1) G ¼ ~f ðt; T; S; RHÞ (2) G ¼ ~f ðt; T; SÞ

441

0.00110

4.836

0.9720

3 41

0.00110

4.622

0.9744

(3) G ¼ ~f ðt; T; RHÞ (4) G ¼ ~f ðt; S; RHÞ

341

0.00290

6.448

0.8978

341

0.00120

4.717

0.9731

(5) G ¼ ~f ðt; TÞ (6) G ¼ ~f ðt; SÞ

241

0.00414

6.3430

0.8927

241

0.00127

4.7156

0.9724

layer i

layer i+1 Neuron1

Neuron1

Control line

18

M U X

18

Neuron j

18

Neuronj

Sel

Adr Controller Fig. 12. Parallel implementation of a neural network.

2677

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685 9000

9000 Measured MLP-Predicted

7000 6000 5000 4000 3000 2000 1000 0 1450

Measured MLP-Predicted

8000 Global horizontal irradiation, (Wh/m²/day)

Global horizontal irradiation, (Wh/m²/day)

8000

7000 6000 5000 4000 3000 2000 1000

1500

1550

1600

1650

1700

1750

1800

0 1450

1850

1500

1550

Time (days)

1600

1650

(a)

Global horizontal irradiation, (Wh/m²/day)

Global horizontal irradiance, (Wh/m²/day)

1850

7000 6000 5000 4000 3000

Measured MLP-Predicted

8000 7000 6000 5000 4000 3000 2000

2000

1500

1550

1600

1650

1700

1750

1800

1000 1450

1850

1500

1550

1600

1650

1700

1750

1800

1850

Time (days)

Time (days)

(c)

(d)

9000

9000 Measured MLP-Predicted

7000 6000 5000 4000 3000 2000

Measured MLP-Predicted

8000 Global horizontal irradiation, (Wh/m²/day)

8000 Global horizontal irradiation, (Wh/m²/day)

1800

9000 Measured MLP-Predicted

8000

1000 1450

1750

(b)

9000

1000 1450

1700

Time (days)

7000 6000 5000 4000 3000 2000

1500

1550

1600

1650

1700

1750

1800

1850

Time (days)

(e)

1000 1450

1500

1550

1600

1650

1700

1750

1800

1850

Time (days)

(f)

Fig. 13. Comparison between measured and predicted global solar radiation data for different configurations: (a) G ¼ ~f ðt; T; S; RHÞ, (b) G ¼ ~f ðt; T; SÞ, (c) G ¼ ~f ðt; T; RHÞ, (d) G ¼ ~f ðt; S; RHÞ, (e) G ¼ ~f ðt; TÞ, and (f) G ¼ ~f ðt; SÞ.

sum, therefore its description in VHDL consists in specifying the number of inputs, their sizes, as well as the operations

necessary for the accumulation and multiplication (addition and multiplication).

2678

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685 1

0.8

r=0.9720

0.7 0.6

MBE=4.836

0.5 0.4 0.3 0.2 0.1 0 1000

Measured MLP-predicted

0.9

Cumulative distribution function Fx

Cumulative distribution function Fx

0.9

1 Measured MLP-predicted

0.8

r=0.9744

0.7 0.6

MBE=4.622

0.5 0.4 0.3 0.2 0.1

2000

3000

4000

5000

6000

7000

8000

0 1000

9000

2000

3000

4000

x

r=0.8978 MBE=6.448

0.5 0.4 0.3 0.2 0.1

0.7 0.6

2000

3000

4000

5000

6000

7000

8000

7000

8000

9000

0.4 0.3 0.2

0 1000

2000

3000

4000

5000

x

(d) 1

Measured MLP-predicted

0.9

Cumulative distribution function Fx

Cumulative distribution function Fx

9000

0.5

9000

r=0.8927 MBE=6. 343

0.6 0.5 0.4 0.3 0.2 0.1 0 1000

8000

MBE=4.717

(c)

0.7

7000

r=0.9730

0.1

1

0.8

6000

0.8

x

0.9

9000

Measured MLP-predicted

0.9

0.6

0 1000

8000

1

Measured MLP-predicted

Cumulative distribution function Fx

Cumulative distribution function Fx

0.7

7000

(b)

1

0.8

6000

x

(a) 0.9

5000

Measured MLP-predicted

0.8 0.7 0.6

r=0.9724 MBE=4.715

0.5 0.4 0.3 0.2 0.1

2000

3000

4000

5000

6000

7000

8000

9000

0 1000

2000

3000

4000

5000

x

x

(e)

(f)

6000

Fig. 14. Cumulative distribution function between measured and predicted global solar irradiation data for different configurations: (a) G ¼ ~f ðt; T; S; RHÞ, (b) G ¼ ~f ðt; T; SÞ, (c) G ¼ ~f ðt; T; RHÞ, (d) G ¼ ~f ðt; S; RHÞ, (e) G ¼ ~f ðt; TÞ, and (f) G ¼ ~f ðt; SÞ.

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685 Table 2 Analysis of the best configurations. Configuration

Accuracy Simplest Availability, cost and r architecture efficiency

(1) G ¼ ~f ðt; T; S; RHÞ

0.9720

441

(2) G ¼ ~f ðt; T; SÞ

0. 9749

341

(3) G ¼ ~f ðt; T; RHÞ

0.8978

341

(4) G ¼ ~f ðt; S; RHÞ

0.9730

341

(5) G ¼ ~f ðt; TÞ

0.8927

241

(6) G ¼ ~f ðt; SÞ

0.9724

241

Expensive (sunshine duration sensor), not always available and simplest architecture Expensive (Sunshine duration sensor), not always available, accurate and simplest architecture Not expensive, sensors always available, not accurate, and simplest architecture Expensive (sunshine duration sensor), not always available, accurate and simplest architecture Not expensive, sensor always available, not accurate, and simplest architecture Expensive (Sunshine duration sensor), not always available, accurate and simplest architecture

The description in VHDL of the approximation unit of the activation function serves to find the approximation intervals, and the constants ai and bi which describe the linear segments defined as Yi = ai  X + bi. The structural description of a neuron with VHDL allows during the compiling step to specify generically some characteristics like the input numbers, the data size and even to modify the type of some arithmetic operators such as the adder or the multiplier and eventually the activation function unit if one wants to modify this function. Fig. (10a) presents the result of the activation function simulation under ModelSimÒ simulation platform. In order to show the accuracy of this function a comparison between the calculated activation function by MatLabÒ and with that estimated by the ModelSimÒ are made. The results are shown in Fig. (10b) and as can be seen a good agreement is obtained between the two activation functions. Concerning the description of the ROM in the VHDL we are interested in the declaration of the number of words memory (size of memory), the size of the bus address as well as the size of the words memory. Therefore, the neuron computes the product of its inputs with the corresponding weights, which are memorized in a ROM and then the results are added. Subsequently, the result is presented to a comparison unit designed to represent an appropriate sigmoid function. The simulation of the ROM module is shown in Fig. 11. In order to develop the neuron in its numeric format, the three main elements described above will be used. The VHDL description of the neuron module is presented in Appendix A. Based on the level of parallelisms given by various configurations, we can affirm that the neural network can be classified into two groups (Ortigosa et al., 2006): – The first one is called configuration of down-level parallelism, which consists of implementing completely the operation of the network based only on one neuron, and a unit of control; this last reconfigure the neuron by the modification of the weights and the inputs of the network. The advantage of this technique is that it is less gluttonous in surface; the inconvenience is the risk of performance loss (speed of calculation). – The second is called configuration of high-level parallelism, it is based on the interconnection of all neurons of the network

2679

architecture, this type of development is solely valid for networks of small size (according to the size of the targets circuit). The advantage of this technique is the quick calculation performance (computing time). This is the configuration used in this study (see Fig. 12). The hardware implementation of the MLP on FPGA is based on two main elements (Mekki et al., 2008): The first one is the controller, and the second is the neuron function. The controller is like a state machine, which links the necessary calculation steps in order to reproduce a propagation of the MLP network. It consists of a management module of the control signals (CE0, CE1 and Load), and a module generation of the signals for data selection (SEL0, and SEL1) through the multiplexers, and the addresses signals (ADR0, and ADR1) of the ROM containing the weights and bias. 6. Results and discussion This section is subdivided into three subsections: the first one concerns with the MatLab simulation results while the second section deals with the results obtained by using the VHDL as well as the simulation results on ModelSim. The FPGA-implementation of the developed models (MLP-predictors) is presented in the third subsection. 6.1. MatLab-simulation results For several simulations, the best performance for each configuration as well as the statistical test between measured and predicted global solar irradiation is illustrated in Table 1. Fig. 13 shows a comparison between the measured and the predicted global solar irradiation for the different configurations. As can be seen from these curves, the obtained results by the first, second, fourth and sixth configurations are very close with the actual data, which the network has not seen before. The rest of the configurations (the third and fifth) cannot provide very acceptable results. It should be noted from Table 1 that one hidden layer within four neurons is sufficient for predicting the global solar irradiation data; the simplest architecture can be implemented very easily and does not need a lot of space on the FPGA. Fig. 14 illustrates the cumulative distribution function between measured and predicted data. The correlation coefficient obtained is between 89% and 97%, and the MBE varied between 4% and 6%. We can conclude that the sunshine duration increases clearly the performance of the predictor, however, the relative humidity cannot influence the accuracy. When only one parameter is used as input it is clearly proven that the sixth model which has as input only the sunshine duration provides much better results than the fifth predictor which has as input only the air temperature. However, the problem now is to choose the best and more suitable configuration for renewable energy applications and other fields (climate, agriculture, etc.). Therefore, in order to select which one will be used for implementing into FPGA the following criteria are defined: – Accuracy (correlation coefficient). – Simplicity of the architecture (number of hidden layers, and neurons within hidden layers). – Availability and the cost of the sensors used (which one is cheaper, T, RH or S sensors, and most available). Based on the above criteria and according to the results presented in Table 2, we can select two configurations; the second and the third. Therefore the former ½G ¼ ~f ðt; T; SÞ can provide more accurate results but it is expensive and the sensor required

2680

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

Fig. 15. The numeric architecture for both MLP-Predictors: (a) G ¼ ~f ðt; T; SÞ and (b) G ¼ ~f ðt; T; RHÞ.

for sunshine duration is not always available, especially in underdevelopment countries (Mellit et al., 2008) and the latter ½G ¼ ~f ðt; T; RHÞ is not as accurate, but can provide acceptable results, is not expensive and the sensors used (air temperature and relative humidity) are always available. In fact, the former is very suitable for applications which need more accuracy, while the latter for applications that do not need very accurate results. Therefore, the developed MLP-predictors can be given by the following formula: 80 19 M < = X 2 @ ~¼  P P   1A w2 ðkÞb2 ðkÞ y M N : 1 þ exp  ; w ði; jÞxðiÞ þ b k¼1 j¼1

i¼1

1

1

ð9Þ

where w1, w2, b1 and b2 are the weights and bias of the networks, respectively, x represents the inputs data which can be the sunshine duration, air temperature, and day of year or relative humidity ~ is the predicted global solar irradia(according to the predictor). y tion, M and N are the number of neurons in the hidden layer and in the input layer, respectively. The experimental values of w1, w2, b1 and b2 for both MLP-predictors can be seen in Appendix B. 6.2. VHDL-simulation results Once both configurations ½G ¼ ~f ðt; S; TÞ and G ¼ ~f ðt; T; RHÞ are optimized with respect to the number of hidden layers and the number of the neurons within each layer, the weights and bias are saved for each configuration in order to be used for the

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

2681

Fig. 16. Simulation results by using ModelSimÒ: (a) G ¼ ~f ðt; T; SÞ and (b) G ¼ ~f ðt; T; RHÞ.

implementation of the MLP-predictor on the FPGA. The ISE Ver. 10.1 of Xilinx is used in the present study for developing the VHDL source code. The choice of VHDL is justified by its flexibility and the fact that it is a standard language (IEEE 1076). Furthermore, it is a target device and independent designing tool, i.e., with one design description and many device architectures can be included. Soft computing programs were written by using the VHDL and the different data used in this study have been coded on 18 bits in fixed-point (as described above). To be more specific, this can be easily represented as std_logic_vector type, which is the most suitable data type for digital processing in an FPGA, and then the ModelSimÒ software is used for simulation of the developed configurations on VHDL. The numeric architectures of these predictors are shown in Fig. 15(a) and (b). They contain 3 + 4 + 1 elementary neurons, Mux_12x2x1, Mux_18x8x1, Mux_18x16x1 and the control unit. The simulation result by using the ModelSim is presented in Fig. 16(a) and (b), where T is the air temperature, S is the sunshine duration, RH is the relative humidity and G is the global solar radiation. A comparison between MatLab and VHDL results is presented in Fig. 17(a) and (b) for the designed MLP-predictors ½G ¼ ~f ðt; T; SÞ and G ¼ ~f ðt; T; RHÞ. As can be seen a good agree-

ment is obtained between both series and also the correlation coefficient r is about 99%. These results show the effectiveness of the implemented MLP-predictors on VHDL. Subsequently, by using the Virtex-II FPGA (XC2v1000) board of Xilinx the proposed architectures will be implemented and tested. 6.3. FPGA-implementation of MLP-predictors The implementation of the designed MLP-predictors ½G ¼ ~f ðt; T; SÞ and G ¼ ~f ðt; T; RHÞ was achieved using a XilinxÒ Virtex-II FPGA (XC2v1000) from Xilinx (see Fig. 18). This FPGA has 3072 slices and 6114 logic cells. The FPGA has also thirtytwo 18  18 multipliers, as well as thirty-two 18 K bit modules of dedicated dual-port RAM. Fig. 19 shows the Register Transfer Level (RTL) schematic of both MLP-predictors. Table 3 illustrates the FPGA logic resources used to develop the predictors addressed in this paper. Therefore, once the bit-stream files for both MLP-predictors are downloaded into the target device to make it operative, the final step is to develop the experimental realization of the electronics hardware circuit. A simplified schematic of this electronics board is shown in Fig. 20. The designed circuit contains: two sensors for the sunshine duration and air temperature ½G ¼ ~f ðt; T; SÞ, or relative humidity and air temperature ½G ¼ ~f ðt; T; RHÞ, conditioning circuits, A/D

2682

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

ModelSim-predicted solar irradiation,(Wh/m²/day)

9000

Second model:

8000

~ G = f (t , T , S )

r=99.84% 7000 6000 5000 4000 3000 2000 1000 0

0

1000

2000 3000 4000 5000 6000 7000 MatLab-predicted solar irradiation,(Wh/m²/day)

8000

9000

8000

9000

(a)

ModelSim-predicted solar irradiation,(Wh/m²/day)

9000 8000

Third model:

~ G = f (t , T , RH )

r=99.54% 7000 6000 5000 4000 3000 2000 1000

0

1000

2000

3000

4000

5000

6000

7000

MatLab-predicted solar irradiation,(Wh/m²/day)

(b) Fig. 17. Comparison between MatlabÒ and ModelSimÒ results: (a) G ¼ ~f ðt; T; SÞ and (b) G ¼ ~f ðt; T; RHÞ.

converters, Joint Test Action Group (JTAG) and FPGA device. The proposed configuration will be developed for the second part of this paper (Experimental validation). 7. Conclusion and future actions In this paper, intelligent predictors for solar irradiation are proposed and implemented into reconfigurable FPGA Virtex-II (XC2v1000). A MLP network is used for developing the solar irradiation predictor based on some meteorological data (air temperature, sunshine duration and relative humidity). The accuracy and the generalization of the MLP in the system prediction have been demonstrated by comparing the test results with actual data.

Two MLP-predictors have been chosen based on cost, accuracy and availability of the sensors. The proposed predictors are suitable for the particular area considered climatic conditions; however, they can also be used in areas that have similar environmental conditions. Therefore, in order to develop a semi-global predictor, a large database would be used for several areas (varied climatic conditions). The proposed hardware devices can be considered as sensors for measuring the global solar irradiation from air temperature, relative humidity or sunshine duration in areas where there are no instruments for measuring the solar irradiation data. Some other geographical parameters (latitude, longitude, Albedo, etc.) may improve the accuracy of the proposed predictors.

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

2683

Fig. 18. The used VirtexÒ-II FPGA (XC2v1000) development board.

Fig. 19. The Register Transfer Level (RTL) schematic of both MLP-predictors for both predictors G ¼ ~f ðt; T; SÞ and G ¼ ~f ðt; T; RHÞ.

The designed predictors have huge potential in industrial electronics for developing intelligent sensors for solar irradiation based on the FPGA hardware. Our future actions can be summarized as follows:

Table 3 Synthesis report of the implemented MLP-predictors. Device utilization summary (estimated values) Logic utilization

Used

Available

Utilization (%)

Number Number Number Number Number Number

1331 404 2374 75 17 2

5120 10240 10240 324 40 16

25 3 23 23 42 12

of of of of of of

slices slice flip-flops 4 input LUTs bonded IOBs MULT18X18s CLKs

 Experimental realization of the developed predictors on FPGA for real-time measuring of solar irradiation (electronics board) by taking in account the expenditure required.  Improve the accuracy of the designed predictors by using a large dataset and introducing some geographical parameters.  Modification of the prediction times at 1 h, 10 min, etc.

2684

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

Time 12 bits

Air temperature sensor

Conditioning circuit

A/D Converter

Sunshine duration sensor

Conditioning circuit

A/D Converter

12 bits

FPGA Virtex II Xilinx® (XC2v1000)

12 bits

EPROM (Bit_stream files): MLP-predictors

or

Relative humidity sensor 12 bits Global Solar Irradiation

JTAG Cable

Plug-in Data Acquisition Board MatLab® ISE 10.1:(VHDL code sources) ModelSim® LabView®

Parallel Port

PC Fig. 20. Simplified schematic of the proposed electronics board.

Acknowledgment The first author would like to thank the International Centre for Theoretical Physics (ICTP), Trieste (Italy) for providing the materials and the computers facilities for performing the present work. This work was also supported by the Ministry of Higher Education & Scientific Research (Algiers) under project number: J0201720080012. Appendix A. The VHDL code source of the neuron module

Library declaration library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_SIGNED.ALL; Entity declaration of the neuron Entity Neurone_1_X is Generic ( constant W0:integer:=10; constant W1:integer:=20; constant W2:integer:=20; constant B: integer:=20 ); Port (X: in std_logic_vector (17 downto 0); adr: in std_logic_vector (1 downto 0); Ck: in std_logic; Ce: in std_logic; Load: in std_logic; En_S: in std_logic; S: out std_logic_vector (17 downto 0)); End Neurone_1_X;

Architecture of the neuron architecture Behavioral of Neurone_1_X is Component declaration of the ROM component ROM_3_X is generic (constant x0:integer:=10; constant x1:integer:=20; constant x2:integer:=20; constant Size: Natural:=32); port (adr: in std_logic_vector (1 downto 0); d: out std_logic_vector (Size-1 downto 0)); end component ROM_3_X; MAC declaration Component MAC is Port (X: in std_logic_vector (17 downto 0); Y: in std_logic_vector (17 downto 0); Z: in std_logic_vector (17 downto 0); A: out std_logic_vector (35 downto 0); CK: in std_logic; Ce: in std_logic; LOAD: in std_logic); end component MAC; Component declaration of activation function component seg_function is Port (X: in std_logic_vector (17 downto 0); Y: out std_logic_vector (17 downto 0); en_seg: in std_logic); end component; Signal W:std_logic_vector (17 downto 0); Signal A:std_logic_vector (17 downto 0); Signal Z:std_logic_vector (17 downto 0); Signal Y:std_logic_vector (17 downto 0);

A. Mellit et al. / Expert Systems with Applications 38 (2011) 2668–2685

begin ZW0,X1=>W1,X2=>W2,Size=>18) Port MAP (d=>W,adr=>adr); MACX:MAC Port MAP (X=>X,Y=>W,Z=>Z,CK=>CK,CE=>CE, LOAD=>LOAD,A (26 downto 9)=>A,A (35 downto 27)=> Y (8 downto 0),A (8 downto 0)=>Y (17 downto 9)); fun:seg_function port MAP (X=>A,en_Seg=>en_s,Y=>S); end Behavioral;

Appendix B. Weights and bias The weights and bias for the second MLP-predictorG ¼ ~f ðt; T; SÞ (one hidden layer within four neurons):

2

1:5150 0:2181

5:0313

3

6 1:5028 0:2685 5:0393 7 7 6 w1 ¼ 6 7; 4 0:0553 1:6722 0:0926 5

2

6 6 b1 ¼ 6 4

3

6 15:1699 7 7 6 w2 ¼ 6 7; 4 69:9007 5

5:0221 18:137 191:41 3 1:9540 2:0199 7 7 7 and b2 ¼ ½69:8752 4:0259 5

2

15:2070

0:0255

14:7969 The weights and bias for the third MLP-predictor G ¼ ~f ðt; T; RHÞ (one hidden layer within four neurons):

2

0:1005

0:0735

3:5152

3

6 0:0629 0:0236 3:4991 7 7 6 w1 ¼ 6 7; 4 179:8510 9:3032 91:2333 5 0:5047 6:2012 1:5861 3 1:5598 6 1:6246 7 7 6 b1 ¼ 6 7 b2 ¼ ½0:0924 4 112:8772 5 2

2

18:2444

3

6 18:2686 7 7 6 w2 ¼ 6 7; 4 0:0338 5 0:2029

4:7203 References Adnan, S., Arcakly´ogclu, E., Ozalp, M., & Agclar, N. C. (2005). Forecasting based on neural network approach of solar potential in Turkey. Renewable Energy, 30, 1075–1090. Aguiar, R. J., & Collares-Perreira, M. (1992). T.A.G.A time dependent autoregressive Gaussian model for generating synthetic hourly radiation. Solar Energy, 49(3), 167–174. Allen, R. G. (1997). Self-calibrating method for estimating solar radiation from air temperature. Journal of Hydraulic Engineering, 2(2), 56–67. Amos, B., Omondi, C., & Aajapakse, J. (2006). FPGA implementations of neural networks. Springer. Angstrom, A. (1924). Solar and terrestrial radiation. Quarterly journal of the Royal Meteorological Society, 50, 121–126. Benghanem, M., Mellit, A., & Alamri, S. N. (2009). ANN-based modelling and estimation of daily global solar radiation data: A case study. Energy Conversion and Management, 50, 1644–1655. Bristow, K. L., & Campbell, G. S. (1984). On the relationship between incoming solar radiation and daily maximum and minimum temperature. Agricultural and Forest Meteorology, 31, 159–166. Cao, J. C., & Cao, S. H. (2006). Study of forecasting solar irradiance using neural networks with preprocessing sample data by wavelet analysis. Energy, 3, 3435–3445.

2685

Chandel, S. S., Agarwal, R. K., & Pandey, A. N. (2005). New correlation to estimate global solar radiation on horizontal surfaces using sunshine hour and temperature data for indian sites. Journal of Solar Energy Engineering, 127, 417–420. David, B. A., & Atsu, S. S. D. (1999). Estimation of solar radiation from the number of sunshine hours. Applied Energy, 63, 161–167. Gomez, V., & Casanovas, A. (2003). Fuzzy modeling of solar irradiance on inclined surfaces. Solar Energy, 75, 307–315. Haykin, S. (1999). Neural network: A comprehensive foundation. Neural Network: Macmillan. Helen, C. (2007). Power estimating clear-sky beam irradiation from sunshine duration. Solar Energy, 71(4), 217–224. Hontoria, L., Aguilera, J., & Zufiria, P. (2005). An application of the multilayer perceptron: Solar radiation maps in Spain. Solar Energy, 79, 523–530. Maafi, A., & Adane, A. (1989). A two state Markovian model of global irradiation suitable for photovoltaic conversion. Solar Wind Technology, 6, 247–252. Mehreen, S., Muneer, G. T., & Kambezidis, H. D. (1998). Models for obtaining solar radiation from other meteorological data. Solar Energy, 64(1–3), 99–108. Mekki, H., Mellit, A., Salhi, H., & Khaled, B. (2008). FPGA-based implementation of multilayer perceptron for modelling of photovoltaic panel. American Institute of Physics A.I.P Conference Proceedings, 1019, 211–215. Mellit, A. (2008). Artificial intelligence technique for modeling and forecasting of solar radiation: A review. International Journal of Artificial intelligence and soft computing, 1(1), 52–76. Mellit, A., & Kalogirou, S. A. (2008). Artificial intelligence techniques for photovoltaic applications: A review. Progress in Energy and Combustion Science, 34, 574–632. Mellit, A. Hadj Arab, A., Khorissi, N., & Salhi, H. (2007). An ANFIS-based forecasting for solar radiation data from sunshine duration and ambient temperature. IEEE power engineering society general meeting, 24–28 June, 2007 (pp. 1–6). Florida, USA. Mellit, A., Benghanem, M., Hadj Arab A,. & Guessoum, A. (2004). Modeling of global solar radiation data from sunshine duration and temperature using the Radial Basis Function networks. The IASTED, MIC, February 22–25, 2004. Grindelwald, Switzerland (on CD-ROM). Mellit, A., Benghanem, M., Hadj Arab, A., & Guessoum, A. (2005). A simplified model for generating sequences of global radiation data for isolated sites: Using artificial neural network and a library of Markov transition Matrices. Solar Energy, 79(5), 468–482. Mellit, A., Benghanem, M., & Kalogirou, S. A. (2006). An adaptive wavelet-network model for forecasting daily total solar radiation. Applied Energy, 83(7), 705–722. Mellit, A., Kalogirou, S. A., Shaari, S., Salhi, H., & Hadj Arab, A. (2008). Methodology for predicting sequences of mean monthly clearness index and daily solar radiation data in remote areas: Application for sizing a stand-alone PV system. Renewable Energy, 33(7), 1570–1590. Mellit, A., Shaari, S., & Mekki, H. (2008). FPGA-based artificial neural network for prediction of solar radiation data from sunshine duration and air temperature. In IEEE international conference on computational technologies in electrical and electronics engineering (pp. 118–123). Novosibirsk, Russia, July 21–25, 2008. Mora-Lopez, L. L., & Sidrach-de-Cardona, M. (1998). Multiplicative ARMA models to generate hourly series of global irradiation. Solar Energy, 63, 283–291. Nelson, A., & Marcelo, T. (2002). Custom architectures for fuzzy and neural networks controllers. JCS&T, 2(2), 9–16. Ortigosa, E. M., Canas, A., Ros, E., Ortigosa, P. M., Mota, S., & Dıaz, J. (2006). Hardware description of multilayer perceptrons with different abstraction levels. Microprocessors and Microsystems, 30, 435–444. Pedroni, A. V. (2004). Circuit design with VHDL. London, England: MIT Press. Prieto, J. I., Martınez-Garcıa, J. C., & Garcıa, D. (2009). Correlation between global solar irradiation and air temperature in Asturias. Spain Solar Energy, 83, 1076–1085. Rehman, S., & Mohandes, M. (2008). Artificial neural network estimation of global solar radiation using air temperature and relative humidity. Energy Policy, 36, 571–576. Santos, J. M., & Pinazo, J. (2003). Canada Methodology for generating daily clearness index values Kt starting from the monthly average daily value Kt. Determining the daily sequence using stochastic models. Renewable Energy, 28, 1523–1544. Sen, Z. (1998). Fuzzy algorithm for estimation of solar irradiation from sunshine duration. Solar Energy, 63(1), 39–49. Sozen, A., Arcakly´ogclu, E., & Ozalp, M. (2004). Estimation of solar potential in Turkey by artificial neural networks using meteorological and geographical data. Energy Conversion and Management, 45(18–19), 3033–3052. Tymvios, F. S., Jacovides, C. P., Michaelides, S. C., & Scouteli, C. (2005). Comparative study of Ångström’s and artificial neural networks methodologies in estimating global solar radiation. Solar Energy, 78(6), 752–762. Zekai, S. (2008). Solar energy fundamentals and modelling techniques: Atmosphere environment climate change and renewable energy. Springer. Zhu, J., & Sutton, P. (2003). FPGA Implementations of neural networks – A survey of a decade of progress (pp. 1062–1066), Springer (Eds.): FPL, LNCS 2778.