Extrapolación usando potencias pares de \( h \)

Aproximación \( \mathcal{O}(h^2) \) $$ \begin{equation} M = N_{1}(h) + K_{1} h^{2} + K_{2} h^{4} + K_{3} h^{6} + K_{4} h^{8} + K_{5} h^{10} + \cdots \tag{27} \end{equation} $$

Aproximación \( \mathcal{O}(h^4) \)

Disminuyendo el tamaño de paso a la mitad de la aproximación \( \mathcal{O}(h^{2}) \) $$ \begin{equation*} M = N_{1} \biggl( \frac{h}{2} \biggr) + \frac{1}{4} K_{1} h^{2} + \frac{1}{16} K_{2} h^{4} + \frac{1}{64} K_{3} h^{6} + \frac{1}{256} K_{4} h^{8} + \frac{1}{1024} K_{5} h^{10} + \cdots \end{equation*} $$

Multiplicando por cuatro $$ \begin{equation*} 4 M = 4 N_{1} \biggl( \frac{h}{2} \biggr) + K_{1} h^{2} + \frac{1}{4} K_{2} h^{4} + \frac{1}{16} K_{3} h^{6} + \frac{1}{64} K_{4} h^{8} + \frac{1}{256} K_{5} h^{10} + \cdots \end{equation*} $$

Restando la aproximación \( \mathcal{O}(h^{2}) \) $$ \begin{equation*} 3 M = 4 N_{1} \biggl( \frac{h}{2} \biggr) - N_{1}(h) - \frac{3}{4} K_{2} h^{4} - \frac{15}{16} K_{3} h^{6} - \frac{63}{64} K_{4} h^{8} - \frac{255}{256} K_{5} h^{10} - \cdots \end{equation*} $$

Simplificando y agrupando términos $$ \begin{equation*} M = N_{1} \biggl( \frac{h}{2} \biggr) + \frac{1}{3} \biggl[ N_{1} \biggl( \frac{h}{2} \biggr) - N_{1}(h) \biggr] - \frac{1}{4} K_{2} h^{4} - \frac{5}{16} K_{3} h^{6} - \frac{21}{64} K_{4} h^{8} - \frac{85}{256} K_{5} h^{10} - \cdots \end{equation*} $$

Usando un cambio de variable $$ \begin{equation} M = N_{2}(h) - \frac{1}{4} K_{2} h^{4} - \frac{5}{16} K_{3} h^{6} - \frac{21}{64} K_{4} h^{8} - \frac{85}{256} K_{5} h^{10} - \cdots \tag{28} \end{equation} $$

Aproximación \( \mathcal{O}(h^{2 n}) \) $$ \begin{equation} N_{n}(h) = N_{n-1} \biggl( \frac{h}{2} \biggr) + \frac{1}{4^{n-1} - 1} \biggl[ N_{n-1} \biggl( \frac{h}{2} \biggr) - N_{n-1}(h) \biggr] \tag{29} \end{equation} $$

Ejemplo

Calcular \( f'(0.5) \) usando una diferencia hacia adelante $$ \begin{equation*} f(x) = - 0.10 x^{4} - 0.15 x^{3} - 0.5 x^{2} - 0.25 x + 1.2 \end{equation*} $$

Aproximación con \( h=1 \) $$ \begin{equation*} f'(0.5) = \frac{f(1.5) - f(0.5)}{1} = \frac{-1.3125 - 0.925}{1} = -2.2375 \end{equation*} $$

Aproximación con \( h=0.5 \) $$ \begin{equation*} f'(0.5) = \frac{f(1) - f(0.5)}{1} = \frac{0.2 - 0.925}{0.5} = -1.45 \end{equation*} $$

Extrapolación \( \mathcal{O}(h^{2}) \) $$ \begin{equation*} f'(0.5) = -1.45 + \frac{1}{3} \bigl[ -1.45 - (-2.2375) \bigr] = -1.1875 \end{equation*} $$

Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-1.1875 - (-1.45)}{-1.1875}\bigg| \times 100\% = 22.1\% \end{equation*} $$

Aproximación con \( h=0.25 \) $$ \begin{equation*} f'(0.5) = \frac{f(0.75) - f(0.5)}{0.25} = \frac{0.636328 - 0.925}{0.25} = -1.154688 \end{equation*} $$

Extrapolación \( \mathcal{O}(h^{2}) \) $$ \begin{equation*} f'(0.5) = -1.154688 + \frac{1}{3} \bigl[ -1.154688 - (-1.45) \bigr] = -1.056251 \end{equation*} $$

Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-1.026251 - (-1.154688)}{-1.026251}\bigg| \times 100\% = 9.32\% \end{equation*} $$

Extrapolación \( \mathcal{O}(h^{4}) \) $$ \begin{equation*} f'(0.5) = -1.056251 + \frac{1}{15} \bigl[ -1.056251 - (-1.1875) \bigr] = -1.047501 \end{equation*} $$

Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-1.047501 - (-1.056251)}{-1.047501}\bigg| \times 100\% = 0.84\% \end{equation*} $$

Aproximación con \( h=0.125 \) $$ \begin{equation*} f'(0.5) = \frac{f(0.625) - f(0.5)}{0.125} = \frac{0.796558 - 0.925}{0.125} = -1.027539 \end{equation*} $$

Extrapolación \( \mathcal{O}(h^{2}) \) $$ \begin{equation*} f'(0.5) = -1.027539 + \frac{1}{3} \bigl[ -1.027539 - (-1.154688) \bigr] = -0.985152 \end{equation*} $$

Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-0.985152 - (-1.027539)}{-0.985152}\bigg| \times 100\% = 4.3\% \end{equation*} $$

Extrapolación \( \mathcal{O}(h^{4}) \) $$ \begin{equation*} f'(0.5) = -0.985152 + \frac{1}{15} \bigl[ -0.985152 - (-1.056251) \bigr] = -0.980412 \end{equation*} $$

Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-0.980412 - (-0.985152)}{-0.980412}\bigg| \times 100\% = 0.48\% \end{equation*} $$

Extrapolación \( \mathcal{O}(h^{6}) \) $$ \begin{equation*} f'(0.5) = -0.980412 + \frac{1}{63} \bigl[ -0.980412 - (-1.047501) \bigr] = -0.979347 \end{equation*} $$

Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-0.979347 - (-0.980412)}{-0.979347}\bigg| \times 100\% = 0.11\% \end{equation*} $$

Resumiendo los resultados en una matriz $$ \begin{equation*} \begin{array}{c|cccc} h & f'(0.5) & \mathcal{O}(h^{2}) & \mathcal{O}(h^{4}) & \mathcal{O}(h^{6}) \\ \hline 1 & -2.2375 & & & \\ 0.5 & -1.45 & -1.1875 & & \\ 0.25 & -1.154688 & -1.056251 & -1.047501 & \\ 0.125 & -1.027536 & -0.985152 & -0.980412 & -0.979347 \end{array} \end{equation*} $$

Lo anterior puede escribirse como $$ \begin{equation*} \begin{matrix} \mathcal{O}(h^{2}) & \mathcal{O}(h^{4}) & \mathcal{O}(h^{6}) & \mathcal{O}(h^{8}) \\ \hline N_{(1,1)} & & & \\ N_{(2,1)} & N_{(2,2)} & & \\ N_{(3,1)} & N_{(3,2)} & N_{(3,3)} & \\ N_{(4,1)} & N_{(4,2)} & N_{(4,3)} & N_{(4,4)} \end{matrix} \end{equation*} $$

Fórmula matemática

$$ \begin{align*} i &= 1, \dots, m \\ N_{(i,1)} &= N(h) \\ j &= 2, \dots, i+1 \\ N_{(i,j)} &= N_{(i,j-1)} + \frac{1}{4^{j-1} - 1} \bigl[ N_{(i,j-1)} - N_{(i-1,j-1)} \bigr] \\ h &= \frac{h}{2} \end{align*} $$

Seudocódigo

    function extrapolacion_Richarson_2n(f, x, h)
        for i=1 to m do
            N(i,1) = g(f, x, h)
            for j=2 to i+1 do
                N(i,j) = N(i,j-1) + (N(i,j-1) - N(i-1,j-1))/(4^(j-1) - 1)
            end for
            h = h/2
        end for
        return N
    end function

Implementación

def extrapolacion_Richarson_2n(f,x,h):
    m = 4
    N = np.zeros((m,m))
    for i in range(0,m):
        N[i,0] = diferencia_adelante(f,x,h)
        for j in range(1,i+1):
            N[i,j] =  N[i,j-1] + (N[i,j-1] - N[i-1,j-1])/(4**j - 1)
        h = h/2
    return N

B = extrapolacion_Richarson_2n(g,0.5,1.0)
print(B)

[[-2.2375      0.          0.          0.        ]
 [-1.45       -1.1875      0.          0.        ]
 [-1.1546875  -1.05625    -1.0475      0.        ]
 [-1.02753906 -0.98515625 -0.98041667 -0.97935185]]