Adrian R. Rennie, Uppsala University, Sweden
December 2016, Last modified 17 June 2018.
1.2 Legal Notice
2. Use of the Program
2.1 Data Files
2.2 Definitions of Parameters
2.3 Suggestions for Start Values
2.4 Customising the Program
3. Simultaneous Fits with Multiple Data Sets
4. Suggestions and Hints
4.2 Frequently Asked Questions
Acknowledgements and References
Fitting models to reflectivity or scattering data is usually best performed by including the constraints of prior knowledge about the to the models. A further objective in fitting algorithms is to choose the parameters for minimisation that are not correlated. For this reason fitting programs have been developped that are designed for particular classes of scientific problems. In the case of structures formed by surfactants, the individual molecules are often identified by known hydrophilic and hydrophobic regions with known volumes and scattering contrast. For simple systems the programs BIKE and MBIKE are used to model bilayers of surfactants and lipids that occur at solid/solution interfaces.
The program MMEMB extends the model used in BIKE to include mixtures of two amphiphiles and the possibility that these are segregated non-uniformly. The structure is shown schematically in the figure below:
Associated with each volume for the surfactant there will be a scattering length. Solvent molecules are also defined by a volume and a scattering length. These are discussed in more detail in sections 2.2 and 2.3 below.
The program mmemb is an extension of bike which allows unconstrained models of multiple uniform layers for a single data set. The program mbike is equivalent to the program wetdoc for multiple data sets. These two programs provides a means of making interactive, graphical fits to neutron reflection data using multilayer models calculated using optical matrix methods. The parameters may be changed manually to explore the effect of different structural models or varied using a least squares algorithm.
The program iss constrained to model 5 layers with 4 of the layers defined by molecular properties of adsorbed species (volume, extent of the tail region etc.). The programs are intended for operation with Windows and can optionally be run with the clickfit_m GUI. The current version is prepared using the MinGW Fortran compiler. The current version of mmemb is 1.4.
The programs are written entirely in FORTRAN and use the FITFUN fitting package and PGPLOT (T. J. Pearson, Caltech) graphics as modified by R. E. Ghosh from the ILL, Grenoble, France.
Installation The program can be downloaded with other software as a zip file refprog_2015.zip. It is recommended to run the program using clickfit and the utility 'Prop' available from the ILL. Instruction for download and use of Prop are available from the ILL WWW site. Prop is installed but clickfit and the fitting programs only need to be copied to suitable directories.
Information about other fitting programs that will treat smooth profiles, multiple bilayers and other specific problems is available on the web at: http://www.reflectometry.net/refprog.htm
These programs are made available for non-commercial use without charge. They should be acknowledged in any publication by reference to the Author and this web page. No guarantee is provided that the results of the programs are correct. It is the reponsibility of the user to check all results.
Instructions on the use of FITFUNS can be found in the documentation at the ILL, Grenoble.
The main options for the program are chosen from a 'Prelude' dialogue box that allows selection of the data format, use of resolution function etc.
The default choices in the prelude can be changed by editing the appropriate .fcl file. Once the choices are made, the main program is controlled from another interactive window:
The individual variables can be selected with a mouse and a new dialogue box appears that allows new values for parameter and the step size to be given. Other functions can be selected from the buttons or pull down menus. When display of data or a fit is calculated, it is shown in a separate graphics window:
Ten different ASCII data formats can be read in the current version. These are:
The data format is selected in either the opening dialogue or the Clickfit 'Prelude'. A fuller description of the data formats is available at http://www.reflectometry.net/refdata.htm. The four column data set input has been added in August 2007. The 4th column provides information about Q resolution of the data. At present this resolution is not automatically incorporated in the calculation but information must be provided separately. The input routine is purely to provide convenience and avoid reformatting data. It is hoped to incorporate automatic use of resolution from data sets when some agreement is reached about how resolution is defined.
The program assumes that data for scattering length density is provided in units of 1 x 10-6 A-2. If the momentum transfer, Q, in the input data files is in Å-1 then the thickness of layers must be given in Å. These could be scaled with other parameters if input data is in nm-1.
The following summary of the definitions may be useful:
The following diagram indicates this arrangement schematically:
The space in the layers of heads and tails that is not filled by surfactant molecules is assumed to be filled by solvent molecules. An important physical constraint is that the space in these layers is at least sufficient for the surfactant molecules, both A and B. This implies, for example, that:
(thn + tti + tto + tho) x Ahd > 2 x (Vhead tot + Vtail tot)
For mmemb, The scattering length of each component can be set to a different value for each data set. The thickness, volume and roughness are kept the same for modelling each data set.
The roughness for the top material and oxide layers is given in Ångstrom but the roughness at the following interface for the other layers is defined as a fraction of the thickness (Rough f).
It is for the user to determine how to model data and to choose parameters and values consistently. Some examples and suggestions as to how to estimate parameters are provided here. Data for scattering lengths and a simple means of determining scattering length densities is provided at the NCNR, NIST web site. The following table provides some approximate values for scattering length densities in the units used in the programs. In order to obtain a scattering length the atomic formula for a molecule is needed. The scattering length density calculation needs also information about the mass density of the material (which is combined with the formula mass) to determine a formula volume.
|Material||Chemical Formula||Scattering Length Density / 10-6 Å-2|
In these programs the parameters for the solvent and the surfactant moieties are given in terms of the molecular volume and the scattering length. Some examples of approximate values for these quantites are given in the next table.
|Material||Chemical Formula||Formula Volume / Å3||Scattering Length / 10-15m (fm)|
|Dodecyl Chain deuterated||C12D25||370||246.5|
The users input of molecular volume will be important in determining the amount of solvent that is surrounding the surfactant in the interfacial layers. It is important to consider when calculating volumes whether it is appropriate to consider a liquid or a crystalline density. The values for layer thickness for the surfactants will clearly depend greatly on the molecular structure but are ofte in the region of 10 to 30 Å. The areas per molecule in the layer are similarly varied but often in the range of 40 to 200 Å2.
It is very important to check that the values for the roughness are physically reasonable. The approximation used by the program due to Nevot and Croce is only valid for values of the roughness that are small compared with the layer thickness. If large values of the roughness or continuously varying profiles are needed for a model it will be necessary to choose a different program that can model such profiles. Please consult the catalogue of other programs to make a suitable choice such as lprof or cprof.
The last parameters, the ranges for fitting and the limits for graphs are saved in a parameter file if the 'Save' option is used. These are the defaults when the program is restarted.
Further customisation of the defaults is possible by editing the clickfit configuration file that is used to start the program. An example (mmemb.fcl) is shown below:
vers|1.0 prog|mmemb.exe prpt|mmem prld|wntle|MMEMB-prelude prld|title|MMEMB - A.R. Rennie version 1.4 4 March 2018 prld|Data type .dat 0; RAL 1; Afit 2; NIST 3; .TXT (ANSTO) 4; .OUT (ILL) 5; New .his 6; .mft 7; 3-col no header 8; mantid .mft 9 |float|7| 0 | 9 | prld|Give data weighting 0-none;1-statistical|float|0| 0 | 1 | prld|Fit data as R*Q**4 0-no, 1 yes |float|0| 0 | 1 | prld|Include resolution 0-none; 1 const dQ/Q; 2 const dQ; 3 (dQ/Q + dQ); 4 taken from input data |float|4| 0 |4| prld|Resolution: for dQ/Q constant give % resolution |float|5.0|.1|30| prld|Resolution: for Delta-Q constant give value (A-1)|float|0.01| 1e-5 | 0.1 | prld|help|refprel.hhh rcmd|wntle|Reading new data rcmd|title|Reading reflectivity data rcmd|Data filename.dat |filer|a28708.mft| rcmd|help|refread.hhh main|wntle|mmemb - fitting a mixed bilayer model to multiple reflection data hcmd|wntle|About... hcmd|title|MMEMB - mmemb+gui hcmd|View file/View helpfile |filed|mmemb.hhh jcmd|wntle|model output jcmd|title|Write out model for later comparison with data jcmd|Write out reflectivity file (1) or Interface as BSD file (2) |float|1|1|2| jcmd|using parameter set number|float|1|1|10| jcmd|Reflectivity file: Minimum Q value A-1 |float|0|0|4 jcmd|Reflectivity file: Maximum Q value A-1 |float|0.3|0.05|4 jcmd|Reflectivity file: Number of points in output |float|200|50|512 jcmd|Filename for output: |filew|mmembout jcmd|Title for reflectivity results|text|Output from mmemb rstx|attempt restart function (dummy at present - rsta control name)
The default data types, resolution and even input data file name can be altered by editing the fcl file. It is possible to keep multiple copies of fcl files with different names in order to start the program with different defaults.
A separate program MBIKE is used to read and make simultaneous fits to multiple data sets for the same sample or structure. The use is very similar to BIKE but it should be used with the clickfit_m graphical user interface (GUI) as this permits setting some different values for parameters for different data sets.
There is one additional parameter in MBIKE (21): Mult Ahg. This is a multiplicative factor for the area per molecule for each data set. If set to 1 the area is just Area/hd. It can be either smaller or larger than 1.
The following parameters can be allowed to vary between different data sets (the others are constrained to be identical):
It is expected that for a given experiment only some of the different variables will be needed but the range of parameters that can be constrained or varied allows some flexibility in use of the program. Different ranges of momentum transfer for fitting can be selected for different data sets using the options under 'Fitting' in the GUI or the 'O' command if the program is run from a command line.
There are a number of reasons to fit a model to multiple data sets. These include:
In studies of complicated systems make sure that the model for the bare substrate fits the data measured for that system before proceeding to more complex systems. It is useful to build up from simple models (few layers) to more complex models (many layers) when trying to fit data. Check that the model is compatible with all contrasts before proceeding.
It is usually convenient to refine a model with only a few parameters initially. Manual changes of parameters to find good starting values are often the most efficient way to search for reasonable models.
Resolution can be included in different ways: the normal function would be to assume a constant dQ/Q. A further option is either constant dQ or a combination of terms that have fixed values of dQ/Q and dQ. This resembles a function that approximates to fixed slits at various angles is available for scans made in this way (using the old version of D17 at the ILL.) Data from D17 is no longer normally collected in this way. Old versions of the program allowed definition of resolution in terms of the slit sizes etc but this. is no longer included in current versions.
At present the resolution from individual data sets is not used in calculating smearing even when information is provided in the fourth column (as no standard definition is available).
The default options in this program is for equal weighting of all data points in the fits. This is often found to be more satisfactory than weighting by the errors which are frequently not appropriately chosen. Systematic errors and variation in the resolution may be large compared with the random errors particularly at large reflectivity (small Q).
Γ = 2 M / (NA A)If necessary make allowance for the value of Mult Ahg. You will also need to convert to whatever units (e.g. cm2 or m2) are required. A is in Å2.
I am very grateful to Dr Ron Ghosh who has provided the FITFUN and clickfit software and co-operated in the development of these programs.
A description of the methods used in these calculations is given in the Rutherford Appleton Laboratory Report: 'Adaptation of Methods in Multilayer Optics for the Calculation of Specular Neutron Reflection' by J. Penfold, No. RAL-88-088.
Other details on the calculation of reflectivity profiles can be found in the books by O. S. Heavens, 'Optical Properties of Thin Solid Films', 2nd Ed. (1991) Dover and J. Lekner, 'Theory of Reflection', M. Nijhof, Amsterdam (1987). The matrix calculations were originaly described by F. Abeles Ann. de Physique, 5, 611 (1950) and the method to include small amounts of roughness by L. Nevot and P. Croce J. Phys. Appl. 15, T61 (1980).
Please report mistakes or make suggestions for improvements to:
Professor Adrian R. Rennie
Uppsala University, Uppsala, Sweden
Program and documentation: © Copyright A. R. Rennie Last updated 17 June 2018.