how to solve equations
Show older comments
clc,clear
%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(t) = [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
ho = 5.7+3.8*v;
hi = 2.8+3*v;
alpha_c = 0.9;
bita_c = 0.83;
tau_G = 0.95;
tau = 0.9;
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;
UT = KT\LT;
Ut = 1\[((LG\KG)+(1\(hc+hr))+(Lg\Kg)+(1\ho))];
Ub = 1\[((Li\Ki)+1\hi)];
UtT = 1\[((1\UT)+(1\Ut))];
Ut_air = 1\[((1\UtT)+(1\hT))];
UL = Ut_air+Ub;
hp1 = UT\(Ut+UT);
hp2 = hT\(UtT+hT);
To = (((hp1*hp2*0.656*I(t)\UL)+I(t))*(1-exp(-b*UL\ma*ca)*L))+Ti*exp{(-b*UL\ma*ca)*L};
i am trying to solve for To at diffrent given value of I(t) at diffrent time. then i want to plot like the image attached.
please help me with siple method because i am new to this software and my thesis evaluation is stayed for this. thanks in advance

2 Comments
Star Strider
on 28 Apr 2020
Your Question is not at all clear.
What equations do you want to solve, and for what variables?
ALOK DUBEY
on 28 Apr 2020
Answers (1)
Star Strider
on 28 Apr 2020
There were a number of errors in your code, and some may still exist. I corrected the ones I was certain of.
In this (now vectorised) code, ‘To’ is an (8x8) matrix. Be certain that you are using the mldivide,\ function correctly, and that you do not intend rdivide,/, and specifically the vectorised (element-wise) version of rdivide (./) instead:
%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
ho=5.7+3.8*v;
hi=2.8+3*v;
alpha_c= 0.9;
bita_c=0.83;
tau_G=0.95;
tau=0.9;
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;
hT = 0.5;
UT=KT\LT;
Ut=1\[((LG\KG)+(1\(hc+hr))+(Lg\Kg)+(1\ho))];
Ub=1\[((Li\Ki)+1\hi)];
UtT=1\[((1\UT)+(1\Ut))];
Ut_air=1\[((1\UtT)+(1\hT))];
UL=Ut_air+Ub;
hp1=UT\(Ut+UT);
hp2= hT\(UtT+hT);
To= (((hp1.*hp2.*0.656.*I\UL)+I).*(1-exp(-b.*UL\ma.*ca).*L))+Ti.*exp((-b.*UL\ma.*ca).*L);
figure
plot(I, To)
grid
.
7 Comments
ALOK DUBEY
on 28 Apr 2020
Star Strider
on 29 Apr 2020
As I mentioned in my Answer, please be certain that you are using the correct division operators, and that the variables are in the correct order in the equation with respect to the division operators.
I strongly suspect that you do not want to be using the mldivide,\ function here, however I have no idea what the original equations were so I have no idea how to correct those.
ALOK DUBEY
on 29 Apr 2020
Star Strider
on 29 Apr 2020
You can attach it here as a PDF. I cannot promise that it will solve the problem.
ALOK DUBEY
on 29 Apr 2020
Star Strider
on 29 Apr 2020
What specific equations in that paper are you attempting to code?
ALOK DUBEY
on 29 Apr 2020
Categories
Find more on Mathematics 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!
