pooltool.ptmath.roots

Submodules

Overview

Function

solve_quartics(ps, solver)

Returns the smallest positive and real root for each quartic polynomial.

Functions

pooltool.ptmath.roots.solve_quartics(ps: numpy.typing.NDArray[numpy.float64], solver: QuarticSolver = QuarticSolver.HYBRID) numpy.typing.NDArray[numpy.float64][source]

Returns the smallest positive and real root for each quartic polynomial.

Parameters:
  • ps (numpy.typing.NDArray[numpy.float64]) -- A mx5 array of polynomial coefficients, where m is the number of equations. The columns are in the order a, b, c, d, e, where these coefficients make up the quartic polynomial equation at^4 + bt^3 + ct^2 + dt + e = 0.

  • solver (QuarticSolver) -- The method used to calculate the roots. See pooltool.ptmath.roots.quartic.QuarticSolver.

Returns:

An array of shape m. Each value is the smallest root that is real and positive. If no such root exists (e.g. all roots have complex), then np.inf is returned.

Return type:

roots