Path: blob/main/latex-templates/templates/optics/interference_patterns.tex
51 views
unlisted
\documentclass[a4paper, 11pt]{article}1\usepackage[utf8]{inputenc}2\usepackage[T1]{fontenc}3\usepackage{amsmath, amssymb}4\usepackage{graphicx}5\usepackage{siunitx}6\usepackage{booktabs}7\usepackage[makestderr]{pythontex}89\title{Optics: Interference Patterns and Analysis}10\author{Computational Science Templates}11\date{\today}1213\begin{document}14\maketitle1516\section{Introduction}17Interference phenomena demonstrate the wave nature of light through the superposition of coherent waves. This analysis explores Young's double-slit experiment, multiple-beam interference, Michelson interferometry, and Fabry-P\'erot cavities, examining both intensity patterns and their applications in metrology and spectroscopy.1819\section{Mathematical Framework}2021\subsection{Two-Beam Interference}22For two coherent beams with amplitudes $E_1$ and $E_2$ and phase difference $\delta$:23\begin{equation}24I = I_1 + I_2 + 2\sqrt{I_1 I_2}\cos\delta25\end{equation}2627\subsection{Double-Slit with Diffraction}28The intensity pattern for double-slit interference with single-slit diffraction:29\begin{equation}30I(\theta) = I_0 \left(\frac{\sin\beta}{\beta}\right)^2 \cos^2\alpha31\end{equation}32where $\alpha = \frac{\pi d \sin\theta}{\lambda}$ (interference) and $\beta = \frac{\pi a \sin\theta}{\lambda}$ (diffraction).3334\subsection{Multiple-Beam Interference}35For N slits (grating), the intensity is:36\begin{equation}37I = I_0 \left(\frac{\sin\beta}{\beta}\right)^2 \left(\frac{\sin N\alpha}{\sin\alpha}\right)^238\end{equation}3940\subsection{Fabry-P\'erot Interferometer}41Transmission of a Fabry-P\'erot cavity:42\begin{equation}43T = \frac{1}{1 + F\sin^2(\delta/2)}44\end{equation}45where $F = \frac{4R}{(1-R)^2}$ is the finesse coefficient and $\delta = \frac{4\pi n d \cos\theta}{\lambda}$.4647\section{Environment Setup}48\begin{pycode}49import numpy as np50import matplotlib.pyplot as plt51plt.rc('text', usetex=True)52plt.rc('font', family='serif')5354def save_plot(filename, caption=""):55plt.savefig(filename, bbox_inches='tight', dpi=150)56print(r'\begin{figure}[htbp]')57print(r'\centering')58print(r'\includegraphics[width=0.95\textwidth]{' + filename + '}')59if caption:60print(r'\caption{' + caption + '}')61print(r'\end{figure}')62plt.close()63\end{pycode}6465\section{Young's Double-Slit Experiment}66\begin{pycode}67# Physical parameters68wavelength = 632.8e-9 # He-Ne laser (m)69d = 0.5e-3 # Slit separation (m)70a = 0.1e-3 # Slit width (m)71L = 2.0 # Screen distance (m)7273# Angular range74theta = np.linspace(-0.01, 0.01, 1000)75theta[theta == 0] = 1e-10 # Avoid division by zero7677# Phase terms78alpha = np.pi * d * np.sin(theta) / wavelength79beta = np.pi * a * np.sin(theta) / wavelength8081# Intensity patterns82I_interference = np.cos(alpha)**283I_diffraction = (np.sin(beta) / beta)**284I_total = I_diffraction * I_interference8586# Screen position87x = L * np.tan(theta) * 1000 # mm8889# Find fringe spacing90fringe_spacing = wavelength * L / d * 1000 # mm9192# Create plots93fig, axes = plt.subplots(2, 2, figsize=(10, 8))9495# Plot 1: Full pattern96axes[0, 0].plot(x, I_total, 'b-', linewidth=1)97axes[0, 0].plot(x, I_diffraction, 'r--', linewidth=1.5, alpha=0.7, label='Diffraction envelope')98axes[0, 0].set_xlabel('Position on screen (mm)')99axes[0, 0].set_ylabel('Intensity (normalized)')100axes[0, 0].set_title('Double-Slit Interference Pattern')101axes[0, 0].legend()102axes[0, 0].set_xlim([-15, 15])103axes[0, 0].grid(True, alpha=0.3)104105# Plot 2: Central region zoom106axes[0, 1].plot(x, I_total, 'b-', linewidth=1.5)107axes[0, 1].set_xlabel('Position on screen (mm)')108axes[0, 1].set_ylabel('Intensity (normalized)')109axes[0, 1].set_title('Central Fringes')110axes[0, 1].set_xlim([-5, 5])111axes[0, 1].grid(True, alpha=0.3)112113# Plot 3: 2D intensity pattern114x_2d = np.linspace(-15, 15, 400)115y_2d = np.linspace(-5, 5, 200)116X, Y = np.meshgrid(x_2d, y_2d)117118# Convert to angle119theta_2d = np.arctan(X / 1000 / L)120alpha_2d = np.pi * d * np.sin(theta_2d) / wavelength121beta_2d = np.pi * a * np.sin(theta_2d) / wavelength122beta_2d[beta_2d == 0] = 1e-10123124I_2d = (np.sin(beta_2d) / beta_2d)**2 * np.cos(alpha_2d)**2125126axes[1, 0].imshow(I_2d, extent=[-15, 15, -5, 5], cmap='hot', aspect='auto')127axes[1, 0].set_xlabel('Position (mm)')128axes[1, 0].set_ylabel('Vertical position (mm)')129axes[1, 0].set_title('2D Interference Pattern')130131# Plot 4: Comparison of slit widths132slit_widths = [0.05e-3, 0.1e-3, 0.2e-3]133colors = ['blue', 'green', 'red']134for aw, color in zip(slit_widths, colors):135beta_w = np.pi * aw * np.sin(theta) / wavelength136I_w = (np.sin(beta_w) / beta_w)**2137axes[1, 1].plot(x, I_w, color=color, linewidth=1.5,138label=f'$a = {aw*1e6:.0f}$ $\\mu$m')139140axes[1, 1].set_xlabel('Position on screen (mm)')141axes[1, 1].set_ylabel('Intensity (normalized)')142axes[1, 1].set_title('Diffraction Envelope vs Slit Width')143axes[1, 1].legend()144axes[1, 1].set_xlim([-15, 15])145axes[1, 1].grid(True, alpha=0.3)146147plt.tight_layout()148save_plot('double_slit.pdf', "Young's double-slit interference with diffraction envelope and 2D pattern.")149150# Calculate number of fringes in central maximum151n_fringes = int(2 * d / a)152\end{pycode}153154\section{Multiple-Slit Interference (Diffraction Grating)}155\begin{pycode}156# N-slit interference patterns157N_values = [2, 5, 10, 20]158colors_N = ['blue', 'green', 'orange', 'red']159160# Angular range for grating161theta_g = np.linspace(-0.005, 0.005, 2000)162alpha_g = np.pi * d * np.sin(theta_g) / wavelength163x_g = L * np.tan(theta_g) * 1000164165fig, axes = plt.subplots(2, 2, figsize=(10, 8))166167# Plot 1: Comparison of N-slit patterns168for N, color in zip(N_values, colors_N):169# N-slit interference function170I_N = np.where(np.abs(np.sin(alpha_g)) < 1e-10,171N**2,172(np.sin(N * alpha_g) / np.sin(alpha_g))**2)173I_N = I_N / N**2 # Normalize174175axes[0, 0].plot(x_g, I_N, color=color, linewidth=1, label=f'$N = {N}$', alpha=0.8)176177axes[0, 0].set_xlabel('Position on screen (mm)')178axes[0, 0].set_ylabel('Intensity (normalized)')179axes[0, 0].set_title('N-Slit Interference Patterns')180axes[0, 0].legend()181axes[0, 0].set_xlim([-3, 3])182axes[0, 0].grid(True, alpha=0.3)183184# Plot 2: Principal and secondary maxima185N = 10186alpha_detail = np.linspace(-0.5 * np.pi, 2.5 * np.pi, 1000)187I_detail = np.where(np.abs(np.sin(alpha_detail)) < 1e-10,188N**2,189(np.sin(N * alpha_detail) / np.sin(alpha_detail))**2)190I_detail = I_detail / N**2191192axes[0, 1].plot(alpha_detail/np.pi, I_detail, 'b-', linewidth=1.5)193axes[0, 1].axhline(y=1/N**2, color='red', linestyle='--', alpha=0.5, label='Secondary maxima')194axes[0, 1].set_xlabel('$\\alpha/\\pi$')195axes[0, 1].set_ylabel('Intensity (normalized)')196axes[0, 1].set_title(f'Principal and Secondary Maxima ($N = {N}$)')197axes[0, 1].legend()198axes[0, 1].grid(True, alpha=0.3)199200# Plot 3: Resolution criterion201# Resolving two wavelengths202lambda1 = 589.0e-9 # Na D1203lambda2 = 589.6e-9 # Na D2204N_res = 100205206theta_res = np.linspace(-0.001, 0.001, 2000)207alpha1 = np.pi * d * np.sin(theta_res) / lambda1208alpha2 = np.pi * d * np.sin(theta_res) / lambda2209x_res = L * np.tan(theta_res) * 1000210211I1 = np.where(np.abs(np.sin(alpha1)) < 1e-10, N_res**2,212(np.sin(N_res * alpha1) / np.sin(alpha1))**2)213I2 = np.where(np.abs(np.sin(alpha2)) < 1e-10, N_res**2,214(np.sin(N_res * alpha2) / np.sin(alpha2))**2)215216axes[1, 0].plot(x_res, I1/N_res**2, 'b-', linewidth=1.5, label=f'$\\lambda_1 = {lambda1*1e9:.1f}$ nm')217axes[1, 0].plot(x_res, I2/N_res**2, 'r-', linewidth=1.5, label=f'$\\lambda_2 = {lambda2*1e9:.1f}$ nm')218axes[1, 0].plot(x_res, (I1 + I2)/(2*N_res**2), 'k--', linewidth=1, alpha=0.5, label='Sum')219axes[1, 0].set_xlabel('Position on screen (mm)')220axes[1, 0].set_ylabel('Intensity (normalized)')221axes[1, 0].set_title(f'Sodium D-lines Resolution ($N = {N_res}$)')222axes[1, 0].legend(fontsize=8)223axes[1, 0].grid(True, alpha=0.3)224225# Plot 4: Angular width of principal maximum226N_width = np.arange(2, 101)227angular_width = 2 * wavelength / (N_width * d) * 180 / np.pi * 3600 # arcseconds228229axes[1, 1].loglog(N_width, angular_width, 'g-', linewidth=2)230axes[1, 1].set_xlabel('Number of slits $N$')231axes[1, 1].set_ylabel('Angular width (arcsec)')232axes[1, 1].set_title('Principal Maximum Width vs $N$')233axes[1, 1].grid(True, alpha=0.3, which='both')234235plt.tight_layout()236save_plot('multiple_slit.pdf', 'Multiple-slit interference: N-slit patterns, resolution, and angular width.')237\end{pycode}238239\section{Michelson Interferometer}240\begin{pycode}241# Michelson interferometer simulation242def michelson_intensity(d_mirror, wavelength, n=1):243"""Intensity at detector for mirror displacement d."""244delta = 4 * np.pi * n * d_mirror / wavelength245return 0.5 * (1 + np.cos(delta))246247# Mirror displacement range248d_mirror = np.linspace(0, 10e-6, 1000)249250fig, axes = plt.subplots(2, 2, figsize=(10, 8))251252# Plot 1: Fringe pattern for single wavelength253I_single = michelson_intensity(d_mirror, wavelength)254axes[0, 0].plot(d_mirror*1e6, I_single, 'b-', linewidth=1.5)255axes[0, 0].set_xlabel('Mirror displacement ($\\mu$m)')256axes[0, 0].set_ylabel('Intensity (normalized)')257axes[0, 0].set_title('Michelson Fringes (Single Wavelength)')258axes[0, 0].grid(True, alpha=0.3)259260# Plot 2: Coherence length effect (white light)261# Simulate short coherence length262coherence_lengths = [1e-6, 5e-6, 20e-6]263colors_coh = ['red', 'green', 'blue']264265for L_c, color in zip(coherence_lengths, colors_coh):266envelope = np.exp(-np.abs(d_mirror) / L_c)267I_wl = 0.5 * (1 + envelope * np.cos(4 * np.pi * d_mirror / wavelength))268axes[0, 1].plot(d_mirror*1e6, I_wl, color=color, linewidth=1.5,269label=f'$L_c = {L_c*1e6:.0f}$ $\\mu$m')270271axes[0, 1].set_xlabel('Mirror displacement ($\\mu$m)')272axes[0, 1].set_ylabel('Intensity')273axes[0, 1].set_title('Coherence Length Effect')274axes[0, 1].legend()275axes[0, 1].grid(True, alpha=0.3)276277# Plot 3: Two-wavelength beat pattern278lambda3 = 600e-9279lambda4 = 650e-9280281I3 = michelson_intensity(d_mirror, lambda3)282I4 = michelson_intensity(d_mirror, lambda4)283I_beat = I3 + I4284285axes[1, 0].plot(d_mirror*1e6, I_beat, 'purple', linewidth=1)286axes[1, 0].set_xlabel('Mirror displacement ($\\mu$m)')287axes[1, 0].set_ylabel('Total intensity')288axes[1, 0].set_title('Two-Wavelength Beat Pattern')289axes[1, 0].grid(True, alpha=0.3)290291# Plot 4: 2D fringe pattern (circular fringes)292r = np.linspace(0, 10e-3, 200)293theta_circ = np.linspace(0, 2*np.pi, 100)294R, THETA = np.meshgrid(r, theta_circ)295296# Path difference varies with r^2 for off-axis rays297d_offset = 1e-6 # Small mirror offset298f = 0.1 # Focal length of observation lens299delta_2d = 4 * np.pi * (d_offset + R**2 / (8 * f**2)) / wavelength300301I_2d_mich = 0.5 * (1 + np.cos(delta_2d))302303X_circ = R * np.cos(THETA)304Y_circ = R * np.sin(THETA)305306im = axes[1, 1].pcolormesh(X_circ*1000, Y_circ*1000, I_2d_mich, cmap='gray', shading='auto')307axes[1, 1].set_xlabel('$x$ (mm)')308axes[1, 1].set_ylabel('$y$ (mm)')309axes[1, 1].set_title('Circular Michelson Fringes')310axes[1, 1].set_aspect('equal')311312plt.tight_layout()313save_plot('michelson.pdf', 'Michelson interferometer: single wavelength, coherence effects, and circular fringes.')314\end{pycode}315316\section{Fabry-P\'erot Interferometer}317\begin{pycode}318# Fabry-Perot interferometer319def fabry_perot_transmission(wavelength_range, d, n, R, theta=0):320"""Transmission of Fabry-Perot cavity."""321delta = 4 * np.pi * n * d * np.cos(theta) / wavelength_range322F = 4 * R / (1 - R)**2 # Finesse coefficient323T = 1 / (1 + F * np.sin(delta/2)**2)324return T325326# Cavity parameters327d_fp = 10e-3 # Cavity spacing (m)328n_fp = 1.0 # Refractive index (air)329330# Reflectivities331reflectivities = [0.7, 0.9, 0.99]332colors_R = ['blue', 'green', 'red']333334# Wavelength range around 632.8 nm335wavelength_range = np.linspace(632.7e-9, 632.9e-9, 2000)336337fig, axes = plt.subplots(2, 2, figsize=(10, 8))338339# Plot 1: Transmission for different reflectivities340for R, color in zip(reflectivities, colors_R):341T = fabry_perot_transmission(wavelength_range, d_fp, n_fp, R)342axes[0, 0].plot(wavelength_range*1e9, T, color=color, linewidth=1.5, label=f'$R = {R:.2f}$')343344axes[0, 0].set_xlabel('Wavelength (nm)')345axes[0, 0].set_ylabel('Transmission')346axes[0, 0].set_title('Fabry-P\\'erot Transmission')347axes[0, 0].legend()348axes[0, 0].grid(True, alpha=0.3)349350# Plot 2: Finesse and free spectral range351R_range = np.linspace(0.5, 0.999, 100)352finesse = np.pi * np.sqrt(R_range) / (1 - R_range)353354ax2 = axes[0, 1]355ax2.semilogy(R_range * 100, finesse, 'b-', linewidth=2)356ax2.set_xlabel('Reflectivity (\\%)')357ax2.set_ylabel('Finesse $\\mathcal{F}$', color='b')358ax2.tick_params(axis='y', labelcolor='b')359ax2.grid(True, alpha=0.3)360ax2.set_title('Cavity Finesse')361362# Plot 3: Ring pattern363r_ring = np.linspace(0, 15e-3, 200)364theta_ring = np.linspace(0, 2*np.pi, 100)365R_mesh, THETA_mesh = np.meshgrid(r_ring, theta_ring)366367f_lens = 0.1 # Focal length368theta_fp = R_mesh / f_lens # Angle at cavity369370R_val = 0.9371T_2d = fabry_perot_transmission(wavelength, d_fp, n_fp, R_val, theta_fp)372373X_fp = R_mesh * np.cos(THETA_mesh)374Y_fp = R_mesh * np.sin(THETA_mesh)375376im3 = axes[1, 0].pcolormesh(X_fp*1000, Y_fp*1000, T_2d, cmap='hot', shading='auto')377axes[1, 0].set_xlabel('$x$ (mm)')378axes[1, 0].set_ylabel('$y$ (mm)')379axes[1, 0].set_title(f'Fabry-P\\'erot Ring Pattern ($R = {R_val}$)')380axes[1, 0].set_aspect('equal')381382# Plot 4: Resolution of two wavelengths383lambda_fp1 = 632.80e-9384lambda_fp2 = 632.82e-9 # Very close wavelengths385wavelength_detail = np.linspace(632.78e-9, 632.84e-9, 1000)386387R_high = 0.98388T1 = fabry_perot_transmission(wavelength_detail, d_fp, n_fp, R_high)389T2_1 = fabry_perot_transmission(wavelength_detail, d_fp * (lambda_fp2/lambda_fp1), n_fp, R_high)390391axes[1, 1].plot(wavelength_detail*1e9, T1, 'b-', linewidth=1.5, label='$\\lambda_1$')392axes[1, 1].plot(wavelength_detail*1e9, T2_1, 'r--', linewidth=1.5, label='$\\lambda_2$')393axes[1, 1].set_xlabel('Wavelength (nm)')394axes[1, 1].set_ylabel('Transmission')395axes[1, 1].set_title('High-Resolution Spectroscopy')396axes[1, 1].legend()397axes[1, 1].grid(True, alpha=0.3)398399plt.tight_layout()400save_plot('fabry_perot.pdf', "Fabry-P\\'erot interferometer: transmission peaks, finesse, ring pattern, and resolution.")401402# Calculate FSR and resolving power403FSR = wavelength**2 / (2 * n_fp * d_fp) # Free spectral range404finesse_high = np.pi * np.sqrt(0.98) / (1 - 0.98)405resolving_power = finesse_high * 2 * d_fp / wavelength406\end{pycode}407408\section{Newton's Rings and Thin Film Interference}409\begin{pycode}410# Newton's rings (air wedge between lens and flat)411R_lens = 1.0 # Radius of curvature of lens (m)412n_air = 1.0413414# Radius of mth dark ring: r_m = sqrt(m * lambda * R)415m_values = np.arange(0, 20)416r_dark = np.sqrt(m_values * wavelength * R_lens)417r_bright = np.sqrt((m_values + 0.5) * wavelength * R_lens)418419fig, axes = plt.subplots(2, 2, figsize=(10, 8))420421# Plot 1: Dark ring radii422axes[0, 0].plot(m_values, r_dark*1000, 'bo-', linewidth=1.5, markersize=4, label='Dark rings')423axes[0, 0].plot(m_values, r_bright*1000, 'rs-', linewidth=1.5, markersize=4, label='Bright rings')424axes[0, 0].set_xlabel('Ring number $m$')425axes[0, 0].set_ylabel('Radius (mm)')426axes[0, 0].set_title("Newton's Rings Radii")427axes[0, 0].legend()428axes[0, 0].grid(True, alpha=0.3)429430# Plot 2: 2D Newton's ring pattern431r_newton = np.linspace(0, 5e-3, 300)432theta_newton = np.linspace(0, 2*np.pi, 100)433R_n, THETA_n = np.meshgrid(r_newton, theta_newton)434435# Air gap thickness436t_gap = R_n**2 / (2 * R_lens)437438# Phase difference (reflection from bottom adds pi)439delta_newton = 4 * np.pi * n_air * t_gap / wavelength + np.pi440I_newton = np.cos(delta_newton/2)**2441442X_n = R_n * np.cos(THETA_n)443Y_n = R_n * np.sin(THETA_n)444445im4 = axes[0, 1].pcolormesh(X_n*1000, Y_n*1000, I_newton, cmap='gray', shading='auto')446axes[0, 1].set_xlabel('$x$ (mm)')447axes[0, 1].set_ylabel('$y$ (mm)')448axes[0, 1].set_title("Newton's Rings Pattern")449axes[0, 1].set_aspect('equal')450451# Plot 3: Visibility vs number of rings452# Visibility decreases due to finite source size453source_size = 1e-3 # mm454m_vis = np.arange(1, 51)455# Simplified visibility model456visibility = np.exp(-m_vis * (source_size / (R_lens * 1000))**2)457458axes[1, 0].plot(m_vis, visibility, 'g-', linewidth=2)459axes[1, 0].set_xlabel('Ring number $m$')460axes[1, 0].set_ylabel('Visibility')461axes[1, 0].set_title('Fringe Visibility vs Ring Number')462axes[1, 0].grid(True, alpha=0.3)463464# Plot 4: Interferometric surface testing465# Simulated surface deviation from flat466x_surf = np.linspace(-10, 10, 200)467y_surf = np.linspace(-10, 10, 200)468X_s, Y_s = np.meshgrid(x_surf, y_surf)469470# Add some surface errors (astigmatism + defects)471surface_error = 0.1 * wavelength * (0.3 * X_s**2 - 0.2 * Y_s**2) / 100472surface_error += 0.05 * wavelength * np.exp(-((X_s-3)**2 + (Y_s+2)**2) / 4)473474delta_surf = 4 * np.pi * surface_error / wavelength475I_surf = np.cos(delta_surf/2)**2476477im5 = axes[1, 1].pcolormesh(X_s, Y_s, I_surf, cmap='gray', shading='auto')478axes[1, 1].set_xlabel('$x$ (mm)')479axes[1, 1].set_ylabel('$y$ (mm)')480axes[1, 1].set_title('Surface Testing Interferogram')481axes[1, 1].set_aspect('equal')482483plt.tight_layout()484save_plot('newton_rings.pdf', "Newton's rings and interferometric surface testing.")485\end{pycode}486487\section{Coherence and Visibility}488\begin{pycode}489# Temporal and spatial coherence analysis490c = 3e8 # Speed of light491492# Temporal coherence493def temporal_coherence_function(tau, tau_c):494"""Complex degree of temporal coherence."""495return np.exp(-np.abs(tau) / tau_c)496497# Spatial coherence (Van Cittert-Zernike)498def spatial_coherence_function(d, wavelength, theta_s):499"""Complex degree of spatial coherence for circular source."""500from scipy.special import j1501x = np.pi * d * theta_s / wavelength502return np.where(x == 0, 1, 2 * j1(x) / x)503504fig, axes = plt.subplots(2, 2, figsize=(10, 8))505506# Plot 1: Temporal coherence507tau = np.linspace(-10e-15, 10e-15, 200)508coherence_times = [1e-15, 3e-15, 10e-15]509colors_tc = ['blue', 'green', 'red']510511for tau_c, color in zip(coherence_times, colors_tc):512gamma_t = temporal_coherence_function(tau, tau_c)513axes[0, 0].plot(tau*1e15, gamma_t, color=color, linewidth=2,514label=f'$\\tau_c = {tau_c*1e15:.0f}$ fs')515516axes[0, 0].set_xlabel('Time delay $\\tau$ (fs)')517axes[0, 0].set_ylabel('$|\\gamma(\\tau)|$')518axes[0, 0].set_title('Temporal Coherence Function')519axes[0, 0].legend()520axes[0, 0].grid(True, alpha=0.3)521522# Plot 2: Coherence length vs linewidth523linewidths = np.logspace(-3, 1, 100) # nm524coherence_lengths = wavelength**2 / (linewidths * 1e-9) / 1e-6 # um525526axes[0, 1].loglog(linewidths, coherence_lengths, 'b-', linewidth=2)527axes[0, 1].set_xlabel('Spectral linewidth (nm)')528axes[0, 1].set_ylabel('Coherence length ($\\mu$m)')529axes[0, 1].set_title('Coherence Length vs Linewidth')530axes[0, 1].grid(True, alpha=0.3, which='both')531532# Plot 3: Spatial coherence533d_sep = np.linspace(0, 10e-3, 200)534source_angles = [0.001, 0.005, 0.01] # rad535colors_sc = ['blue', 'green', 'red']536537from scipy.special import j1538539for theta_s, color in zip(source_angles, colors_sc):540gamma_s = np.abs(spatial_coherence_function(d_sep, wavelength, theta_s))541axes[1, 0].plot(d_sep*1000, gamma_s, color=color, linewidth=2,542label=f'$\\theta_s = {theta_s*1000:.0f}$ mrad')543544axes[1, 0].set_xlabel('Slit separation (mm)')545axes[1, 0].set_ylabel('$|\\gamma_{12}|$')546axes[1, 0].set_title('Spatial Coherence (Van Cittert-Zernike)')547axes[1, 0].legend()548axes[1, 0].grid(True, alpha=0.3)549550# Plot 4: Fringe visibility vs path difference551path_diff = np.linspace(0, 100e-6, 200)552L_c = 30e-6 # Coherence length553554# Visibility = |gamma| for equal intensity beams555visibility_plot = np.exp(-path_diff / L_c)556557# Also show fringes with decreasing visibility558I_fringes = 0.5 * (1 + visibility_plot * np.cos(2 * np.pi * path_diff / wavelength))559560axes[1, 1].plot(path_diff*1e6, visibility_plot, 'b-', linewidth=2, label='Visibility envelope')561axes[1, 1].plot(path_diff*1e6, I_fringes, 'gray', linewidth=0.5, alpha=0.5)562axes[1, 1].axvline(x=L_c*1e6, color='red', linestyle='--', alpha=0.7, label=f'$L_c = {L_c*1e6:.0f}$ $\\mu$m')563axes[1, 1].set_xlabel('Path difference ($\\mu$m)')564axes[1, 1].set_ylabel('Visibility / Intensity')565axes[1, 1].set_title('Fringe Visibility vs Path Difference')566axes[1, 1].legend()567axes[1, 1].grid(True, alpha=0.3)568569plt.tight_layout()570save_plot('coherence.pdf', 'Temporal and spatial coherence analysis and fringe visibility.')571\end{pycode}572573\section{Results Summary}574\begin{pycode}575# Generate results table576print(r'\begin{table}[htbp]')577print(r'\centering')578print(r'\caption{Summary of Interference Parameters}')579print(r'\begin{tabular}{lll}')580print(r'\toprule')581print(r'Parameter & Symbol & Value \\')582print(r'\midrule')583print(r'\multicolumn{3}{c}{\textit{Double-Slit}} \\')584print(f'Wavelength & $\\lambda$ & {wavelength*1e9:.1f} nm \\\\')585print(f'Slit separation & $d$ & {d*1e3:.1f} mm \\\\')586print(f'Slit width & $a$ & {a*1e6:.0f} $\\mu$m \\\\')587print(f'Fringe spacing & $\\Delta x$ & {fringe_spacing:.3f} mm \\\\')588print(f'Fringes in central max & $N$ & {n_fringes} \\\\')589print(r'\midrule')590print(r'\multicolumn{3}{c}{\textit{Fabry-P\\'erot}} \\')591print(f'Cavity spacing & $d$ & {d_fp*1000:.0f} mm \\\\')592print(f'Free spectral range & FSR & {FSR*1e12:.2f} pm \\\\')593print(f'Finesse ($R = 0.98$) & $\\mathcal{{F}}$ & {finesse_high:.0f} \\\\')594print(f'Resolving power & $R_p$ & {resolving_power/1e6:.1f} $\\times 10^6$ \\\\')595print(r'\bottomrule')596print(r'\end{tabular}')597print(r'\end{table}')598\end{pycode}599600\section{Statistical Summary}601\begin{itemize}602\item \textbf{Wavelength}: $\lambda = $ \py{f"{wavelength*1e9:.1f}"} nm603\item \textbf{Slit separation}: $d = $ \py{f"{d*1e3:.1f}"} mm604\item \textbf{Slit width}: $a = $ \py{f"{a*1e6:.0f}"} $\mu$m605\item \textbf{Screen distance}: $L = $ \py{f"{L:.1f}"} m606\item \textbf{Fringe spacing}: \py{f"{fringe_spacing:.3f}"} mm607\item \textbf{Fringes in central maximum}: $\approx$ \py{f"{n_fringes}"}608\item \textbf{Fabry-P\'erot FSR}: \py{f"{FSR*1e12:.2f}"} pm609\item \textbf{Fabry-P\'erot finesse} ($R = 0.98$): \py{f"{finesse_high:.0f}"}610\item \textbf{Resolving power}: \py{f"{resolving_power/1e6:.1f}"} $\times 10^6$611\end{itemize}612613\section{Conclusion}614Interference patterns provide crucial evidence for the wave nature of light and enable high-precision measurements. The double-slit pattern shows interference fringes modulated by a single-slit diffraction envelope. Multiple-slit gratings provide enhanced resolution proportional to the number of slits. Michelson interferometry enables nanometer-scale displacement measurements with applications in gravitational wave detection. Fabry-P\'erot cavities achieve ultra-high spectral resolution with finesse values exceeding 1000, critical for laser spectroscopy and optical communications. Understanding coherence is essential for predicting fringe visibility and designing interferometric systems.615616\end{document}617618619