Skip to main content

Module passivity_conservation

Module passivity_conservation 

Source
Expand description

Passivity, energy conservation, and C02-C09 numerical budget verifiers.

Implements independent first-principles f64 evaluators for:

  • C02-C09 f64 small closed-form budget: $|y - y_{\text{ref}}| \le 64 \cdot 2^{-52} Q$.
  • C02-C09 $N$-term reduction / DFT budget: $16,\gamma_N \sum_{i=1}^N |t_i|$ with $\gamma_N = \frac{N u}{1 - N u}, u = 2^{-53}$.
  • C02-C09 QAC B32 scalar budget: $|y - y_{\text{ref}}| \le 8,u_{32} S + 2\times 10^{-6} |y_{\text{ref}}|, u_{32} = 2^{-24}$, and vector relative $L_2 \le 5\times 10^{-6}$.
  • Electromagnetic Mode 0 (Poynting flux, energy density, static wavelength guard) and Mode 2 (3D Cartesian Yee CFL bound and exact discrete dispersion relation).
  • Acoustic Mode 00 (fluid intensity/energy), Mode 01 (6-component Cauchy elasticity), and Mode 03 (impedance reflection/transmission energy conservation $R + T = 1$).
  • Multi-port scattering matrix passivity ($|\mathbf{S}|_2 \le 1$) and grid-refinement observed convergence order $p = \frac{\ln(E_1/E_2)}{\ln(h_1/h_2)} \ge 1.8$.

Structs§

BudgetEvaluation
Detailed audit record for a numerical budget comparison.
EmMode0OracleResult
Instantaneous electromagnetic Mode 0 oracle output (vacuum or isotropic lossless medium).
QacElasticMode01OracleResult
Independent QAC Mode 01 isotropic elastic solid oracle result.
QacFluidMode00OracleResult
Independent QAC Mode 00 fluid acoustic oracle result.

Enums§

ConservationValidationError
Errors emitted by passivity, conservation, and numerical budget verifiers.

Constants§

C02_AMPLITUDE_SCALES_B32
Standard C02 QAC B32 amplitude scaling factors.
C02_AMPLITUDE_SCALES_F64
Standard C02 amplitude scaling factors for linear-domain invariance checks.
F32_UNIT_ROUNDOFF
IEEE-754 f32 unit roundoff $u_{32} = 2^{-24}$ (0.5 * f32::EPSILON as f64).
F64_EPSILON
IEEE-754 f64 machine epsilon $\varepsilon = 2^{-52}$.
F64_UNIT_ROUNDOFF
IEEE-754 f64 unit roundoff $u = 2^{-53}$ (0.5 * f64::EPSILON).
VACUUM_IMPEDANCE_OHM
Characteristic impedance of vacuum $Z_0 = \mu_0 c_0$ ($\Omega$).
VACUUM_PERMEABILITY_H_PER_M
Exact SI magnetic constant (vacuum permeability) $\mu_0 = 4\pi \times 10^{-7}\text{ H/m}$ consistent with $c_0 = 299,792,458\text{ m/s}$ and $Z_0 = \mu_0 c_0$.
VACUUM_PERMITTIVITY_F_PER_M
Vacuum electric permittivity $\varepsilon_0 = \frac{1}{\mu_0 c_0^2}$ ($\text{F/m}$).

Functions§

evaluate_acoustic_interface_oracle
Evaluate QAC Mode 03 normal-incidence planar acoustic interface coefficients: $r = \frac{Z_2 - Z_1}{Z_2 + Z_1}$, $t = \frac{2 Z_2}{Z_2 + Z_1}$, energy reflectance $R = r^2$, energy transmittance $T = \frac{Z_1}{Z_2} t^2$, verifying energy conservation $R + T = 1$.
evaluate_em_mode0_instantaneous_oracle
Evaluate the independent C02 Mode 0 instantaneous $\mathbf{E}/\mathbf{B}$ oracle in an isotropic medium ($\varepsilon_r > 0, \mu_r > 0$).
evaluate_em_wavelength_m
Evaluate phase wavelength $\lambda = \frac{c_0}{f \sqrt{\varepsilon_r \mu_r}}$, strictly rejecting static/aperiodic fields ($f \le 0$) per C02-C02 and Mode 0.
evaluate_qac_elastic_mode01_oracle
Evaluate QAC Mode 01 small-strain isotropic elasticity oracle (C02 Mode 01): $\lambda = K - \frac{2}{3}\mu$, $c_P = \sqrt{\frac{\lambda + 2\mu}{\rho}}$, $c_S = \sqrt{\frac{\mu}{\rho}}$, $\boldsymbol{\sigma} = \lambda\operatorname{tr}(\boldsymbol{\varepsilon})\mathbf{I} + 2\mu\boldsymbol{\varepsilon}$, $p = -\frac{1}{3}\operatorname{tr}(\boldsymbol{\sigma})$.
evaluate_qac_fluid_mode00_oracle
Evaluate QAC Mode 00 fluid acoustic perturbation oracle (C02 Mode 00): $c = \sqrt{K/\rho}$, $Z = \sqrt{\rho K}$, $\mathbf{I} = p\mathbf{v}$, $e = \frac{1}{2}\rho|\mathbf{v}|^2 + \frac{p^2}{2K}$. Rejects non-collocated $p$ and $\mathbf{v}$ when collocated is false.
gamma_n_f64
Compute Higham’s rounding constant $\gamma_N = \frac{N u}{1 - N u}$ with $u = 2^{-53}$.
verify_acoustic_energy_conservation
Verify Acoustic energy flux conservation and passivity: $\nabla\cdot\mathbf{I} + \frac{\partial e}{\partial t} = -w_{\text{loss}}$ with $w_{\text{loss}} \ge 0$.
verify_b32_scalar_budget
Evaluate the C02-C09 QAC B32 scalar budget: $|y - y_{\text{ref}}| \le 8,u_{32} S + 2\times 10^{-6} |y_{\text{ref}}|, \quad u_{32} = 2^{-24}$.
verify_b32_vector_budget
Evaluate the C02-C09 QAC B32 vector budget: per-component B32 scalar check plus relative $L_2 \le 5\times 10^{-6}$ when $|\mathbf{y}_{\text{ref}}|_2 > 0$.
verify_f64_closed_form_budget
Evaluate the C02-C09 small closed-form f64 budget: $|y - y_{\text{ref}}| \le 64 \cdot 2^{-52} Q$.
verify_grid_convergence_order
Verify observed grid-refinement convergence order $p = \frac{\ln(E_1 / E_2)}{\ln(h_1 / h_2)} \ge p_{\min}$ across successive grid spacings $h_1 > h_2$ with positive errors $E_1 > E_2 > 0$.
verify_n_term_reduction_budget
Evaluate the C02-C09 $N$-term reduction / DFT budget: $|y - y_{\text{ref}}| \le 16,\gamma_N \sum_{i=1}^N |t_i|$.
verify_poynting_conservation_balance
Verify Poynting energy conservation and passivity balance: $\nabla\cdot\mathbf{S} + \frac{\partial u}{\partial t} = -w_{\text{loss}}$ with $w_{\text{loss}} = \sigma |\mathbf{E}|^2 \ge 0$.
verify_scattering_matrix_passivity
Verify passivity of a multi-port complex scattering matrix $\mathbf{S}$ (up to $4\times 4$): $|\mathbf{S}|2 \le 1 + 64,\varepsilon \iff \lambda{\max}(\mathbf{S}^\dagger\mathbf{S}) \le (1 + 64,\varepsilon)^2$.
verify_yee_cfl_and_dispersion
Verify Cartesian 3D Yee CFL stability (C02 Mode 2): $\Delta t \le \frac{1}{v \sqrt{\Delta x^{-2} + \Delta y^{-2} + \Delta z^{-2}}}$ with $v = \frac{c_0}{\sqrt{\varepsilon_r \mu_r}}$, and evaluate the exact discrete dispersion RHS $(v\Delta t)^2 \sum_{j=0}^2 \frac{\sin^2(k_j \Delta x_j / 2)}{\Delta x_j^2}$.