Wetlay - Fitting Neutron Reflection data from multi-layered systems

R. Ghosh, ILL, September 2000, Updated July 2015


Procedures implementing Abeles method for calculating the reflectivity from a sequence of layers have been developed by J. Penfold (ISIS), and extended by A. R. Rennie (Uppsala University). The fitfun library has been used for a number of interactive fitting programs which run on both Unix and PC-Windows systems.

A recent version is wetdoc which includes the posssibility of including and refining a solvent contribution to each layer, is useful in the case of biological systems where there is considerable water penetration in, for example, lipid bi-layer systems.

There are practical constraints in managing large number of parameters in interactive programs. Often most parameters are well-known, and even measured in reference experiments, but still need to be set-up. In practice the number of variable parameters permitted in the standard fitfun library has been set at 40, any of which may be varied to minimise differences between the observed data and the calculated pattern.

In the case of the bi-layers the number of layer components, (with contributions depending on surface roughness, scattering length density and thickness (and solvent concentration), rapidly becomes unmanageable.

To simplify data input, and extend the number of layers wetlay reads first a data file containing all the layer information, and then the fitting routine is adapted only to modify the parameters for selected layers. The current limit for the number of layers has been set to 20.

Content of Layers file

This has the form shown below:
Layer file "layfil"  for sequence tests September 2000
 # name            :   thickness   rho   roughness  solvent  
 1 Si0   :                 10      3.4      2         0
 2 water :                  6      6.3      0         100
 3 head  :                  8      1.63     2         15
 4 tail  :                 38      -.4      2         10
 5 interB:                  8      1.63     2         15
 6 waterw:                 16      6.3      2         100
 7 interA:                  8      1.63     2         15
 8 tail:                   38      -.4      2         10
 9 Head:                    8      1.63     2         15
The first line is simply a title. The second line is skipped, but is shown here simply labelling columns. Then for each layer in sequence there is a name, upt to 16 characters, but terminated by a colon. There then follow four values of thickness, scattering density, roughness and % solvent concentration for each layer. The values are free format, separated by tabulations, spaces or commas.

The choice of layers is made using the V function in fitfun In the following example the layer parameters in layer 6, layer 4 and layer 8 are to be adjusted from the values read in from the layer file.

wlay>V
 FITFUN 6.6  TITLE:
 SET #  1  FITTING Y : Log10 Reflectivity     VERSUS X :  Q /A-1             
 NUMBER  PARAMETER   VALUE    (  OLD VALUE )     STEP     % DEVIATION 
    1   Rho(top)     2.070    (   2.070    )  0.0000E+00      0.00
    2   Rho(sub)     6.350    (   6.350    )  0.0000E+00      0.00
    3   Scale        1.000    (   1.000    )  0.0000E+00      0.00
    4   Rough       0.0000E+00(  0.0000E+00)  0.0000E+00      0.00
    5   Bgd         0.0000E+00(  0.0000E+00)  0.0000E+00      0.00
    6   Layer #j     6.000    (   6.000    )  0.0000E+00      0.00
    7   Thick(j)     19.62    (   19.62    )   1.000          0.00
    8   Rho(j)       6.300    (   6.300    )  0.0000E+00      0.00
    9   Rough(j)     2.000    (   2.000    )  0.0000E+00      0.00
   10   Sol%(j)      10.00    (   10.00    )  0.0000E+00      0.00
   11   Layer #k     4.000    (   4.000    )  0.0000E+00      0.00
   12   Thick(k)     38.00    (   38.00    )  0.0000E+00      0.00
   13   Rho(k)     -0.4000    ( -0.4000    )  0.0000E+00      0.00
   14   Rough(k)     2.000    (   2.000    )  0.0000E+00      0.00
   15   Sol%(k)      1.000    (   1.000    )  0.0000E+00      0.00
   16   Layer #l     8.000    (   8.000    )  0.0000E+00      0.00
   17   Thick(l)     38.00    (   38.00    )  0.0000E+00      0.00
   18   Rho(l)     -0.4000    ( -0.4000    )  0.0000E+00      0.00
   19   Rough(l)     2.000    (   2.000    )  0.0000E+00      0.00
   20   Sol%(l)      16.84    (   16.84    )   1.000          0.00
   21   Layer #m    0.0000E+00(  0.0000E+00)  0.0000E+00      0.00
   22   Thick(m)    0.0000E+00(  0.0000E+00)  0.0000E+00      0.00
   23   Rho(m)      0.0000E+00(  0.0000E+00)  0.0000E+00      0.00
   24   Rough(m)    0.0000E+00(  0.0000E+00)  0.0000E+00      0.00
   25   Sol%(m)     0.0000E+00(  0.0000E+00)  0.0000E+00      0.00

etc (40 total)
It is thus possible to eliminate layers which have already been given in the static layers file (e.g. giving zero thickness), or to modify and fit any layer parameter specified therein.

Treating sequences of data

A variant of wetlay is wetlays, which uses the addition features of fitfun to define a starting set of parameters, essentially using the standard fitfun commands, and then to treat a sequence of data stored in the multiple measurement file. This may result from a time or slowly changing temperature sequence. As described in the fitfun documentation the results of the sequence may be plotted and listed in the output file wlysmmm.lis using the seqfit commands P 1 j, and L j k l respectively, which select parameters from the parameter table for output. A complete file of the table of results is appended to the file wlysnnn.sls.