Adrian R. Rennie, Uppsala, Sweden
March 2010, Last modified 25 August 2017.
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
This document is also available as a pdf file. bike.pdf.
Fitting models to reflectivity or scattering data is often best performed by including constraints of prior knowledge to the models. A further enhancement is to choose appropriate parameters for minimisation that are not correlated. For this reason it is convenient to develop some fitting programs that are optimised for particular classes of problems. The programs BIKE and MBIKE are intended to help model the structures of surfactants and lipids that are found at solid/solution interfaces.
These materials often form bilayers with well defined hydrophilic and hydrophobic regions. The individual molecules are amphiphilic and generally consist of a hydrophilic head group and one or more hydrophobic tails per molecule. These are 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 bike is an extension of drydoc 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. In both programs, simple structure with up to eight layers can be modelled.
The programs bike and mbike are constrained to model 4 layers with 3 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 a GUI. The current version is prepared using the MinGW Fortran compiler. The current version of bike is 3.5 and of mbike is 3.5.
The programs are written entirely in FORTRAN and use the FITFUN fitting package and 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 profiles, multiple data sets 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 a different 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:
Seven 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 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 two surfactant molecules. This implies that:
(thn + ttail + tho) x Ahd > 2 x (Vhead + Vtail)
It is necessary to check that this constraint is met manually as it is not built in to the programs.
For mbike, 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 (bike.fcl) is shown below:
vers|1.0 prog|bike.exe prpt|bike prld|wntle|bike-prelude prld|title|bike - A.R. Rennie Version 3.4 27 June 2015 prld|Give data weighting 0-none;1-statistical|float|0| 0 | 1| 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|9| 0 | 9 | 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 - from data |float|1| 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.dat| rcmd|help|refread.hhh main|wntle|bike - fitting a bilayer model to reflection data hcmd|wntle|About... hcmd|title|Bike - a bilayer at a solid surface hcmd|View file/View helpfile |filed|bike.hhh jcmd|wntle|model output jcmd|title|Write out model for later comparison with data jcmd|Write out reflectivity file (1), Interface as BSD file (2) or Physical Model Parameters (3) |float|1|1|5| jcmd|Reflectivity file: Minimum Q value A-1 |float|0.0|0|4 jcmd|Reflectivity file: Maximum Q value A-1 |float|0.4|0|4 jcmd|Reflectivity file: Number of points in output |float|50|0|512 jcmd|Filename for output (with extension)|filew|bikeout.dat jcmd|Title for reflectivity results|text|Output from bike 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
Program and documentation: © Copyright A. R. Rennie Last updated 25 August 2017.