error in code for research paper

1 view (last 30 days)
ALOK DUBEY
ALOK DUBEY on 8 May 2020
Commented: Sara on 29 Aug 2022
clear all;
clc;
%Hourly variation of climatic parameter and various temperatures (July 13, 2004)
t =[9 10 11 12 1 2 3 4]; %Time is in Hour
I=[366 528 704 660 639 323 167 298]; %intensity is in W\m2
Ta =[31 33 34 36 36 36 35 36]; % ambient temperature at diffrent time
Ti =[34.2 35.1 37.7 38.2 38.7 37.8 37.4 37.7]; %temperature of air at inlet at diffrent time
v = [2.83 3.9 4.3 4.83 4.47 4.8 3.63 3.83]; %velocity of air in duct at diffrent time
%diffrent parameters for calculation
alpha_c= 0.9;
bita_c=0.83;
tau_G=0.95;
tau=0.9;
ita_c= 0.15;
alpha_T= 0.5;
%(alpha*tau)eff= 0.656;
ca=1.005;
ma=0.002;
hc=7.98;
hr=3.47;
Li= 0.05;
Lc= 0.0003;
LT= 0.0005;
LG=0.003;
Lg=0.003;
Ki=0.035;
Kc=0.039;
KT=0.033;
KG=1;
Kg=0.04;
b=0.45;
L=1.2;
for i=1:8
Ti(i)=Ta(i);
ho(i)=5.7+3.8.*v(i);
hi(i)=2.8+3.*v(i);
UT=KT\LT;
Ut(i)=1.\(((LG.\KG)+(1.\(hc+hr))+(Lg.\Kg)+(1.\ho(i))));
Ub(i)=1.\(((Li.\Ki)+1.\hi(i)));
UtT(i)=1.\(((1.\UT)+(1.\Ut(i))));
Ut_air(i)=1.\(((1.\UtT(i))+(1.\hT)));
hT(i)=1.\((LT.\KT)+(1.\hi(i)));
UL=Ut_air(i)+Ub(i);
hp1(i)=(UT.\(Ut(i)+UT));
hp2(i)= (hT(i).\(UtT(i)+hT(i)));
To1(i)= ((((hp1.*hp2.*0.656.*I(i)).\UL)+I(i)).*(1-exp(((-b.*UL).\(ma.*ca)).*L)));
To2(i)=(Ti(i).*exp(((-b.*UL)\(ma.*ca)).*L));
To(i)=To1(i)+To2(i);
Tbs(i)= (((hp1.*0.656.*I(i))+(UtT(i).*Ta)+(hT.*To(i))).\(UtT(i)+hT(i)));
Tc(i)=((([alpha_c.*bita_c+alpha_T(1-bita_c)].*I(i))-(ita_c.*I(i).*bita_c)+(Ut(i).*Ta+UT.*Tbs(i))).\(Ut(i)+UT));
%Average air temperature over the length of air duct below PV module
Tavg(i)= (((hp1.*hp2.*0.656.*I(i).\UL)+I(i)).*(1-((1-exp(-b.*UL.\ma.*ca).*L).\(b.*UL.\ma.*ca))))+Ti(i).*((1-exp(-b.*UL.\ma.*ca).*L).\(b.*UL.\ma.*ca));
end
Ut
Ub
To
Tbs
Tc
Tavg
how to rectify error in code

Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 8 May 2020
Edited: KALYAN ACHARJYA on 8 May 2020
You have not defined/evaluated the ht variables, before to use it.
Ut_air(i)=1.\(((1.\UtT(i))+(1.\hT)));
%...............................^
In the later line, you have assigned hT(i), if it may work, moved the hT before the Ut_air(i) assignment
hT(i)=1.\((LT.\KT)+(1.\hi(i)));
Also note on hT as scalar and hT(i) as vector (same variable)?
  15 Comments
ALOK DUBEY
ALOK DUBEY on 8 May 2020
thanks a lot for reply sir. i did procedure you are telling but i am getting values which are out of range.
Sara
Sara on 29 Aug 2022
Thanks for sharing this type of informative article. I have learned some right stuff here. I really like your articles

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!