Model
A plane wave of vacuum wavelength λ falls at angle θᵢ on N slits of width a with centres d apart.
In the far field (or the focal plane of a lens) every slit adds a phasor. The phase step between
neighbouring slits is 2β, and the phase across one slit spans 2α:
Sign convention. All angles are directions of travel measured from the grating normal, positive counter-clockwise, on the transmitted side. The zero order is the undeviated beam θ₀ = θᵢ, and a positive order is deviated towards larger θ.
- N
- number of coherently illuminated slits (beam width / d)
- d, 1/d
- grating pitch; groove density in lines/mm
- a
- transparent width of one slit (a ≤ d)
- θᵢ, θm
- incidence angle and angle of order m
- m
- diffraction order (integer)
- w, w′
- entrance slit width and its image on the detector, w′ = w (fcam/fcol) cos θᵢ / cos θm
- p
- detector pixel pitch
- dx/dλ
- linear dispersion fcam m/(d cos θm); its inverse is quoted in nm/mm
Assumptions and validity: scalar Fraunhofer diffraction with no obliquity factor and no polarization dependence; a perfectly periodic, infinitely thin amplitude grating in air; uniform, fully coherent illumination of N slits; incoherent sum over spectral lines. The spectrometer treats the entrance slit as an incoherent line source whose image adds a rectangle of width w′ (linearised about the camera axis), with ideal aberration-free lenses and a detector of 2048 square pixels with 100 % fill factor. The white-light continuum uses the order-integrated result, valid when the spectrum is smooth over λ/(mN) (the tool warns for N < 10).
Derivation: array factor, resolving power and instrument profile
Array factor. The slits sit at xn = nd. A far-field direction θ adds the phase k d(sin θ − sin θᵢ) = 2β per slit, so the field is a geometric series: Σn=0N−1 e2iβn = ei(N−1)β sin(Nβ)/sin β. Dividing by N normalises it to 1 at β = 0. Integrating across one slit multiplies by sin α/α.
Removable singularity. At every principal maximum β = mπ both sines vanish. Writing β = mπ + ε gives sin(Nβ)/(N sin β) = (−1)m(N−1) sin(Nε)/(N sin ε) → (−1)m(N−1). The code reduces β to ε first and uses 1 − (N² − 1)ε²/6 + … when |Nε| < 10⁻⁴, so the peaks are exactly 1 times the envelope.
Missing orders. The envelope vanishes at α = kπ. At order m, α/β = a/d, so α = πma/d, which is a multiple of π when m = k·d/a. Those orders are missing even though the grating equation allows them.
Resolving power. The first zero next to a principal maximum sits at Nε = π, a shift of Δ(sin θ) = λ/(Nd). A second line of wavelength λ + Δλ has its order-m peak shifted by mΔλ/d. Rayleigh's criterion puts the second peak on the first zero, so mΔλ/d = λ/(Nd), which gives λ/Δλ = mN. For equal lines the sum dips to 8/π² ≈ 81 % between the peaks; the tool uses that dip as its "resolved" test.
Dispersion and FSR. Differentiating d(sin θ − sin θᵢ) = mλ at fixed θᵢ gives d cos θ dθ = m dλ. The same angle carries λ in order m + 1 and λ + λ/m in order m, so a band wider than λ/m overlaps the next order.
Instrument profile. Each point of the entrance slit is an independent source at a slightly different θᵢ. Its spectrum is the same grating response shifted on the detector, so the recorded profile is the grating response convolved with the slit image (width w′), then integrated over each pixel (a second rectangle of width p) and sampled at the pixel centres. The widths add roughly in quadrature for similar sizes and the largest one wins otherwise. Only the first factor scales with N.