Tutorial Zrw2o8riet
Simple Lab Rietveld Refinement – ZrW2O8
Files needed: zrw2o8_rt.cif; 6g17pbg01.raw; zrwneut_sh.xy; zx002.xye
Learning Outcomes: This example shows a simple Rietveld refinements of an inorganic material using laboratory X-ray data, constant wavelength neutron data and time of flight neutron data.
Lab X-ray Data
1. Save the datafiles and cif file in your working directory.
2. Work through the menus in the Rietveld refinement section of topas-editor/Durham_TOPAS menus.
3. Click on “1. Select Data File” and navigate to find the file 6g17pbg01.raw.
4. In “2. Instrument”select “BB_CuKa2_PSD” – a similar diffractometer to the one used to collect the data.
5. In “3. Corrections”, click on “Refine sample height” to flag that sample height should be refined then click on “Variable Slits Used” as data were collected using a constant illuminated sample area.
6. In “4. Rietveld or Pawley ” click on the icon to “Read a CIF file” and select zrw2o8_rt.cif.
7. Click the icon to send the input file across to topas (see examples).
8. Click the icon to launch TOPAS if it’s not already running.
9. Click on the “run” icon in topas.
10. The refinement should converge rapidly.
11. Try refining temperature factors (e.g. type “beq @ 1” at the end of each “site” line containing atomic information). Try refining cell parameters by introducing parameter names. i.e. change the cell parameter lines to read:
a lpa 9.15762
b lpa 9.15762
c lpa 9.15762
12. You should get a Rwp of ~ 7.5%. RBragg will be around 3.3%.
13. Try refining atomic coordinates. Remember that x,x,x is a special position. One way to control this is to give each coordinate a unique name e.g.:
site Zr1 x xzr1 0.00185 y xzr1 0.00185 z xzr1 0.00185 occ Zr+4 1. beq @ 0.5
site W1 x xw1 0.34134 y xw1 0.34134 z xw1 0.34134 occ W+6 1. beq @ 0.5
site W2 x xw2 0.60119 y xw2 0.60119 z xw2 0.60119 occ W+6 1. beq @ 0.5
site O1 x xo1 0.20174 y yo1 0.44616 z zo1 0.45549 occ O-2 1. beq @ 0.5
site O2 x xo2 0.79260 y yo2 0.57026 z zo2 0.55406 occ O-2 1. beq @ 0.5
site O3 x xo3 0.49502 y xo3 0.49502 z xo3 0.49502 occ O-2 1. beq @ 0.5
site O4 x xo4 0.22770 y xo4 0.22770 z xo4 0.22770 occ O-2 1. beq @ 0.5
Or, better still, force coordinates to be equivalent with “Get” terms like:
site Zr1 x xzr1 0.00184 y =Get(x);:0.00184 z =Get(x);:0.00184 occ Zr+4 1.0 beq @ 0.5
site W1 x xw1 0.34134 y =Get(x);:0.34134 z =Get(x);:0.34134 occ W+6 1.0 beq @ 0.5
site W2 x xw2 0.60118 y =Get(x);:0.60118 z =Get(x);:0.60118 occ W+6 1.0 beq @ 0.5
site O1 x xo1 0.20173 y yo1 0.44627 z zo1 0.45557 occ O-2 1.0 beq @ 0.5
site O2 x xo2 0.79258 y yo2 0.57034 z zo2 0.55406 occ O-2 1.0 beq @ 0.5
site O3 x xo3 0.49483 y =Get(x);:0.49483 z =Get(x);:0.49483 occ O-2 1.0 beq @ 0.5
site O4 x xo4 0.22801 y =Get(x);:0.22801 z =Get(x);:0.22801 occ O-2 1.0 beq @ 0.5
With complex refinements it can be useful to stop atoms refining to unreasonable fractional coordinates, particularly early in a refinement or when you have weakly scattering atoms (O) in the presence of strongly scattering (Zr, W). One way of doing this is to store reference coordinates alongside the refined coordinates and have min/max values relating them. If the refinement does diverge you can then reset atoms to their reference coordinates by putting !max_shift to 0.0.
There is a shortcut for setting this up in topas-editor. If you have the previous block of sites in your INP file you can select the site lines then do a right-click. Select “topas-editor commands/Topas refine atomic coordinates”. The selected lines will be replaced by the text below.:
'macros (name, value, reference) to refine xyz coords with +/- max_shift A min/max
prm !max_shift 0.6 'Angstroms along each axis
macro Nvrx(name, value, ref) {x name value min = ref-max_shift/Get(a); max = ref+max_shift/Get(a);}
macro Nvry(name, value, ref) {y name value min = ref-max_shift/Get(b); max = ref+max_shift/Get(b);}
macro Nvrz(name, value, ref) {z name value min = ref-max_shift/Get(c); max = ref+max_shift/Get(c);}
site Zr1 num_posns 4 Nvrx(xZr1, 0.00185, 0.00184) y =Get(x);:0.00185` z =Get(x);:0.00185` occ Zr+4 1.0 beq beqZr1 0.5
site W1 num_posns 4 Nvrx(xW1, 0.34134, 0.34134) y =Get(x);:0.34134` z =Get(x);:0.34134` occ W+6 1.0 beq beqW1 0.5
site W2 num_posns 4 Nvrx(xW2, 0.60118, 0.60118) y =Get(x);:0.60118` z =Get(x);:0.60118` occ W+6 1.0 beq beqW2 0.5
site O1 num_posns 12 Nvrx(xO1, 0.20170, 0.20173) Nvry(yO1, 0.44637, 0.44627) Nvrz(zO1, 0.45558, 0.45557) occ O-2 1.0 beq beqO1 0.5
site O2 num_posns 12 Nvrx(xO2, 0.79252, 0.79258) Nvry(yO2, 0.57035, 0.57034) Nvrz(zO2, 0.55411, 0.55406) occ O-2 1.0 beq beqO2 0.5
site O3 num_posns 4 Nvrx(xO3, 0.49491, 0.49483) y =Get(x);:0.49491` z =Get(x);:0.49491` occ O-2 1.0 beq beqO3 0.5
site O4 num_posns 4 Nvrx(xO4, 0.22792, 0.22801) y =Get(x);:0.22792` z =Get(x);:0.22792` occ O-2 1.0 beq beqO4 0.5
Refining coordiantes should give Rwp ~7.36 %.
Add the phrase “view_structure” to the bottom of the str section to view coordinates. You can display multiple cells or coordination polyhedra in the viewer.
14. Calculate bond distances by including the line “append_bond_lengths” at the end of the str section (before “for strs”). Note that e.g. some W-O bonds are longer than expected (1.9 A vs expected 1.8 A). Compare with neutron data later.
15. As the bond lengths are outside the expected range try adding some bond distance restraints. This can be done using the “restrain distance” button in the “Miscellaneous” section. You need to specify the two sites involved, the ideal distance between them, the “tolerance” before the restraint is applied (i.e. it’s not applied if the actual distance is within +/- tolerance of the set distance) and the weighting to give the restraint. It’s normally safest to give the full label of any atomic site as it may be that the bond is not between sites in your asymmetric unit. The full label is given in the bond distance calculation (remove any colons!).
With topas v8 or v7 you should be able to use:
Distance_Restrain(Zr1 O1 5 0 0 -1, 2.075, 2.02818`, 0.05, 1.0)
Distance_Restrain(Zr1 O2 9 -1 0 1, 2.075, 2.04840`, 0.05, 1.0)
Distance_Restrain(W1 O1 0 0 0 0, 1.790, 1.84483`, 0.05, 1.0)
Distance_Restrain(W2 O2 6 0 0 0, 1.790, 1.82327`, 0.05, 1.0)
For historical reasons, the labels that used to work in v4.2 are:
Distance_Restrain(Zr1 O1 10 0 0 0, 2.075, 2.04574, 0.05, 1.0)
Distance_Restrain(Zr1 O2 7 -1 1 1, 2.075, 2.04812, 0.05, 1.0)
Distance_Restrain(W1 O1 0 0 0 0, 1.790, 1.81945, 0.05, 1.0)
Distance_Restrain(W2 O2 4 0 0 0, 1.790, 1.82079, 0.05, 1.0)
The Rwp should be marginally higher, around 7.37%. It’s similarity to that from un-restrained refinment indicates that the restraints are consistent with the data.
16. You might like to try the influence of different peak shapes, different numbers of background terms, refining a zero point instead of sample height correction, etc. Try changing the parameter axial to values of 0 then 20 and fixing it (change parameter name to !axial) to see the influence of axial divergence on peak shape.
17. The CuKa2_analyt() emission profile used by default in jEdit and vs Code is for an analytical description of the peak profile. If you were using a convolution-based or fundamental parameters approach you might use the CuKa2() or CuKa5() emission profiles..
Constant Wavelength Neutron Data
Information: powder neutron data (zrw2o8_sh.xy) were collected using a wavelength of 1.8857 A at Brookhaven National Lab.
1. You could set up an INP file from scratch by repeating the process described above for X-ray data. Select data file zrw2o8_sh.xy. Select “Neutron CW” for the instrument type and enter a wavelength of 1.8857 A. Choose to refine a zero point not sample height.
2. Or you could just save your X-ray INP file to zrw2o8_fit_sh_01.inp and edit it so it becomes suitable for fitting the neutron data. Make the changes below (the first three can all be done by clicking on “2. Instrument/Neutron CW” in the menus):
- Delete the CuKa2_analyt(0.0001) emission profile and replace with “lam ymin_on_ymax 0.0001 la 1.0 lo 1.8857 lh 0.001”
- Change the LP_Factor(0) to LP_Factor(90)
- Add the line “neutron_data”
- Delete the “Variable_Divergence_Intensity” line
- Replace the Specimen_Displacement() line with Zero_Error(zero, 0.0).
3. You might try going anisotropic on all atoms. After an isotropic refinement delete all the temperature factor information and replace with the word “adps”. i.e. the atomic information should look like:
site Zr1 x xzr1 0.00184 y =Get(x);:0.00184 z =Get(x);:0.00184 occ Zr+4 1.0 adps
site W1 x xw1 0.34134 y =Get(x);:0.34134 z =Get(x);:0.34134 occ W+6 1.0 adps
site W2 x xw2 0.60118 y =Get(x);:0.60118 z =Get(x);:0.60118 occ W+6 1.0 adps
site O1 x xo1 0.20173 y yo1 0.44627 z zo1 0.45557 occ O-2 1.0 adps
site O2 x xo2 0.79258 y yo2 0.57034 z zo2 0.55406 occ O-2 1.0 adps
site O3 x xo3 0.49483 y =Get(x);:0.49483 z =Get(x);:0.49483 occ O-2 1.0 adps
site O4 x xo4 0.22801 y =Get(x);:0.22801 z =Get(x);:0.22801 occ O-2 1.0 adps
4. You should be able to get Rwp ~9.1%.
4. Calculate bond distances and angles using “append_bond_lengths”. You should find sensible Zr-O and W-O bond distances and bond angles close to 90/109 degrees in ZrO6 octahedra and WO4 tetrahedra.
Time of Flight Neutron Data
Information: data were collected using the back scattering bank on the old HRPD at ISIS. Data collection time was 5 minutes so the signal to noise ratio is relatively poor.
In most tof experiments it’s ususal to analyse multiple banks simultaneously using INP files set up with “for xdds” and “for strs” sections. It’s therefore usually quickest to start from a prewritten template file. You normally get these from the instrument scientist. In this example we will use a topas-editor template and only have a single data set so we will adjust the template accordingly.
Time-of-flight INP files are significantly more complex than standard files so it’s best to consult the instrument scientist for expert advice. If you load topas.log you can see what most of the unfamiliar macros are doing.
You may need to have file local.inc in your TOPAS directory for all the macros to work.
1. In the TOPAS_Durham menus go to “Neutron tof” and click to load a template. Select the HRPD template and save the INP file as zx002_tof_01.inp or similar.
2. The INP file is set up to have sections where you specify the filenames, sections describing the different banks of data being fitted and an overall section which contains information that feeds into each bank (xdd) and structure (str). Try hitting ctrl-k-0 in topas-editor and the different sections will be folded away so the file is easy to navigate.
3. Go through and edit the file ready to analyse the ZrW2O8 data. You will need to:
- Set the filename by changing line ~32 to read: macro filename {ZX002}. Ths is the stem of the filename and in a multibank analysis gets expanded to ZX002_tof_b1.dat, ZX002_tof_b2.dat etc by the subsequent lines in the INP file.
- The lines starting “#define USE_HRPD_..”. tell TOPAS which banks to analysefit. Comment out all but the line that says “#define USE_HRPD_BS…” as we only have data from the back scattering bank.
- In the bank 1 bs section of the file (line ~48) the instrumental constants are defined. Unfold this section and change !difc_bs in the TOF_x_axis_calibration() macro to 48250. This value was determined using a Si standard immediately prior to this experiment.
- Go to the “Overall” section of the file around line 100 and unfold it. This section contains first information that is fed into each bank (for xdds) then information that’s fed into the first str defined in each bank (for strs 1 to 1).
- Change space_group to P213 and phase_name to ZrW2O8.
- Change the cell parameter line to read: Cubic( lpa_ZrW2O8 9.17)
- Overwrite the sites by pasting the coordinates in from one of your X-ray refinements (or copy the coordinate list given above). Or you could read in a CIF with right-click then “topas-editor commands/Topas import cif” or ctrl-ti.
2. Run the refinement. You should get Rwp ~22.1% with either isotropic or anisotropic sites. As the data were recorded at 2 K thermal vibrations are small so the models don’t differ signficiantly.
3. Go to the bank 1 section around line 43 and unfold it. Try refining the sample peak shape contribution by removing the exclamation marks from lor_bs, dsp_bs, and dspsq_bs in the tof_sample_peakshape() macro. These describe the lorentzian mixing, a term that depends on d-spacing (strain) and a term that depends on d-spacing2 (size). You should get Rwp ~20.4%.
4. Try refining the TOF_x_axis_calibration() constants t0_bs and difa_bs. These describe a constant and d2 contribution to peak positions.
5. Look at the fit. You will see an unfitted peak around 100,000 microseconds. This is due to the vanadium can used. Immediately after the TOF_XYE() line for this bank add the line: “exclude 99700 100700”. You should now get Rwp ~20.1%.
6. Click on view_structure so you can see the structure.
7. If you haven’t got john’s local.inc installed you may need the macro below in your input file.
macro tof_sample_peakshape(lor,lor_val,dsp,dsp_val,dspsq,dspsq_val)
{
prm dsp dsp_val del = 0.05 Val + 1; min 1
prm dspsq dspsq_val del = 0.05 Val + 1; min 0
peak_type pv
pv_lor lor lor_val
pv_fwhm = dsp D_spacing + dspsq D_spacing^2;
}
8. There is a cheat file below.
Extra Work
The constant wavelength data are suitable for trying indexing.
You can also try structure solution using either the X-ray data or room temperature neutron data.
Cheat Files
INP files for x-ray, constant wavelength neutron and tof data.