Finding The Coefficients of HTE

So we know what HTE does, but how do we fit data to find A, B, C & D?

From a published set of enthalpy data we can get values for HT-H298 vs T, and we want to fit the data to an equation of the form HTE(T) = a + b.T + c.T^2 + d/T or HTE(T) = a + b.T + c.T^2 + d.T^neg1

So given a set of data T1, T2, T3 ...Tn and E1, E2, E3, ...En, we would like to find the coefficients a, b, c, d to fit a polynomial with powers 0, 1, 2, neg1 Lets simplify by storing the data to vectors, and use real data from USGS Bulletin 1259 page 111 for Fe2O3:

T gets 298.18 400 500 600 700 800 900 950 950 1000 1050 1100 1200 1300 1400 1500 1600 1700 1800

E gets 0 2.75 5.77 9.01 12.46 16.13 20.03 22.06 22.22 24.02 25.82 27.50 30.87 34.25 37.65 41.07 44.54 48.10 51.88

but the E values are in kcal and we want cal so:

E gets 1000 x E Powers gets 0 1 2 neg1

Now we need a Coefficient Matrix (we will call CM)

CM gets T jot dot power Powers where jot is " alt + j ", dot is the full stop on your electronic typewriter, and power is " * "

Then the coefficients (a, b, c, d ) are:

coeffs gets E domino CM where domino is " alt + shift + = " and is the symbol of the proper division sign in a box. It looks like a domino piece, but it is more correctly the matrix division operator.

The result is neg19628.3 44.406 neg0.003074 1986174

But remember the "coeffs" a, b, c, d need the multipliers unravelled to get back to A, B, C, D

A = neg 19628 B = 44.406 C = neg 3.074 D = 19.862

So, by this method, we have estimates of A, B, C, D for our data set (Fe2O3 from USGS Bulletin 1259): And we see this is quite close (as we would expect) to the Metsim HTE coefficients fitted for Fe2O3

from B672158: A = neg 20748.8 B = 46.152 C = neg 3.875 D = 21.946

So we have a simple APL method for establishing the coefficients of any polynomial and can fit data from any source to suit any of Metsim's equations (such as grinding selection and appearance functions etc.

This method is from the book "APL With a Mathematical Accent" by Reiter and Jones.

Cheers, Jim