next up previous
Next: Making Other Least Squares Up: LEAST SQUARES REFINEMENT USING Previous: Parameters and Variables

Subsections


Examples of Least squares programs

We illustrate these general ideas by, first, a simple example of LSQ which does not involve structure parameters, and, second, notes on the use of the standard single crystal structure refinement program, SFLSQ.

There are two fundamental questions to be asked of a main LSQ program:

  1. on which calculated function is it refining
  2. which parameters may be refined.

DSLSQ

DSLSQ is a main program which determines the values of up to 6 cell parameters by LSQ fitting, using values of d spacings observed at different values of h,k,l.

The calculated function used is the expression for the square of d*, in reciprocal space:

\begin{displaymath}d^*(h,k,l)^2 = (h^2a^{*2} + k^2b^{*2} + l^2c^{*2} +
2kb^*l c^*\cos\alpha^* + 2lc^*ha^*\cos\beta^*
+ 2ha^*kb^*\cos\gamma^*)
\end{displaymath}

The parameters to be varied are the reciprocal cell quadratic products A*, B*, C*, D*, E* and F*, where A*=$a^{*2}$, D*= $b^*c^*\cos\alpha^*$, etc.

The author of the main program had the choice of names for these parameters, and decided to make them members of family 1, genus 1, having species names A*, B* etc. Alternatively, she could have made them members of family 1, genus 2, with genus name CELL, and species names the integers 1 to 6. There are no other parameters in this simple example.

The calculated function $G_{calc}(h,k,l)$ has been programmed into a routine CALCDS, which is given the values of h,k,l, and returns the value of $G_{calc}$ as defined above, together with all derivatives of $G_{calc}$ with respect to the relevant cell parameters. If a user happened to have data which were observations of, say, d rather than d* squared, CALCDS could be simply rewritten to calculate instead $G_{calc}(h,k,l)=d$ and its derivatives.

Other routines which have been written for this specific application are:
APSHDS to apply shifts to the parameters,
NWINDS to output new Crystal Data containing the shifted parameters,
PARSDS to decide which are the parameters of the problem, and
VARSDS to set up which parameters are variables.

The routines APSHDS, CALCDS, NWINDS, PARSDS and VARSDS may be inspected in a listing of CCSL if further detail is sought.

Structure Factor LSQ

SFLSQ (standard LSQ refinement with possible geometric constraints), GRLSQ (taking groups of input reflections together) and MAGLSQ (for magnetic structures) are all examples of CCSL single-crystal LSQ programs.

Crystallographic LSQ involving structure factors follows much the same pattern as the DSLSQ example above. The calculated function involves a structure factor computation by a routine such as LFCALC, during which derivatives are made with respect to all structure parameters which are variables.

For details of the L cards which drive such LSQ programs the user should consult the specification in Chapter 3. An example of the Crystal Data for SFLSQ is as follows:

 
I NCYC 5   PRIN 3   CONV 0.02
L RELA 2   2 Co SITE  1 Mn SITE  1 Sn SITE
L VARY   ALL SITE
L MODE 5     WGHT 1
L SCAL     1    1    1
L FIX  DOMR
N Co2Mnsn at room temp
S     -X,    -Y,     -Z
S  1/2+X, 1/2+Y,      Z
S      Y,     Z,      X
S     -Y,     X,     -Z
A Co   1/4   1/4   1/4    0.3115
A Mn     0     0     0    0.2842
A Sn   1/2   1/2   1/2    0.3386
F Co    1    0.2500
F Mn    1   -0.3730
F Sn    1    0.6228
C 6
E    1    100.    0.05

The C , S , A , F , and E cards are the same as for other programs, giving 3 atoms in special positions in a cubic space group, with neutron nuclear scattering factors, and type 1 extinction corrections on the structure factors.

The I card requests 5 cycles of refinement, with printing of the observed and calculated values of the function on the first and last cycles, and terminating before the 5th cycle if the largest shift/$\sigma$ is smaller than 0.02 (rather than the default of 0.01).

L cards are needed where defaults need to be changed, so L WGHT asks for unit weights rather than statistical weights, L MODE asks for the special extinction correction input mode rather than the standard format for observed input files, and so on.

Each LSQ main program has its own defaults built in as to whether a given parameter should be fixed or varied. In general most structure parameters are by default varied, but site occupation factors are by default fixed, so the L VARY ALL SITE card is needed here.

It is required to relate all three site occupation factors by the linear relation expressed on the L RELA card.

Interpretation

The main program SFLSQ interprets the above Crystal Data and deduces that all three atomic positions are so special that all their coordinates are fixed. It makes 9 basic variables, being: MOSC, SCAL 1, SCAL 2, SCAL 3 (having deduced that there are 3 scale zones from the L SCAL card) Co ITF, Mn ITF, Sn ITF (the isotropic temperature factors, varied by default) and Mn SITE and Sn SITE .

it makes 10 variables, being all the above plus Co SITE (a redundant variable), and records the constraint:

2* Co SITE + Mn SITE + Sn SITE = constant
By default, as there is no L REFI card, the program refines on the modulus of the structure factor. Another input dataset is needed, in the format indicated by the card saying L MODE 5 ; the name of the file containing this data set is requested interactively.
next up previous
Next: Making Other Least Squares Up: LEAST SQUARES REFINEMENT USING Previous: Parameters and Variables
P.J. Brown - Institut Laue Langevin, Grenoble, FRANCE. e-mail brown@ill.fr