Azzera filtri
Azzera filtri

i have a txt file with 'temp' and 'heat flux' and i need to use it to calculate final temp and optimum emissivity. my code runs fine but the output file is coming out blank?

10 visualizzazioni (ultimi 30 giorni)
C1 = 3.74177e8;
C2 = 1.43878e4;
sig = 5.67e-8;
T_static = 229.58;
Tval = fopen('radiative boundary.txt', 'r');
Tvalue = fscanf(Tval, '%f');
fclose(Tval);
T = Tvalue;
H = hvalue;
Temp_value = [];
optimum_emsvty = [];
Temp_value = Temp_value;
optimum_emsvty = optimum_emsvty;
for i = 1:length(H)
e0 = 0.0;
e1 = 1.0;
delt = 1;
while abs(delt) > 0.000001
e = (e0 + e1) / 2.0;
c = 500;
for j = 1:5
c = c - wall(c, i, T, H, e, sig, T_static) / derivative(@wall, c, 1e-6, i, T, H, e, sig, T_static);
end
powr = integral(@(lam) power(lam, C1, C2, e), 8, 12);
delt = powr - integral(@(lam) power(lam, C1, C2, 1), 8, 12);
if delt > 0
e1 = e;
elseif delt < 0
e0 = e;
end
end
c = double(c);
end
writematrix(optimum_emsvty,'Optimum_Emissivity.txt');
writematrix(Temp_value,'Final_Wall_Temperature.txt');
function powr = power(lam, C1, C2, e)
powr = (e * C1) / ((lam^5) * (exp(C2 / (lam * T_static)) - 1));
end
  6 Commenti
Tony
Tony il 5 Giu 2024
You'll have to ask that student, or the supervisor, what Temp_value and optimum_emsvty are supposed to do/mean. If you're lucky, they've written the calculations somewhere. Otherwise, you'll have to figure out the lines of code yourself.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Just for fun in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by