pastas.rfunc.Hantush.get_tmax_approximation#
- pastas.rfunc.Hantush.get_tmax_approximation(p: pastas.typing.ArrayLike, cutoff: float | None = None) float#
Approximates the time (tmax) when the step response reaches a specified cutoff.
This analytical approximation is derived by evaluating the tail of the impulse response integral. The derivation relies on the following steps: 1. The tail integral is mapped to dimensionless time x = t/a. 2. Deep in the tail, the b/t term in the exponent is assumed negligible,
reducing the integral to the standard Exponential Integral, E1(x).
E1(x) is approximated by its leading asymptotic term: exp(-x) / x.
Equating this to the remaining area (1 - cutoff) yields an equation of the form x * exp(x) = z, which is classically solved using the Lambert W function: x = W(z).
To prevent crashing the calculation when rho is large (causing k0 to underflow and z to overflow), the math is translated into log-space. The exponentially scaled Bessel function (k0e) and the Wright Omega function (the exact analytical solution to y + ln(y) = log_z) are used. This provides a globally continuous, unbreakable equivalent to lambertw(z).