Escolar Documentos
Profissional Documentos
Cultura Documentos
Com este documento pretendo apoiar a aula que será transmitida online e que podem aceder
através do link
https://videoconf-colibri.zoom.us/j/93954142388
O documento estará no moodle em formato word e cada aluno pode utilizá-lo para tirar dúvidas.
Peço que leiam atentamente o documento, tentem também resolver os exercícios (aproveitando
para treinar a máquina de calcular) e se surgir dúvidas entrem em contato comigo por e-mail, Skype
ou por um chat no moodle.
Parte III-Proposta de resolução de um exercício- Exercício para resolver sozinhos recorrendo aos
exemplos anteriores sem resolução com solução final.
Nota – o que está em azul são comentários que na aula seriam falados a preto e outras cores o que
seria escrito no quadro.
1
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
Nesta aula vamos apenas estudar apenas casos em que os pontos são igualmente espaçados, o
espaçamento entre os pontos (intervalo tabelar)
Definição
Δ0 f ( x k )=f ( x k )
Δr f ( x k ) =Δr−1 f ( x k +h )−Δ r−1 f ( x k )
r
onde
Δ f ( xk ) é a diferença ordinária de f de ordem r em
x=x k .
f n+1 x0 , x1 , , xn .
Seja uma função tabelada em pontos distintos,
2 Δ 2 f ( xi ) =Δ 1 f ( x i +h )−Δ 1 f (x i) Δ 2 f ( x0 ) =Δ 1 f ( x1 ) −Δ 1 f ( x 0)
3 Δ 3 f ( xi ) =Δ 2 f ( xi +h )−Δ 2 f (x i) Δ 3 f ( x 0 )=Δ 2 f ( x1 ) −Δ 2 f ( x 0)
Ordem zero
2
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
x0 Δ 0 f ( x ¿¿ 0)=f ( x 0) ¿
x1 Δ 0 f ( x ¿¿ 1)=f (x ¿¿ 1)¿ ¿
x2 Δ 0 f ( x ¿¿ 2) ¿=
f (x¿ ¿2)¿
x3 Δ 0 f ( x ¿¿ 3)=f ( x¿ ¿3) ¿ ¿
x4 Δ 0 f (x ¿¿ 4)¿=
f (x¿ ¿ 4) ¿
x5 Δ 0 f ( x ¿¿ 5)¿=
f (x¿ ¿5)¿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 f ( x 2)
x4 Δ 0 f ( x ¿¿ 4) ¿ Δ 2 f ( x3 )
Δ1 f ( x 4 )
x5 Δ 0 f ( x ¿¿ 5)¿=
7
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
Ordem 5
x 0 1 2 3 4 5
x0 Δ 0 f ( x ¿¿ 0)¿
Δ 1 f ( x0 )
x1 Δ 0 f ( x ¿¿ 1)¿ Δ 2 f ( x0 )
Δ 1 f ( x1 ) Δ3 f ( x 0 )
x2 Δ 0 f ( x ¿¿ 2) ¿ Δ 2 f ( x1 ) Δ 4 f ( x 0 ) =Δ3 f ( x 1 )− Δ3 f ( x 0 )
Δ 1 f ( x2 ) Δ 3 f ( x1 ) Δ 5 f ( x 0 )=Δ 4 f ( x 1 )− Δ4 f (x 0)
x3 Δ 0 f ( x ¿¿ 3)¿ Δ 2 f ( x2 ) Δ 4 f ( x 1 )= Δ3 f ( x 2 )− Δ3 f (x 1 )
Δ 1 f ( x3 ) Δ 3 f ( x 2)
x4 Δ 0 f ( x ¿¿ 4) ¿ Δ 2 f ( x3 )
Δ1 f ( x 4 )
x5 Δ 0 f ( x ¿¿ 5)¿=
8
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
xi
…
Ordem 0 Ordem 1 Ordem 2 Ordem 3 Ordem n
x0 f [ x0 ]
1
Δ f [ x 0]
x1 f [ x 1] 2
Δ f [ x 0]
1 3
Δ f [ x 1] Δ f [ x0 ] ⋱
x2 f [ x2 ] 2 n
Δ f [ x 1] Δ f [ x0 ]
1 3
Δ f [ x 2] Δ f [ x1] ⋰
2
x3 f [ x3 ] Δ f [ x 2]
1
Δ f [ x3] ⋰
x4 f [ x4 ] ⋮
9
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
10
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
Exercício 8
x 0 1 2 3
−1 3
0 1
1 -1
2 0
Ordem um
x 0 1 2 3
−1 3
1-3=-2
0 1
-1-1=-2
1 -1
0-(-1)=1
2 0
11
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
Ordem dois
x 0 1 2 3
−1 3
1-3=-2
0 1 -2-(-2)=0
-1-1=-2
1 -1 1-(-2)=3
0-(-1)=1
2 0
Ordem três
x 0 1 2 3
−1 3
1-3=-2
0 1 -2-(-2)=0
-1-1=-2 3-0=3
1 -1 1-(-2)=3
0-(-1)=1
2 0
12
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
Vamos então tentar construir o polinómio com base nestes valores. Relembro que na última aula
vimos que:
pn ( x )=d 0 +d 1 ( x−x 0 ) +d 2 ( x−x 0 )( x−x 1 ) +…+ d n ( x−x 0 )( x−x 1 ) … ( x−x n−1 )
Com
d 0 f x0
d1 f x0 , x1
…
d k =f [ x 0 , x 1 ,… , x k ] , k =0,1 ,…, n
ordem 0 d0
d 0 f x0 f x0 0 f x0
ordem 1 d1
f x1 f x0 0 f x1 0 f ( x0 ) f x0
d1 f x0 , x1
x1 x0 h h
h
f xk
f xk , xk 1
h
ordem 2 d2
13
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
f x1 f x0 2 f x0
f x1 , x2 f x0 , x1 2 f x0
d 2 f x0 , x1 , x2 h h h
x2 x0 2h 2h 2h 2
2 f xk
f xk , xk 1 , xk 2
2h 2
ordem 3 d3
f x1 , x2 , x3 f x0 , x1 , x2 f x1 , x2 , x3 f x0 , x1 , x2
d3 f x0 , x1 , x2 , x3
x3 x0 3h
2 f x1 2 f x0 2 f x1 2 f x0 3 f x0
3 f x0
2h 2 2h 2 2h 2 2h
2
3h 3h 3h 3 2h 3
3 f xk
f xk , xk 1 , xk 2 , xk 3
3 2h 3
Se fossemos para a ordem 4 , poderíamos tentar intuir que no numerador ficaríamos com duas
diferenças de ordem 3, e no denominador iriamos ter ainda de multiplicar por 4h, então
ordem n dn
n f x0
d n f x0 , x1 , , xn
n! hn
E em geral
Teorema
Sejam
x 0 , x 1 ,…, x n , n+1 pontos distintos em [ a,b ] tais que
x i−x i−1 =h ,
i=1,2,…,n .
14
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
Δn f ( x k )
f [ x k , x k +1 ,…, x k +n ]=
n! hn .
Substituindo em
f x0 2 f x0 n f x0
pn x f x0 x x0 x x0 x x1 x x0 x x1 x xn1
h 2! h 2 n! hn .
Exercício
15
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
f (x) 3 1 -1 0
b) Determinar o polinómio interpolador de Newton-Gregory.
E o polinómio por:
Ou seja
2 0 3
p3 ( x ) =3− ( x +1 ) + 2 ( x+1 )( x )+
1 1 ∗2 (1¿¿ 3∗3 !)( x−1) ( x +1 ) ( x ) ¿
2) Não podemos escolher, por exemplo os pontos {−1,0,1 }, porque nós estamos a interpolar,
isto é o ponto (1.1) tem de estar entre o primeiro e último ponto.
16
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
2 3
p2 ( x ) =1− x+ 2 ( x−1) ( x ) então
1 1 ∗2
2 3
p2 (1.1 ) =1− ( 1.1 ) + 2 ( 1.1−1 ) ( 1.1 )=−1.035
1 1 ∗2
Dada a tabela
x
0 0,1 0,2 0,3 0,4 0,5
3x
e 1 1,35 1,82 2,46 3,32 4,48
a) Fazer a tabela das diferenças ordinárias.
d) Calcular usando a forma de Newton-Gregory de grau 2 uma aproximação de f (0.25).
a)
os pontos adequados podem ser: [[0.1, 0.2, 0.3], [0.2, 0.3, 0.4]]
Usei X= [0.1, 0.2, 0.3]
Exercicio
17
Aula 23 –Diferenças Ordinárias & Fórmula de Newton-Gregory (6-5-2020)
18