[temperature !E]…
[move_to_the_next_temperature_regardless_of_the_change_in_rwp]
[save_values_as_best_after_randomization]
[use_best_values]
[do_processes]
A temperature regime has no affect unless the reserved parameter name T is used in val_on_continue attributes, or, if the following temperature dependent keywords are used:
randomize_on_errorsautomatically determines parameter displacements without the need for rand_xyzor val_on_continue. It performs well on a wide range of problems.
The reserved parameter T returns the current temperature and it can be used in equations and in particular the val_on_continue attribute. The first temperature defined becomes the starting temperature; subsequent temperature(s) become the current temperature.
If increases relative to a previous cycle then the temperature is advanced to the next temperature. If decreases relative to previous temperatures of lesser values then the current temperature is rewound to a previous temperature such that its previous is of a greater value.
move_to_the_next_temperature_regardless_of_the_change_in_rwp forces the refinement to move to the next temperature regardless of the change in Rwp from the previous temperature.
save_values_as_best_after_randomization saves the current set of parameters and gives them the status of “best solution”. Note, this does not change the global “best solution” which is saved at the end of refinement.
use_best_values replaces the current set of parameters with those marked as “best solution”.
do_processes executes any swap_sites or try_site_patterns processes.
The temperature regime as defined in the macro Auto_T is sufficient for most problems.
A typical temperature regime starts with a high value and then a series of annealing temperatures, for example:
temperature 2
move_to_the_next_temperature_regardless_of_the_change_in_rwp
temperature 1
temperature 1
temperature 1
If the current temperature is the last one defined (the fourth one), and decreased relative to the second and third temperatures, then the current temperature is set to the second temperature.
The current temperature can be used in all equations using the reserved parameter T, for example:
x @ 0.123 val_on_continue = Val + T Rand(-.1, .1)
The following temperature regime will allow parameters to randomly walk for the first temperature. At the second temperature the parameters are reset to those that gave the “best solution”.
temperature 1
temperature 1 use_best_values
temperature 1
temperature 1 use_best_values
temperature 1
temperature 10
save_values_as_best_after_randomization
move_to_the_next_temperature_regardless_of_the_change_in_rwp
Note, that when a “best solution” is encountered the temperature is rewound to a position where the temperature decreased. For example, if the RWP dropped at lines 2 to 5 then the next temperature will be set to “line 1”.
The following will continuously use the “best solution” before randomisation. This particular temperature regime has a tendency to remain in a false minimum.
temperature 1 use_best_values
[th2_offset E]…
Used for applying 2q corrections to phase peaks. The following example applies a sample displacement correction:
th2_offset = -2 Rad © Cos(Th) / Rs;
th2_offset is used for example in the Zero_Error and Specimen_Displacement macros.
[try_site_patterns $sites [num_patterns_at_a_time #] ]…
try_site_patterns performs an exhaustive search of all possible cation configurations where the cations in question is identified by $sites. num_patterns_at_a_time defines the number of patterns to process at any one time. Outline of the algorithm:
While try_site_patterns processes still to be processed {
k = 0
Do
Change the cation configuration according to try_site_patterns
If (k+1) > (k) then reset site positions
k = k + 1
While (k+1) > (k) or k < num_patterns_at_a_time
}
The number of possible cation configurations determines the approximate magnitude of a structure determination problem. A structure consisting of NA cation sites of species A and NB cation sites of species B has, for a particular set of cation positions, a number of possible configurations NAB calculated as follows:
NAB = (NA+NB)CNB / NB!
where the notation uCv=(u-0)(u-1)(u-2)…(u-(v-1)) has been used. Thus for NA=3 and NB=4 we have NAB=(7 6 5 4)/(4 3 2 1)=NBA=(7 6 5)/(3 2 1)=35. The number of configurations NABD for and additional set of cation sites of species D becomes:
NABD = NAB ((NA+NB+NDD)CND / ND! )
An additional two D sites, or, NA=3, NB=4 and ND=2 gives and NABD=1260. Thus the number of configurations quickly becomes prohibitive for an exhaustive search.
Here is an example of using try_site_patterns on three Ca sites and two Zr sites:
str…
site Ca…
site Ca…
site Ca…
site Zr…
site Zr…
try_site_patterns “Ca Zr” num_patterns_at_a_time 3
NCaZr=10 and thus try_site_patterns will cycle through the 10 patterns searching for a reduction in .