- The xfit main window, labelled "xfit". This has a menu bar with three pull-down menus attached:
**File**,**Mode**and**Help**. It also has a scrolled text window for displaying messages from the Fit program. Initially, this should contain information about the last update of the xfit GUI and the last update of the Fit program. A file name prompt will also appear - a file name cannot be entered here, this is treated merely as a message from Fit that it is ready to accept file names selected using the interface. - The PGPLOT graphics window, labelled "PGPLOT Window 1". This window will be empty on starting up the program.

**Load Y...****Load X...****Load SD's...****Load Parameters...****Save Parameters...****Quit**

- Y - this is the data which you wish to fit.
- X - this gives the X values for each channel in the Y file. If no file is entered for the X axis, the channel numbers will be used by default. If the number of channels in the X-axis file is not equal to the number of channels in the Y file or the number of frames is not equal to 1, the default X-axis is used. The X-axis is expected to monotonically increasing or decreasing but this is not checked.
- SD's - this is a file of the standard deviations for each channel. These are then used in weighting the fit. If no file is specified, unit weights are applied.
- Load/Save Parameters - values for the fitted parameters can be saved in a file, the format of which is explained in Output. Saved parameters can then be loaded and used to initialize parameters for a new fitting run.
- The
**Quit**option causes a Confirm dialog box to appear to verify the intention to exit xfit.

There are the following stages in opening a file for input using the Otoko File Selection box:

- click on the desired file in the right hand column.
- select the appropriate file type from the Binary Data option menu.
- enter the first frame, last frame and increment in the corresponding text fields.

`setenv CCP13HOME ~/CCP13`

if the CCP13 files are in a directory called CCP13 which is in your home directory.

Peak type | Key | Parameters |
---|---|---|

Gaussian | g | 3 |

Lorentzian | c | 3 |

Pearson VII | p | 4 |

Voigt | v | 4 |

Debye Gaussian chain scattering | d | 3 |

Double exponential | x | 4 |

Leibler diblock copolymer scattering | l | 6 |

The selection is made by pressing the appropriate key while the focus is in the plot window. All subsequent peaks will be of the same type until a different peak type is selected. The default type is Gaussian.

The formulae used for the different peak types give different meanings to the descriptions width and shape. In what follows, the position of the peak is assumed to be at the origin of the x-axis, h is the height of the peak, w is the width and s is the shape. Peak widths are the full width at half maximum (FWHM) unless otherwise stated.

**Gaussian**

$y\; =\; he-4ln2(x/w)2$**Lorentzian**

$y\; =\; h/[1\; +\; 4(x/w)2]$**Pearson VII**

$y\; =\; h/[1\; +\; 4(x/w)2(21/s-1)]s$

When s = 1, the Pearson VII is equivalent to a Lorentzian but as s increases, the peak becomes more Gaussian in character.**Voigt**

The Voigt is a convolution of a Lorentzian with a Gaussian. The shape parameter, s, corresponds to the ratio of the width of the Lorentzian to the width of the Gaussian, w. Therefore, when s = 0, the resulting curve is a Gaussian of width w.This can be expressed as: $y\; =\; h\; Integrale-4ln2(t/w)2/\; [(x+(2ln2/w)2+\; ln2s2]dt$

An approximation is used:

$y\; =\; h[\Sigma $_{i=1}^{4}(C _{i}(s/2 - A_{i}) + D_{i}(2ln2 x/w - B_{i})) /( (s/2 - A ] /_{i})^{2}+ (2ln2 x/w - B_{i})^{2})[Σ _{i=1}^{4}(C _{i}s/2 - C_{i}A_{i}+ D_{i}B_{i}) /(s ]^{2}/4 - sA_{i}+ A_{i}^{2}+ B_{i}^{2})

where the constants have the following values,i = 1 2 3 4 A -1.2150 -1.3509 -1.2150 -1.3509 B 1.2359 0.3786 -1.2359 -0.3786 C -0.3085 0.5906 -0.3085 0.5906 D 0.0210 -1.1858 -0.0210 1.1858 **Debye Gaussian Chain Scattering**

$y\; =\; 2h[e-(x/w)2-\; (1-(x/w)2)]/(x/w)4$

Here, w corresponds to 1/R_{g}if the x-axis corresponds to a q-axis. The central (guinier) region of the peak is Gaussian in character while the tail (power law) region is Lorentzian in character.**Double Exponential**

$y\; =\; 2h/[e-x/w+\; e+x/s]$

This peak is asymmetric; w corresponds to the rate at which the peak grows, approaching from the left, while s corresponds to the rate of growth, approaching from the right.**Leibler Diblock Copolymer Scattering**

This curve is described by a different set of parameters to those above:- Scale factor - overall scale factor
- Position - position on the x-axis of the origin of the q-axis
- Length - length of a Kuhn step
- Number - number of Kuhn steps
- Fraction - the volume fraction of A:B
- Flory - the Flory interaction parameter

*Macromolecules***13**(1980) 1602-1617 eqns IV-2 to IV-8)

An exponential component can be added into the background by pressing <e> while the focus is in the plot window. This will add two parameters to the fit to define the exponential curve, $e$_{1}.e^{e2.x} .

**Free**- if a parameter has been previously constrained using the other options, it is released to be a free parameter in the fit.**Set**- fix the value of a parameter to the value in the text field. The parameter is effectively removed from the fit.**Limit...**- this causes the Limit dialog box to appear. This has a label to show you the parameter number you are limiting and a brief description of the parameter. Two text fields are available for setting limits on the value of the parameter. The parameter number can be incremented by use of the arrow buttons next to the parameter number. Activation of the arrow buttons has the effect of applying the limits to the previous parameter.**Tie...**- this causes the Tie dialog box to appear. This has a label to show you which parameter you are tying and a brief description of the parameter. A text field is available for setting the parameter number to which the dependent parameter will be tied. A brief description of the independent parameter is updated when the apply button is activated. An option menu is available to specify the type of constraint to be applied to the dependent parameter. These are either an equality constraint or simple lattice constraints, i.e. applying (h,k) indices for hexagonal and tetragonal lattice positions or (h,k,l) indices for cubic lattice positions. These must be relative to the (1,0) or (1,0,0) positions, respectively. The parameter number can be incremented by use of the arrow buttons next to the parameter number. Activation of the arrow buttons has the effect of applying the tie constraint for the previous parameter. N.B. xfit always ties the higher parameter number to the lower one and modifies the Tie dialog and Setup dialog boxes to reflect this. It is not possible to make a compound tie constraint unless the constraint is one of equality, e.g. to tie parameter 8 to parameter 5 as the (1,1) hexagonal position and then tie parameter 5 to parameter to parameter 2 as the (2,0) tetragonal position.

**PLOT**- this allows you to plot the curve corresponding to the (modified) parameter set.**STEP**- this makes one linearized least-squares step. This is useful in seeing if the current model has a good chance of converging to the global minimum. The refinement may converge after a step. If the converged solution is satisfactory click on**RUN**to continue.**RUN**- this allows the algorithm to continue to convergence or to the maximum number of iterations (50 + number of steps taken).After the

**RUN**button has been activated, the parameter entries and the buttons in the Setup dialog box will be made insensitive and the Try Again confirm dialog box will appear.

Background and origin | ||
---|---|---|

Frame | Parameter | |

1 | Background polynomial degree | |

2 | a0 | |

3 | a1 | |

4 | a2 | |

5 | a3 | |

6 | a4 | |

7 | No. of exponential background parameters | |

8 | e1 | |

9 | e2 | |

10 | Origin for lattice constraints | |

Peak 1 | Parameter | Leibler parameter |

11 | height | scale |

12 | position | origin of q-axis |

13 | width | Kuhn step size |

14 | shape | number of steps |

15 | integrated area | volume fraction |

16 | unused | Flory interaction parameter |

17 | unused | unused |

18 | unused | unused |

19 | unused | unused |

20 | unused | unused |

Peak 2 | Parameter | Leibler parameter |

21 | height | scale |

etc | etc | etc |

Diamond Light Source is the UK's national synchrotron science facility, located at the Harwell Science and Innovation Campus in Oxfordshire.

Copyright © 2020 Diamond Light Source

Diamond Light Source Ltd

Diamond House

Harwell Science & Innovation Campus

Didcot

Oxfordshire

OX11 0DE