International Journal of Photoenergy / 2015 / Article / Psdc 1

Research Article

A Model for Hourly Solar Radiation Data Generation from Daily Solar Radiation Data Using a Generalized Regression Artificial Neural Network

Pseudocode 1

% Start
clc
clear
close all
%  %— — — — — — —Input Data— — — — — —
fileName=Site.xlsx;
sheetName=hourly Solar radiation data;
L=; % add a latitude value
LOD=; % add a longitude value
% T means testing data
SRi=xlsread(fileName, sheetName, C3:C4358); % hourly solar radiation
Wi=xlsread(fileName, sheetName, D3:D4358); % hour angle
Wsi=xlsread(fileName, sheetName, E3:E4358); % sun set angle
GD=xlsread(fileName, sheetName, G3:G4358); % daily solar radiation
DN=xlsread(fileName, sheetName, F3:F4358); % day number (day & month)
h=xlsread(fileName, sheetName, I3:I4358); % hour
SRi_T=xlsread(fileName, sheetName, C4359:C8546);
Wi_T=xlsread(fileName, sheetName, D4359:D8546);
Wsi_T=xlsread(fileName, sheetName, E4359:E8546);
GD_T=xlsread(fileName, sheetName, G4359:G8546);
DN_T=xlsread(fileName, sheetName, F4359:F8546);
h_T=xlsread(fileName, sheetName, I4359:I8546);
SR=SRi1000;
SR_T=SRi_T1000;
W=(Wi_T(pi/180));
Ws=(abs(Wsi_T(pi/180)));
%=============Proposed GRNN Model=================
inputs=[L LOD Wi, Wsi, GD DN h];
I=inputs;
targets=SR;
T=targets;
net=newgrnn(I,T);
test=[L LOD Wi_T, Wsi_T, GD_T DN_T h_T];
Test=test;
x_predicted=sim(net,Test);
X_P=x_predicted;
%============Liu and Jordan Model==================
R_LiuJordan=((((pi)/24)(cos(W)-cos(Ws)))./(sin(Ws)-((piWs)/180).cos(Ws)));
SR_LiuJordan=R_LiuJordan.GD_T
%============Collares-Pereira and Rabel Model======
a=0.409+(0.5016sin(Ws-60));
b=0.6609+(0.4767sin(Ws-60));
R_Collares=((a + (b.cos(W))).((((pi/24))(cos(W)-cos(Ws))))./(sin(Ws)-((piWs)/180).cos(Ws)));
SR_Collares=R_Collares.GD_T;
%=================Plot data===========================
plot (SR_T)
xlim([0 100])
hold on
plot (SR_LiuJordan, k)
xlim([0 100])
hold on
plot (SR_Collares, g)
xlim([0 35])
hold on
plot (X_P, red)
xlim([0 100])
%— — — —Models evaluation— — — — — — — —
n=length(X_P);                                    
E3_Hour=SR_T-X_P;
GRNN_MAPE=abs(E3_Hour./SR_T);
GRNN_meanMAPE1=sum(GRNN_MAPE)/n;
GRNN_meanMAPE=GRNN_meanMAPE1100;
GRNN_RMSE=sqrt(sum((X_P-SR_T).2/n))
GRNN_MBE=sum(X_P-SR_T)/n
SUM=(sum(X_P)./n);
liner_RMSE_Percentage=(GRNN_RMSE/SUM)100
liner_MBE_Percentage=(GRNN_MBE/SUM)100
% End

Article of the Year Award: Outstanding research contributions of 2020, as selected by our Chief Editors. Read the winning articles.