Gauss–Legendre method

In numerical analysis and scientific computing, the Gauss–Legendre methods are a family of numerical methods for ordinary differential equations. Gauss–Legendre methods are implicit Runge–Kutta methods. More specifically, they are collocation methods based on the points of Gauss–Legendre quadrature. The Gauss–Legendre method based on s points has order 2s.

All Gauss–Legendre methods are A-stable.

The Gauss–Legendre method of order two is the implicit midpoint rule. Its Butcher tableau is:


 * {| cellpadding=3px cellspacing=0px style="text-align: center;"


 * style="border-right:1px solid; border-bottom:1px solid;" | 1/2 || style="border-bottom:1px solid;" | 1/2
 * style="border-right:1px solid;" | || 1
 * }
 * }

The Gauss–Legendre method of order four has Butcher tableau:


 * {| cellpadding=3px cellspacing=0px style="text-align: center;"


 * style="border-right:1px solid;" | $$ \tfrac12 - \tfrac16 \sqrt3 $$ || $$ \tfrac14 $$ || $$ \tfrac14 - \tfrac16 \sqrt3 $$
 * style="border-right:1px solid; border-bottom:1px solid;" | $$ \tfrac12 + \tfrac16 \sqrt3 $$ || style="border-bottom:1px solid;" | $$ \tfrac14 + \tfrac16 \sqrt3 $$ || style="border-bottom:1px solid;" | $$ \tfrac14 $$
 * style="border-right:1px solid;" | || $$ \tfrac12 $$ || $$ \tfrac12 $$
 * }
 * style="border-right:1px solid;" | || $$ \tfrac12 $$ || $$ \tfrac12 $$
 * }

The Gauss–Legendre method of order six has Butcher tableau:


 * {| cellpadding=3px cellspacing=0px style="text-align: center;"


 * style="border-right:1px solid;" | $$ \tfrac12 - \tfrac1{10} \sqrt{15} $$ || $$ \tfrac5{36} $$ || $$ \tfrac29 - \tfrac1{15} \sqrt{15} $$ || $$ \tfrac5{36} - \tfrac1{30} \sqrt{15} $$
 * style="border-right:1px solid;" | $$ \tfrac12 $$ || $$ \tfrac5{36} + \tfrac1{24} \sqrt{15} $$ || $$ \tfrac29 $$ || $$ \tfrac5{36} - \tfrac1{24} \sqrt{15} $$
 * style="border-right:1px solid; border-bottom:1px solid;" | $$ \tfrac12 + \tfrac1{10} \sqrt{15} $$ || style="border-bottom:1px solid;" | $$ \tfrac5{36} + \tfrac1{30} \sqrt{15} $$ || style="border-bottom:1px solid;" | $$ \tfrac29 + \tfrac1{15} \sqrt{15} $$ || style="border-bottom:1px solid;" | $$ \tfrac5{36} $$
 * style="border-right:1px solid;" | || $$ \tfrac5{18} $$ || $$ \tfrac49 $$ || $$ \tfrac5{18} $$
 * }
 * style="border-right:1px solid;" | || $$ \tfrac5{18} $$ || $$ \tfrac49 $$ || $$ \tfrac5{18} $$
 * }
 * }

The computational cost of higher-order Gauss–Legendre methods is usually excessive, and thus, they are rarely used.

Intuition
Gauss-Legendre Runge-Kutta (GLRK) methods solve an ordinary differential equation $$ \dot{x} = f(x)$$ with $$x(0) = x_0$$. The distinguishing feature of GLRK is the estimation of $ x(h) - x_0 = \int_0^h dt \, f( x(t) ) $ with Gaussian quadrature.

$$x(h) = x(0) + \frac{h}{2} \sum_{i=1}^\ell w_i k_i + O(h^{2\ell}),$$

where $$k_i = f( x( h c_i) )$$ are the sampled velocities, $$w_i$$ are the quadrature weights, $c_i = \frac{1}{2} h (1+r_i)$ are the abscissas, and $$r_i$$ are the roots $$P_\ell(r_i) = 0$$ of the Legendre polynomial of degree $$\ell$$. A further approximation is needed, as $$k_i$$ is still impossible to evaluate. To maintain truncation error of order $$O(h^{2\ell})$$, we only need $$k_i$$ to order $$O(h^{2\ell-1})$$. The Runge-Kutta implicit definition $k_i = f{\left(x_0 + h \sum_j a_{ij} k_j \right)}$ is invoked to accomplish this. This is an implicit constraint that must be solved by a root finding algorithm like Newton's method. The values of the Runge-Kutta parameters $$a_{ij}$$ can be determined from a Taylor series expansion in $$h$$.

Practical example
The Gauss-Legendre methods are implicit, so in general they cannot be applied exactly. Instead one makes an educated guess of $$ k_i $$, and then uses Newton's method to converge arbitrarily close to the true solution. Below is a Matlab function which implements the Gauss-Legendre method of order four. This algorithm is surprisingly cheap. The error in $$k_i$$ can fall below $$10^{-12}$$ in as few as 2 Newton steps. The only extra work compared to explicit Runge-Kutta methods is the computation of the Jacobian.

Time-symmetric variants
At the cost of adding an additional implicit relation, these methods can be adapted to have time reversal symmetry. In these methods, the averaged position $$(x_f+x_i)/2$$ is used in computing $$k_i$$ instead of just the initial position $$x_i$$ in standard Runge-Kutta methods. The method of order 2 is just an implicit midpoint method.


 * $$ k_1 = f\left(\frac{x_f+x_i}{2}\right) $$
 * $$ x_f = x_i + h k_1 $$

The method of order 4 with 2 stages is as follows.


 * $$ k_1 = f\left( \frac{x_f+x_i}{2} - \frac{\sqrt{3}}{6} h k_2\right) $$
 * $$ k_2 = f\left( \frac{x_f+x_i}{2} + \frac{\sqrt{3}}{6} h k_1\right) $$
 * $$ x_f = x_i + \frac{h}{2}(k_1 + k_2) $$

The method of order 6 with 3 stages is as follows.


 * $$ k_1 = f\left( \frac{x_f + x_i}{2} - \frac{\sqrt{15}}{15} h k_2 - \frac{\sqrt{15}}{30} h k_3 \right) $$
 * $$ k_2 = f\left( \frac{x_f + x_i}{2} + \frac{\sqrt{15}}{24} h k_1 - \frac{\sqrt{15}}{24} h k_3 \right) $$
 * $$ k_3 = f\left( \frac{x_f + x_i}{2} + \frac{\sqrt{15}}{30} h k_1 + \frac{\sqrt{15}}{15} h k_2 \right) $$
 * $$ x_f = x_i + \frac{h}{18}( 5 k_1 + 8k_2 + 5k_3)$$