This simulation shows how X-ray diffraction is used to determine the structure of a crystalline material. X-rays have wavelengths similar to the spacing between planes of atoms, so waves reflected from successive planes interfere. They reinforce only at angles that satisfy Bragg's law, nλ = 2d sinθ. The first tab shows the geometry behind Bragg's law. The second tab shows the powder diffraction pattern of a cubic crystal and which reflections its structure allows. The third tab gives the pattern of an unknown cubic element so you can index the peaks and determine the crystal structure and lattice parameter.
Bragg's law. X-rays reflect from two adjacent lattice planes separated by distance d. Move the sliders for the incidence angle θ, the plane spacing d, and the wavelength λ. The ray reflected from the lower plane travels an extra distance 2d sinθ (dark red segments). When that extra distance is a whole number of wavelengths, the two reflected waves are in phase and diffraction is constructive. The plot below the figure shows the diffracted intensity from a stack of N planes; click on it to set θ, or use the buttons to jump to a Bragg angle. Increase N to see the peaks sharpen.
Powder pattern. Choose a cubic crystal structure, the lattice parameter a, and the X-ray source. The simulated powder pattern shows only the reflections allowed by the structure factor, labeled by Miller indices (hkl). Hover over a peak, or a row of the table, to see its values.
Index a pattern. An unknown cubic element is scanned. Use the sin²θ ratios to decide the structure, then pick a trial structure: the table assigns h²+k²+l² values and calculates a from each peak. A correct indexing gives the same a for every peak. Enter your structure and lattice parameter and select "Check". Uncheck "show sin²θ columns" to do the calculations by hand.
X-rays scattered from two parallel planes a distance d apart differ in path length by 2d sinθ, where θ is the angle between the beam and the planes. The scattered waves add constructively when this path difference is an integer number of wavelengths:
The detector sits at 2θ from the incident beam, so diffraction patterns are plotted versus 2θ.
For a stack of N equally spaced planes, the phase difference between successive planes is
and the diffracted intensity, normalized to its maximum, is
The peaks fall at φ = 2πn (Bragg's law) and their width decreases as 1/N. Real crystallites contain thousands of planes, so peaks are sharp.
The spacing of (hkl) planes in a cubic crystal with lattice parameter a is
The nth-order reflection from (hkl) is treated as the first-order reflection from (nh nk nl), so n = 1 and Bragg's law becomes
Because h² + k² + l² is an integer, the sin²θ values of a cubic pattern are in ratios of integers.
The sum is over the atoms in the unit cell at fractional positions (xj, yj, zj). Reflections with F = 0 are absent:
| Structure | Reflection present when | |F|² | Allowed h²+k²+l² |
|---|---|---|---|
| Simple cubic | all hkl | f² | 1, 2, 3, 4, 5, 6, 8, 9, … (never 7, 15, 23) |
| BCC | h+k+l even | 4f² | 2, 4, 6, 8, 10, 12, 14, 16, … |
| FCC | h, k, l all odd or all even | 16f² | 3, 4, 8, 11, 12, 16, 19, 20, … |
| Diamond cubic | all odd, or all even with h+k+l = 4m | 32f² (odd), 64f² (even) | 3, 8, 11, 16, 19, 24, 27, 32, … |
The relative intensity of each peak is calculated as
where p is the multiplicity (number of equivalent planes in the family), the term in parentheses is the Lorentz-polarization factor, and s = sinθ/λ. The decrease of the atomic scattering factor and the Debye-Waller factor are combined into one approximate term, f² exp(−2Bs²) ≈ exp(−5.5s²) with s in Å−1, so the intensities are approximate. Families with the same h²+k²+l² (such as 300 and 221) overlap in a cubic pattern, and their intensities are added. Peaks are Gaussian with full width at half maximum 0.20° + 0.10° tanθ; the Kα2 line is not included.
Divide each sin²θ by the first one. If the ratios multiplied by a small integer (1, 2, or 3) give integers that match an allowed sequence in the table, that sequence identifies the structure. The lattice parameter follows from each peak:
A correct indexing gives the same a from every peak. The measured peak positions in the unknown sample include random errors up to ±0.02°. Simple cubic and BCC patterns cannot be distinguished by peak positions alone if fewer than seven lines are measured, because the BCC sequence 2, 4, 6, … divided by 2 matches the simple cubic sequence 1, 2, 3, … until the missing 7 in simple cubic. A shorter wavelength (Mo Kα) records more lines.
| a | lattice parameter (edge length of the cubic unit cell) (Å) |
| B | Debye-Waller temperature factor (Ų) |
| d | spacing between adjacent lattice planes (Å) |
| dhkl | spacing between (hkl) planes (Å) |
| f, fj | atomic scattering factor; of atom j |
| F, Fhkl | structure factor of the (hkl) reflection |
| h, k, l | Miller indices of a family of planes |
| i | imaginary unit, √−1 |
| I | diffracted intensity |
| Imax | maximum diffracted intensity |
| j | index of an atom in the unit cell |
| m | integer (diamond cubic selection rule) |
| n | order of the reflection (integer) |
| N | number of planes in the stack |
| p | multiplicity, number of equivalent planes in a family |
| s | sinθ/λ (Å−1) |
| xj, yj, zj | fractional coordinates of atom j in the unit cell |
| θ | Bragg angle, the angle between the X-ray beam and the planes (°) |
| 2θ | diffraction angle, the angle between the incident and diffracted beams (°) |
| λ | X-ray wavelength (Å) |
| φ | phase difference between waves reflected by successive planes (rad) |
This simulation was created in the Department of Chemical and Biological Engineering at University of Colorado Boulder for LearnChemE.com by John L. Falconer using Claude AI. It was prepared with financial support from the National Science Foundation (DUE 2336987 and 2336988). Address any questions or comments to LearnChemE@gmail.com.
Diffracted intensity from planes; click the plot to set θ.