solvers module

Define equation solvers.

For now, used only in acceptance computations.

solve_scalar_equation_brent(func, param_value, x_bounds, warning=True)[source]

Solve a scalar equation for multiple parameters using Brent’s method.

Parameters:
  • func (Callable[[float, float], float]) – Function f(x, param) whose root is to be found for each parameter.

  • param_value (float) – Single parameter value to use when solving the equation.

  • x_bounds (tuple[float, float]) – Interval (x_min, x_max) in which to search for the root. The bounds will be swapped if provided in reverse order.

  • warning (bool, default: True) – If True (default), warnings are issued for empty inputs, range inversion, or missing roots in the interval.

Returns:

Root found for the parameter value. NaN if no root is found.

Return type:

float