pub struct DoniachSunjic;Expand description
Doniach–Šunjić asymmetric lineshape (XPS core-level peaks).
A · cos[πγ/2 + (1−γ)·atan((x−c)/σ)] / (1 + ((x−c)/σ)²)^((1−γ)/2)
Parameters (in order): [amplitude, center, sigma, gamma]
gammais the asymmetry index (0⇒ symmetric Lorentzian-like; larger ⇒ stronger high-binding-energy tail).amplitudescales the curve.
The area-normalising 1/σ^(1−γ) prefactor of the textbook form is folded into
amplitude so the parameter set matches the other height-amplitude kernels;
the numpy benchmark formula is identical, so numpy↔Rust parity is exact.
Trait Implementations§
Source§impl Model for DoniachSunjic
impl Model for DoniachSunjic
Source§fn jacobian(&self, x: &[f64], params: &[f64]) -> Vec<f64>
fn jacobian(&self, x: &[f64], params: &[f64]) -> Vec<f64>
Analytical Jacobian of the Doniach–Šunjić lineshape.
Let u = (x−c)/σ, φ = πγ/2 + (1−γ)·atan(u),
D = (1+u²)^((1−γ)/2), so f = A·cos(φ)/D.
∂f/∂A = cos(φ)/D
Shared factor for center/sigma (via ∂f/∂u): ∂f/∂u = A·(1−γ)·[−sin(φ)−cos(φ)·u] / ((1+u²)·D)
∂u/∂c = −1/σ ⟹ ∂f/∂c = ∂f/∂u · (−1/σ) ∂u/∂σ = −u/σ ⟹ ∂f/∂σ = ∂f/∂u · (−u/σ)
For gamma: ∂φ/∂γ = π/2 − atan(u), ∂D/∂γ = −½·ln(1+u²)·D
∂f/∂γ = A·[−sin(φ)·(π/2−atan(u)) + ½·cos(φ)·ln(1+u²)] / D
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