Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

4. Peak broadening: the Scherrer equation and the Williamson–Hall plot

School of Engineering, Nazarbayev University

Ideal infinite crystals produce sharp Dirac-delta Bragg peaks, yet real engineering alloys (ball-milled nanopowders, electrodeposited thin films, cold-rolled steels) exhibit noticeably broadened diffraction peaks. Crucially, two different microstructural features broaden XRD peaks: nanoscale crystallite size DD and dislocation-induced heterogeneous lattice microstrain ε=Δd/d\varepsilon = \Delta d / d. Applying the single-peak Scherrer formula blindly to a cold-worked metal mistakes microstrain for ultra-fine grains, an error we diagnose and cure via linear Williamson–Hall deconvolution.

Learning objectives

  1. Compute coherent crystallite domain sizes D [nm]D\ [\mathrm{nm}] from peak FWHM β [rad]\beta\ [\mathrm{rad}] via diffraction.scherrer_crystallite_size_nm.

  2. Contrast the sec⁡θ\sec\theta angular dependence of size broadening against the 4εtan⁡θ4\varepsilon\tan\theta dependence of nonuniform lattice microstrain.

  3. Demonstrate why naive single-peak Scherrer sizing systematically underestimates grain size in cold-worked alloys.

  4. Deconvolve crystallite size DD and microstrain ε\varepsilon simultaneously via linear regression in diffraction.williamson_hall_fit.

Time: about 60 min

1. Principles and governing equations

1.1 Finite-Size (Scherrer) vs. Microstrain (Stokes–Wilson) Broadening

  1. Finite Coherent Domain Size DD: Incomplete destructive interference just off the Bragg angle across a crystallite of thickness DD broadens the 2θ2\theta peak with full-width at half-maximum (FWHM, in radians):

    βD(2θ)=KλDcos⁡θ⟺D=KλβDcos⁡θ(1.1)\beta_D(2\theta) = \frac{K\lambda}{D\cos\theta} \quad \Longleftrightarrow \quad D = \frac{K\lambda}{\beta_D\cos\theta} \tag{1.1}

    where K≈0.9K \approx 0.9 is the dimensionless Scherrer shape factor (note unit scaling: 1 A˚=0.1 nm1\ \mathrm{\AA} = 0.1\ \mathrm{nm}).

  2. Heterogeneous Microstrain ε=Δd/d\varepsilon = \Delta d / d: Differentiating Bragg’s law λ=2dsin⁡θ\lambda = 2d\sin\theta at fixed λ\lambda gives 0=2 Δdsin⁡θ+2dcos⁡θ Δθ  ⟹  Δθ=−(Δd/d)tan⁡θ0 = 2\,\Delta d\sin\theta + 2d\cos\theta\,\Delta\theta \implies \Delta\theta = -(\Delta d / d)\tan\theta. Since Δ(2θ)=2Δθ\Delta(2\theta) = 2\Delta\theta and root-mean-square strain spans ±ε\pm\varepsilon, Stokes & Wilson obtain:

    βε(2θ)=4εtan⁡θ(1.2)\beta_\varepsilon(2\theta) = 4\varepsilon\tan\theta \tag{1.2}

1.2 Additive Williamson–Hall Linear Law

Under Lorentzian (Cauchy) profile convolution, FWHMs add linearly (βtot=βD+βε\beta_{\mathrm{tot}} = \beta_D + \beta_\varepsilon). Multiplying through by cos⁡θ\cos\theta yields a straight line in (x,y)=(4sin⁡θ, βtotcos⁡θ)(x, y) = (4\sin\theta,\, \beta_{\mathrm{tot}}\cos\theta):

βtotcos⁡θ⏟y=KλD⏟intercept+ε⏟slope (4sin⁡θ)⏟x(1.3)\underbrace{\beta_{\mathrm{tot}}\cos\theta}_{y} = \underbrace{\frac{K\lambda}{D}}_{\text{intercept}} + \underbrace{\varepsilon}_{\text{slope}}\,\underbrace{(4\sin\theta)}_{x} \tag{1.3}

Demonstration 1: Angular Scaling of Size Broadening (sec theta) vs Microstrain (tan theta)
==========================================================================================
2theta [deg] | beta_size [deg] | beta_strain [deg] | Strain/Size Ratio | Scherrer D [nm]
----------------------------------------------------------------------------------------
        30.0 |          0.2350 |            0.1535 |             0.653 |         35.0000
        50.0 |          0.2504 |            0.2672 |             1.067 |         35.0000
        75.0 |          0.2861 |            0.4396 |             1.537 |         35.0000
       100.0 |          0.3531 |            0.6828 |             1.934 |         35.0000
       125.0 |          0.4916 |            1.1006 |             2.239 |         35.0000

What Demonstration 1 shows. Because tan⁡θ=sin⁡θ/cos⁡θ\tan\theta = \sin\theta / \cos\theta grows faster than sec⁡θ=1/cos⁡θ\sec\theta = 1/\cos\theta by an extra factor of sin⁡θ\sin\theta, microstrain broadening is modest at low 2θ2\theta (30∘30^\circ) but dominates at high 2θ2\theta (125∘125^\circ). When ε=0\varepsilon = 0, scherrer_crystallite_size_nm recovers D=35.0000 nmD = 35.0000\ \mathrm{nm} across every single peak.


2. Why Single-Peak Scherrer Underestimates Grain Size in Cold-Worked Alloys

We simulate a cold-rolled nanocrystalline Cu alloy with true domain size Dtrue=45.0 nmD_{\mathrm{true}} = 45.0\ \mathrm{nm} and dislocation microstrain εtrue=0.0022\varepsilon_{\mathrm{true}} = 0.0022 across all five FCC reflections (111), (200), (220), (311), (222) and inspect the biased apparent sizes DappD_{\mathrm{app}} returned by naive single-peak Scherrer.


Demonstration 2: Apparent Scherrer Bias Across Reflections of Cold-Worked FCC Copper
====================================================================================
Cu (hkl)   | 2theta [deg] | FWHM_tot [deg] | Naive Scherrer D_app [nm] |   Bias [%]
----------------------------------------------------------------------------------
(1, 1, 1)  |       43.318 |         0.3902 |                    21.907 |     -51.32%
(2, 0, 0)  |       50.451 |         0.4327 |                    20.296 |     -54.90%
(2, 2, 0)  |       74.128 |         0.6021 |                    16.536 |     -63.25%
(3, 1, 1)  |       89.941 |         0.7532 |                    14.908 |     -66.87%
(2, 2, 2)  |       95.151 |         0.8134 |                    14.478 |     -67.83%
<Figure size 704x440 with 1 Axes>

Figure 4.1. Synthetic data. Crystallite size from the Scherrer equation applied to single peaks of strained copper. Because the strain broadening is counted as size broadening, every estimate is below the true 45 nm, and the error grows with angle.

What Demonstration 2 shows. The single-peak Scherrer estimate is below the true 45.0 nm45.0\ \mathrm{nm} crystallite size on every peak: 21.9 nm21.9\ \mathrm{nm} on (111) (−51.3%-51.3\%) and 14.5 nm14.5\ \mathrm{nm} on (222) (−67.8%-67.8\%). Whenever apparent Scherrer size shrinks systematically with 2θ2\theta, significant microstrain is present.


3. Williamson–Hall Deconvolution & Broadened Profile Comparison

We pass (beta_tot_cu, tt_cu) into diffraction.williamson_hall_fit, both noise-free and with realistic experimental FWHM measurement noise, and plot the Williamson–Hall diagram alongside the annealed vs. nanocrystalline cold-worked diffractograms.


Demonstration 3: Williamson-Hall Linear Deconvolution (Annealed vs Cold-Worked vs Noisy)
========================================================================================
Clean Cold-Worked Fit : D = 45.0000 nm, eps = 0.002200, R^2 = 1.000000
Noisy Cold-Worked Fit : D = 43.00 nm,  eps = 0.00214,  R^2 = 0.9986
Annealed (eps=0) Fit  : D = 45.0000 nm, eps = 7.73e-19
<Figure size 1210x473 with 2 Axes>

Figure 4.2. Synthetic data. (a) Williamson–Hall plot for annealed and cold-worked copper: the intercept gives the crystallite size and the slope the microstrain. (b) The (111) and (200) peaks of the two samples.

What Demonstration 3 shows. Extrapolating the Williamson–Hall line back to 4sin⁡θ=04\sin\theta = 0 removes 100%100\% of the microstrain contribution, recovering the exact intercept Kλ/D  ⟹  D=45.0000 nmK\lambda/D \implies D = 45.0000\ \mathrm{nm} and slope ε=2.20×10−3\varepsilon = 2.20\times 10^{-3}.


4. Sensitivity: Instrumental Broadening Subtraction

Every real diffractometer contributes an instrumental width βinst\beta_{\mathrm{inst}} (typically 0.05∘–0.10∘0.05^\circ\text{--}0.10^\circ, measured using a strain-free LaB6\mathrm{LaB_6} NIST standard) that must be subtracted before Scherrer or Williamson–Hall analysis:

  • Lorentzian deconvolution: βsample=βobs−βinst\beta_{\mathrm{sample}} = \beta_{\mathrm{obs}} - \beta_{\mathrm{inst}}

  • Gaussian deconvolution: βsample=βobs2−βinst2\beta_{\mathrm{sample}} = \sqrt{\beta_{\mathrm{obs}}^2 - \beta_{\mathrm{inst}}^2}

We test how uncorrected βinst=0.08∘\beta_{\mathrm{inst}} = 0.08^\circ distorts size estimates across true grain sizes D∈{10,30,80,200} nmD \in \{10, 30, 80, 200\}\ \mathrm{nm}.


Demonstration 4: Instrumental Broadening Sensitivity Across True Grain Sizes
============================================================================
D_true [nm] | FWHM_sample [deg] | FWHM_obs_L [deg] | Uncorrected D [nm] |  Error [%]
------------------------------------------------------------------------------------
       10.0 |            0.8547 |           0.9347 |               9.14 |      -8.56%
       30.0 |            0.2849 |           0.3649 |              23.42 |     -21.92%
       80.0 |            0.1068 |           0.1868 |              45.75 |     -42.82%
      200.0 |            0.0427 |           0.1227 |              69.64 |     -65.18%

Inside the algorithm

At D=10 nmD = 10\ \mathrm{nm}, sample broadening (0.85∘0.85^\circ) swamps the 0.08∘0.08^\circ instrument width (−8.6%-8.6\% bias), whereas at D=200 nmD = 200\ \mathrm{nm}, βinst\beta_{\mathrm{inst}} exceeds βsample\beta_{\mathrm{sample}} (0.043∘0.043^\circ), capping uncorrected Scherrer estimates below 70 nm70\ \mathrm{nm} (−65%-65\% error, why XRD line broadening has a practical upper ceiling around 100–200 nm100\text{--}200\ \mathrm{nm}). Below we inspect diffraction.williamson_hall_fit and verify ordinary least squares in pure NumPy.

Check against the library


Inside the Algorithm: NumPy Vandermonde OLS vs diffraction.williamson_hall_fit
==============================================================================
def williamson_hall_fit(
    beta_fwhm_rad: np.ndarray,
    two_theta_deg: np.ndarray,
    wavelength_A: float = CU_K_ALPHA_A,
    shape_factor: float = 0.9,
) -> dict:
    """Separate size and microstrain broadening via Williamson-Hall fit beta*cos(theta) = K*lam/D + 4*eps*sin(theta)."""
    beta = np.asarray(beta_fwhm_rad, dtype=float).ravel()
    theta = 0.5 * np.radians(np.asarray(two_theta_deg, dtype=float).ravel())
    if beta.size < 2 or beta.size != theta.size:
        raise ValueError("Provide at least two matching (beta_fwhm_rad, two_theta_deg) reflections.")
    x = 4.0 * np.sin(theta)
    y = beta * np.cos(theta)
    a_mat = np.column_stack([x, np.ones_like(x)])
    coeffs, _, _, _ = np.linalg.lstsq(a_mat, y, rcond=None)
    slope = float(coeffs[0])
    intercept = float(coeffs[1])
    y_pred = a_mat @ coeffs
    ss_res = float(np.sum((y - y_pred) ** 2))
    ss_tot = float(np.sum((y - np.mean(y)) ** 2))
    r2 = 1.0 - ss_res / ss_tot if ss_tot > 0.0 else 1.0
    d_nm = 0.1 * (shape_factor * wavelength_A) / intercept if intercept > 0.0 else np.inf
    return {
        "crystallite_size_nm": float(d_nm),
        "microstrain": slope,
        "slope": slope,
        "intercept": intercept,
        "r2": r2,
    }

NumPy: D = 43.00399777 nm, eps = 0.0021404098
Library   : D = 43.00399777 nm, eps = 0.0021404098

Exercises

Worked solutions are in 04_solutions.ipynb. The cell below the list is a short self-check to start from.

  1. Verify a result. Verify across five reflections of strained Si (D=60 nmD = 60\ \mathrm{nm}, ε=0.0018\varepsilon = 0.0018) that naive single-peak Scherrer size satisfies 1Dapp(θ)=1D+4εsin⁡θ0.1 Kλ [nm−1]\frac{1}{D_{\mathrm{app}}(\theta)} = \frac{1}{D} + \frac{4\varepsilon\sin\theta}{0.1\,K\lambda}\ [\mathrm{nm^{-1}}] to rounding error.

  2. Find how it fails. Quantify the exact error factor when β=0.45∘\beta = 0.45^\circ is passed into scherrer_crystallite_size_nm without converting degrees to radians, and compare the erroneous size to copper’s lattice constant aCu=0.36149 nma_{\mathrm{Cu}} = 0.36149\ \mathrm{nm}.

  3. Implement it yourself. Implement gaussian_size_strain_fit(beta_fwhm_rad, two_theta_deg, wavelength_A, shape_factor=0.9) for quadrature-broadened Gaussian peaks β2=βD2+βε2\beta^2 = \beta_D^2 + \beta_\varepsilon^2 and compare against Lorentzian williamson_hall_fit.


Self-check for the exercises
============================
Reciprocal Scherrer bias identity verified to machine precision across all 5 Si peaks
All checks passed.