---
title: "X-ray Fluorescence Spectrometer Interactive Lab | Sandbox Physics"
description: "Why does a stronger elemental line not always mean more of that element?"
canonical_url: "https://sandboxphysics.com/labs/xray-fluorescence-spectrometer/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/xray-fluorescence-spectrometer/"
last_modified: "2026-11-03"
---

IN27 · Count what escapes

# X-ray Fluorescence Spectrometer

**Why does a stronger elemental line not always mean more of that element?** A stronger line can come from more atoms, more effective excitation or less absorption before the photons reach the detector. Thin samples can be compared with known standards. Thicker samples need a correction that depends on composition, thickness and viewing geometry.

Excite an iron–copper sample with photons, retain spectra and standards, and compare thin-sample calibration with conditional absorption corrections.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

### Can line strength measure content?

Drag the collector, then acquire matching standards. Actual sample controls never supply the inferred composition.

Recorded counts **$0$**

Copper fraction in Fe–Cu **$0.35$**

Thin-calibration copper fraction **$0.35$**

Independent composition check **$0\,\%$**

Main photon energy $E_0/\mathrm{keV}$ $12$ 18 keV photon fraction $f_{18}$ $0$ Actual areal density $T/(\mathrm{mg}\,\mathrm{cm}^{-2})$ $0.1$ Actual copper fraction in Fe–Cu $x_{\mathrm{Cu}}$ $0.35$ Collector angle above surface $\beta/{}^{\circ}$ $45$

Known conditions, matrix and detector

The declared areal density and Al fraction are independent assumptions, not measurements by this spectrum. Changing actual thickness does not change those assumptions.

Actual Al mass fraction $w_{\mathrm{Al}}$ $0$ Declared areal density for inference $T_{\mathrm{decl}}/(\mathrm{mg}\,\mathrm{cm}^{-2})$ $0.1$ Declared Al mass fraction $w_{\mathrm{Al,decl}}$ $0$ Incident angle above surface $\alpha/{}^{\circ}$ $45$ Detector FWHM $\Delta E/\mathrm{eV}$ $124$ Entrance photon rate $\Phi/(\mathrm{photons}\,\mathrm{s}^{-1})$ $100000000$ Exposure $t/\mathrm{s}$ $12$ Acquisition seed $n$ $2701$ Counting noise

Model assumptions

A homogeneous Fe–Cu layer with optional Al matrix is excited by an ideal two-line photon spectrum. Pinned xraylib 4.3.0 data distinguish K-shell photoionization from total attenuation. A primary-fluorescence depth integral includes incident absorption and outgoing self-absorption; both rays use the illuminated face. Angles are above the surface. Branch-weighted unresolved groups use their mean energy for attenuation and efficiency. The finite circular collector uses a point-sample solid angle. A 500-micrometre silicon detector behind 8-micrometre beryllium uses first-photoelectric-interaction efficiency and a Gaussian full-energy response. Secondary fluorescence, chemical shifts, roughness, multilayers, polarization anisotropy, detector escape/tails, scattering redistribution, damage, pileup and dead time are omitted. A matched empirical holder background is measured separately. Rates above 20000 counts per second and saturated 16-bit bins withhold inference. Energy references, pure standards and a mixed independent check are retained. Composition is conditional on operator-declared areal density and Al fraction; it does not determine unknown thickness or matrix. Local counting uncertainty uses diagonal peak/standard propagation and entrance-monitor variance; shared-background correlations, energy/standard/model uncertainty are omitted. Low-count Poisson and high-count rounded Gaussian sampling are used. Depth is integrated; displayed thickness, packet size and speed are schematic. The apparatus is a teaching geometry, not a specific commercial product.

### A retained detector spectrum

Raw references, checks and retained records

Withheld energy-reference error $\delta E/\mathrm{eV}$ **$0$**

Calibrated Gaussian FWHM $\Delta E/\mathrm{eV}$ **$0$**

Conditional profile residual $\chi^2/\nu$ **$0$**

Withheld energy peak counts $N_{E,\mathrm{check}}$ **$0$**

Withheld energy shape residual $\chi^2_E/\nu_E$ **$0$**

Mixed-check spectral residual $\chi^2_{\mathrm{mix}}/\nu_{\mathrm{mix}}$ **$0$**

Normalized spectral condition $\kappa$ **$0$**

Raw counted acquisitions in the calibration and sample

| Acquisition | Spectrum counts | Entrance monitor | Seed |
| --- | --- | --- | --- |

Immutable retained spectra

| Record | Calibration | Supported |
| --- | --- | --- |

Two monochromatic line references calibrate the energy axis and width; a third is withheld. Pure iron and copper standards determine sensitivities. A mixed standard is an independent check. All have separate noise streams. CSV and JSON retain their definitions, full counted spectra, dark, blank, hardware, units and seeds, plus the declared sample assumptions; either file can replay the inverse without generator truth.

Uncertainty is a local, diagonal counting approximation conditional on exact standards, energy calibration, areal density and matrix. Shared-background correlations, parameter/model uncertainty and secondary fluorescence are omitted. A passing check does not validate an unknown matrix.

Physics tutorial

## Which photons can leave the sample?

**Background** An incident X-ray can remove an inner electron. When another electron fills the vacancy, the atom may emit a characteristic X-ray. Only some emitted photons escape the sample and reach the collector.

**Why it matters** Elemental abundance affects a peak area, but excitation energy, layer thickness and absorption by other elements also change it.

Start with the essentials

- **Focus question**: Why does a stronger elemental line not always mean more of that element?
- **One-sentence intuition**: Separate the chance of creating a K-shell vacancy from the loss of incident and fluorescent photons, then compare counted spectra with known standards.

### Core mathematical model

#### Primary fluorescent photons collected per entrance photon

$$
P_j=\frac{\Omega}{4\pi}\eta_j\omega_K b_j\sum_s f_s\frac{w\tau_K(E_s)}{\sin\alpha}\frac{1-e^{-A_{sj}T}}{A_{sj}}
$$

The detector subtends $\Omega$ and has full-energy efficiency $\eta_j$. The fluorescence yield and branching fraction are $\omega_K$ and $b_j$. Source weights $f_s$ sum to one; $w$ is the emitting element mass fraction. The K-shell photoionization coefficient $\tau_K$ is distinct from total attenuation. Normal areal density $T$ uses grams per square centimetre.

#### The two absorption paths

$$
A_{sj}=\frac{\mu_{\mathrm{mix}}(E_s)}{\sin\alpha}+\frac{\mu_{\mathrm{mix}}(E_j)}{\sin\beta}
$$

Both angles are measured above the illuminated surface. Total mixture attenuation $\mu_{\mathrm{mix}}$ includes loss by photoelectric absorption and scattering. Incident energy is $E_s$; fluorescent group energy is $E_j$.

### Common difficulties

#### A line energy is not its absorption edge

**Typical misconception** Photons at the copper line energy should excite copper K fluorescence.

**Better mental model** Removing a K electron needs the higher K-shell binding energy. A fluorescent photon carries a smaller energy difference between two occupied shells.

#### A good standard cannot reveal every matrix

**Typical misconception** Passing a mixed-standard check proves the unknown sample has the assumed thickness and composition.

**Better mental model** The check tests the stated reference conditions. Different unknown thicknesses or matrices can still change absorption; those require independent information.

### Run the experiment

1. 01

   #### Start with a thin alloy

   Change actual copper fraction, save a spectrum and compare thin calibration with the conditional estimate.

   **What to observe:** The two estimates remain close for weak absorption. Their input is the retained peak area, not the actual-composition control.

2. 02

   #### Cross an absorption edge

   Choose the below-edge preset, then the hard-tail preset.

   **What to observe:** Eight-keV photons can create iron K vacancies but cannot create copper K vacancies. An eighteen-keV component restores copper excitation.

3. 03

   #### Add material below the surface

   Choose self-absorption, compare both estimates, then change the declared areal density separately.

   **What to observe:** Fluorescence from greater depth is progressively lost. The thin estimate shifts; the corrected result needs the declared thickness.

4. 04

   #### Change the view or the matrix

   Drag the collector and acquire new standards. Try the light-matrix preset; declare its Al fraction as 0.65 in the advanced controls.

   **What to observe:** Old geometry fails compatibility. The wrong matrix fails the profile test; supplying the known matrix can recover a conditional result.

Physical conclusion

Composition is conditional on matching calibration and declared sample conditions. A thin-sample ratio can be biased by self-absorption.

## Related experiments and articles

How physics instruments measure · Reading path

### How physics instruments measure

Articles on this path that use this experiment, followed by the other experiments they suggest.

1. [Article **Why X-ray fluorescence depends on sample thickness**](https://sandboxphysics.com/stories/instruments/xray-fluorescence-spectrometer/)

Quantum & fields · Starter path

## Start from a single measurement

Predict an outcome, then count what the measurements actually give. The path starts with one qubit and moves on to wave packets, bound states and two-photon interference.

[Start here → **Quantum State & Born Measurement** Predict a probability, turn the analyzer, then compare your prediction with the measured frequency over many shots. Observe · 15 min](https://sandboxphysics.com/labs/qubit-state/)

1. [1 Quantum State & Born Measurement](https://sandboxphysics.com/labs/qubit-state/)
2. [2 Stern–Gerlach Sequence](https://sandboxphysics.com/labs/stern-gerlach-sequence/)
3. [3 Wave Packet & Uncertainty](https://sandboxphysics.com/labs/wave-packet-uncertainty/)
4. [4 Quantum Harmonic Oscillator](https://sandboxphysics.com/labs/quantum-harmonic-oscillator/)
5. [5 Which Path & Quantum Eraser](https://sandboxphysics.com/labs/quantum-eraser/)
6. [6 Hong–Ou–Mandel Two-Photon Interference](https://sandboxphysics.com/labs/hong-ou-mandel/)

[View the full path →](https://sandboxphysics.com/topics/quantum/#starter-path)
