Fifth-order AGM-formula for the period of a large-angle pendulum

In this paper, an approximate algebraic formula for calculating the period of a large-angle pendulum was developed based on fifth-order iteration of the arithmetic-geometric mean (AGM) formula for the complete elliptic integral of the first kind. The present formula is capable of estimating the period of the nonlinear pendulum for the entire range of possible amplitudes i.e. 0 ∘ < A < 180 ∘ , but it is particularly useful for large-angle ( 90 ∘ < A ≤ 170 ∘ ) and extremely large-angle ( 170 ∘ < A ≤ 179.9 ∘ ) oscillations. The accuracy of the present formula was tested using exact solution, numerical solution and other published large-angle formulas. It was observed that the present formula is several orders more accurate than the numerical solution and the other published formulas. The maximum error of the present formula for amplitudes up to 179.9 ∘ was found to be 2.93 × 10 - 6 % . The present formula can be used for pedagogical purpose because of its simplicity.


Introduction
The didactic value of the pendulum can hardly be overstated. Perhaps, this can be attributed to the fact that there are many mechanical systems and physical phenomena that exhibit pendulum-like motion [1]. A pendulum system exhibits rich physics that makes it useful for teaching various topics on mechanics and mechanical vibration. Nonlinear vibration can be introduced at undergraduate level vibration courses using the pendulum [2,3]. This can be done by expanding the sine nonlinearity of the pendulum equation using Taylor's series and truncating after the second term, which results to the well-known cubic-nonlinear Duffing equation. Also, the pendulum can be used to estimate local gravity in a simple lab experiment [4] and to estimate the inertia of compact bodies [5]. At graduate level, the pendulum can be used to study the oscillations of mechanical and other complex physical systems [1,6] and to investigate nonlinear phenomena such as chaos [7], jump [8,9], parametric oscillations [10] and bifurcations [11].
The Wolfram Demonstration Project is an open-access peer-reviewed online resource that provides interactive illustrations of the dynamics of various physical systems and is very useful for students and instructors. The online resource provides several applications of the pendulum motion [12] and the pendulum system has 123 demonstration projects, which is the highest for any single system. This huge number of demonstration * Correspondence email address: akuro.big-alabo@uniport.edu.ng projects can only attest to the pedagogical value of the pendulum.
The dynamic equation for the undamped oscillations of the pendulum motion is well-known to be: where the initial conditions are φ(0) = A andφ(0) = 0, and the possible oscillation amplitudes are in the range A ∈ [0, π] radians. For the simple pendulum, ω 0 = g/l where g is the acceleration due to gravity and l is the length of the pendulum. For other pendulumlike motions, ω 0 is expressed differently based on the system's parameters [1].
The trigonometric nonlinearity in equation (1) arises from the geometric effects, which depend on the amplitude. During small-angle oscillations, i.e. A < 10 • , the geometric nonlinear effect is insignificant and the approximation sin φ ∼ = φ is applicable. Therefore, the pendulum motion can be modelled by a simple harmonic motion (i.e.φ+ω 2 0 φ = 0) and has a constant period that is given as T 0 = 2π/ω 0 . In contrast, during moderateangle to large-angle oscillations, the geometric nonlinear effect is appreciable and the period depends on the amplitude. The greater the amplitude, the stronger the geometric nonlinear effect and equation (1) must be used to determine the period and oscillation profile of the pendulum. The exact period of equation (1) can be derived in terms of the complete elliptic integral of the first kind as [6]: where m = sin 2 (A/2) is the elliptic parameter and K(m) = π/2 0 (1−m sin 2 θ) −1/2 dθ is the complete elliptic integral of the first kind.
The exact period in equation (2) is generally not suitable for undergraduate courses because it is not expressed in terms of elementary functions. Although K(m) can be evaluated numerically, explicit algebraic solutions are preferable especially for introductory courses. In view of this, there has been a renewed interest to derive approximate algebraic solutions that provide an accurate estimate of the period of a largeangle pendulum [1-3, 6, 13-20]. However, most of these approximations are only accurate to less than 1.0% relative error for a limited range of the possible amplitudes and would require complementary solutions for those amplitudes in which they are inaccurate [5].
A recent review of approximate algebraic formulas for the period of a nonlinear pendulum was published by Hinrichsen [5] and it provides a comprehensive collection of over forty approximations that are applicable to smallangle, medium-angle and large-angle oscillations. The study [5] included a comparative analysis of the various approximations which showed that the simplest and most accurate formulas for small-angle oscillations with nonlinearity (10 • < A < 45 • ) are those of Denman [21] and Carvalhaes and Suppes [15].
The formula of Denman [21] is given as: and was derived using a Chebyshev series expansion of the sine nonlinearity. It produced a relative error that is less than 0.2% for angles up to 90 • . The approximate formula of Carvalhaes and Suppes [15] for small-angle oscillations was derived based on a second-order iteration of the arithmetic-geometric mean (AGM) formula for K(m) and it is given as: (1 + cos(A/2)) 2 (4) Equation (4) produced a relative error that is less than 0.001% for angles up to 90 • but is slightly more complicated than equation (3). For moderate-angle oscillations (45 • < A < 90 • ), equation (4) can be used although a more accurate approximation by Belendez et al. [17] was recommended. The formula of Belendez et al. [17] was obtained by Taylor series expansion of the exact frequency relation to K(m). The Taylor series expansion was implemented about the point m = 4 √ 1 − m = cos(A/2) = 1 and truncated at the fourth term to obtain the following formula: Equation (5) has a maximum relative error that is less than 0.001% for amplitudes up to 105 • .
For large-angle oscillations, Hinrichsen [5] compared a number of approximate formulas which included Butikov [13], Lima [6], Qing-Xin and Pei [3], Xue et al. [18], Big-Alabo [20] and Carvalhaes and Suppes [15]. The comparison showed that the formulas of Xue et al. [18] and Carvalhaes and Suppes [15] are the most accurate for large-angle oscillations. The formula of Xue et al. [18] was derived based on a logarithmic approximation of K(m) and it is given as: whereas the formula of Carvalhaes and Suppes [15] is based on a fourth-order iteration of the AGM formula for K(m) and is given as: [1] showed that the fourth-order iteration of the AGM formula can be simplified algebraically to produce a formula that has exactly the same accuracy but is much simpler than equation (7) as shown: 1 + cos(A/2) + 2 cos(A/4)(cos(A/2)) 1/4 2 (8) Equation (6) produces a maximum relative error that is less than 0.02% for any amplitude while equation (7) produces a maximum relative error of less than 0.04% for amplitudes up to 179.9 • . However, equation (7) is more accurate than equation (6) for large-angle oscillations except in the case of extremely large-angle oscillations in the range of 178 In spite of the progress that has been made in deriving approximate pendulum formulas for large-angle oscillations, there is still need to derive a more accurate and simpler formula composed of elementary functions; perhaps one that can be introduced at undergraduate level. In this paper, a new explicit algebraic approximation for the period of a large-angle pendulum that is composed of elementary functions was derived based on the fifth-order iteration of the AGM formula for K(m). The accuracy of the new formula was investigated using exact, numerical and published approximate solutions. An important feature of the formula is that its derivation is simple enough for inclusion into undergraduate courses on mechanics and vibration.

AGM Formula for Pendulum Period
The AGM is a recursive algorithm of two sequences; one is an arithmetic sequence and the other is a geometric sequence. The sequences can be defined as shown: where n ∈ Z + and a 0 , b 0 are the initial values for the algorithm. Based on these sequences, the AGM is defined for a 0 > 0 and b 0 > 0 as the point of convergence of a n and b n as n → ∞. Therefore, where M (a 0 , b 0 ) is the AGM of a 0 and b 0 . Since the arithmetic mean of two numbers is always greater than the corresponding geometric mean, then a n decreases and b n increases to the convergence point. The AGM has a commutative property which implies that the order of a 0 and b 0 is not important. Also, M (a 0 , b 0 ) has a quadratic convergence property, which means that its accuracy doubles after each iteration. The consequence is that only a few terms are necessary to obtain a very high accuracy. The fast convergence of the AGM algorithm can be illustrated by considering the AGM of two numbers e.g. √ 2 and 1. The AGM results for the fourth-order iteration are shown in Table 1 and are displayed to 32 digits. It can be seen that after four iterations the first 20 digits of a n and b n match perfectly. Hence, the fourth-order AGM has been used to derive solutions for K(m) [1,22] and for the period of a largeangle pendulum [1,15].
The AGM of 1 and √ 2 as demonstrated in Table 1 is of historical significance in the study of elliptic functions because its determination in connection to the perimeter of a lemniscate that is 2 units long and has a focal distance of √ 2 led to the discovery of the relationship between the AGM and K(m) by Carl Fredrich Gauss in 1799. However, the relationship was published about two decades later in 1818.
The relationship between K(m) and the AGM can be expressed as [1,15]: Putting equation (11) in (2) and noting that m = sin 2 (A/2) gives the exact period of the pendulum in terms of the AGM as: Equation (12) implies that a 0 = 1 and b 0 = cos(A/2). Now, we turn our attention to the approximate algebraic expression for the AGM based on fifth-order iteration.
As explained in ref. [15], the application of the AGM algorithm to compute the large-angle pendulum period is widely known and not new. However, what is new is extracting or deriving explicit algebraic solutions based on the AGM algorithm. Previous studies [1,15] have provided explicit algebraic formula for the large-angle pendulum period based on fourth-order iteration but the present study is based on a fifth-order iteration. The recurrence sequences in equations (9) express the current approximation in terms of the immediate preceding terms of the sequences and this approach was applied in ref. [15] to derive an explicit formula for the largeangle pendulum period. The idea of the present approach in applying the AGM is to formulate a recurrence relationship that expresses the current approximation in terms of the starting values i.e. a 0 and b 0 . This approach, unlike the approach in ref. [15], simplifies the algebraic manipulation and produces a more compact expression.
Then substituting a 1 = 1 2 (a 0 + b 0 ) and b 1 = √ a 0 b 0 in equations (17) expresses the fifth-order approximation in terms of the initial values as shown: Assuming a 0 = 1 and b 0 = β, then M (1, β) ∼ = a 5 = 1 16 From equations (19) and (11), the approximate algebraic solution for K(m) based on fifth-order iteration of the AGM can be expressed as: Putting β = cos(A/2) in equation (19) and using the resulting expression in equation (12) gives the fifthorder AGM solution for the approximate period of the pendulum as: Finally, application of the identity cos 2 θ = (1+cos 2θ)/2 simplifies equation (21) to give:

Results and Discussions
In this section the accuracy of the present formula for the period of a large-angle pendulum was investigated by comparing with results of the exact solution, other published approximate formulas and numerical results. The published large-angle formulas used for comparison are those of Lima [6], Qing-Xin and Pei [3], Xue et al. [18] and Carvalhaes and Suppes [15], and are presented as equations (23) to (26). These approximate formulas were selected for comparison with the present formula because a recent analysis [5] showed that they are the most accurate large-angle formulas.
Approximate formula of Lima [6] T 1 T 0 = Approximate formula of Carvalhaes and Suppes [15] and Big-Alabo [1] Present approximate formula (27) Table 2 shows the computed normalized time period results for the approximate formulas in equations (23) to (27) and for the exact solution in equation (2). The results are computed to 6 significant figures for amplitudes in the range of 10.0 • ≤ A ≤ 179.9 • . It can be seen from the results in Table 2 that it is only the present formula that matches the exact solution perfectly. Therefore, to have better assessment of the accuracy on the present pendulum formula, the absolute errors (i.e. ε = |T ex − T i |/T 0 where i = 1 to 5) of equations (23) to (27) were compared on semi-log plots as shown in Figures 1 to 3.   ) T1/T0 T2/T0 T3/T0 T4/T0 T5/T0 Tex/T0  present formula is two or more orders more accurate than T 4 /T 0 and at least five orders more accurate than the other three large-angle formulas. For extremely largeangle oscillations in the range 179.0 • ≤ A ≤ 179.9 • , the present formula is several orders more accurate than the other large-angle formulas except T 3 /T 0 that has similar accuracy with the present formula when A = 179.9 • . At A = 179.9 • , the absolute error of the present formula is approximately 1.57 × 10 −7 while its relative error is 2.93 × 10 −6 %. Hence, it can be concluded that the e20230014-6 Fifth-order AGM-formula for the period of a large-angle pendulum present formula is more accurate than the other existing formulas for large-angle oscillations of a pendulum. A further investigation of the accuracy of the present large-angle formula was conducted by comparing with numerical solution. The numerical results were obtained by applying the explicit Runge-Kutta method, implemented in Mathematica software package, to solve equation (1). The results of the comparison are presented in Table S1 of the supplementary material and show the absolute and normalized errors. The absolute error was calculated as discussed earlier while the normalized error was calculated as the ratio of the absolute error to the machine epsilon error. According to IEEE 754-2008 standard for floating point arithmetic that is based on 64-bit or double precision, the machine epsilon error has a value of 2 −52 ∼ = 2.22 × 10 −16 . Table S1 shows that the present pendulum formula is either more accurate or within the accuracy of machine precision when A ≤ 170.0 • . The implication is that the present formula is at least seven orders more accurate than the corresponding numerical solution in this range. For extremely large-angle oscillations in the range of 170.0 • < A ≤ 179.9 • , the present formula is at least four orders more accurate than the numerical solution. The Table S1 also shows the period estimate when A = 179.99999 • and the error of the present formula was calculated to be 0.0764%, which is excellent considering how close this amplitude is to the limiting amplitude of 180.0 • .

Conclusions
An accurate formula that is based on elementary functions has been derived to estimate the period of a large-angle pendulum. The present formula is based on algebraic simplification of the fifth-order iteration of the AGM formula for the exact period of the pendulum. The derivation of the present formula is simple enough for inclusion in relevant undergraduate courses. The present large-angle formula was validated using the exact solution, other published large-angle formulas and numerical solution. The error analysis of the various approximate solutions showed that the present formula is several orders more accurate than the other published largeangle formulas and the numerical solution. Furthermore, the present formula is shown to combine simplicity and accuracy. Hence, the present large-angle pendulum formula is recommended for undergraduate and postgraduate courses on mechanics, physics and vibration where systems exhibiting pendulum-like motions are taught.

Supplementary material
The following online material is available for this article: Table S1 -Comparison of the present formula and numerical solution.