clc
clear all
tic
file = 'areatemp1';
file1 = 'machtemp1';
opts = detectImportOptions(file,'NumHeaderLines',0);
opts1 = detectImportOptions(file1,'NumHeaderLines',0);
T = readtable(file,opts);
T.Properties.VariableNames = {'Area','Mach','Temp'};
t = readtable(file1,opts1);
t.Properties.VariableNames = {'mach','temp'};
Tc = 20:0.1:50;
P0 = 18:25;
T0 = 25:50;
D0 = input ('What is the size of the hole in microns? ');
D0 = D0*10^-6;
A0 = ((pi*D0)^2)/4;
i = 0;
j = 0;
k = 0;
Patm = 1;
R = 8.314;
A01 = (1/5)*A0;
gama = 1.4;
for i = 1:length(Tc);
rhoe(i) = Patm/(R*Tc(i));
for j = 1:length(P0);
P011(j) = 0.666*P0(j) + 0.333*Patm;
for k = 1:length(T0);
mass(j,k) = (0.6856*P011(j)*A01)/(R*T0(k))^(1/2);
rho0(j,k) = 0.9805 * (P011(j)/(R*T0(k)));
V0(j,k) = mass(j,k)/(rho0(j,k)*A0);
P01(j,k) = P0(j)-(1/4)*(rho0(j,k)*V0(j,k)^2);
T1(k) = T0(k) * 0.8316;
V1(k) = (gama*R*T1(k))^(1/2);
P1(k) = P01(j,k) * 0.5274;
Areas(i,j,k) = 1/((((R*T0(k))^(1/2))*rhoe(i)*V1(k))/(1.3712*P01(j,k))+sqrt((((R*T0(k))^(1/2)*rhoe(i)*V1(k))/(1.3712*P01(j,k)))^2+(R*T0(k)*rhoe(i)*(P1(k)-Patm))/(0.6856*P01(j,k))^2));
dif = Areas(i,j,k);
Tarray = table2array(T);
tarray = table2array(t);
machs(i,j,k) = interp1(Tarray(:,1), Tarray(:,2), dif);
temps(i,j,k) = interp1(Tarray(:,1), Tarray(:,3), dif);
t1(i,j,k) = temps(i,j,k)*T0(k);
temperatura(i,j,k) = interp1(tarray(:,1), tarray(:,2), machs(i,j,k));
T2(i,j,k) = temperatura(i,j,k)*t1(i,j,k);
T22(i,j,k) = round(T2(i,j,k),1);
end
end
end
if Tc(i) == T22(i,j,k)
Tfinal(i,j,k) = 1;
else
Tfinal(i,j,k) = 0;
end
toc
0 Comments
Sign in to comment.