Professional Documents
Culture Documents
clear all;
lat = input('Enter the latitude:');
long=input('Enter the longitude:');
tilt_angle=input('Enter the tilt angle:');
time=input('Enter the time. Example for 2pm enter 1400:');
Llocal=input('Enter the local timemmeridian in degrees:');
date_n=input('Enter the day of the year, example for 10th Jan, Please enter 10:');
m=input('Enter the month of the year. Example for May. Please enter 5"');
date_1=0;
A = [0 1202 1187 1164 1130 1106 1092 1093 1107 1136 1136 1190 1204];
B = [0 0.141 0.142 0.149 0.164 0.177 0.185 0.186 0.182 0.165 0.152 0.144 0.141];
C = [0 0.103 0.104 0.109 0.120 0.130 0.137 0.138 0.134 0.121 0.111 0.106 0.103];
Month = [0 31 28 31 30 31 30 31 31 30 31 30 31];
%%%%%%%%%%%%%%%%%%%%%%%date calci%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
for i = 0:(m-1)
date_1 = Month(i) + date_1;
end
date = date_1+date_n;
%%%%%%%%%%%%%%%%Calculate z%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
z=((date-1)*(360/365));
Et=229.18*(0.000075+0.001868*cos(z)-0.032077*sin(z)-0.014615*cos(2*z)-
0.04089*sin(2*z));
d1=(360/365)*(284+date);
d=(23.45*sin(d1));
%%%%%%%%%%%%%%%%%%%%%%Calculation of Ib%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%
m_exp_cal = -(B(m)/Ii);
Ibn_exp= exp(m_exp_cal);
Ibn=A(m)*Ibn_exp;
Ib=Ibn*Ii;
%%%%%%%%%%%%%%%%%%%%%%%Calculation of Id%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%
Id=(C(m)*Ibn);
rb=rb_num/rb_denom;
rd=(((1+cos(tilt_angle)))/2);
Rr=0.6*((1-cos(tilt_angle))/2);
%%%%%%%%%%%%%%%%%%%%%%%%%%Calculation of It%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%
Ir=Ib+Id;