Skip to main content

ComplexAnalysis

Struct ComplexAnalysis 

Source
pub struct ComplexAnalysis;
Expand description

Complex analysis operations.

Implementations§

Source§

impl ComplexAnalysis

Source

pub fn residue_simple_pole( f: &dyn Fn(Complex) -> Complex, z0: Complex, h: f64, ) -> Complex

Compute residue of f(z) at z0 using Laurent series approximation. For simple pole: lim_{z->z0} (z - z0) * f(z)

Source

pub fn residue_pole_order_n( f: &dyn Fn(Complex) -> Complex, z0: Complex, order: usize, h: f64, ) -> Complex

Compute residue using derivative formula for higher order poles. For pole of order n: (1/(n-1)!) * lim_{z->z0} d^{n-1}/dz^{n-1} [(z-z0)^n * f(z)]

Source

pub fn derivative(f: &dyn Fn(Complex) -> Complex, z: Complex, h: f64) -> Complex

Numerical derivative of complex function (central difference on the real axis).

Source

pub fn derivative_complex_step( f: &dyn Fn(Complex) -> Complex, z: Complex, h: f64, ) -> Complex

Complex derivative via the complex-step method.

For analytic f, f'(z) = (f(z + ih) − f(z − ih)) / (2ih) with error O(h²). Stepping along the imaginary axis exercises the derivative in the complex plane (not just along the real axis) and avoids the cancellation that limits real finite differences.

Source

pub fn derivative_cauchy( f: &dyn Fn(Complex) -> Complex, z: Complex, radius: f64, n: usize, ) -> Complex

Full complex derivative via the Cauchy integral formula: f'(z) = (1/(2πi)) ∮ f(w)/(w − z)² dw around a circle of radius sampled at n points. Robust for analytic f (no finite-difference step-size tuning needed).

Source

pub fn nth_derivative( f: &dyn Fn(Complex) -> Complex, z: Complex, n: usize, h: f64, ) -> Complex

Nth derivative of complex function.

Source

pub fn contour_integral_circle( f: &dyn Fn(Complex) -> Complex, z0: Complex, radius: f64, n: usize, ) -> Complex

Contour integral using trapezoidal rule on a circle. ∮_C f(z) dz where C is circle centered at z0 with radius r.

Source

pub fn cauchy_integral_formula( f: &dyn Fn(Complex) -> Complex, z0: Complex, radius: f64, n: usize, ) -> Complex

Cauchy integral formula: f(z0) = (1/(2πi)) ∮_C f(z)/(z-z0) dz

Source

pub fn cauchy_derivative_formula( f: &dyn Fn(Complex) -> Complex, z0: Complex, n: usize, radius: f64, contour_n: usize, ) -> Complex

Cauchy’s derivative formula: f^(n)(z0) = (n!/(2πi)) ∮_C f(z)/(z-z0)^(n+1) dz

Source

pub fn is_analytic(f: &dyn Fn(Complex) -> Complex, z: Complex, h: f64) -> bool

Check if function is analytic at point (using Cauchy-Riemann equations).

Source

pub fn laurent_series_coefficients( f: &dyn Fn(Complex) -> Complex, z0: Complex, max_positive: usize, max_negative: usize, radius: f64, n_points: usize, ) -> (Vec<Complex>, Vec<Complex>)

Compute Laurent series coefficients around z0. Returns (a_n for n >= 0, a_n for n < 0)

Source

pub fn mobius_transform( z: Complex, a: Complex, b: Complex, c: Complex, d: Complex, ) -> Complex

Conformal mapping: Möbius transformation. f(z) = (az + b) / (cz + d)

Source

pub fn mobius_inverse( w: Complex, a: Complex, b: Complex, c: Complex, d: Complex, ) -> Complex

Inverse Möbius transformation.

Source

pub fn schwarz_christoffel( z: Complex, vertices: &[Complex], angles: &[f64], pre_factor: Complex, ) -> Complex

Schwarz-Christoffel mapping (simplified for polygon). Maps upper half-plane to polygon interior.

Source

pub fn argument_principle( f: &dyn Fn(Complex) -> Complex, z0: Complex, radius: f64, n: usize, ) -> f64

Argument principle: (1/(2πi)) ∮ f’(z)/f(z) dz = Z - P where Z is number of zeros and P is number of poles inside contour.

Source

pub fn rouches_theorem( f: &dyn Fn(Complex) -> Complex, g: &dyn Fn(Complex) -> Complex, z0: Complex, radius: f64, n: usize, ) -> bool

Rouché’s theorem test: if |f(z)| > |g(z)| for every z on contour C, then f and f+g have same number of zeros inside C.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.