Uppsala University
Manual written August 1996 - Updated November 2010
Contents, Introduction , Models, Use, Conclusion, References, ContactNote. This document uses the 'Symbol' font to display some equations. If you are viewing this page on a workstation without this font, some of the equations may be confusing!
1.
Introduction2.
Description of Models3.
Use of the Program5.
Concluding RemarkContents, Introduction, Models, Use, Conclusion, References, Contact
This program is intended to fit a few simple models from the field of polymer science to small-angle neutron scattering (SANS) data. It is not intended to be comprehensive but rather to provide a start in fitting non-linear models to data. For many purposes the simple linear regression analysis of data plotted on appropriate axes is the best technique for analysis. In further cases a satisfactory result is obtained only from a simultaneous fit of a model to several spectra measured for different samples that may vary in contrast or concentration. This simple program is designed to demonstrate models that can not be reduced to a linear form or to help fit data that is collected outside the range of linear small angle approximations. The models that come in to this category involve polydispersity, scattering at intermediate or large angles and polymer blends or solutions. For purposes of comparison the 'Zimm' and 'Guinier' models are included: it is sometimes instructive to look at the result of these fits in plotted forms. If it is difficult to make a correct background subtraction for a sample it is sometimes useful to fit these models with the addition of an adjustable flat background.
The program has some limitations - plots are normally graphs of intensity I(Q) versus the scattering vector Q and the weighting in the fits depends on the experimental errors. This alone will give different results in a least-squares minimisation. It is often important to remember that a significant fraction of the error in measured small angle scattering data does not arise from random statistical noise but has elements that are systematic or correlated. The experimentalist must decide to what extent automatic least squares minimisation gives the best fit results. The program uses the FITFUN library of fitting routines which permits a high degree of interactivity in trying different model parameters [1].
It is very difficult to provide a program that will be sufficient for a large number of users with very different samples (and model functions). Further, if a program permits a complicated model to be refined there is a tendency for users to attempt simultaneous refinement of too many parameters. To avoid this hazard the program permits only discrete, simple models rather than attempting to calculate scattering functions for general numbers of polydisperse, interacting components. Other programs exist for the treatment of a variety of other models (notably in the field of colloid science). Even for the models available in this program it is advisable for the user to exercise caution in deciding how to let the various parameters float!
The effects of resolution are not included in these models. This is a deliberate simplification intended for initial data analysis. Many of the functions are rather smooth, featureless curves and the effects of resolution are rather small. The effect is usually to cause a reduction in the fitted dimension (usually Rg) of at most a few per cent, even when the wavelength spread and angular divergence give rise to perhaps 15-20% DQ/Q at the smallest values of momentum transfer Q. As this will effect all data of a comparable size to about the same extent, this effect can often be ignored unless high accuracy is required. The fortuitous insensitivity to resolution does not apply to all models and where spectra contain sharp features, either maxima or minima, care must be exercised.
Other programs such as RFIT must be used if the effects of resolution are important.
Contents, Introduction, Models, Use, Conclusion, References, Contact
There are twelve models available in the present program which are described below:
This is the Fourier transform of a Gaussian segment distribution and has the form given by Debye [2]:
P(r) = 2 . ( r2 - 1 + exp(-r2) ) / r4
where r is the dimensionless variable Q Rg and Rg is the radius of gyration of the molecule. The model that is calculated in the program is this function scaled with an intensity I(Q=0) plus a flat background.
The model calculates a distribution of scattering functions P(r) as described in 2.1. The distribution is that for free-radical polymerisation and is expressed in terms of the ration of Mw/Mn. This can only take values between 1 and 2. This model is described in many textbooks on polymer chemistry see e.g. reference [3], for example in The probability of a chain of N monomers P(N) is expressed as:
P(N) = (r-1) r(N -1)
The scattering of each component is weighted by N.P(N) - the radius is assumed to vary as the square root of N. The polydispersity r is entered in the model as Mw/Mn, the ratio of weight average to number average molecular weight which should only take values between 1 and 2.
This is similar to option 2 but the distribution is assumed to be Gaussian in the radius of gyration. Once again the component scattering functions are weighted by the probability times the mass (assumed to be proportional to the square of the radius). The polydispersity is entered in this model as a fractional standard deviation, i.e. if sigma is given as 0.1 this is taken as 10% of the current Rg. This type of distribution may be appropriate to some anionic polymers with narrow distributions of molecular weight.
This is the analogue of a simple Zimm plot [7] in which a linear fit is made to 1/I(Q) Vs Q2. the function in this model is:
S(Q) = [ Q2R2/3 + 1/I(Q=0) ]-1 + Background
The background in this model is constant with Q - this is not the same as the effect of a virial coefficient which is constant in Q2. This can be used to compare the results of simple linear regression such as those obtained from the program RGUIM.
This is similar to the Zimm (option 4) but ln I(Q) is assumed to vary linearly with Q2. Again there is the possibility of including a flat background.
This is the simple Flory-Huggins [4] model for two interacting polymers:
1 / S(Q) = 1 / P1(Q) + 1 / P 2(Q) - 2 χ
In this model P1 and P2 are assumed to be Debye functions as described in section 2.1, the possibility of including a flat background is also included. It is clearly possible to use this model with zero weight for one component to model a single polymer with a solvent or with zero interaction to account for a mixture of polymers differing only in size and contrast.
For comparison with other systems the scattering function for a monodisperse hard sphere is included. Note that the radius in this model is a hard sphere radius and not a radius of gyration. It should also be noted that the instrument resolution may be rather more important in this model which has sharp minima. This can be included in model calculations readily and a variety of other programs are available for this type of problem. The function is given by:
P(Q) = [3 {sin(QR) - QR cos(QR) } / (QR)3 ]2
The radius of the sphere in this function (and as used in the program) is related to the radius of gyration or Guinier radius, Rg by:
R = (5/3)1/2 R g
This relation can be used to compare the results of Guinier fits to this model.
The basic model is described in 2.9 and includes a distortion of the usual Debye scattering function induced by non-theta solvent conditions. The model in this option further allows a measured SANS spectrum to be used as the background (with a fitable multiplicative factor). This may be useful if it is difficult to estimate the incoherent scattering background and it is not flat. This feature can be used for a simple Debye function fit by setting the parameter 4 (A2) equal to zero.
This function allows for calculations with a single virial interaction term (A2). As the program is only dealing with one data set at a single concentration this is included in the following simple way:
I(Q) = I(Q=0) . { PD(Q) - (A2/I(Q=0)) . PD (Q)2}
The user of the program will need to make due allowance for conversion of the constant A 2 in this formula to a conventional virial constant by making due regard of the sample concentration. PD(Q) is the usual Debye expression for Gaussian segment distributions and depends only on the radius of gyration Rg. The function described will modify the true, observed Rg from that entered as the argument for PD(Q).
Benoit [8] derived an expression for the scattering from branched or star polymers with a number of arms f, which can be expressed in the following way:
P(Q) = 2/x2 {x/f - (1- e-x)/f + (1-e-x) 2(f-1)/2f }
where x is equal to (Rg2Q2/fg) and g is equal to (3f-2)/f2. This reduces to the usual Debye formula (Section 2.1) for the case that f equals 2 (a linear molecule).
The scattering from di-block copolymers in the limit of the RPA has been described by Leibler [5,6] and may be expressed once again as a combination of functions related to that of Debye (option 1) :
1 / I(q) = (PAA + P BB + 2PAB)/ (PAAPBB-PAB 2)- 2 c
where the functions Pij are given in terms of the functions p(f,x) where
p(f,x) = (2/x2)(fx + e-fx - 1)
and x equals Q2Rg2 with Rg the radius of the copolymer and f is equal to NA/(NA + NB).
Contents , Introduction, Models, Use, Conclusion, References, Contact3.1 How to Run the Program
The current version of the program (4.2, 16 November 2006) has been built with latest FITFUN library and is compatible with the standard ILL SANS data treatment prgrams. The current version can either be run using Prop as described below or as a further enhancement with Clickfit that allows a full graphical user interface. The instructions for the Clickfit GUI are also available at the ILL WWW site. To use this GUI it will be neccesary to install Prop and to start clickfit.bat with prop.
Instructions on the use of FITFUNS can be found in the documentation at the ILL, Grenoble. The preferred operation of Polymer is by means of the Clickfit GUI. This is described here.
The main options for the program are chosen from a 'Prelude' dialogue box that allows selection of the data format, number of layers, 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:

Older versions are available for both DOS and UNIX and are designed to run in the environment used with the standard ILL SANS programs. If this has been set up it will be sufficient to give the command:
polymer
on UNIX or
RUN POLYMER
for (DOS)
The details of how to set-up the environment variables and the data formats are described elsewhere.
Once running the program, the user chooses one of the models described in section 2, having selected a model the user will then be able to give standard FITFUN commands (for a full description see the FITFUN documentation [1]). Interactive help is obtained by typing selecting Help from the pull down menus or, in command line mode by typing H. The user must select data to be fitted with the read R command and before attempting any fits set some sensible starting values of the parameters. The parameters can be saved in a parameter file poly.ffn when leaving the program. These parameters will be the defaults when the program is next run.
Most small angle spectra will contain a region obscured by a beam stop and this should be excluded from any fit using the only, O, command. Otherwise the program may try to fit the model to these data points! Use the fit F n command to allow the program to try to fit the model to the data. The step size used in iterations of the fit is scaled automatically by FITFUN. For high precision it may be convenient to use step sizes smaller than 1 for floating variables, in some cases 0.5 or even 0.1 may be more appropriate. The user is encouraged to experiment.
Remember that for the routine to minimise the function several iterations will be necessary - generally a few more than n2 where n is the number of floating variables. If there are correlations it may prove impossible to minimise certain functions, under these circumstances it will be necessary to apply other knowledge to constrain parameters. The correlation matrix and a list of observed and calculated values can be obtained with the list L command. This creates a file polymmm.lis which can be printed on a line printer. The number mmm will increment when the program is restarted.
The option P will produce a plot file (for subsequent printing) that contains the current fit. If a fit range has been selected with the Only command, it will include extrapolations to the plot limits beyond the range of the data. The usual default for the plot file is Postscript but this can be changed using environment variables as described in the ILL SANS documentation.
It is often useful to compare fits with different models. A simple procedure is to make a good fit with one chosen model and then to save the parameters, exit and restart the program with a new model. The basic parameters such as radius of gyration and I(Q=0) are then retained as defaults for the next attempt at fitting data.
The default values for the choices of scale types, model, etc. when used with the Clickfit GUI can be changed by editing the file polymer.fcl. It is thus also possible to have multiple copies of the file with different names that run the same program with different defaults. This can make switching between options very fast!
Saving Parameters The Fitfun command S or save will write the current parameters and scale limits to a file poly.ffn that is read when the program is restarted so as to provide newly updated default values. This is convenient when returning to fit further data. Sometimes when changing to completely different models it is convenient to use the original defaults that can be obtained by deleting (or renaming) poly.ffn in the work directory.
Choice of other than a linear scale also modifies the weighting in the fit (which then uses logarithmic or square root of differences, according to the scale chosen) rather than 1/error. This can be used to explore other weighting criteria in the fit procedure. It is always possible to generate a plot with the non-linear scale but using a normal statistical weight by saving the parameters from a normal fit and restarting the program with different scales and not changing the parameters.
Sequences of data and Kinetics After parameters have been fitted to one data set, FITFUN allows a sequence of runs to be treated automatically. This is conveniently done with the 'Make Sequence' button in Clickfit that will allow data files to be selected. It is possible to choose whether to use the same starting parameters for each data set or to use the updated parameters from the previous fit. The latter choice may improve convergence in kinetic data. The output of fit parameters is made to a csv file (name is defined by the user) that also records the fit status for each data set (i.e. succesfully minimised, no minimum found or limit of iterations reached.).
The standard units for momentum transfer Q in the ILL SANS data are Å -1 and this will be the normal unit for the x-axis, radii are in consequence given in Å. The intensity scale will depend on the normalisation of the data. Molecular weights and interaction parameters can only be calculated if the data has been corrected to absolute units and the concentration is known. It is the users responsibility to convert I(Q=O) to useful parameters. Units for polydispersity are discussed under the relevant models. The value of I(Q=0) will give a weight average molecular weight.
No responsibility can be taken for the correct function of this program. Please check the operation very carefully. It would be of help if any errors or anomalies in the operation of the program were notified to the author. Similarly suggestions for improvements would be gratefully received.
I am very grateful to Dr Ron Ghosh of the ILL, Grenoble for his assistance and for making available his library of programs.
Contents, Introduction , Models, Use, Conclusion, References, ContactBack to Adrian Rennie's Home Page
Please make any comments or report any errors to:
Professor Adrian R. Rennie
Department of Physics,
Uppsala University
Sweden
Back to Adrian Rennie's Home Page
Last Updated 11 February 2011