Skip to content

Y₂O₃ on SPODI

Fit cubic Y₂O₃ to constant-wavelength neutron powder data from SPODI at FRM II, with anisotropic displacement tensors whose components the site symmetry ties together.

The project is the catalogue case pd-neut-cwl_y2o3-spodi, the one the command line and the app's Examples open.

Fitting Single pd neut cwl Bragg Crystal structure

import easydiffraction as edi

Load the project

project_path = edi.download_data('pd-neut-cwl_y2o3-spodi', destination='data')
project = edi.Project.load(project_path)
structure = project.structures['y2o3']
experiment = project.experiments['spodi']
Data 'pd-neut-cwl_y2o3-spodi' is at data/pd-neut-cwl_y2o3-spodi-7967c3a09e3f/pd-neut-cwl_y2o3-spodi

The project marks what its fit frees. The fit below frees it in stages, so start with all of it fixed.

for parameter in project.free_parameters:
    parameter.free = False

Estimate the background

Start the background from an automatic estimate. The default method, arPLS, fits a smooth curve under the pattern that ignores the peaks, and places 21 points along it.

experiment.background.auto_estimate(n_points=21)
project.display.pattern('spodi')

Perform the analysis

The fit goes in stages, freeing one group of parameters at a time.

Scale, 2θ zero and cell

The scale, the zero shift and the cell length put the peaks in place and at the right height.

experiment.linked_structures['y2o3'].scale.free = True
experiment.instrument.calib_twotheta_offset.free = True
structure.cell.length_a.free = True
project.display.parameters.free()
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_y2o3-spodi, 2509 pts fitted / 3060 loaded, 3 free
   iter   time (s)   Rwp (%)  reduced χ²   change
                        3.47         7.84
      1      0.004      2.56         4.27   45.6% ↓
      2      0.008      2.53         4.17   2.3% ↓
      3      0.012      2.53         4.17   
      4      0.016      2.53         4.17   
      5      0.021      2.53         4.17   
  done · converged · 5 iters · reduced χ² 4.17 · Rwp 2.53 % · 0.02 s
project.display.pattern('spodi')

Background

The estimated points are a starting point; fit them now that the peaks are in place.

for point in experiment.background:
    point.intensity.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_y2o3-spodi, 2509 pts fitted / 3060 loaded, 24 free
   iter   time (s)   Rwp (%)  reduced χ²   change
                        2.53         4.20
      1      0.008      2.37         3.68   12.4% ↓
      2      0.016      2.37         3.68   
  done · converged · 2 iters · reduced χ² 3.68 · Rwp 2.37 % · 0.02 s
project.display.pattern('spodi')

Peak widths

experiment.peak.broad_gauss_u.free = True
experiment.peak.broad_gauss_v.free = True
experiment.peak.broad_gauss_w.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_y2o3-spodi, 2509 pts fitted / 3060 loaded, 27 free
   iter   time (s)   Rwp (%)  reduced χ²   change
                        2.37         3.69
      1      0.007      1.80         2.12   42.4% ↓
      2      0.013      1.78         2.08   1.8% ↓
      3      0.017      1.78         2.08   
      4      0.025      1.78         2.08   
  done · converged · 4 iters · reduced χ² 2.08 · Rwp 1.78 % · 0.03 s
project.display.pattern('spodi')

Atom positions

Y1's x and O1's three coordinates are the ones the symmetry leaves free.

for site in structure.atom_sites:
    for coordinate in (site.fract_x, site.fract_y, site.fract_z):
        coordinate.free = not coordinate.symmetry_constrained
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_y2o3-spodi, 2509 pts fitted / 3060 loaded, 31 free
   iter   time (s)   Rwp (%)  reduced χ²   change
                        1.78         2.09
      1      0.009      1.42         1.33   36.5% ↓
      2      0.016      1.42         1.33   0.1% ↓
      3      0.026      1.42         1.33   
  done · converged · 3 iters · reduced χ² 1.33 · Rwp 1.42 % · 0.03 s
project.display.pattern('spodi')

Anisotropic displacements

Last, the displacement tensors, each with only the components its site symmetry leaves free.

for tensor in structure.atom_site_aniso:
    for component in (
        tensor.adp_11,
        tensor.adp_22,
        tensor.adp_33,
        tensor.adp_12,
        tensor.adp_13,
        tensor.adp_23,
    ):
        component.free = not component.symmetry_constrained
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_y2o3-spodi, 2509 pts fitted / 3060 loaded, 43 free
   iter   time (s)   Rwp (%)  reduced χ²   change
                        1.42         1.33
      1      0.011      1.33         1.17   11.8% ↓
      2      0.019      1.33         1.17   0.1% ↓
      3      0.031      1.33         1.17   
  done · converged · 3 iters · reduced χ² 1.17 · Rwp 1.33 % · 0.04 s
project.display.pattern('spodi')
project.display.fit.correlations()
project.display.structure('y2o3')

Save the project

project.save_as('pd-neut-cwl_y2o3-spodi')
project.report.save_html('pd-neut-cwl_y2o3-spodi.html')
Saving project to 'pd-neut-cwl_y2o3-spodi'
Saving report to 'pd-neut-cwl_y2o3-spodi.html'