The complete elliptic integral of the first kind (CEI-1) plays in a significant role in mathematics, physics and engineering. There is no simple formula for its computation, thus numerical algorithms are essential for coping with practical problems involved. The commercial implementations for the numerical solutions, such as the functions ellipticK and EllipticK provided by MATLAB and Mathematica respectively, are based on $\mathcal{K}_{\mathrm{cs}}(m)$ instead of the usual form $K(k)$ such that $m = k^2$ and $\mathcal{K}_{\mathrm{cs}}(k^2) = K(k)$. It is necessary to develop open source implementations for the computation of the CEI-1 in order to avoid potential risks of using commercial software and possible limitations due to the unknown factors. In this paper, the infinite series method, arithmetic-geometric mean (AGM) method, Gauss-Chebyshev method and Gauss-Legendre methods are discussed in details with a top-down strategy. The four key algorithms for computing CEI-1 are designed, verified, validated and tested, which can be utilized in R\& D and be reused properly. Numerical results show that our open source implementations based on $K(k)$ are equivalent to the commercial implementation based on $\mathcal{K}_{\mathrm{cs}}(m)$. The general algorithms for computing orthogonal polynomials developed are significant byproducts in the sense of STEM education and scientific computation.
翻译:第一类完全椭圆积分(CEI-1)在数学、物理学和工程学中扮演着重要角色。由于其计算缺乏简单公式,数值算法对于处理相关实际问题至关重要。商用数值解的实现(如MATLAB和Mathematica分别提供的ellipticK和EllipticK函数)基于$\mathcal{K}_{\mathrm{cs}}(m)$而非通常形式$K(k)$,其中$m = k^2$且$\mathcal{K}_{\mathrm{cs}}(k^2) = K(k)$。为规避使用商业软件的潜在风险及未知因素可能带来的限制,有必要开发CEI-1计算的开源实现。本文采用自顶向下的策略,详细讨论了无穷级数法、算术几何平均法、高斯-切比雪夫法和高斯-勒让德法。我们设计、验证、确认并测试了四种计算CEI-1的关键算法,这些算法可运用于研发并得到合理复用。数值结果表明,基于$K(k)$的开源实现与基于$\mathcal{K}_{\mathrm{cs}}(m)$的商用实现在结果上等价。所开发的正交多项式通用算法在STEM教育与科学计算方面具有重要的衍生价值。