Profiles / Sciences
OP

Optics & photonics

Refraction, lenses, photons and diffraction with SI units and CODATA constants.

10 recipes on this page · open in the interactive view

Recipes
  1. Step-index fiber: critical angle, NA and V number
  2. Thin lens: image distance and magnification
  3. Photon energy and photon flux of lasers
  4. Single-slit diffraction pattern
  5. Rings of a Laguerre-Gauss laser mode
  6. Fresnel reflectance and the Brewster angle
  7. Reflectance of a gold mirror from its complex index
  8. Measuring a Gaussian beam with a knife edge
  9. Fabry-Perot etalon: FSR, finesse and linewidth
  10. Diffraction grating: orders and angles of a spectrum
executed on MentDB

Step-index fiber: critical angle, NA and V number

For a fiber with core index 1.4475 and cladding 1.4440 (9 um core), compute the critical angle (Snell with a 90 degree refraction), the numerical aperture, the acceptance angle in air and the V number at 1310 nm to know if it is single-mode.

Pipeline
Script
admin
#1. Step-index fiber: core n1 = 1.4475, cladding n2 = 1.4440;
-> "[n1]" 1.4475; -> "[n2]" 1.4440;
#2. Critical angle at the core-cladding interface, Snell with r = 90 degrees;
-> "[thc]" (math eval "asin(n2/n1)" (concat "{\"n1\": " [n1] ", \"n2\": " [n2] ", \"_angle\": \"deg\"}"));
#3. Numerical aperture and acceptance half-angle in air;
-> "[NA]" (math calc "sqrt([n1]^2-[n2]^2)");
-> "[acc]" (math eval "asin(na)" (concat "{\"na\": " [NA] ", \"_angle\": \"deg\"}"));
#4. Normalized frequency at 1310 nm for a 9 um core: V = 2 pi a NA / lambda;
-> "[V]" (unit calc (concat "2*pi*4.5 um*" [NA] "/(1310 nm)"));
concat "critical angle = " (math round [thc] 2) " deg, NA = " (math round_sig [NA] 3) ", acceptance = " (math round [acc] 2) " deg, V = " (math round [V] 3) (if (< [V] 2.405) {": single-mode"} {": multimode"})
Result
mentdb
critical angle = 86.01 deg, NA = 0.101, acceptance = 5.77 deg, V = 2.171: single-mode
Go further
executed on MentDB

Thin lens: image distance and magnification

Solve the thin lens equation 1/f = 1/do + 1/di symbolically for di, then apply it to a 50 mm camera lens focusing on a person 1.70 m tall standing 2 m away.

Pipeline
Script
admin
#1. Thin lens equation 1/f = 1/do + 1/di, solved for di;
-> "[sol]" (json load select "rx_lens" (cas solve "1/f = 1/u + 1/v" "v") /[0]/v);
#2. Camera lens f = 50 mm, subject at 2 m;
-> "[di]" (math eval [sol] "{\"f\": 50, \"u\": 2000}");
#3. Magnification and image of a 1.70 m person;
-> "[M]" (math calc "-[di]/2000");
concat "di = " [sol] " = " (math round [di] 3) " mm, M = " (math round_sig [M] 3) ", image height = " (math round (math calc "abs([M])*1700") 2) " mm"
Result
mentdb
di = (f*u)/(-f+u) = 51.282 mm, M = -0.0256, image height = 43.59 mm
Go further
  • Tabulate di for subjects from 0.5 m to 10 m with num table
  • Compute the depth of field with num solve for a given circle of confusion
executed on MentDB

Photon energy and photon flux of lasers

Compute the photon energy E = hc/lambda of a 405 nm, 633 nm and 1064 nm laser in eV, and the number of photons per second emitted by a 5 mW HeNe laser.

Pipeline
Script
admin
#1. Photon energy of three lasers;
-> "[E1]" (unit calc "_h*_c/(405 nm)" "eV");
-> "[E2]" (unit calc "_h*_c/(633 nm)" "eV");
-> "[E3]" (unit calc "_h*_c/(1064 nm)" "eV");
#2. Photon flux of a 5 mW HeNe laser: N = P / E;
-> "[N]" (unit calc (concat "5 mW/(" [E2] " eV)") "1/s");
concat "405 nm: " (math round [E1] 3) " eV, 633 nm: " (math round [E2] 3) " eV, 1064 nm: " (math round [E3] 3) " eV; a 5 mW HeNe emits " (math round (math calc "[N]/1e16") 3) " x 10^16 photons/s"
Result
mentdb
405 nm: 3.061 eV, 633 nm: 1.959 eV, 1064 nm: 1.165 eV; a 5 mW HeNe emits 1.593 x 10^16 photons/s
Go further
  • Get the photon momentum h/lambda and the radiation force P/c with unit calc
  • Convert to wavenumbers with unit calc "1/(633 nm)"
executed on MentDB

Single-slit diffraction pattern

A 633 nm beam goes through a 50 um slit, screen at 1.5 m. Compute the width of the central fringe, then find the first secondary maximum (root of tan(b) = b) and its relative intensity (sin b / b)^2.

Pipeline
Script
admin
#1. Single slit a = 50 um, lambda = 633 nm, screen at 1.5 m;
-> "[x1]" (unit calc "633 nm*1.5 m/(50 um)" "mm");
#2. First secondary maximum: tan b = b between pi and 3pi/2;
-> "[b]" (num solve "tan(b)-b" "b" 3.2 4.6);
#3. Relative intensity sinc^2 and position;
-> "[I]" (math calc "(sin([b])/[b])^2");
concat "central fringe width = " (math round (math calc "2*[x1]") 2) " mm; 1st side maximum at b = " (math round [b] 4) " rad, I/I0 = " (math round [I] 4) ", at " (math round (math calc "[b]/pi*[x1]") 2) " mm from the centre"
Result
mentdb
central fringe width = 37.98 mm; 1st side maximum at b = 4.4934 rad, I/I0 = 0.0472, at 27.16 mm from the centre
Go further
executed on MentDB

Rings of a Laguerre-Gauss laser mode

The LG(p=2, l=0) mode of a laser has an intensity L2(u)^2 exp(-u), u = 2r^2/w^2. The script finds the dark rings from the roots of the Laguerre polynomial, the power in the central lobe, and the beam quality M2 = 2p+1 from the second moment.

Pipeline
Script
admin
#1. Laguerre-Gauss laser mode LG p=2, l=0, waist w = 1 mm: I of r is L2 of u squared * exp of -u, u = 2r^2/w^2;
-> "[w]" 1;
#2. Dark rings: roots of the Laguerre polynomial L2;
-> "[u1]" (num solve "laguerre(2, u)" "u" 0 1);
-> "[u2]" (num solve "laguerre(2, u)" "u" 3 4);
-> "[r1]" (math calc "[w]*sqrt([u1]/2)"); -> "[r2]" (math calc "[w]*sqrt([u2]/2)");
#3. Power inside the first dark ring, the total power being 1;
-> "[P1]" (num integrate "laguerre(2, u)^2*exp(-u)" "u" 0 [u1]);
#4. Second moment radius W = w sqrt of mean u, and beam quality M2 = 2p+1;
-> "[mu]" (num integrate "u*laguerre(2, u)^2*exp(-u)" "u" 0 "inf");
concat "{\"dark_rings_mm\": [" (math round [r1] 4) ", " (math round [r2] 4) "], \"power_in_central_lobe\": " (math round [P1] 4) ", \"M2\": " (math round [mu] 6) ", \"second_moment_radius_mm\": " (math round (math calc "[w]*sqrt([mu])") 4) "}"
Result
mentdb
{"dark_rings_mm": [0.5412, 1.3066], "power_in_central_lobe": 0.1568, "M2": 5, "second_moment_radius_mm": 2.2361}
Go further
  • Draw the radial profile with plot function "laguerre(2, 2*x^2)^2*exp(-2*x^2)" "x" 0 2.5.
  • For l > 0 the generalized Laguerre polynomials are needed: build them with cas eval "LaguerreL(n, l, x)".
executed on MentDB

Fresnel reflectance and the Brewster angle

Light goes from air into glass (n = 1.52) at 45 deg. Compute the refraction angle, the s and p reflectances from the Fresnel equations Rs = sin^2(ti - tt)/sin^2(ti + tt), Rp = tan^2(ti - tt)/tan^2(ti + tt), and the Brewster angle atan(n2/n1) where Rp vanishes.

Pipeline
Script
admin
-> "[n]" 1.52;
-> "[ti]" (math deg_to_rad 45);
#1. Snell law;
-> "[tt]" (math asin (math calc "sin([ti])/[n]"));
#2. Fresnel reflectances;
-> "[Rs]" (math calc (concat "(" (math sin (math calc "[ti]-[tt]")) "/" (math sin (math calc "[ti]+[tt]")) ")^2"));
-> "[Rp]" (math calc (concat "(" (math tan (math calc "[ti]-[tt]")) "/" (math tan (math calc "[ti]+[tt]")) ")^2"));
#3. Brewster angle;
-> "[tb]" (math atan [n]);
concat "refraction " (math round (math rad_to_deg [tt]) 2) " deg; Rs = " (math round [Rs] 4) ", Rp = " (math round [Rp] 4) ", unpolarised " (math round (math calc "([Rs]+[Rp])/2") 4) "; Brewster " (math round (math rad_to_deg [tb]) 2) " deg, normal incidence R = " (math round (math calc "(([n]-1)/([n]+1))^2") 4)
Result
mentdb
refraction 27.72 deg; Rs = 0.0967, Rp = 0.0094, unpolarised 0.053; Brewster 56.66 deg, normal incidence R = 0.0426
Go further
  • At the Brewster angle the reflected and refracted rays are perpendicular: check ti + tt = 90 deg.
  • Plot Rs and Rp versus the angle with plot function.
executed on MentDB

Reflectance of a gold mirror from its complex index

At 633 nm gold has n = 0.18 + 3.0i. Normal-incidence reflectance R = |(n - 1)/(n + 1)|^2, the phase shift on reflection, and the field penetration depth lambda/(4 pi kappa).

Pipeline
Script
admin
-> "[n]" "0.18+3.0i";
#1. Amplitude reflection coefficient;
-> "[r]" (complex div (complex sub [n] 1) (complex add [n] 1));
-> "[R]" (math calc (concat (complex abs [r]) "^2"));
#2. Phase shift on reflection;
-> "[ph]" (math rad_to_deg (complex arg [r]));
#3. Intensity penetration depth lambda over 4 pi kappa;
-> "[fp]" (string regexp_extract (constant math_four_pi) "[-0-9.]+E?[-0-9]*" 0);
-> "[d]" (math calc (concat "633/([fp]*" (complex im [n]) ")"));
concat "r = " [r] "; R = " (math round (math calc "100*[R]") 2) " %; phase " (math round [ph] 2) " deg; penetration depth " (math round [d] 2) " nm"
Result
mentdb
r = 0.7729109734036411+0.5773449828720989i; R = 93.07 %; phase 36.76 deg; penetration depth 16.79 nm
Go further
  • Silver (0.06 + 4.2i) and aluminium (1.2 + 7.3i): compare the reflectances.
  • At oblique incidence use complex sqrt for the complex refraction angle.
executed on MentDB

Measuring a Gaussian beam with a knife edge

A razor blade cuts a Gaussian beam: the transmitted power is P(x)/P0 = erfc(sqrt(2) x / w)/2. The blade positions at 90 % and 10 % power are 0.64 mm apart. Get the 1/e^2 radius w with erf_inv, the Rayleigh range at 1064 nm, and check the fraction at x = w.

Pipeline
Script
admin
-> "[dx]" 0.64;
#1. P = 0.9 at -x0 and 0.1 at +x0 with sqrt2 x0 / w = erf_inv 0.8;
-> "[k]" (math erf_inv 0.8);
-> "[w]" (math calc (concat "[dx]/(2*" [k] ")*sqrt(2)"));
#2. Rayleigh range in mm, lambda = 1064 nm;
-> "[pi]" (string regexp_extract (constant math_pi) "[-0-9.]+E?[-0-9]*" 0);
-> "[zr]" (math calc "[pi]*[w]^2/1064E-6");
#3. Fraction still transmitted with the blade at x = w;
-> "[f]" (math calc (concat (math erfc (math sqrt 2)) "/2"));
concat "erf_inv 0.8 = " (math round [k] 5) ", w = " (math round [w] 4) " mm, the 10-90 width is " (math round (math calc "[dx]/[w]") 4) " w; Rayleigh range " (math round [zr] 1) " mm; at x = w: " (math round (math calc "100*[f]") 3) " %, check erf = " (math round (math erf (math sqrt 2)) 5)
Result
mentdb
erf_inv 0.8 = 0.90619, w = 0.4994 mm, the 10-90 width is 1.2816 w; Rayleigh range 736.4 mm; at x = w: 2.275 %, check erf = 0.9545
Go further
  • Fit all the blade positions with stat fit_model and the model erfc instead of using two points.
  • Repeat at several z to get the beam quality factor M^2.
executed on MentDB

Fabry-Perot etalon: FSR, finesse and linewidth

A 5 mm air-spaced etalon with mirrors R = 0.95. Free spectral range c/(2nL), coefficient of finesse F = 4R/(1-R)^2, finesse pi sqrt(F)/2, phase FWHM 4 asin(1/sqrt F), and the transmission halfway between two peaks.

Pipeline
Script
admin
-> "[c]" (string regexp_extract (constant physics_c) "[-0-9.]+E?[-0-9]*" 0);
-> "[R]" 0.95;
-> "[L]" 0.005;
#1. Free spectral range in GHz;
-> "[fsr]" (math calc "[c]/(2*[L])/1E9");
#2. Coefficient of finesse and finesse;
-> "[F]" (math calc (concat "4*[R]/" (math power (math calc "1-[R]") 2)));
-> "[fin]" (math calc "pi*sqrt([F])/2");
#3. Exact FWHM of the Airy peak and minimum transmission at delta = pi;
-> "[dd]" (math calc (concat "4*" (math asin (math calc "1/sqrt([F])"))));
-> "[Tmin]" (math calc (concat "1/(1+[F]*" (math power (math sin (math calc "pi/2")) 2) ")"));
concat "FSR = " (math round [fsr] 3) " GHz, F = " (math round [F] 1) ", finesse = " (math round [fin] 2) " (exact " (math round (math calc "2*pi/[dd]") 2) "), linewidth " (math round (math calc "[fsr]*1000/[fin]") 1) " MHz, contrast Tmin = " (math round [Tmin] 5)
Result
mentdb
FSR = 29.979 GHz, F = 1520, finesse = 61.24 (exact 61.23), linewidth 489.5 MHz, contrast Tmin = 6.6E-4
Go further
  • Scan the cavity length: transmission T(delta) = 1/(1 + F sin^2(delta/2)) with plot function.
  • Mirror losses and flatness reduce the effective finesse.
executed on MentDB

Diffraction grating: orders and angles of a spectrum

A 600 lines/mm grating at normal incidence. For the sodium D line, a helium-neon and a violet diode, compute the highest order trunc(d/lambda), the first-order angles sorted, and the resolving power N m needed to split the sodium doublet.

Pipeline
Script
admin
#Groove spacing in nm;
-> "[d]" (math calc "1E6/600");
#1. Highest order for 589.3 nm;
-> "[mmax]" (math trunc (math calc "[d]/589.3"));
#2. First-order angles in degrees;
-> "[a1]" (math round (math rad_to_deg (math asin (math calc "632.8/[d]"))) 3);
-> "[a2]" (math round (math rad_to_deg (math asin (math calc "589.3/[d]"))) 3);
-> "[a3]" (math round (math rad_to_deg (math asin (math calc "405/[d]"))) 3);
-> "[sorted]" (math order_double (concat "[" [a1] ", " [a2] ", " [a3] "]"));
#3. Lines to illuminate to resolve 589.0 and 589.6 nm in order 1 and 2;
-> "[R]" (math calc "589.3/0.6");
concat "d = " (math round [d] 2) " nm, max order " [mmax] "; angles 405/589/633 nm: " [sorted] " deg; R = " (math round [R] 0) ", needs " (math ceil [R]) " lines in order 1, " (math ceil (math calc "[R]/2")) " in order 2"
Result
mentdb
d = 1666.67 nm, max order 2; angles 405/589/633 nm: [14.064,20.706,22.314] deg; R = 982, needs 983 lines in order 1, 492 in order 2
Go further
  • With an incidence angle, use d(sin ti + sin tm) = m lambda.
  • Angular dispersion dtheta/dlambda = m/(d cos theta).

Also in Sciences

MA
Mathematician
Calculus, linear algebra, number theory and complex numbers: exact and numerical in the same script.
10 recipes
MT
Math teacher & student
Equations, tables of values, fractions and probabilities: exact answers and their decimal check.
10 recipes
PH
Physicist
Mechanics with units, constants and differential equations: trajectories, pendulums, oscillators.
10 recipes
TH
Thermodynamics & heat transfer
Conduction, heat pumps, ideal gases and cooling laws with units, integrals and ODEs.
10 recipes
NR
Nuclear & radiation physicist
Decay, half-lives, generators and shielding: dates, fits and solvers for radiation work.
10 recipes
AQ
Atomic & quantum physicist
Spectral lines, matter waves, blackbody radiation and CODATA constants with their uncertainties.
10 recipes
AE
Acoustics engineer
Decibels, Doppler, spectra and reverberation: the daily formulas of noise and room acoustics.
10 recipes
CN
Cryptographer & number theorist
RSA and Diffie-Hellman by hand, primes, modular arithmetic and exact big integers.
10 recipes
OR
Operations researcher
Optimisation with constraints, Markov chains for maintenance, newsvendor inventory: solve and plot.
10 recipes
ME
Metrologist
Uncertainty budgets following the GUM, exact decimals and calibration curves.
10 recipes
MP
Mathematical physicist
Special functions at work: Bessel modes, Hermite and Laguerre states, gamma and zeta, with the CAS.
10 recipes
CM
Crystallographer & materials physicist
Miller indices, metric tensors, elastic tensors and structure factors.
10 recipes