Aproximación \( \mathcal{O}(h) \) $$ \begin{equation} M = N_{1}(h) + K_{1} h + K_{2} h^{2} + K_{3} h^{3} + K_{4} h^{4} + K_{5} h^{5} + \cdots \tag{22} \end{equation} $$
Aproximación \( \mathcal{O}(h^{2}) \)
Disminuyendo el tamaño de paso a la mitad de la aproximación \( \mathcal{O}(h) \) $$ \begin{equation*} M = N_{1} \biggl( \frac{h}{2} \biggr) + \frac{1}{2} K_{1} h + \frac{1}{4} K_{2} h^{2} + \frac{1}{8} K_{3} h^{3} + \frac{1}{16} K_{4} h^{4} + \frac{1}{32} K_{5} h^{5} + \cdots \end{equation*} $$
Multiplicando por dos $$ \begin{equation*} 2 M = 2 N_{1} \biggl( \frac{h}{2} \biggr) + K_{1} h + \frac{1}{2} K_{2} h^{2} + \frac{1}{4} K_{3} h^{3} + \frac{1}{8} K_{4} h^{4} + \frac{1}{16} K_{5} h^{5} + \cdots \end{equation*} $$
Restando la aproximación \( \mathcal{O}(h) \) $$ \begin{equation*} M = 2 N_{1} \biggl( \frac{h}{2} \biggr) - N_{1}(h) - \frac{1}{2} K_{2} h^{2} - \frac{3}{4} K_{3} h^{3} - \frac{7}{8} K_{4} h^{4} - \frac{15}{16} K_{5} h^{5} - \cdots \end{equation*} $$
Agrupando términos $$ \begin{equation*} M = N_{1} \biggl( \frac{h}{2} \biggr) + \biggl[ N_{1} \biggl( \frac{h}{2} \biggr) - N_{1}(h) \biggr] - \frac{1}{2} K_{2} h^{2} - \frac{3}{4} K_{3} h^{3} - \frac{7}{8} K_{4} h^{4} - \frac{15}{16} K_{5} h^{5} - \cdots \end{equation*} $$
Usando un cambio de variable $$ \begin{equation} M = N_{2}(h) - \frac{1}{2} K_{2} h^{2} - \frac{3}{4} K_{3} h^{3} - \frac{7}{8} K_{4} h^{4} - \frac{15}{16} K_{5} h^{5} - \cdots \tag{23} \end{equation} $$
Aproximación \( \mathcal{O}(h^{3}) \)
Disminuyendo el tamaño de paso a la mitad de la aproximación \( \mathcal{O}(h^{2}) \) $$ \begin{equation*} M = N_{2} \biggl( \frac{h}{2} \biggr) - \frac{1}{8} K_{2} h^{2} - \frac{3}{32} K_{3} h^{3} - \frac{7}{128} K_{4} h^{4} - \frac{15}{512} K_{5} h^{5} - \cdots \end{equation*} $$
Multiplicando por cuatro $$ \begin{equation*} 4 M = 4 N_{2} \biggl( \frac{h}{2} \biggr) - \frac{1}{2} K_{2} h^{2} - \frac{3}{8} K_{3} h^{3} - \frac{7}{32} K_{4} h^{4} - \frac{15}{128} K_{5} h^{5} - \cdots \end{equation*} $$
Restando la aproximación \( \mathcal{O}(h^{2}) \) $$ \begin{equation*} 3 M = 4 N_{2} \biggl( \frac{h}{2} \biggr) - N_{2}(h) + \frac{3}{8} K_{3} h^{3} + \frac{21}{32} K_{4} h^{4} + \frac{105}{128} K_{5} h^{5} + \cdots \end{equation*} $$
Simplificando y agrupando términos $$ \begin{equation*} M = N_{2} \biggl( \frac{h}{2} \biggr) + \frac{1}{3} \biggl[ N_{2} \biggl( \frac{h}{2} \biggr) - N_{2}(h) \biggr] + \frac{1}{8} K_{3} h^{3} + \frac{7}{32} K_{4} h^{4} + \frac{35}{128} K_{5} h^{5} + \cdots \end{equation*} $$
Usando un cambio de variable $$ \begin{equation} M = N_{3}(h) + \frac{1}{8} K_{3} h^{3} + \frac{7}{32} K_{4} h^{4} + \frac{35}{128} K_{5} h^{5} + \cdots \tag{24} \end{equation} $$
Aproximación \( \mathcal{O}(h^{4}) \)
Disminuyendo el tamaño de paso a la mitad de la aproximación \( \mathcal{O}(h^{3}) \) $$ \begin{equation*} M = N_{3} \biggl( \frac{h}{2} \biggr) + \frac{1}{64} K_{3} h^{3} + \frac{7}{512} K_{4} h^{4} + \frac{35}{4096} K_{5} h^{5} + \cdots \end{equation*} $$
Multiplicando por ocho $$ \begin{equation*} 8 M = 8 N_{3} \biggl( \frac{h}{2} \biggr) + \frac{1}{8} K_{3} h^{3} + \frac{7}{64} K_{4} h^{4} + \frac{35}{512} K_{5} h^{5} + \cdots \end{equation*} $$
Restando la aproximación \( \mathcal{O}(h^{3}) \) $$ \begin{equation*} 7 M = 8 N_{3} \biggl( \frac{h}{2} \biggr) - N_{3}(h) - \frac{7}{64} K_{4} h^{4} - \frac{105}{512} K_{5} h^{5} - \cdots \end{equation*} $$
Simplificando y agrupando términos $$ \begin{equation*} M = N_{3} \biggl( \frac{h}{2} \biggr) + \frac{1}{7} \biggl[ N_{3} \biggl( \frac{h}{2} \biggr) - N_{3}(h) \biggr] - \frac{1}{64} K_{4} h^{4} - \frac{15}{512} K_{5} h^{5} - \cdots \end{equation*} $$
Usando un cambio de variable $$ \begin{equation} M = N_{4}(h) - \frac{1}{64} K_{4} h^{4} - \frac{15}{512} K_{5} h^{5} - \cdots \tag{25} \end{equation} $$
Aproximación \( \mathcal{O}(h^{n}) \) $$ \begin{equation} N_{n}(h) = N_{n-1} \biggl( \frac{h}{2} \biggr) + \frac{1}{2^{n-1} - 1} \biggl[ N_{n-1} \biggl( \frac{h}{2} \biggr) - N_{n-1}(h) \biggr] \tag{26} \end{equation} $$
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) \) $$ \begin{equation*} f'(0.5) = -1.45 + \bigl[ -1.45 - (-2.2375) \bigr] = -0.6625 \end{equation*} $$
Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-0.6625 - (-1.45)}{-0.6625}\bigg| \times 100\% = 118.87\% \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) \) $$ \begin{equation*} f'(0.5) = -1.154688 + \bigl[ -1.154688 - (-1.45) \bigr] = -0.859376 \end{equation*} $$
Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-0.859376 - (-1.154688)}{-0.859376}\bigg| \times 100\% = 34.36\% \end{equation*} $$
Extrapolación \( \mathcal{O}(h^{2}) \) $$ \begin{equation*} f'(0.5) = -0.859376 + \frac{1}{3} \bigl[ -0.859376 - (-0.6625) \bigr] = -0.925001 \end{equation*} $$
Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-0.925001 - (-0.859376)}{-0.925001}\bigg| \times 100\% = 7.09\% \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) \) $$ \begin{equation*} f'(0.5) = -1.027539 + \bigl[ -1.027539 - (-1.154688) \bigr] = -0.900390 \end{equation*} $$
Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-0.900390 - (-1.027539)}{-0.900390}\bigg| \times 100\% = 14.12\% \end{equation*} $$
Extrapolación \( \mathcal{O}(h^{2}) \) $$ \begin{equation*} f'(0.5) = -0.900390 + \frac{1}{3} \bigl[ -0.900390 - (-0.859376) \bigr] = -0.914061 \end{equation*} $$
Error relativo $$ \begin{equation*} e_{r} = \bigg|\frac{-0.914061 - (-0.900390)}{-0.914061}\bigg| \times 100\% = 1.5\% \end{equation*} $$
Extrapolación \( \mathcal{O}(h^{3}) \) $$ \begin{equation*} f'(0.5) = -0.914061 + \frac{1}{7} \bigl[ -0.914061 - (-0.925001) \bigr] = -0.912498 \end{equation*} $$
Error relativo $$ \begin{equation*} e_{r} = \bigg| \frac{-0.912498 - (-0.914061)}{-0.912498} \bigg| \times 100\% = 0.17\% \end{equation*} $$
Resumiendo los resultados en una matriz $$ \begin{equation*} \begin{array}{c|cccc} h & f'(0.5) & \mathcal{O}(h) & \mathcal{O}(h^{2}) & \mathcal{O}(h^{3}) \\ \hline 1 & -2.2375 & & & \\ 0.5 & -1.45 & -0.6625 & & \\ 0.25 & -1.154688 & -0.859376 & -0.925001 & \\ 0.125 & -1.027539 & -0.900390 & -0.914061 & -0.912498 \end{array} \end{equation*} $$
Lo anterior puede escribirse como $$ \begin{equation*} \begin{matrix} \mathcal{O}(h) & \mathcal{O}(h^{2}) & \mathcal{O}(h^{3}) & \mathcal{O}(h^{4}) \\ \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*} $$
Primer patrón $$ \begin{equation*} \begin{matrix} \mathcal{O}(h) & \mathcal{O}(h^{2}) & \mathcal{O}(h^{3}) & \mathcal{O}(h^{4}) \\ \hline N_{(\color{blue}{1},1)} = N(h) & & & \\ N_{(\color{green}{2},1)} = N \bigl( \frac{h}{2} \bigr) & N_{(\color{green}{2},2)} = N_{(\color{green}{2},1)} + \frac{1}{2^{2-1} - 1} \bigl[ N_{(\color{green}{2},1)} - N_{(\color{green}{2}-1,1)} \bigr] & & \\ N_{(\color{red}{3},1)} = N \bigl( \frac{h}{4} \bigr) & N_{(\color{red}{3},2)} = N_{(\color{red}{3},1)} + \frac{1}{2^{2-1} - 1} \bigl[ N_{(\color{red}{3},1)} - N_{(\color{red}{3}-1,1)} \bigr] & N_{(\color{red}{3},3)} = N_{(\color{red}{3},2)} + \frac{1}{2^{3-1} - 1} \bigl[ N_{(\color{red}{3},2)} - N_{(\color{red}{3}-1,2)} \bigr] & \\ N_{(\color{fuchsia}{4},1)} = N \bigl( \frac{h}{8} \bigr) & N_{(\color{fuchsia}{4},2)} = N_{(\color{fuchsia}{4},1)} + \frac{1}{2^{2-1} - 1} \bigl[ N_{(\color{fuchsia}{4},1)} - N_{(\color{fuchsia}{4}-1,1)} \bigr] & N_{(\color{fuchsia}{4},3)} = N_{(\color{fuchsia}{4},2)} + \frac{1}{2^{3-1} - 1} \bigl[ N_{(\color{fuchsia}{4},2)} - N_{(\color{fuchsia}{4}-1,2)} \bigr] & N_{(\color{fuchsia}{4},4)} = N_{(\color{fuchsia}{4},3)} + \frac{1}{2^{4-1} - 1} \bigl[ N_{(\color{fuchsia}{4},3)} - N_{(\color{fuchsia}{4}-1,3)} \bigr] \end{matrix} \end{equation*} $$
Lo anterior puede escribirse como $$ \begin{align*} N_{(i,?)} &= N(h) \\ N_{(i,?)} &= N_{(i,?)} + \frac{1}{2^{?-1} - 1} \bigl[ N_{(i,?)} - N_{(i-1,?)} \bigr] \end{align*} $$
para \( i = 1, 2, 3, 4 = 1, \dots, m \)
Segundo patrón $$ \begin{equation*} \begin{matrix} \mathcal{O}(h) & \mathcal{O}(h^{2}) & \mathcal{O}(h^{3}) & \mathcal{O}(h^{4}) \\ \hline N_{(1,\color{blue}{1})} = N(h) & & & \\ N_{(2,\color{blue}{1})} = N \bigl( \frac{h}{2} \bigr) & N_{(2,\color{green}{2})} = N_{(2,\color{green}{2}-1)} + \frac{1}{2^{\color{green}{2}-1} - 1} \bigl[ N_{(2,\color{green}{2}-1)} - N_{(1,\color{green}{2}-1)} \bigr] & & \\ N_{(3,\color{blue}{1})} = N \bigl( \frac{h}{4} \bigr) & N_{(3,\color{green}{2})} = N_{(3,\color{green}{2}-1)} + \frac{1}{2^{\color{green}{2}-1} - 1} \bigl[ N_{(3,\color{green}{2}-1)} - N_{(2,\color{green}{2}-1)} \bigr] & N_{(3,\color{red}{3})} = N_{(3,\color{red}{3}-1)} + \frac{1}{2^{\color{red}{3}-1} - 1} \bigl[ N_{(3,\color{red}{3}-1)} - N_{(2,\color{red}{3}-1)} \bigr] & \\ N_{(4,\color{blue}{1})} = N \bigl( \frac{h}{8} \bigr) & N_{(4,\color{green}{2})} = N_{(4,\color{green}{2}-1)} + \frac{1}{2^{\color{green}{2}-1} - 1} \bigl[ N_{(4,\color{green}{2}-1)} - N_{(3,\color{green}{2}-1)} \bigr] & N_{(4,\color{red}{3})} = N_{(4,\color{red}{3}-1)} + \frac{1}{2^{\color{red}{3}-1} - 1} \bigl[ N_{(4,\color{red}{3}-1)} - N_{(3,\color{red}{3}-1)} \bigr] & N_{(4,\color{fuchsia}{4})} = N_{(4,\color{fuchsia}{4}-1)} + \frac{1}{2^{\color{fuchsia}{4}-1} - 1} \bigl[ N_{(4,\color{fuchsia}{4}-1)} - N_{(3,\color{fuchsia}{4}-1)} \bigr] \end{matrix} \end{equation*} $$
Lo anterior puede escribirse como $$ \begin{align*} N_{(i,1)} &= N(h) \\ N_{(i,j)} &= N_{(i,j-1)} + \frac{1}{2^{j-1} - 1} \bigl[ N_{(i,j-1)} - N_{(i-1,j-1)} \bigr] \end{align*} $$
para $$ \begin{align*} j &= 2 \\ &= 2, 3 \\ &= 2, 3, 4 \end{align*} $$
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}{2^{j-1} - 1} \bigl[ N_{(i,j-1)} - N_{(i-1,j-1)} \bigr] \\ h &= \frac{h}{2} \end{align*} $$
function extrapolacion_Richarson_n(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))/(2^(j-1) - 1)
end for
h = h/2
end for
return N
end function
import numpy as np
def g(x):
resultado = - 0.1*x**4 - 0.15*x**3 - 0.5*x**2 - 0.25*x + 1.2
return resultado
def diferencia_adelante(f,x,h):
derivada = (f(x+h) - f(x))/h
return derivada
def extrapolacion_Richarson_n(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])/(2**j - 1)
h = h/2
return N
A = extrapolacion_Richarson_n(g,0.5,1.0)
print(A)
[[-2.2375 0. 0. 0. ]
[-1.45 -0.6625 0. 0. ]
[-1.1546875 -0.859375 -0.925 0. ]
[-1.02753906 -0.90039062 -0.9140625 -0.9125 ]]