Welcome to the nlfit folder

The direction file is described in Direction file.doc .htm.

The code nlfit is designed to minimize          

 

 

The function fA is different for every functional form.  This means that it is necessary to re-compile at least part of nlfit every time this form is changed.  The optional penalty term is discussed in Penalty.docx .htm. These codes differ from previous versions of nlfit in that they make more extensive use of unformatted data sets and they have a PolySA option that allows Pen(c) and fA(c,x) to be written as separate stand alone code, possibly in a different computer language. 

             NlfitFortran.zip is stored using bnlfitFortran.bat operating on nlfitFortran.txt.    There are 5 slightly different codes in the zip and a 6th code in nlfit-Pas.zip (bnlfitpas.bat).

  1. The simplest codes require recompilation each time the approximating function is changed.  The ide’s for these are stored in the folders using them.  The penalty is.
    1. GePairpFit\nlfitW1.wpj (nlfitw1.zip) double precision only, calculates PC and PPCC in the main code and uses RobminW1.for.  GePairpFit\nlfitw1.zip  This is the simplest  to use when precision neede for fit is 8 digits or so, and there are no linear dependencies, #PadeApproximates)
    2. nlfitmp.wpj (Poly is double precision, Minimization is multiple precision) GePairpFit\nlfitmp.zip (This is slow, but the array is now relatively immune to Pade problems.)
    3. GePairpFit\nlfit.vfproj (Intel10 Fortran, uses quadruple precision) nlfitq.zip (This is about as accurate as the above for the array and also allows the hope of up to 15 digit accuracy in the fit.
    4. GePairpFit\nlfitqmp.vfproj (Intel10 Fortran, quadruple precision, combines with multiple precision array) GePairpFit\nlfitqmp.zip (This is the biggest hammer in the section.  When it fails try using higher values of NPOW to isolate the troublesome regions.)
  2. The prototype code is reached through nlfit.vfproj.  It uses the quadruple precision extension made by the intel 10 version of Fortran 90.  All arrays are dynamically allocated in the main code. 
  3. The code nlfit.wpj utilizes Watcom’s extension of Fortran 77 to include dynamic allocation.  It has the real*16 parts commented out and a few other changes.  Thus
    1. nlfit.for à nlfitW.for
    2. nlfsubq.for à nlfsubW.for
    3. robmin.for à robminW.for
    4. This code is set up to check the partial derivatives.  If  ivorf(i) in the direction file is made N > 2, the code calculates both analytical and numerical derivatives for the N’th data point and prints them out.  The delta used to find the numerical derivatives is the error estimate in the direction file.
    5.  The sample code nlfit1.wpj is still under development – most recently accessed through ..\..\wsteve\h2fit\BobNlfit\ednlfit.bat.  The function f is assumed to be a pade approximate. (pade\Welcome.docx .htm)  The partials of χ2 are calculated in the main code nlfsubq à main.  The options for double precision and multiple precision second derivative arrays are available.  The test code is fitting <H2> as a function of the separation distance R of the two nuclei.  It is normally called as >nlfit.bat potfit.dir from  ..\..\wsteve\h2fit\BobNlfit.

 

    1. The code negg1d is described in ..\..\WaveFunction\WaveFunctionByMinimization.docx .htm.  It uses complex constants and first derivatives with a real second derivative matrix ../../optimization/Robmin/CRobmin.doc .htm.
  1. The third code is listed in makefile.g77.  This code requires that the user dimension (or most often over dimension) a few parameters.  As with the first code the bulk of the storage is done using unformatted data sets, and the few that do not can be over dimensioned with little harm.  As the g77 implies, this set of code works on linux and unix operating systems (Extract all files, copy makefile.g77 over makefile and in the nlfit folder issue the command make).  At present in linux it is best to use gnuplot for looking at the results.
    1. nlfitW.for  à nlfitg77.for
    2. other files are the *W.for files
  2. The fourth code differs from nlfitg77 in that it has a series of includes for watfor.  Watfor has limitations, owing to the default size of the unformatted files, this code works with only 5 of the 6 parameters variable.  It does give a valuable check of the coding logic.
    1. nlfitg77.for à nlfitW4.for
    2. other files are the *W.for files
  3. A fifth code is in the makefile.  It uses gfortran which for this code differs from Watcom only in that the Fortran 90 allocatable statement is needed for the dynamical arrays.
    1. nlfit.for  à nlfitGF.for ß real*16 à real*8 (later real*10)
    2. other files are the *W.for files
  4. A sixth code, nlfit-Pas.zip, is in Pascal.  This uses 10 byte extended precision which is about a factor of 100 better able to resolve a near linear dependence than is the usual 8 byte precision.  Much of the extra precision is in the exponent which helps even more. Singular.doc .htm.  The robmin used is very closely related to that in Cambio Cambio\Welcome.htm.  Pascal is fast (Progdet\SoftWare.html). The code is compiled using Delphi in windows and then in linux using code from http://freepascal.org (Progdet.htm) with the terminal command. 

fpc –MDelphi nlfit.dpr

  1. Nlfit2, nlfit2-Pas.zip, is a simpler version of the Pascal code.  The code uRobmin2.pas is a version of Robmin in which all possible arrays appear only in robmin.  The code nlfitsub2 incorporates the sum that is in chiders above.  This code also has the option of taking numerical derivatives. 



NlfitSub\Welcome.htm

            This folder contains the code that one would call to fit data inside a code (e.g. in Cambio)  This code is called by the main Nlfit code after handling the input and before the output.

PolySA\Welcome.htm .doc

            The subroutines PolySA\polysubq.for and PolySA\upolysub.pas organize the results of the calls to poly and take numerical derivatives when requested.  

This folder invokes the PolySA option.  The Fortran Nlfit uses CALL FSYSTEM(‘PolySA.exe’), while the Pascal code uses WinExec(‘PolySA.exe’) at the location where the various poly subroutines find the values Pen and of FA and its partials.

            The Pascal code does not wait for PolySA to finish.  This makes it necessary to look for a file with a series of “are we done yet questions” that tie up a small amount of the processor for no good use.  Details are in ..\..\Progdet\dll\pascal\Welcome.htm.   

 

../chiders/Welcome.docx .htm

            This folder contains the chipxx code for making the partials of χ2(cons) from the partials of fA.  The first X refers to the precision with which fA and its partials are calculated while the second refers to the precision of χ2 and its partials.

RobminSA\Welcome.doc .htm

This is the test folder for the robust minimization routines used in nlfit.  These in turn depend on the matrix inversion routines in Cholesky\MatInvSA.  Tests of these are described in Cholesky\Singular.doc .htm.

robfit\TemplFit\eff\Welcome.doc .htm

            A fit to the efficiency of an intrinsic Germanium Gamma Ray detector as a function of energy involves fitting 63 points to a linear Pade approximate multiplying the exponential of a Pade.  This very fast but somewhat difficult fit is the testing ground for the routines described above.  The poly routines that give fand its derivatives are in this folder.

Stop.in

蕐ӏ蕘ӏx

Figure 1 Author's view of chi-square in the minimization region. 
            Look at figure 1 above.  Nlfit does not stop easily.  It requires that fr à 1-10-15 in rather small steps.  Physicists frequently look for very small bumps in noisy data, hence the very reluctant stopping.  That said, when fr becomes small, the routine is Newton-Raphson with quadratic convergence.  As a practical matter, it should converge in ~100 steps.  If it does not the derivatives or the matrix inversion are faulty.  #Precision Options

            It can happen that nlfit goes into a seemingly infinite loop in which the improvement in c2 is at an agonizingly slow pace.  The file stop.in is tested occasionally. Normally, it is empty.  Making the first character in this file ‘s’ or ‘S’ causes the routine to stop normally, saving its best values to date.

            Be sure to change the s in first position of stop.in before the next nlfit run.

Quick Start

            The folder PolySA contains the zip PolySA.zip.  This zip contains

  1. Nlfit.exe – Fortran calling code compiled by Intel-10 to work in windows
  2. Polysa.wpj, Polysa.tgt, Polysa.for, pademp.for.  A sample set of the stand alone poly called by nlfit.exe
  3.  #Numerical Partials require 2M+1 evaluations of the function and generally lose about 7 digits of accuracy.  Analytical derivatives approximately double the time to evaluate the function, sometimes less, and usually have full double precision accuracy.

Powers

            If the fit is to a set of points without statistical error, the error in the fit is that of the largest miss.  Npow values greater than one in selectively push down the worst misses.  As Npow increases, the minimization becomes that of the largest error. A value of Npow greater than one also makes the minimization explicitly non linear, since the second derivative array always depends on the last fit. The precision matters less because those points well fitted cease to dominate the second derivative array.  The recommended procedure is to minimize first with Npow = 1, then 2, 3, and 4 then to reverse this as 4, 2, 1 if and only if the data contains random errors.

Precision Options

  1. The derivatives of fA and of χ2 are both double precision - fastest
  2. The function fA is double precision, but the multiplications that form the second derivative matrix are quadruple precision as are the sums that for the first and second partials of χ2.  The matrix inversion is in quadruple precision.  This is fast owing to the Intel-10 version of quadruple precision but requires no coding beyond double precision in the calculation of fA.  
  3. The function fA is double precision.  The multiplications that form the second derivative parts and their sums are multiple precision (it=19, 250 digits).  The inversion step uses multiple precision Cholesky matrix inversion MPSMINV.

The inversion steps are slow.  This should normally be used only after step 0 has finished.  It can be used simply to get around a hangup and the minimization continued with option 0.  However, when the minimization seems to take forever with very small steps, this is a solution.

  1. The function fA and its derivatives are quadruple precision.  All summations and inversions are also quadruple precision.  The Intel-10 compiler is needed even for PolySA.  This is easy to code, simply use real*16 for everything.  It is fairly fast and greatly extends the fitting range.   
  2. The function fA and its derivatives are quadruple precision (Intel-10).  The product of these, the sums and the matrix inversions are multiple precision (it=19, 250 digits)
  3. The function fA and its derivatives along with all other terms are multiple precision.  Nlfit is based on the notion that the set of cons is real*8.  This can limit the final accuracy, though normally the practical limit is linear dependency.

With an Intel-10 nlfit.exe and PolySA without Intel 10, the options available are 0, 1, 2, and 5.  Without quadruple precision (e.g. in Linux), the options are 0,2, and 5.

  1. The Pascal version of nlfit does not use PolySA.  It has fA and its derivatives in double precision, but the product and sums that form the derivatives of χ2 are in extended precision as are the matrix inversions.  This falls between 0 and 1 above, with roughly a factor of 100 gain in the ability to approach linear dependencies.  It is fast. 

 

 

Sections 3 through 5 are out of date.  They are left in for reference only.

for\nlfit.wpj Welcome.htm– double precision extendable using Bailey’s routines – Uses Cambio’s robmin.

    1. Ptcheby\nlfit.wpj – expands a Pade in Tchebyshev polynomials
  1. formp\nlfit.wpj Welcome.htm– uses multiple precision when requested
    1. 2dPoly\nlfit.wpj
    2. EkofZ\nlfit.wpj
    3. FermiFit\nlfit.wpj
    4. fit8\nlfit.wpj
    5. LogAigau\nlfit.wpj
    6. ..\chiders\Welcome.docx .htm This folder contains the code that evaluates .  Usually the subroutines in this folder are called directly from NlfitSub.
    7. The stand alone codes are tested in ..\robfit\TemplFit\eff TestingNlfit.docx .htm


Discussion

            Nlfit has been a working code for many years.  The old version is discussed in in #pre2007_Fortran. 

            The data is a set of N values of {xi,fi,ei}.  The code POLYSA.htm uses cI to extend this set to {xi,fi,fA,I,ei}.  The code nlfitSA calculates the vector  and the array from {xi,fi,fA,I,ei}.  The code RobminSA uses the sequence of values of χ2Pow,I to determine fr, the desired fractional decrease in .  Then it uses this value along with cI, and  to predict cI+1.  Thus the nlfit code consists of three separable codes with a bit of overhead.  

The routine Robmin has a set of Marquardt parameters determined experientially from the steps used to minimize . The newest robmin starts from ..\..\optimization\solving\Welcome.htm ß see especially the documents on Bracketing, Bracketi-bli, and Newton.

In the fall of 2007, the ability to use MultiplePrecision for the calculations involved in finding PC and PPCC and to the appropriate steps for inverting PPCC was added to the general code.  #options Option 0 does not use multiple precision.  Options 1, and 2 use double precision first derivatives from Poly with multiple precision summands.  These do not use multiple precision data from poly.  Options 0, 1, and 2 can be used with POLYSA.htm which can be in any computer language and use any compiler. Options 3, 4 and 5 require the user written code, in the subroutine poly.for or pademp.for to return multiple precision values of .    These are most easily done using formp\mpbob.for (Mpbob.htm) Multiple precision testing was done by making fits to  for -6£x£0 #Log(AiGau). 

In calculating the first derivative vector and the second derivative array, multiple precision can keep values that would otherwise be lost to truncation error.  Then in the second derivative matrix may also need to be multiple precision to keep these values.  This means that while it is often necessary to have fA and its derivatives multiple precision that there is also a region where only the stock routines nlfitSa and robmin need to be multiple precision.

 

The only coding needed to take full advantage of the nlfit described below is that of the definitions of  in pademp.for.

             

            In general the htm’s contain links to zips with the data fitted and watcom ide’s for recompiling the Fortran.  When the zip contains Fortran code, the routines are older than those in the formp folder, but they worked for the examples shown.  Presumably the new ones work better, but they have not been tested.

Details2

            The code nlfit minimizes the chi-square of equation .  The user needs to to write a double precision routine similar to formp\poly.for to utilize most of Robmin’s (htm) ability to minimize c2 or a routine that returns multiple precision partials of fA with respect to cJ similar to formp\pademp.for. 

      SUBROUTINE POLY(X,PF,CONS,FA,MPPF,NCONS,NX,MP)

      IMPLICIT REAL*8 (A-H,O-Z)

      DIMENSION X(NX),PF(*),CONS(*)

      DIMENSION MPPF(64,*)

            The first argument X is the vector xi in .  It has NX dimensions.  The second argument PF is .  The vector CONS is c in .  Both PF and CONS have NCONS dimensions.  The scalar FA is the value of   in .  The array MPPF(64,*) is the multi-precision version of PF.  Each value is represented by 64 integers from -8192 to 8191 leading to approximately 250 digits of precision.  (../../MultiplePrecision/Bob/Welcome.htm).  The integer MP is passed to the subroutine to inform it that MPPF is needed if it is geater than 3. (formp\pademp.for is a Poly including multiple precision)  The routine poly is called for every value of xi.  The returned values of FA enable the calculation of c2.  The values of PF give both PC(J)=and a surprisingly accurate estimate of  PPCC(J,K) = .  

            Once these have been found the next estimate of the constants is given by CONS(J)= where l is a Marquardt parameter that needs to be found rather precisely and S(j) is a smoothing factor that contains an estimate of the range of validity of the second order expansion of c2.  The details begin in FitData.doc .htm. 

 

Plotting

            Begin by plotting the data.  Plot codes are described in gplot\WELCOME.htm.  I have recently compiled gplot with the Intel-10 compiler.  The resulting executable contained in gplot.zip appears to run properly on all windows computers.  Nlfit produces fit.dat which is “essentially” the fit at each of the data points, res.out which is ((fi-fA(xi))/erri)2*Npow at each of the data points and err.out which is fi-fA(xi) at each of the data points. 

            The open source code http://www.gnuplot.info/ is one of the best ways to plot the data.  On my fedora linux system, I go to the directory with the data, then enter the command gnuplot.  Then

plot “BOBc.txt”, “FIT.DAT” to get a plot of the data and the fit to the data.

 

Standard Deviations of the calculated results

            The error matrix in StdDev.doc htm is shown to be closely related to the matrix used in minimizing the c2 of equation .  After the minimum is reached nlfit makes a final inversion of the second derivative matrix and multiplies this inverse by 2 c2 divided by the number of degrees of freedom to form the error matrix.  The diagonal terms of this matrix are the standard deviations of the fitted constants and are written in the normal output file.  The fitted constants, the ivorf terms that tell which constants vary, and the complete error matrix are written to the file ERRMAT.OUT. 

            A  fit is made to the derivative of a generalized Fermi function, dfpoly.for, in the folder FermiFit FermiFit\Welcome.htm.  The code polstd.for uses the generalized Fermi function FPOLY.FOR which is the integral of the fitting polynomial, the constants fitted and the error matrix to calculate the standard deviation of the Fermi function over the range specified in the direction file polstd.dir.

Compilers

            Nlfit uses some extensions to Fortran 77.  In particular it opens files, including scratch files and it also calls the system in the event that the user needs help.  The addition of a double precision variable to a multiple precision variable uses ISHFT, IBCLR and IBSET.  Compiler dependent routines in appropriately named files are slightly different for each compiler. 

            My attempts to use dll’s mostly failed due to a need to pass locations from one compiler to another (Progdet.htm#dll).  The fourth method in the series of tests documented in ..\..\Progdet\dll\Welcome.htm is not a dll at all, but rather a stand alone code whose arguments are passed as two binary files.  PolySA\Welcome to POLYSA.htm. This means that the code PolySA\polysa.for can be used to call PolySA\pademp.for.  The Ide for this is PolySA\polysa.wpj while the Ide for the rest of the code is PolySA\nlfit.vfproj.  The bulk of the code is compiled in release form by the Intel-10 compiler while the part specific to a fiven analytical approximation to the function of interest is compiled by ..\..\Progdet\openwatcom.htm

1.     Watfor

              Watfor is a dos based Fortran 77 compiler with very few extensions. --  W4.mht Watfor.htm -- It checks for uninitialized variables at run time better than any other compiler that I have used.  When it has been installed from one of my CD’s, the editor/ide is named e.  The code using lnigau.for as poly is in formp\formp.zip.  Unzip to a new folder.  Switch to Dos.  Then in Dos issue the command.

e nlfit

F9 toggles between the command line and the editor.  The command $ takes the editor to the bottom line.  There are a group of c$includes.  One of these will need to be a new poly.  Watfor code in this mode is on the order of a factor of 20 slower than the more modern compilers below. 

2.     Watcom

            Watcom is in the public domain.  Users will need to recompile their version of poly – here poly.for – For options ³ 3 the entire code will need recompilation.  For options < 3, the IDE PolySA\polysa.wpj can be used to recompile the poly function, here named pademp.for along with polysa to make a short stand alone routine that can run with the intel-10 version of nlfit.  The ide for the full code, needed for options ³ 3, is formp\nlfit.wpj. The Watfor version C$ à C# must be changed to make this work.  Owing to a common heritage, Watcom attemps to compile the code with C$, but since the code no long runs in dos, the dos specific commands will cause it to fail without this change.  Details on obtaining and using Watcom begin in Progdet.htm#OpenWatcom.  For those who do not wish to program in Fortran see Mixing Fortran and C with Watcom.doc .htm.

3.     g77

            Formp\unix.zip –(To Be Done) is the same fortran as that in formp.  The zip also contains a makefile for constructing nlfit.  The current one uses lnigau.for.  It also has a sample data file algau.out and finally a code named gplot (for directions see..\..\gplot\WELCOME.DOC  .htm) for plotting the data, the fit, err.out and res.OUT.  This particular gplot assumes that xterm is available.  Unix is a natural for mixing Fortran and C, see Mixing FORTRAN and C.htm.

4.     Intel10

            This started originally as the Microsoft power station nlfit.mdp and is currently formp\nlfit.vfproj.  This produces code about 40% faster than the best that Watcom does.  This is probably due to optimization of the “school boy” loop in MPxMP.  formp\mpbob.for.

Pade Approximates

            As referenced in FA.doc#PadeApproximates, Pade Approximate methods are very powerful and not completely understood.  The function and its partials are given in LogAigau/Pade.doc#PadeAndPartials.   A general discussion of the numerical problem seen in fitting to a Pade is given in LinDep.doc .htm.  The specific problem in fitting the error function conjugate is discussed in LogAigau\TheProblem.doc .htm and a partial solution is given in LogAigau/TheProblem.doc#PartialSolution .htm.

            A somewhat more general solution is discussed in Ptcheby/Welcome.htm  -  Ratio of two Chebyshev polynomials.

Positive Definite Matrices

Curve fit matrices are almost always positive definite. The section title says it all.  Unfortunately they are not always invertible.  Errors in the matrix can cause #Matrix Inversion Problems.  These frequently mean that some approximations to the inverse predict maxima, while most predict saddle points.  In this work a Marquardt parameter is used in combination with smoothing values (Smvals.doc .htm) to keep the matrix always invertible.  The inability to invert the second derivative matrix is almost always due to approximate linear dependencies in the second derivative array.  In this work a multiple precision array (MultiplePrecision\Welcome.htm) was formed from sums of double precision terms at each point.  It was found that this was needed only for the first half of the Cholesky (Cholesky\Welcome.htm) inversion routine sminv.for (also in formp\robmin.for).  This resulted in the routines  MPHSMINV.for which is called when sminv says that it cannot invert the matrix.  This greatly increases the computation time owing to the fact that the multiple precision multiplications as coded here are rather slow.   

Log(AiGau)

            This folder is a test of the multiple precision routines. Welcome.htm. 

Sub-directories

1        2dFit 2dFit.htm  Uses old robmin, slightly re-written gplot and real data.  – demonstrates a fit to x,y,z data.  That is z is fitted a z @ fA(x,y)

2        2dPoly Welcome.htm  Uses new robmin and original gplot.  Contains a routine for re-writing data into a proper form for plotting as a series of 1d lines.

3        aigau Welcome.htm  16 digit fit to the complementary error function.  Uses Bailey’s multiple precision bailey\Welcome.htm.

4        efffit EFF2.htm This uses an old robmin stored in effitfor.zip. 

5        fit8 fit8\Welcome.doc .htm – experiments with a different Pade form            
This speeds the convergence by a factor of 100 to 1000 for small N.  Eventually the derivatives for ai+N begin to be very similar so that about 8-10 digits are all that this method can reach easily with a double precision PPCC array.  This form is also used in LogAigau\PadeM\Welcome.htm where it is not a significant improvement over the fit in LogAigau Welcome.htm.

6        formp formp\Welcome.htm – current set of fortran and compiler files

7        for for\Welcome.htm – pre 2007 set of Fortran used with most of the data and examples in TestData.  Multiple precision “comment” lines appropriate for Bailey’s transmp codes are in nlfit and robmin.  

8        LogAigau Welcome.htm – 16 digit fit to log of complementary error function.  (not as accurate as 3 above) Tests the routines in 6.  The log has up to two extra digits making an exact fit that much less accurate than the one above.

9        Minsteps Minsteps\Minimization-in-steps-Real.doc .htm A somewhat disastrous attempt to iterate to more accuracy.  Demonstrates that an accurate inverse of an approximate matrix frequently does not predict a minimum and in fact may predict a maximum.  – The conclusion is that the Cholesky matrix inversion fails when the curve fit matrix fails to be positive definite.  This failure in the test was due to the fact that information was lost in the matrix PPCC owing to its fininte number of digits.  The solution to the equation PPCC´X = PC in this case is a saddle point or even an extremum.  This is not the solution desired.  Minimizing the expectation value of PC´X + ½ PPCC ´X´X had the problem that the minimum is for extremely large X and the derivative equation is not even close to a solution.  Finally the “best” solution is to use the non-inversion of the matrix as a flag and to set the value of all X’s to zero in the case that the matrix does not invert.

Figure 2 cp2 /co2 as a function of l

10    Ptcheby Ptcheby\Welcome.htm Substituting Tchebyshev polynomials for the polynomials in the Pade, makes the convergence much better.  Uses Bailey’s multiple precision bailey\Welcome.htm. 

11    TestData TestData\Welcome.htm

12    ..\..\wsteve\h2fit H2fit.htm

13    zips  -- see especially fit7.zip This code started much of the current work when it required ~ 500,000 steps to converge.         The derivatives in this case are very similar for the denominator and the numerator expansion resulting in PPCC’s with many similar terms.  The routine requied 10,000 to 50,000 iterations and 1 to 3 restarts to converge.  The problem and a partial solution are documented in #fit8 above.

 

 

        

Documents/Folders

1        ..\robfit\TemplFit\eff\Welcome.htm Test data for a double Pade fit.

2        mpsminv1.doc .htm ß testing MPHSMINV

3        NLFIT Code.doc .htm – Details the code, refers to FofLambda.doc

4        NumericalPartials.doc .htm, Numerical derivatives.htm  Sample Poly routines using numerical derivatives.  The newest code has an option to calculate numerical derivatives internally.  This multiplies the time required by 4×Ncon and still is not as accurate as the analytical derivatives can be, but when one has lots more computer time than coding and mathematical skills this can get the fit  a lot faster.

5        The number of Multiple Precision integers.htm

6        Alex1.htm .doc – Further generalization of the Fermi function.  A.E.S. Green introduced me to this function.

7        TestData\green\DFFIT.htm .doc – details on finding the derivative of the Fermi function

8        README.htm .doc

9        StdDevfc.doc htm ..\ErrorMatrix\Welcome.htm – Derivation of the relation between the second derivative array and the error matrix.

10    The following four fits were used to construct PabK\tphoto.wpj which gives the photoabsorption (cm2/mol) as a function of E and Z for gamma rays travelling through matter.  This is used in the templfit extension of ..\robfit\Welcome.htm. 

a.        AofZ\Welcome.htm -  Fits the atomic weight as a function of the atomic number.

b.      RhoOfZ\Welcome.htm – Fits the number of moles/cm3 as a function of atomic number Z

c.       EkofZ\Welcome.htm Fits the K shell energy as a function of atomic number Z

d.      Pbel\Welcome.htm PabK Pabk2 Pbel Fits to the photo-attenuation (cm2/mole) as a function of E and Z

11    FermiFit\Welcome.htm  Tests error calculations using artificial data

12    2dPoly

13    aigau  integral of Gaussian from - to x – closely related to the error function. LogAigau alternate fit not as accurate.

14    amu2 better fit to attenuation.  Compton fits needed to approximate Compton scattering.  Pairp fits pair production.

15    AofZ EkofZ RhoOfZ

16    H2ScattFermi

17    pade2d