pub struct TrueVoigt;Expand description
True Voigt profile (Gaussian ⊗ Lorentzian) via the Faddeeva function.
A · Re[w(z)] / Re[w(z₀)], with z = ((x−c) + iγ)/(σ√2) and
z₀ = iγ/(σ√2), so amplitude is the peak height (A at x=c).
Parameters (in order): [amplitude, center, sigma, gamma]
sigmais the Gaussian standard deviation,gammathe Lorentzian HWHM.γ→0⇒ Gaussian;σ→0⇒ Lorentzian. Distinct from thevoigt/pseudo_voigtkey, which is the linear pseudo-Voigt approximation.
Trait Implementations§
Source§impl Model for TrueVoigt
impl Model for TrueVoigt
Source§fn jacobian(&self, x: &[f64], params: &[f64]) -> Vec<f64>
fn jacobian(&self, x: &[f64], params: &[f64]) -> Vec<f64>
Analytical Jacobian of the true Voigt profile.
Uses the Faddeeva derivative identity: dw(z)/dz = −2z·w(z) + 2i/√π,
which gives (treating z_r and z_i as independent real parameters):
∂Re[w]/∂z_r = Re[dw/dz] = −2(z_r·w_r − z_i·w_i)
∂Re[w]/∂z_i = −Im[dw/dz] = 2(z_r·w_i + z_i·w_r) − 2/√π
where (w_r, w_i) = faddeeva_complex(z_r, z_i).
For the profile f = A·w_r / peak0 (with peak0 = Re[w(0, z_i)]):
∂f/∂A = w_r / peak0
∂f/∂c = A / peak0 · dwr_dzr · (−inv) [∂z_r/∂c = −inv]
∂f/∂σ and ∂f/∂γ use the quotient rule because peak0 also changes.
§Accuracy note
The HAW approximation has ≈1e-6 accuracy; the Jacobian inherits that floor, so the self-consistency test uses tolerance 1e-5 (10× the default analytic budget). This is a justified relaxation, not a correctness gap.
Source§fn jacobian_into(&self, x: &[f64], params: &[f64], out: &mut [f64])
fn jacobian_into(&self, x: &[f64], params: &[f64], out: &mut [f64])
Source§fn eval_slice_into(&self, xs: &[f64], params: &[f64], out: &mut [f64])
fn eval_slice_into(&self, xs: &[f64], params: &[f64], out: &mut [f64])
out[i] = eval([xs[i]], params). Read more