<* $Id: xnd_rvar.html,v 1.1.1.1 2000/00/24 11:26:00 berar Exp $ *> XND 1.2 : encoding variables and usage of codewords.

xnd 1.2: encoding of variables in the standard blocks.


xnd top Next file Previous file

Introduction

For each variable in the program, xnd allows some complex treatment such as a polynomial expansion or introduction of linear dependance. All the variables in xnd are read using the same procedure. For convenient reasons they are grouped by block of variables which have the same behaviour.

The program is structured in order to have a starting input file of a simple form containing only a limited number of foundamental blocks having a simple form. Nevertheless, it is possible, as the refinement progresses, to add some more blocks or to modify the existent. This actually leads to an increased complexity of the block structures and to a growing number of blocks. We have already said that it is possible to introduce a depence on an external variable Temp in all the cristallographic parameters.

A new structure associated with a key takes place of the previous numerical code in xnd_1.1 which are still recognised.

Each variable has two parameters. The first is its order, it characterizes the allowed expansion along an internal parameter; it is the number of term in the polynomial expansion : if the variable does not depend on this parameter, its order is one. The second parameter is the size of the expansion, its allows complex linear dependance to be written. In this file, the name of the variable will be @VARIABLE, in the real file it should be @LAMBDA, @BACKGROUND, @CELL, @COORD, ... according to the real name of the variable. In the other files of this document all blocks the parameter of each variable will not be specified but the variable block has always the following structure.

@VARIABLEkey identifier for a variable named "VARIABLE"
ORDERd1number of term in the polynomial expansion
SIZEd1size of the parameter space

Order and size expansion

The following table recall the basic cases before showing by some examples.

ordersizeexample
0 The bloc is empty : used to read some blocks in which you can have no data (eg if no points are specified in the background)
11 No Dependance of Temp, that is a classical parameter a=a(0)
>11 Polynomial expansion with Temp of power order(eg cell paramters with thermal expansiond) a=a(0)+a(1)*Temp+a(2)*Temp^2
1n No Dependance of Temp but a multidimensional linear expansion using internal parameters b, c ... a=b(0)+c(0)
>1n Polynomial expansion with Temp of power -order and multidimensional linear expansion a=b(0)+c(0)+Temp*(b(1)+c(1))

Caution, the value of order is limited when reading the file to the value given in the MaxOrder parameter specified in the file header. This has be done to detect some mistakes reading the file avoiding some nosense data.

Content of the value field

In the coordinate file, two fields are associated to each refined variable: The content of each parameter, associated with the format '%', depends on the values of order and size according the following examples:
ordersizecontent
0
11Value(0)RefCode(0)
2Value(0)RefCode(0) Value(1)RefCode(1)
3Value(0)RefCode(0) Value(1)RefCode(1)Value(2)RefCode(2)
12Value(0)RefCode(0,1)RefCode(0,2)
3Value(0)RefCode(0,1)RefCode(0,2)RefCode(0,3)
22Value(0)RefCode(0,1)RefCode(0,1) Value(1)RefCode(1,1)RefCode(1,2)

Codeword and coupling coefficient

The content of RefCode, the refinement code is simple, it contains: These values are read according to the following table

CodeWordCoupling Coef.meaning
0fixed
1..91not readadjusted
11..999fto be read
-1..-91not read fixed
-11..-999fto be read

For the codewords between 11 and 999, the program creates an internal parameter with CodeWord as reference number and all the values refering the parameter are moved from this parameter multiplied by their coupling coefficient. Some specific rules appear in case where the ValidRef value in the general header is non zero, they will be described with alternate refinement.

Examples

The following only contains basic examples. It concerns blocks having no Temp dependance. More complicated examples are detailled in the following section : usage of codewords.

The following example is a fixed size block corresponding to the setting of the instrument. There are 4 variables to read, only the first will be adjusted.

@SETTING
   0.002   1    1.0  0
   0.0     0    .20  -1
Another simple example is found in a coordinates block, which contains x, y, z, occ and biso :
@COORD
   0.123   1    0.25  0    0.432  1
   1.0     0    0.70  1

Example of usage of codewords in xnd.

This section describe some more complex uses of xnd codewords.

Contents

Variables block for an orthorhombic cell

The following lines are an example for a simple parameter block corresponding to an orthorhombic cell. There is no relation between a, b and c which are free. The angles can not be refined. The first position corresponds sample displascement which is also fixed.
@CELL
     0.000   0
     5.375   1      6.375  1       7.789   1       
     90.0    0     90.0    0      90.0    0

Variables block for a quadratic cell

There is one relation between a and b, c is free. The angles are not refined.
@CELL
    0.000    0            
    5.1234  12 1.0     
    5.1234  12 1.0    
    8.2345   1           
    90       0            
    90       0     
    90       0     

Variables block for an cubic cell

That is the same for a cubic block, but a, b and c are varied together.
@CELL
     0.000   0
     1.234  11    1.0     1.234  11    1.0
     1.234  11    1.0     90.0    0
     90.0    0            90.0    0

Variables block for a hexagonal cell with thermal expansion

If the hexagonal cell has to follow the temperature with a linear thermal expansion. A parameter can be written as :
a = a0 + da/dt DT
There is 2 terms, then the block should be written as :
@CELL ORDER=2                                   
    0.000    0       0.0    0        
    5.1234  12 1.0   0.002 13 1.0    
    5.1234  12 1.0   0.002 13 1.0    
    8.2345   1       0.004  1        
    90       0       0      0        
    90       0       0      0
    120      0       0      0
If a linear expansion is not enough, we can write a more complicated expansion :
a = a0 + da/dt DT + d2a/dt2 DT^2
Then the block should be written as :
@CELL ORDER=3                                   
    0.000    0       0.0    0       0.0     0        
    5.1234  12 1.0   0.002 13 1.0   0.0001 14 1.0    
    5.1234  12 1.0   0.002 13 1.0   0.0001 14 1.0    
    8.2345   1       0.004  1       0.0002  1        
    90       0       0      0       0       0        
    90       0       0      0       0       0
    120      0       0      0       0       0

chemical substitution of atoms

The chemical substitution may lead to a more complicated problem. Let us consider a substitution with 3 chemicaly different atoms on a site. The only way to describe the relation is to write that the variation of each occupation depends on to parameters called in the following example p15 and p16.
T(At1) = T0(At1) + 0.5 * p15 + p16
T(At2) = T0(At2) + 0.5 * p15 - p16
T(At3) = T0(At3) - p15
Then we will write a first order block with 2 dimensions.
 
 At1 FE 0                           
@COORD SIZE=2                               
    0.25     0       0              X and Y are on special position
    0.25     0       0
    0.413   14  1.0  0 0            Z has to be the same for all atoms
    0.700   15  0.5 16 1.0          t11 = p15 / 2 + p16
    1.0      7  1.0  0              B common thermal factor
 At2 CO 0                           
@COORD SIZE=2                               
    0.413   14  1.0  0 0            Z is the same for all atoms
    0.100   15  0.5 16 -1.0         t12 = p15 / 2 - p16
    ...
 At3 NI 0                           
@COORD SIZE=2                               
    0.200   15 -1.0  0 0            t13 = -p15
    ...
If the substitution depend on the temperature, this will be more complicated to write but always possible as it can be seen on one of the preceeding atom.
 
 At1 FE 0                           
 -2 2                               
    0.25   0      0      0      0      0
    0.25   0      0      0      0      0
    0.413 14 1.0  0 0    0.001 17 1.0  0
    0.700 15 0.5 16 1.0  0.010 18 0.5 19 1.0
    1.0   17 1.0  0      0.10  20 1.0  0
This structure allows to write all linear relation between parameters. However in a block the number of terms in the expansion and the size of the relation is the same for all the variables.

alternate refinement of parameters

In case of strong correlation between some crystallographic parameters, it is possible without modifying at each cycle the command file to alternate the refined parameters. This can easily be done using some cycling utilities like cycle.xnd (Unix) or xnd_bat.bat (msdos).
In all cases the ValidRef parameter in the header is used to specify the strategy. Then at each time xnd is started the program uses the value of PrtNew to choose the refined parameters. As PrtNew increases the refined parameters will change.

ValidRefcodecouplingrefined if
11always used
2 .. 9
10 .. 199 read
200 ..999read
2..91 always used
2PrtNew % ValidRef == 0
3PrtNew % ValidRef == 1
9PrtNew % ValidRef == 7
10 .. 199 read always used
200 ..299readPrtNew % ValidRef == 0
300 ..399readPrtNew % ValidRef == 1
400 ..499readPrtNew % ValidRef == 2

The following table represent the inside of a block and what append for ValidRef = 4. Note that ValidRef is restricted to values between 2 and 9 and that codeword are always lower than 1000.
valuecodecouplingrefined if PrtNew is
0.105 1 always used
0.251 2 0, 4, 8, ...
0.249 3 1, 5, 9, ...
0.413 11 1.0always used
0.413 199 1.0always used
0.700200 1.0 0, 4, 8, ...
0.700201 1.0 0, 4, 8, ...
0.700300 1.0 1, 5, 9, ...


xnd top Next file Previous file

JFB, April 26th, 1999