-
Notifications
You must be signed in to change notification settings - Fork 4
/
DtaDsc.m
29 lines (29 loc) · 1011 Bytes
/
DtaDsc.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function S = DtaDsc(Mas,j)
%% I/O
% In : SampleCell whole
% Out : [T and DTA] or [T, DTA, Cp, Heat Required] depending on the data
%% Check for hf data availability
checkVariable = isfield(Mas,'hf');
t = Mas.t/60;
DTA = diff(Mas.dT)./diff(t);
if (checkVariable == 1)
if (j==2)
CpRaw = abs(Mas.hf)./(Mas.W.*15);
Cp = filloutliers(abs(CpRaw),'pchip');
Cumhf = cumtrapz(Mas.T,Mas.hf);
S = [Mas.T(2:end), DTA, Cp(1:end-1), Cumhf(1:end-1)];
elseif (j==3)
CpRaw = abs(Mas.hf)./(Mas.W.*20);
Cp = filloutliers(abs(CpRaw),'pchip');
Cumhf = cumtrapz(Mas.T,Mas.hf);
S = [Mas.T(2:end), DTA, Cp(1:end-1), Cumhf(1:end-1)];
else
CpRaw = abs(Mas.hf)./(Mas.W.*10);
Cp = filloutliers(abs(CpRaw),'pchip');
Cumhf = cumtrapz(Mas.T,Mas.hf);
S = [Mas.T(2:end), DTA, Cp(1:end-1), Cumhf(1:end-1)];
end
else
S = [Mas.T(2:end), DTA];
end
end