There are two fundamental questions to be asked of a main LSQ program:
The calculated function used is the expression for the square of d*,
in reciprocal space:
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
has been programmed into a routine
CALCDS, which is given the values of h,k,l, and returns the value of
as
defined above, together with all derivatives of
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
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.
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/ 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.
it makes 10 variables, being all the above plus Co SITE (a redundant variable), and records the constraint: