bluemira.magnetostatics._ellipk =============================== .. py:module:: bluemira.magnetostatics._ellipk Attributes ---------- .. autoapisummary:: bluemira.magnetostatics._ellipk._FloatOrArray bluemira.magnetostatics._ellipk._P bluemira.magnetostatics._ellipk._Q bluemira.magnetostatics._ellipk._C1 bluemira.magnetostatics._ellipk._MACHEP Functions --------- .. autoapisummary:: bluemira.magnetostatics._ellipk.eval_polynomial bluemira.magnetostatics._ellipk._ellipk bluemira.magnetostatics._ellipk.ellipk_nb Module Contents --------------- .. py:data:: _FloatOrArray .. py:data:: _P :value: (0.00013798286460627325, 0.002280257240058756, 0.007974040132204152, 0.00985821379021226,... .. py:data:: _Q :value: (2.940789550485985e-05, 0.0009141847238659173, 0.005940583037531678, 0.01548505166497624,... .. py:data:: _C1 :value: 1.3862943611198906 .. py:data:: _MACHEP :value: 1.1102230246251565e-16 .. py:function:: eval_polynomial(x: float, coefs: collections.abc.Sequence[float]) -> float Evaluate a polynomial via Horner's method. :returns: The evaluation of the polynomial. .. py:function:: _ellipk(m: float) -> float K(m) for m >= 0. :param m: Positive scalar. :returns: Evaluation of K(m). .. py:function:: ellipk_nb(m: _FloatOrArray) -> _FloatOrArray Complete elliptic integral of the first kind, K(m). :param m: Parameter(s) of the elliptic integral. Values m > 1 return NaN. Can be a float or an NDArray. If an array, the function is executed elementwise. :returns: K(m). .. rubric:: Notes .. math:: K(m) = \int_{0}^{\tfrac{\pi}{2}}{(1 - m \sin^2(t)})^{-\tfrac{1}{2}} dt [ellipk_1]_ Implementation based on Scipy's XSF implementation [ellipk_3]_ of the Cephes C [ellipk_2]_ library (MIT licensed) - with help from Claude to translate the C into Python. .. [ellipk_1] Abramowitz, M., and I. A. Stegun. Handbook of Mathematical Functions. Dover Publications, 1965. .. [ellipk_2] Moshier, S. L. (2000). Cephes Math Library Release 2.8. http://www.netlib.org/cephes .. [ellipk_3] https://github.com/scipy/xsf/blob/a4e89b2aa684ed63f63e5ece79b916e1f0fe619b/include/xsf/cephes/ellpk.h