computeEndTemperature.m
function computeEndTemperature()
% solution of exercise 11
mdot = 5.668e-3; % in kg/s
Q12dot = 3225; % in W
t1 = 70; % in °C
M = 44.01e-3; % in kg/mol, für CO2
% read data
data = load("cps.dat");
tD = data(:,1); % in °C
cpD = data(:,3)/M; % in J/(kg K)
% equation as zero of a function
f = @(t) Q12dot - mdot*cpQuer(t1, t, tD, cpD).*(t - t1);
% find interval surrounding solution
epsi = 1e-5;
tMin = t1 + epsi;
cpmin = min(cpD);
tMax = t1 + Q12dot/(mdot*cpmin);
t2 = fzero(f, [tMin, tMax]);
fprintf("Endtemperatur t2 = %9.4f\n", t2)
end
%---------------------------------------------------------------------
function y = cpQuer(t1, t2, tD, cpD)
% berechnet die mittlere spezifische Wärmekapazität von t1 bis t2
% t1 Starttemperatur in °C
% t2 Starttemperatur in °C
% tD Tabellenwerte für t
% cpD Tabellenwerte für cp
% y Wärmekapazität in J/(kg K)
cp_t1 = interp1(tD, cpD, t1);
cp_t2 = interp1(tD, cpD, t2);
y = (t2.*cp_t2 - t1.*cp_t1)./(t2 - t1); % T0 = 0 °C
end