0% found this document useful (0 votes)
26 views

Prediction Method For Solar Power Using

The document discusses prediction methods for solar power output using linear regression and fuzzy logic. It describes developing a PV module model in Matlab/Simulink to predict solar output power based on temperature and irradiance data. Linear regression and fuzzy logic models are developed and compared to determine the maximum error between the two prediction methods.

Uploaded by

madhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Prediction Method For Solar Power Using

The document discusses prediction methods for solar power output using linear regression and fuzzy logic. It describes developing a PV module model in Matlab/Simulink to predict solar output power based on temperature and irradiance data. Linear regression and fuzzy logic models are developed and compared to determine the maximum error between the two prediction methods.

Uploaded by

madhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Progress in Engineering Application and Technology Vol. 2 No.

1 (2021) 653–666
© Universiti Tun Hussein Onn Malaysia Publisher’s Office

PEAT
Homepage: http://penerbit.uthm.edu.my/periodicals/index.php/peat
e-ISSN : 2773-5303

Prediction Method for Solar Power using


Linear Regression and Fuzzy Logic
Noor Izzah Mohd Abiden1, Nor Aira Zambri1*, Norhafiz
Salim2, Omar Abu Hassan1
1
Department of Electrical Engineering Technology, Faculty of Engineering
Technology,
Universiti Tun Hussein Onn Malaysia, 84600 Pagoh, Johor, MALAYSIA
2
Faculty of Electrical Engineering,
Universiti Teknikal Malaysia Melaka (UTeM), Jalan Hang Tuah Jaya, 76100 Durian
Tunggal, Melaka, MALAYSIA
*Corresponding Author Designation

DOI: https://doi.org/10.30880/peat.2021.02.02.063
Received 13 January 2021; Accepted 01 March 2021; Available online 25 June 2021

Abstract: The world is running out of fossil energy sources. Because of this, we are
searching for alternative energy sources for next generation energy needs. However,
solar energy may be the best choice for the future world because solar energy is the
most abundant renewable energy sources. Photovoltaic power is unpredictable and
depends on solar irradiation and temperature. Therefore, a prediction method is
required. The maximum error can be obtained using this prediction method. Fuzzy
logic system was used to get the accurate value of power. With the help from fuzzy
logic and linear regression, the maximum error will be shown accurately.

Keywords: PV Module, Fuzzy Logic, Linear Regression

1. Introduction
Nowadays, the depletion of fossil fuels become a crisis in energy sector. Because of this, we are
looking for new sources of energy for the energy needs of the next decade. We should also make all
forms of energy more environmentally, socially and economically sustainable. [1].
Taking into consideration, renewable energy sources such as solar, wind, hydropower and
geothermal energy are important because they are environmentally friendly. However, solar energy may
be the best choice for the future world because solar energy is the most abundant renewable energy
sources. Asian countries have the highest potential to receive more sunlight compared to other
temperate countries within a year. A lot of solar radiation is unused and wasted essentially [2].
Solar photovoltaic (PV) is becoming an integral component of our energy consumption and will
soon become an energy source to our world. Photovoltaic panels continue to be more efficient, keeping
solar power replacing other conventional sources of energy. Photovoltaic energy is unpredictable and
*Corresponding author: [email protected]
2021 UTHM Publisher. All right reserved.
penerbit.uthm.edu.my/periodicals/index.php/peat
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

depends on solar irradiation and other meteorological factors such as temperature, humidity,
precipitation, wind speed, and cloud coverage [3].
From the previous researchers some of them describe the same objective which is to collect data
for solar power using various parameter which are solar irradiation and temperature. The data for solar
irradiation and temperature used in this project collected at UTHM Parit Raja. The prediction method
used is different from this project. Linear regression and fuzzy logic are used from this project to
predicting the value of maximum error and RMSE values. It also to predict which predicting method
performance is better.
Fuzzy logic helps to conceptualizing the fuzziness in the system into a crisp quantifiable parameter.
Thus, fuzzy logic-based models can be adopted for effective energy planning to arrive at pragmatic
solutions. Fuzzy logic deals with reality and it is a form of many valued logic. It deals with reasoning
that is approximate having also linguistic values rather than crisp values. Fuzzy logic handles the
concept of truth value that ranges between completely true and completely false (0–1). Fuzzy logic has
been applied in many areas. Fuzzy logic and probability are different ways of indicating variability [4].
Linear regression is a supervised machine learning algorithm where the predicted output is
continuous and has a constant slope. Linear regression makes prediction for continuous/real or numeric
variables based on the value of another variable [5].
2. Methodology
Figure 1 shows the whole process of developing PV module, fuzzy logic and linear regresion in
Matlab/Simulink. The PV module was generated to predict the solar output power using two types of
parameters which are temperature and irradiance. The value of temperature and solar irradiance was
collected at UTHM Parit Raja. Then the data obtained will inserted in PV module simulink model to
predict the value of output power.
The input value of temperature and irradiance has been inserted in fuzzy logic system to get the
output power and current from that system. If the output result has error, the step will be repeated until
it show the best result from fuzzy logic system. Linear regression and fuzzy logic model has been
developed using matlab code to get the desired output. The results from linear regression and fuzzy
logic is been being compared to get the value of maximum error. The results data from the two
prediction method then been analysed. The PV Module supply for this project is 200 Watt.

654
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

Figure 1: Flow chart of the whole system

2.1 Modelling of PV module


There are many equivalent circuits of a solar cell, where the single-diode and two-diode models
could be the most commonly used. Since the single-diode model is simple and reliable enough in many
cases. The general model of solar or PV cell [6][7] shown in Figure 2. Equivalent circuit of solar cell
includes photocurrent source, diode, parallel resistor expressing the leakage current and series resistor
describing the internal resistance to the current flow. Table 1 shows constants and the variables used in
the PV module and Table 2 show module rating for modeling in Simulink.

655
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

Figure 2: Equivalent circuit of PV cell


Table 1: Constants and variables value for PV module

𝑰𝒑𝒉 Photo-current (A) 𝑰𝒑𝒉

𝑰𝒔𝒄 Short circuit current (A) 𝐼𝑠𝑐

𝒌𝒊 Short circuit current of cell at 25˚C and 1000𝑊/𝑚2 0.0032

𝑻 Operating temperature (K) 𝑇

𝑻𝒏 Nominal temperature (K) 298

𝑮 Solar irradiation (𝑊/𝑚2 ) 𝐺

𝒒 Electron charge (C) 1.6 X 10−19

𝑽𝒐𝒄 Open circuit voltage (V) 𝑉𝑜𝑐

𝑰𝒑𝒉 The identity factor of the diode 1.3

𝒏 Boltzmann’s constant (𝐽/𝐾) 1.38 X 10−23

𝑲 Band gap energy of the semiconductor (eV) 1.1

𝑬𝒈𝒐 Number of cells connected in series 54

𝑵𝒔 Number of PV modules connected in parallel 1

𝑵𝒑 Series resistance (Ω) 0.221

𝑹𝒔 Shunt resistance (Ω) 415.405

𝑹𝒔𝒉 Diode thermal voltage (V) -

656
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

Table 2: Specification of PV module


Rated power (V) 200 W

Voltage at maximum power (𝑽𝒎𝒑 ) 26.4 V


Current at maximum power (𝑰𝒎𝒑 ) 7.58 A
Open circuit voltage (𝑽𝒐𝒄 ) 32.9 V
Short circuit current (𝑰𝒔𝒄 ) 8.21 A
Total number of cells in series (𝑵𝒔 ) 54
Total number of cells in parallel (𝑵𝒑 ) 1

The simulation of PV module is carried out based on mathematical equations in Matlab/Simulink.


The different equations involved for the simulation of PV module are detailed below which divided into
five equations.
Saturation Current (𝐼0 ):
1 1
𝑇 𝑞.𝐸𝑔0 .( − )
𝑇𝑛 𝑇
𝐼0 = 𝐼𝑟𝑠 ( ). 𝑒𝑥𝑝 [ ] Eq. 1
𝑇𝑛 𝑛 .𝐾

Reversed Saturation Current (𝐼𝑟𝑠 ):


𝐼𝑠𝑐
𝐼𝑟𝑠 = 𝑞 .𝑉𝑜𝑐 Eq. 2
( )
𝑒 𝑛 .𝑁𝑠 .𝐾 .𝑇 −1

Shunt Current (𝐼𝑠ℎ ):

𝑉 + 𝐼 .𝑅𝑠
𝐼𝑠ℎ = ( ) Eq. 3
𝑅𝑠ℎ

Photo Current (𝐼𝑝ℎ ):


𝐺
𝐼𝑝ℎ = [𝐼𝑠𝑐 + 𝑘𝑖 . (𝑇 − 298)] . Eq. 4
1000

PV Current (I):
𝑞.(𝑉 + 𝐼 .𝑅𝑠 )
I = Iph − I0 . [exp(
𝑛 .𝐾 .𝑁𝑠 .𝑇
) − 1] − Ish Eq. 5

2.2 Simulink Model of PV Module


The simulink model of PV module is developed in Matlab/Simulink using equations 1-5 and each
equation is used to developed the subsystem shows in Figure 3. The five subsystems based on the
equations of saturation current, reversed saturation current, shunt current, photo current and PV current.
The final PV module is modeled by connecting all the subsystems in Matlab/Simulink. Three displays
block is used to get the output which are voltage, current and power and the input are temperature and
irradiance is shown in Figure 4.

657
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

Figure 3: Block diagram of PV Module

Figure 4: Block diagram of PV module with output display

3. Simulink Result
From the simulation results, there are three types of output. The output power from PV module is
obtained from the value of parameters used which are temperature and solar irradiance to get the output
power and current .Secondly, the value of output power from fuzzy logic will be obtained. Fuzzification,
inference and defuzzification process was used to obtain the predicted output power and current. Linear
regression will be perform in Matlab/Simulink using matlab code. The value of output power will be
normalized using matlab code then will be inserted in linear regression system to display the scatter
graph.
3.1 Performance of PV Module with different temperature and solar irradiance
The two inputs which are temperature and solar irradiance was used to get the output current,
voltage and power. The 350 set of input data are collected at UTHM Parit Raja and has been recorded
for every 30 minutes in a day. Table 3 shows the value of input and output from solar PV module in
Matlab/Simulink.

658
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

Table 3: Values of input and output from PV module

Input Output Display


Date Time Temperature Irradiance Current, Voltage, Power,
(ºC) (w/m2) I V P
7.00 AM 24.2 7 - 0.09403 25 -2.351
7.30 AM 24.6 70 0.4116 25 10.29
8.00 AM 25.1 134 0.9226 25 23.07
8.30 AM 26.1 185 1.318 25 32.96
5/11/2017 9.00 AM 26.3 267 1.976 25 49.40
9.30 AM 27.8 350 2.609 25 65.23
10.00 AM 28.9 281 2.028 25 50.69
10.30 AM 29.6 698 5.317 25 132.90
11.00 AM 30.1 510 3.812 25 95.30

3.2 Fuzzy Logic


Fuzzy Inference System (FIS) is included in this fuzzy logic system. Fuzzy inference is the
formulating process from input to output using fuzzy logic [8]. The process then provides the basis for
which the decision can be made by classifying the data caused by the desired output that has been set.
In this model Mamdani is used because it used both inference systems which are Multiple Input and
Single Output (MISO) and Multiple Input and Multiple Output (MIMO) systems while Sugeno only
used Multiple Input and Single Output (MISO) system. This system will have two input, temperature
and irradiance and three output which are current, voltage and power.
The fuzzy logic operation consists of three parts which are fuzzification of crisp values, inference
logic which includes IF-THEN logic and finally the defuzzification to obtain crisp output. Figure 5
shows the architecture of fuzzy logic system.
The output results from fuzzy logic in Figure 5 shows the value of current and power for all 350
sets of data. The value of current and power obtained to show the Fuzzy rules and membership functions
are constructed. The more data and information from current amplitudes is required, so membership
functions for low, medium and high will be created.

Figure 5: Architecture of Fuzzy Logic system

659
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

3.2.1 Fuzzification
Fuzzification is the process of decomposing a system input and/or output into one or more fuzzy
sets. The input and output uses same partition grid system in FIS system. It is a step that helps to convert
the inputs where crisp numbers are converted into fuzzy sets [9]. The fuzzifier are separated the input
signals into three state which are, “small”, “medium” or “high” Then, the sets are passes to the control
system for further processing. Figure 6-9 shows the membership function in fuzzy logic.
Fuzzy inference is the process of formulating the mapping from a given input to an output using
fuzzy logic. The rule used in this system are low, medium and high. Figure 10 shows the rule editor in
fuzzy logic system.

Figure 6: Input 1 (Temperature)

Figure 7: Input 2 (Irradiance)

660
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

Figure 8: Output 1 (Current)

Figure 9: Output 2 (Power)

Figure 10: Rule Editor

661
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

3.2.2 Defuzzification
The defuzzification is the inverse step of fuzzification which it transforms the fuzzy set into a crisp
set. It is typically needed in fuzzy control system. This will have a number of rule that transform a
number of variables into a fuzzy result that is described in term of membership in fuzzy set.
Defuzzification will interpreting the membership degrees of the fuzzy set into a specific decision or
value [10]. Figure 11 shows the defuzzification process in fuzzy logic system.
The final output for prediction can be demonstrated through surface view. This section is a fuzzy
implication that helps evaluate the rules involved.

Figure 11: Surface view for output Current and Power

3.3 linear regression


The output for actual data has been divided into testing and training. The value used for the training
is 70.00 % while for the testing is 30 % from 350 data sets.
The output power will be normalize using matlab code to plot the output scatter graph. The scatter
graph will show the value of correlation coefficient (r²), Mean Square Error (MSE), and Root Mean
Square Error (RMSE). The value of correlation coefficient lies between 0 to 1 and RMSE is lies between
0 to 100 %. If the correlation coefficient equal to 1, and RMSE is near 0 the smaller error that the system
will produce. The equation for linear regression is shown below.
Correlation coefficient:
𝑆𝑡 −𝑆𝑟
𝑟2 = 𝑆𝑡
Eq. 6

Total sum of the squares around the mean for the dependant variable:
𝑆𝑡 = (𝑦 − 𝑚𝑒𝑎𝑛 𝑦)² Eq. 7
Sum of the squares of residuals around the regression line:

662
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

𝑆𝑟 = 𝑒² Eq. 8

Error:
𝑒 = 𝑦 − (𝑎0 + 𝑎1 𝑥) Eq. 9
Slope:
𝑛 ∑ 𝑥𝑦−∑ 𝑥 ∑ 𝑦
𝑎1 = 𝑛 ∑ 𝑥²−(∑ 𝑥)²
Eq. 10

Intercept:
𝑎0 = 𝑚𝑒𝑎𝑛 𝑦 − 𝑎1 (𝑚𝑒𝑎𝑛 𝑥) Eq. 11
Mean x and y:
∑𝑥
𝑀𝑒𝑎𝑛 𝑥 = 𝑛
Eq. 12
∑𝑦
𝑀𝑒𝑎𝑛 𝑦 = 𝑛
Eq. 13

Arithmetic mean:
𝑦 = 𝑎0 + 𝑎1 𝑥 Eq. 14
RMSE:

RMSE = √(𝑓𝑜𝑟𝑒𝑐𝑎𝑠𝑡 𝑣𝑎𝑙𝑢𝑒𝑠 − 𝑜𝑏𝑠𝑒𝑟𝑣𝑒𝑑 𝑣𝑎𝑙𝑢𝑒𝑠)² Eq. 15

4. Results and Analysis


4.1 Fuzzy Logic
The input will undergo fuzzification process, then the degree of fulfillment of each rule is
calculated using the AND operator. Membership function output is then distributed to the degree of
fulfillment. All rules and final final membership function outputs aggregated by operator (THEN) to
produce the final fuzzy output. The output value will be affected by the selected defuzzification
technique process, so it is necessary to use an appropriate technique such as triangle shaped graph.
Figure 12 shows the input value of temperature and solar irradiance for 350 sets of data while output
value represents the current and power.
Based on the Table 4, the RPE % has been calculated using equation 16. the RPE shows the different
value between actual power and forecast power. The forecast power is obtained using fuzzy logic
system.
𝑃𝑓𝑜𝑟𝑒𝑐𝑎𝑠𝑡 −𝑃𝑎𝑐𝑡𝑢𝑎𝑙
∑𝑛𝑃𝑜𝑤𝑒𝑟=1 | | 𝑥 100% Eq. 16
𝑃𝑎𝑐𝑡𝑢𝑎𝑙

663
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

Figure 12: Fuzzy Logic output

Table 4: RPE values between fuzzy logic output and target

Input Output Display


Date Time Temperature Irradiance Power Power RPE,
(ºC) (w/m2) actual, forecast, %
P P
7.00 AM 24.2 7 -2.351 -2.23 5.15
7.30 AM 24.6 70 10.29 10.34 0.48
8.00 AM 25.1 134 23.07 23.10 0.13
8.30 AM 26.1 185 32.96 33.12 0.49
5/11/2017 9.00 AM 26.3 267 49.40 49.46 0.12
9.30 AM 27.8 350 65.23 65.42 0.29
10.00 AM 28.9 281 50.69 50.75 0.12
10.30 AM 29.6 698 132.90 133.50 0.45
11.00 AM 30.1 510 95.30 95.98 0.71

4.2 Linear Regression


Figure 13 shows the output for testing and training using linear regression in Matlab/Simulink. The
value used for the training is 70.00 % while for the testing is 30.00 % from 350 data sets. Then the data
will be normalize using matlab code to plot the output scatter graph. The closer the measured data, the
higher efficiency of the graph . So, if the target data approached measured data, the output value will
be more accurate.The value of correlation coefficient (r²), Mean Square Error (MSE), and Root Mean
Square Error (RMSE) will be shown in the graph. The value of correlation coefficient lies between 0 to

664
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

1 and RMSE is lies between 0 to 100.00 %. If the correlation coefficient equal to 1, and RMSE is near
0 the smaller error that the system will produce. The output value for the scatter graph from
Matlab/Simulink of MSE is 2.0078e+0.3, RMSE is 44.8087 and correlation coefficient is 0.0189. As
can be seen in figure, there is linear regression gap trend between the measured data and target data.
Based on the results it can be seen that the measured data slightly closed to the target. This is because
linear regression try to find a best straight line that fitted the data.

Figure 13: Scatter graph for linear regression

4.3 Summary
The fuzzy logic system and linear regression has been compared. Linear regression shows the
maximum error and RMSE value while fuzzy logic only shows the error power output value from the
solar irradiance and temperature. The best performance of prediction method is using linear regression
because the value of error is nearest 1. The value error in power for fuzzy logic was calculate between
output PV module using equation and the error is only between 10.00 %.
5. Conclusion
In conclusion, solar PV module has been developed in Matlab/Simulink to predict the output using
two types of parameters which are solar irradiance and temperature. The value of solar irradiance and
temperature obtained at UTHM Parit Raja in every 30 minutes in a day. In the beginning, learning about
fuzzy logic techniques needs to be mastered to identify the processes that will be involved to predicted
the output values. Then, the input values have been used to predict the output value of current and
power. Fuzzy logic used to give accurate reasoning to achieve the definite output. Linear regression are
used to predict the maximum error between training data and testing data . The training data used was
70 % of the 350 set output data while 30 % of testing data. If the value of correlation coefficient is 1 or
near 1, the RMSE will be 0 because all the points lie on the regression line and it also means that no
errors. The value of RMSE lies between 0 to 100 %, so the smaller value of RMSE the better because
there is only slightly error in that system.
References
[1] R. D. Q. D. Lqglu et al., “A Review of Data Mining and Solar Power Prediction,” vol. 5, pp.
3–7, 2016.

665
Abiden et al., Progress in Engineering Application and Technology Vol. 2 No. 1 (2021) p. 653-666

[2] N. Kannan and D. Vakeesan, “Solar energy for future world : - A review,” vol. 62, pp. 1092–
1105, 2016, doi: 10.1016/j.rser.2016.05.022.
[3] A. Shafi, H. Sharadga, and S. Hajimirza, “Design of Optimal Power Point Tracking Controller
Using Forecasted Photovoltaic Power and Demand,” vol. 3029, no. c, pp. 1–8, 2019, doi:
10.1109/TSTE.2019.2941862.
[4] X. Meng, “Dempster – Shafer based probabilistic fuzzy logic system for wind speed
prediction.”
[5] S. Prasanna, “Efficient Utilization of Non-Conventional Hybrid Energy system Using Arduino
and Fuzzy Logic,” pp. 580–583, 2013
[6] N. Abd, H. Wooi, and J. Selvaraj, “The 3 rd International Conference on Sustainable Future for
Human Security Photovoltaic module modeling using simulink / matlab,” Procedia Environ.
Sci., vol. 17, pp. 537–546, 2013, doi: 10.1016/j.proenv.2013.02.069.
[7] K. Ding, X. Bian, H. Liu, and T. Peng, “A MATLAB-Simulink-Based PV Module Model and
Its Application Under Conditions of Nonuniform Irradiance,” vol. 27, no. 4, pp. 864– 872,
2012.
[8] L. Suganthi, S. Iniyan, and A. A. Samuel, “Applications of fuzzy logic in renewable energy
systems – A review,” Renew. Sustain. Energy Rev., vol. 48, pp. 585–607, 2015, doi:
10.1016/j.rser.2015.04.037.
[9] M. S. Khireddine, N. Slimane, Y. Abdessemed, and M. T. Makhloufi, “Fault detection and
diagnosis in induction motor using artificial intelligence technique,” MATEC Web Conf., vol.
16, pp. 6–9, 2014, doi: 10.1051/matecconf/20141610004.
[10] N. Boumella, J. C. Figueroa, and S. Iqbal, “Generalized Orthogonality Principle,” 2012.

666

You might also like