how to solve equations

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

Your Question is not at all clear.
What equations do you want to solve, and for what variables?
i want to solve this equation
To= (((hp1*hp2*0.656*I(t)\UL)+I(t))*(1-exp(-b*UL\ma*ca)*L))+Ti*exp{(-b*UL\ma*ca)*L};
  • here hT is not defined by mistaken, you can take it as 0.5.
  • i want to know value of To at diffrent I(t), here I(t) changes with time i.e. at 9.0 o'clock it has some value and at 10o'clock its something else'

Sign in to comment.

Answers (1)

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

THANKS FOR REPLY SIR,
I TRIED TO RUN YOUR GIVEN CORRECTED CODE AND I HAVE THIS KIND OF GRAPH. i am taking this equation from a research paper, they explicitly mentioned that they used MATLAB to solve this, i am trying hard but just failing
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.
sir, can i send you research paper, so that you can help me
You can attach it here as a PDF. I cannot promise that it will solve the problem.
my thesis is based on this, i am hoping for reply sir :)
What specific equations in that paper are you attempting to code?
on PAGE 22, equation 6(a),6b,6c is given, i am attaching screenshot of same equtioins here. On page 24 of same paper they mentioned that they solved these equations using MATLAB. i am not able to solve this using MATLAB and failing

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 28 Apr 2020

Edited:

on 29 Apr 2020

Community Treasure Hunt

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

Start Hunting!