Trying to build an 11x9 matrix from another 11x9 matrix and other elements

1 回表示 (過去 30 日間)
Michael Costa
Michael Costa 2020 年 11 月 2 日
コメント済み: Mathieu NOE 2020 年 11 月 3 日
I am writing a program that compares different heat exchangers in order to select the best one for the application. I have successfully built an 11x9 array for the overall heat transfer coefficient (U), but now I am trying to build another 11x9 matrix for the log mean temperature difference (delTlm), and I am getting errors or answers that don't make sense. For example, when I did get an output for the delTlm matrix, every row had all values as the same. Here is the code that I have so far.
A = [2.4; 4.3; 7.4; 4.3; 7.4; 9.1; 2.4; 4.3; 7.4;].*0.0929; %m^2
%From problem 1, the exit temperature curves significantly flatten out
%after an NTU of 3 (returns diminish quickly). I will run the program from
%2.5 NTU to 3.5 NTU
NTU = (2.5:0.1:3.5).';
for i = 1:length(NTU)
%Calculating the effectiveness using the HE_effectiveness program
eff(i) = effectiveness(NTU(i), c, 'One Shell Pass');
%Finding the actual heat transfer from Qmax and the effectiveness
Q = (eff.*Qmax); %kW
%Finding the overall transfer coefficient
U = (NTU.*Cmin)./A.'; %kW/m^2*deg C
%Finding the log mean temperature difference
deltaTlm = Q./U.*A.'
end
  3 件のコメント
Michael Costa
Michael Costa 2020 年 11 月 2 日
%The HE is adiabatic.
%Specific heat capacity of water at 60 deg C
C_c = 4.185*m4; %kJ/s*deg C
%The brine is modelled as pure water.
C_h = 4.185*m13; %kJ/s*deg C
%Solution
%---------
%Finding Cmin, Cmax, Qmax, and c
Cmin = min(C_c, C_h); %kJ/s*deg C
Cmax = max(C_c, C_h); %kJ/s*deg C
Qmax = Cmin*(T13 - T4); %kW
c = Cmin/Cmax;
Michael Costa
Michael Costa 2020 年 11 月 2 日
As I said in the question, I have successfully built the U matrix (thanks to another guy on here)...so you shouldn't have to worry about the c variable or the effectiveness function. Do you see either one of those in the calculation of the matrix that I am asking about? Maybe you have misunderstood my question.

サインインしてコメントする。

採用された回答

Mathieu NOE
Mathieu NOE 2020 年 11 月 2 日
hello
there were only a few minor indexing issues in your main code.
also I recommend not using i or j as index var names as they are reserved for imaginary / complex numbers
so , here main code fixed :
%The HE is adiabatic.
%Specific heat capacity of water at 60 deg C
C_c = 4.185*m4; %kJ/s*deg C
%The brine is modelled as pure water.
C_h = 4.185*m13; %kJ/s*deg C
%Solution
%---------
%Finding Cmin, Cmax, Qmax, and c
Cmin = min(C_c, C_h); %kJ/s*deg C
Cmax = max(C_c, C_h); %kJ/s*deg C
Qmax = Cmin*(T13 - T4); %kW
c = Cmin/Cmax;
A = [2.4; 4.3; 7.4; 4.3; 7.4; 9.1; 2.4; 4.3; 7.4;].*0.0929; %m^2
%From problem 1, the exit temperature curves significantly flatten out
%after an NTU of 3 (returns diminish quickly). I will run the program from
%2.5 NTU to 3.5 NTU
NTU = (2.5:0.1:3.5)';
for ci = 1:length(NTU)
%Calculating the effectiveness using the HE_effectiveness program
eff(ci) = effectiveness(NTU(ci), c, 'One Shell Pass');
%Finding the actual heat transfer from Qmax and the effectiveness
Q = (eff(ci).*Qmax); %kW
%Finding the overall transfer coefficient
U = (NTU(ci).*Cmin)./A.'; %kW/m^2*deg C
%Finding the log mean temperature difference
deltaTlm(ci,:) = Q./U.*A';
end
  2 件のコメント
Michael Costa
Michael Costa 2020 年 11 月 2 日
Awesome thank you Mathieu. This worked great.
Mathieu NOE
Mathieu NOE 2020 年 11 月 3 日
Glad it helped !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by