Physics Theory ============== This section describes the physical principles and equations implemented in L-SURF. Electromagnetic Wave Propagation --------------------------------- Light as Rays ~~~~~~~~~~~~~ L-SURF uses geometric optics (ray tracing) which is valid when: .. math:: \lambda \ll L where :math:`\lambda` is the wavelength and :math:`L` is the characteristic size of obstacles. For visible light (400-700 nm) interacting with surfaces at meter scales, this is well satisfied. Refractive Index ~~~~~~~~~~~~~~~~ The refractive index :math:`n` relates the speed of light in a medium to the vacuum speed: .. math:: n(\lambda, \vec{r}) = \frac{c}{v(\lambda, \vec{r})} where: - :math:`c` = speed of light in vacuum (2.998 × 10⁸ m/s) - :math:`v` = phase velocity in the medium - :math:`\lambda` = wavelength - :math:`\vec{r}` = position (for spatially-varying media) Dispersion Models ^^^^^^^^^^^^^^^^^ **Sellmeier Formula** (for optical glasses): .. math:: n^2(\lambda) = 1 + \sum_{i=1}^{3} \frac{B_i \lambda^2}{\lambda^2 - C_i} where :math:`B_i` and :math:`C_i` are material-specific coefficients. **Cauchy Formula** (empirical approximation): .. math:: n(\lambda) = A + \frac{B}{\lambda^2} + \frac{C}{\lambda^4} Fresnel Equations ----------------- At an interface between two media, light splits into reflected and transmitted components. The amplitudes are governed by the Fresnel equations. Geometry ~~~~~~~~ .. code-block:: text ↓ incident (θᵢ) ↑ reflected (θᵣ) \ / \ / \ / \ n₁ / ═════════════════════════════════ interface n₂ | | transmitted (θₜ) ↓ - :math:`\theta_i` = incident angle (from normal) - :math:`\theta_r` = reflected angle (from normal) - :math:`\theta_t` = transmitted (refracted) angle - :math:`n_1` = refractive index of first medium - :math:`n_2` = refractive index of second medium Snell's Law ~~~~~~~~~~~ The refraction angle is determined by Snell's law: .. math:: n_1 \sin\theta_i = n_2 \sin\theta_t Total Internal Reflection ^^^^^^^^^^^^^^^^^^^^^^^^^ When :math:`n_1 > n_2` and :math:`\sin\theta_i > n_2/n_1`, total internal reflection occurs and no light is transmitted. Fresnel Reflection Coefficients ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Fresnel equations give the amplitude reflection coefficients for s and p polarizations: **S-polarization** (perpendicular to plane of incidence): .. math:: r_s = \frac{n_1 \cos\theta_i - n_2 \cos\theta_t}{n_1 \cos\theta_i + n_2 \cos\theta_t} **P-polarization** (parallel to plane of incidence): .. math:: r_p = \frac{n_2 \cos\theta_i - n_1 \cos\theta_t}{n_2 \cos\theta_i + n_1 \cos\theta_t} Reflectance (intensity ratios): .. math:: R_s = |r_s|^2, \quad R_p = |r_p|^2 Fresnel Transmission Coefficients ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. math:: t_s = \frac{2 n_1 \cos\theta_i}{n_1 \cos\theta_i + n_2 \cos\theta_t} t_p = \frac{2 n_1 \cos\theta_i}{n_2 \cos\theta_i + n_1 \cos\theta_t} Transmittance (accounting for energy flux): .. math:: T_s = \frac{n_2 \cos\theta_t}{n_1 \cos\theta_i} |t_s|^2 T_p = \frac{n_2 \cos\theta_t}{n_1 \cos\theta_i} |t_p|^2 Energy Conservation ^^^^^^^^^^^^^^^^^^^ .. math:: R_s + T_s = 1, \quad R_p + T_p = 1 Unpolarized Light ~~~~~~~~~~~~~~~~~ For unpolarized or randomly polarized light: .. math:: R = \frac{R_s + R_p}{2}, \quad T = \frac{T_s + T_p}{2} Brewster's Angle ~~~~~~~~~~~~~~~~ At Brewster's angle, p-polarized light has zero reflection: .. math:: \theta_B = \arctan\left(\frac{n_2}{n_1}\right) For air-water interface: :math:`\theta_B \approx 53.1°` Polarization Tracking --------------------- L-SURF supports polarization tracking for more accurate simulations. Polarization State ~~~~~~~~~~~~~~~~~~ A ray's polarization is described by: 1. **S-component intensity**: :math:`I_s` 2. **P-component intensity**: :math:`I_p` 3. **Total intensity**: :math:`I = I_s + I_p` At each interface, components are multiplied by Fresnel coefficients: .. math:: I_s^{\text{refl}} = R_s \cdot I_s^{\text{inc}} I_p^{\text{refl}} = R_p \cdot I_p^{\text{inc}} I_s^{\text{trans}} = T_s \cdot I_s^{\text{inc}} I_p^{\text{trans}} = T_p \cdot I_p^{\text{inc}} Multiple Scattering ------------------- Ray Splitting ~~~~~~~~~~~~~ At each surface interaction, L-SURF can: 1. **Single mode**: Generate only reflected OR refracted ray 2. **Splitting mode**: Generate both reflected AND refracted rays Splitting mode accurately tracks energy flow through multiple bounces. Intensity Tracking ~~~~~~~~~~~~~~~~~~ Ray intensity is tracked through propagation: .. math:: I_{\text{final}} = I_0 \prod_{i=1}^{N} R_i \cdot e^{-\alpha_i d_i} where: - :math:`I_0` = initial intensity - :math:`R_i` = reflectance at bounce :math:`i` - :math:`\alpha_i` = absorption coefficient in medium :math:`i` - :math:`d_i` = distance traveled in medium :math:`i` - :math:`N` = number of bounces Termination Criteria ~~~~~~~~~~~~~~~~~~~~ Rays are terminated when: 1. Intensity drops below threshold (typically 10⁻⁶ of initial) 2. Maximum bounce count reached 3. Ray exits simulation domain 4. Ray trapped in total internal reflection cycle Time-of-Flight -------------- Ray Timing ~~~~~~~~~~ Each ray tracks its accumulated time-of-flight: .. math:: t = t_0 + \sum_{i=1}^{N} \frac{d_i}{v_i} = t_0 + \sum_{i=1}^{N} \frac{n_i d_i}{c} where: - :math:`t_0` = initial time (emission time) - :math:`d_i` = path length in segment :math:`i` - :math:`v_i = c/n_i` = phase velocity in segment :math:`i` - :math:`c` = speed of light in vacuum Temporal Coherence ~~~~~~~~~~~~~~~~~~ For pulsed sources, the initial time :math:`t_0` can vary across the beam to model: - Pulse duration - Wavefront curvature - Beam divergence effects Detection Time ~~~~~~~~~~~~~~ At a detector, the time-of-arrival is: .. math:: t_{\text{detect}} = t_{\text{emit}} + \sum \frac{n_i d_i}{c} This enables: - Time-resolved detection - Pulse spreading analysis - Group velocity dispersion studies Wave Surface Interaction ------------------------- Normal Vector Calculation ~~~~~~~~~~~~~~~~~~~~~~~~~ For curved surfaces (e.g., Gerstner waves), the local normal is computed from the surface gradient: .. math:: \vec{n} = \frac{\nabla f}{\|\nabla f\|} where :math:`f(\vec{r}) = 0` defines the surface. For Gerstner waves: .. math:: z = \sum_{i=1}^{N} A_i \sin(k_i x - \omega_i t + \phi_i) The normal vector includes contributions from all wave components: .. math:: \frac{\partial z}{\partial x} = \sum_{i} A_i k_i \cos(k_i x - \omega_i t + \phi_i) \vec{n} = \frac{(-\partial z/\partial x, 0, 1)}{\sqrt{1 + (\partial z/\partial x)^2}} Shadowing and Blocking ~~~~~~~~~~~~~~~~~~~~~~ For rough surfaces, geometric shadowing/blocking occurs when: 1. **Shadowing**: Incident ray blocked by surface feature 2. **Blocking**: Reflected/refracted ray blocked by surface L-SURF handles this through accurate ray-surface intersection testing. Implementation References ------------------------- The implementation follows standard texts: 1. **Born & Wolf** - *Principles of Optics* (7th ed.) - Fresnel equations 2. **Hecht** - *Optics* (5th ed.) - Electromagnetic wave theory 3. **Ishimaru** - *Wave Propagation and Scattering in Random Media* - Rough surface scattering 4. **Tessendorf** - *Simulating Ocean Water* (2001) - Gerstner waves