Calculation of DTA Curve for Arbitrary Enthalpy vs. T Data Input 
Using Model of W.J. Boettinger and U. R. Kattner 
and Notebook by K.-W. Moon

Last update Aug. 14, 2002

0. Introduction

This notebook predicts Differential Thermal Analysis Curves for a user-specified sample enthalpy - temperture relation and for a user-specified set of  instrument parameters. Its primary use is to provide DTA users with information on what to expect from DTA curves under known conditions so that real DTA data can be more easily interpreted.
The notebook follows the model developed by W.J. Boettinger and U. R. Kattner (Metall. and Mater. Trans. A, Vol. 33A, No. 6, (2002) pp. 1779) The instrument parameters are time constants, heating rate, crucible thermal properties and sample mass. The instrument  time constants of this example notebook are determined from experiments on the melting of pure Ni  for a  Perkin-Elmer DTA1700. (The user should determine time constants and crucible thermal properties appropriate to his/her particular instrument.) The enthalpy-temperature data used for this example are obtained by thermodynamic calculation and stored simply as two columns (temperature, enthalpy) in a ASCII file that is read by the notebook script. Two enthalpy files are available: Scheil and Lever solidification of UDIMET 700 (as in Boettinger and Kattner).

Disclaimer: Commercial equipment and materials are identified in order to adequately specify certain procedures.  In no case does such identification imply recommendation or endorsement by the National Institute of Standards and Technology, nor does it imply that the materials or equipment identified are necessarily the best available for the purpose.

1. Initialization of Notebook

ClearAll["Global`*"];
Off[General::spell, General::spell1]

    
<< Graphics`Graphics`
<< Graphics`Legend`
<< Graphics`Graphics`
<< Graphics`MultipleListPlot`

2. Input DTA Parameters and Scheil Calculations
NOTE:  Typical values from Boettinger and Kattner (2002) are red, and  several other choices for input values are blue.

2-1. Input DTA Parameters

a = 6.1;   
b = 5.2;   
d = 5;  
alpha =  .33;  
R = 0.51;  
MS = 0.177*10^-3;

2-2. Calculate thermal mass of sample and crucible

CCAl2O3  =  130/101.961;
CCZrO2  =  78/123.223;
CCPt = 31.5/195.080;

CC = CCZrO2;  
CCR = CCAl2O3;  
CCL = CCPt;  

  
CMZrO2  =  3.159*10^-4;
CMAl2O3  = 1.4411*10^-3;

CM  =  CMZrO2;  
LM = 0;  

  
MC = 2.57*10^-4;

2-3. Input and Interpolate Enthalpy-Temperature Data 
Comment:  H must be in  J/g (kJ / kg)

lfile = "udimet700_Lever.txt";   
sfile = "udimet700_Scheil.txt";   

file= sfile;
dfile  = 
        StringDrop[file, -4];
oldD  =  StringInsert[dfile,  "_Old",  -1];

directory="NIST_DTA";
SetDirectory[
        HomeDirectory[]];
SetDirectory[directory];

data =  
        ReadList[file, Number, 
          RecordLists -> True];
n = Part[Dimensions[data], 1]

data1 = 
        Table[{data[[p]][[1]] + 273.1, data[[p]][[2]]/
              1000}, {p, 1, n}];
Interpolation[data1,  
        InterpolationOrder -> 
          1];
H = %;
CS[T_] = H'[T];

Tstart = data1[[1]][[1]]
Tstop = data1[[n]][[1]] 
Plot[
      Evaluate[H[T]], {T, Tstop, Tstart}, PlotRange -> All]

2-4. Input temperature region of interest

Tmargin1 = IntegerPart[Tstop + 1]
Tmargin2 =  IntegerPart[Tstart - 1]

    
pH =  
      Plot[Evaluate[H[T]], {T, Tmargin1, Tmargin2}, 
        PlotRange -> All]
pCS =  
      Plot[CS[T], {T, Tmargin1, Tmargin2}, PlotRange -> All]

3. Define TW[t]

T0 = Tmargin1;

    TW[t_] = T0 + alpha*t;

    tstart = 0;

    tstop = 
        IntegerPart[
          t  /. Solve[TW[t] == Tmargin2,  
                t][[1]]];

    TW[tstop];

    Tmargin2;

    

    Print["Tmargin1:",  Tmargin1, ", Tmargin2:",  
      Tmargin2,  ", TW[t]=", TW[t]]

4. Solution for the DTA Heating Curve

out1 = 
        NDSolve[{
MS*
                CS[Tsam[t]]*Tsam'[
                  t] == (MC/a)*(Tcup[t] - 
                    Tsam[t]), 
Tsam[tstart] == 
              T0, 
Tcup'[
                t] == (1/a)*(Tsam[t] - Tcup[t]) + (1/
                      b)*(TW[t] - Tcup[t]), 
Tcup[
                tstart] == 
              T0, 
Ttc'[
                t] == (1/d)*(Tcup[t] - 
                    Ttc[t]), 
Ttc[tstart] == 
              T0}, 
{Tsam, Tcup, 
            Ttc}, 
{t, tstart, 
            tstop}, 
MaxSteps -> 
            10000];

    
Tsamif = Tsam /. First[out1];
Tcupif = Tcup /. First[out1];
Ttcif = Ttc /. First[out1];

5. Output: Results

output = 
        Table[{t, Tsamif[t], Tcupif[t], Ttcif[t], TW[t], 
            Ttcif[t] - TW[t]}, {t, tstart, tstop, 
            2}];

    
Print["file:", file, ", Sample mass in kg:",  
      MS, ", Temp. Range:", Tmargin1, "-", Tmargin2, 
      Date[]]

    
pH =  
        Plot[Evaluate[H[T]], {T, Tmargin1, Tmargin2}, 
          PlotRange -> 
            All, 
PlotStyle -> {RGBColor[1, 0, 0], 
              RGBColor[0, 1, 0], 
              RGBColor[0, 0, 0]}, 
Frame ->  
            True, 
Axes ->  
            False];

    
pCS =  
        Plot[CS[T], {T, Tmargin1, Tmargin2}, 
          PlotRange -> 
            All, 
PlotStyle -> {RGBColor[1, 0, 0], 
              RGBColor[0, 1, 0], 
              RGBColor[0, 0, 0]}, 
Frame ->  
            True, 
Axes ->  
            False];

    
\(\(\(pSOL\  = 
        Plot[{Tsamif[t], Ttcif[t], TW[t]}, {t, tstart, tstop}, 
          PlotRange -> 
            All, 
PlotStyle -> {RGBColor[1, 0, 0], 
              RGBColor[0, 1, 0], 
              RGBColor[0, 0, 
                0]}, 
PlotLegend\  -> \ {"Sample", \ "TC", "Wall"}, \ 
LegendPosition\  -> {\(- .77\), \(- .05\)}, \ 
LegendSize\  -> \ { .6, \  .6}, 
LegendShadow -> 
            None, 
Frame -> \ 
            True, 
Axes -> \ 
            False];\)\(
\)
    \)\)
pDTA  =  
        ParametricPlot[{Ttcif[t], Ttcif[t] - TW[t]}, {t, tstart, tstop}, 
          PlotRange -> 
            All, 
PlotStyle -> {RGBColor[1, 0, 0], 
              RGBColor[0, 1, 0], 
              RGBColor[0, 0, 0]}, 
Frame ->  
            True, 
Axes ->  
            False];

6. Export data and plots

6-1. Set the directory for the output

SetDirectory[HomeDirectory[]];
SetDirectory[directory];
DeleteDirectory[oldD,  
        DeleteContents  -> True];
RenameDirectory[dfile,  oldD];
CreateDirectory[dfile];
SetDirectory[dfile];
Directory[]

6-2. Export data and plots

\(\(\(OutFiles = \ {
nb\  = \ 
            SelectedNotebook[]; 
d2file\  = 
            StringInsert[
              dfile, \ "_a.nb", \ \(-1\)]; 
d3file = \ 
            StringInsert[d2file, \ "/", \ 
              1]; 
SaveNB = \ 
            StringInsert[Directory[], 
              d3file, \(-1\)], 

OutputTable\  = \ 
            StringInsert[
              dfile, "_table.dat", \(-1\)]; 
Export[
            OutputTable, 
            output, "Table"], 

OutputpH\  = \ 
            StringInsert[
              dfile, "_H.pdf", \(-1\)]; 
Export[
            OutputpH, 
            pH, "PDF"], 

OutputpCS\  = \ StringInsert[dfile, "_CS.pdf", \(-1\)]; 
Export[
            OutputpCS, 
            pCS, "PDF"], 

OutputpSOL\  = \ StringInsert[dfile, "_SOL.pdf", \(-1\)]; 
Export[
            OutputpSOL, 
            pSOL, "PDF"], 

OutputpDTA\  = \ 
            StringInsert[
              dfile, "_DTA.pdf", \(-1\)]; 
Export[
            OutputpDTA, 
            pDTA, "PDF"]
};\)\(
\)
    \)\)
Print[OutFiles]

5-3. Save notebook

NotebookSave[nb,  SaveNB]