Diferença Finita

Muitas vezes encontramos problemas de interpolação cuja tabela de valores conhecidos tem os valores de \(x_i(i = 0, 1, 2, \ldots, n)\) igualmente espaçados

Assim, \(x_{i+1} - x_i = h\), para todo \(i\), sendo \(h\) uma constante.

Dessa forma, a construção da Tabela de Diferenças finitas fica:

  • De ordem zero: \(\Delta^0_{y_i} = y_i\)
  • De primeira ordem: \(\Delta^1_{y_i} = y_{i+1} - y_i = \Delta^0_{y_{i+1}} -\Delta^0_{y_{i}}\)
  • De segunda ordem: \(\Delta^2_{y_i} = \Delta^1_{y_{i+1}} -\Delta^1_{y_{i}} \)

De forma genérica:

Exemplo 1

Dados os pontos:

x \( 1\) \( 2\) \( 3\)
y \(-2\) \(2\) \(10\)

A matriz de diferenças finitas:

\(x\) \(f(x)\) \(\Delta^1_{y_i}\) \(\Delta^2_{y_i}\)
\(1\) \(-2\) \(f[x_0,x_1] = 2-(-2) = 4 \) \(f[x_0,x_1,x_2] = 8-4 = 4\)
\(2\) \(2\) \(f[x_1,x_2] = 10-2 = 8\)  
\(3\) \(10\)    

Resultando na tabela final:

\(x\) \(f(x)\) \(\Delta^1_{y_i}\) \(\Delta^2_{y_i}\)
\(1\) \(-2\) \(4\) \(4\)
\(2\) \(2\) \(8\)  
\(3\) \(10\)    

Exemplo 2

Veja outro exemplo.
Pontos:

x \( 0\) \( 0.5\) \( 1\) \( 1.5\) \( 2\)
y \(2\) \(2\) \(2\) \(-1.75\) \(-16\)

E a construção da tabela de Diferenças Finitas:

\(x\) \(f(x)\) \(\Delta^1_{y_i}\) \(\Delta^2_{y_i}\) \(\Delta^3_{y_i}\) \(\Delta^4_{y_i}\)
\(0\) \(2\) \(f[x_0,x_1] = 2-2 = 0\) \(f[x_0,x_1,x_2] = 0-0 = 0\) \(f[x_0,x_1,x_2,x_3] = -3.75-0 = -3.75\) \(f[x_0,x_1,x_2,x_3,x_4] = -6.75-(-3.75) = -3\)
\(0.5\) \(2\) \(f[x_1,x_2] = 2-2 = 0\) \(f[x_1,x_2,x_3] = -3.75-0 = -3.75\) \(f[x_1,x_2,x_3,x_4] = -10.5-(-3.75) = -6.75\)  
\(1\) \(2\) \(f[x_2,x_3] = -1.75-2 = -3.75\) \(f[x_2,x_3,x_4] = -14.25-(-3.75) = -10.5\)    
\(1.5\) \(-1.75\) \(f[x_3,x_4] = -16-(-1.75) = -14.25\)      
\(2\) \(-16\)        

Resultado na tabela final:

\(x\) \(f(x)\) \(\Delta^1_{y_i}\) \(\Delta^2_{y_i}\) \(\Delta^3_{y_i}\) \(\Delta^4_{y_i}\)
\(0\) \(2\) \(0\) \(0\) \(-3.75\) \(-3\)
\(0.5\) \(2\) \(0\) \(-3.75\) \(-6.75\)  
\(1\) \(2\) \(-3.75\) \(-10.5\)    
\(1.5\) \(-1.75\) \(-14.25\)      
\(2\) \(-16\)        

Programação em HP PPL

Para obter a tabela de Diferenças Finitas na HP PRIME, temos o programa:

EXPORT div_finita() 
BEGIN
	PRINT();
	LOCAL matriz;
	LOCAL tamanho, i, j;
	M1 := [[0, 0.5, 1, 1.5, 2], [2, 2, 2, -1.75, -16]]; //Pontos em M1
	matriz := transpose(M1);
	tamanho := SIZE(matriz);
	M2 := transpose(row(M1, 2));
	FOR i FROM 2 TO tamanho(1) DO
  		FOR j FROM 1 TO tamanho(1)-i+1 DO
  			M2(j, i):=(M2(j+1, i-1)-M2(j, i-1));
  		END;
	END;
    	MSGBOX("Resultado em M2:");
  	EDITMAT(M2);
END;

Atividade

Determine a tabela de diferenças finita dos pontos:

  • \[ \begin{matrix} \textbf{x} &-1 &0.5 &2 \\ \hline \textbf{y} &-3 &-0.75 &-3 \end{matrix} \]
  • \[ \begin{matrix} \textbf{x} &-1 &0 &1 &2 \\ \hline \textbf{y} &3 &1 &-1 &-15 \end{matrix} \]
  • \[ \begin{matrix} \textbf{x} &0 &0.5 &1 &1.5 &2 \\ \hline \textbf{y} &-2 &-2.5 &-4 &-10.25 &-28 \end{matrix} \]