Download - Mn aula06-interpolacao
![Page 1: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/1.jpg)
Interpolação
![Page 2: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/2.jpg)
A necessidade de obter um valor intermediário que não consta de uma tabela ocorre comumente
Dados experimentais, tabelas estatísticas e de funções complexas são exemplos desta situação.
Como obter estes dados?
![Page 3: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/3.jpg)
Dado um conjunto de dados {xi,f(xi)} tal como na
tabela abaixo:
Como obter o valor de f(x) para um valor de x que não tenha sido medido, como x=2.0 ?
Quando se deseja saber o valor de f(x) para um x intermediário entre duas medidas, isto é, xi<x<xi+1,
pode-se usar as técnicas da interpolação
0,057 0,046 0,028 0,016 0,001 f(xi)
6,04,53,01,50xi
![Page 4: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/4.jpg)
A interpolação consiste em determinar uma função, que assume valores conhecidos em certos pontos (nós de interpolação)
A classe de funções escolhida para a interpolação é a priori arbitrária, e deve ser adequada às características que pretendemos que a função possua
Função a ser considerada: Polinômios ⇒ Interpolação Polinomial
![Page 5: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/5.jpg)
Métodos de interpolação polinomial são utilizados para aproximar uma função f(x), principalmente nas seguintes situações:conhece-se apenas valores de f(x) em
apenas pontos discretos x0, x1 , x2 , ...
f(x) é extremamente complicada e de difícil manejo
f(x) não é conhecida explicitamente
![Page 6: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/6.jpg)
A interpolação por meio de polinômios consiste em:
Interpolar um ponto x a um conjunto de n+1 dados {xi,f(xi)}, significa calcular o valor de f(x), sem conhecer a forma analítica de f(x) ou ajustar uma função analítica aos dados
![Page 7: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/7.jpg)
Interpolação polinomial consiste em se obter um polinômio p(x) que passe por todos os pontos do conjunto de (n+1) dados {xi,f(xi)}, isto é:
p(x0)=f(x0)
p(x1)=f(x1)
…
p(xn)=f(xn)
Obs: contagem começa em zero, portanto tem-se n+1 pontos na expressão
![Page 8: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/8.jpg)
Polinômio p(x) - polinômio interpoladorPode-se demonstrar que existe um único
polinômio p(x) de grau menor ou igual a n que passa por todos os (n+1) pontos do conjunto {xi,f(xi)}( ) ( )p x a a x a x a x f x
n n
n
0 0 1 0 2 0
2
0 0= + ⋅ + ⋅ + + ⋅ = ...
( ) ( )p x a a x a x a x f xn n
n
1 0 1 1 2 1
2
1 1= + ⋅ + ⋅ + + ⋅ = ...
( ) ( )p x a a x a x a x f xn n n n n n
n
n= + ⋅ + ⋅ + + ⋅ =
0 1 2
2 ......
![Page 9: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/9.jpg)
O conjunto de equações corresponde a um sistema linear de n+1 equações e n+1 variáveis
Quais são as variáveis independentes? ai
ou xi ?Poderia ser resolvido diretamenteEssa é uma das formas de se obter o
polinômio interpolador
![Page 10: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/10.jpg)
xxxx
yyyxP
y
y
a
a
x
x
yxaa
yxaa
yxP
yxP
xaaxPxf
)()(
1
1
)(
)(
)()(
001
0101
1
0
1
0
1
0
1110
0010
111
001
101
−−−+=
=
⇔
=+=+
==
+=≈
![Page 11: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/11.jpg)
Problema
Determinar o polinômio interpolador através da resolução de um sistema linear é caro computacionalmente
Outros modos de se obter o polinômio:LagrangeNewton
![Page 12: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/12.jpg)
Seja um conjunto de n+1 dados {xi,f(xi)}.
Encontrar um polinômio interpolador p(x) que passe por todos os pontos
p x L x f x L x f x L x f xn n( ) ( ) ( ) ( ) ( ) ( ) ( )= ⋅ + ⋅ + + ⋅0 0 1 1 ...
Lk(x) são polinômios tais que:
( )L xk i ki= δ sendo que:
δki
se k i
se k i=
≠=
0
1
,
,
![Page 13: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/13.jpg)
( ) ( ) ( ) ( ) ( )( ) ( ) ( ) ( ) ( )L x
x x x x x x x x x x
x x x x x x x x x xk
k k n
k k k ki k ki k n
( ) =− ⋅ − ⋅ ⋅ − ⋅ − ⋅ ⋅ −
− ⋅ − ⋅ ⋅ − ⋅ − ⋅ ⋅ −− +
− +
0 1 1 1
0 1 1 1
... ... ... ...
( )( )
L x e
L x se i k
k k
k i
=
= ≠
1
0 ,
Pois:
![Page 14: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/14.jpg)
Interpolação Linear
Interpolação para 2 pontos (n+1=2) -
ajuste de retas (n=1) (Interpolação Linear) xi x0 x1
f(xi) f(x0) f(x1)
∑=
+==1
01100 )().()().()().()(
iii xfxLxfxLxfxLxp
![Page 15: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/15.jpg)
Ajuste uma reta aos seguintes pontos (x;f(x)): (2; 3,1) e (4; 5,6)
( ) ( ) ( )101
00
10
1 xfxx
xxxf
xx
xxxp ⋅
−−
+⋅
−−
=
![Page 16: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/16.jpg)
Ajuste uma reta aos seguintes pontos (x;f(x)): (2; 3,1) e (4; 5,6)
( ) ( ) ( )101
00
10
1 xfxx
xxxf
xx
xxxp ⋅
−−
+⋅
−−
=
( ) ( ) ( )28.2455.16.524
21.3
42
4 −⋅+−⋅−=⋅
−−+⋅
−−= xx
xxxp
( ) 6.025.1 +⋅= xxp
![Page 17: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/17.jpg)
Forma de Newton
( )))...()((
...))(()(
021
012010
xxxxxxd
xxxxdxxddxp
nnn −−−++−−+−+=
−−
dn -> é o operador diferença dividida
![Page 18: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/18.jpg)
Diferenças divididas
)(][ 00 xfxf =
01
01
01
011,0
)()(][][][
xx
xfxf
xx
xfxfxxf
−−=
−−=
02
1,02,12,1,0
][][][
xx
xxfxxfxxxf
−−=
03
2,1,03,2,13,2,1,0
][][][
xx
xxxfxxxfxxxxf
−−=
Ordem 0
Ordem 1
Ordem 2
Ordem 3
![Page 19: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/19.jpg)
][ 1xf
][ 2xf
][ 3xf
][ nxf
][ 0xf][ 1,0 xxf
][ 2,1 xxf
][ 3,2 xxf
][ 2,1,0 xxxf
][ 3,2,1 xxxf
...
...
Ordem 0 Ordem 1 Ordem 2
![Page 20: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/20.jpg)
Exemplo
Calcule a tabela de diferenças divididas para os seguintes valores:
x -1 0 1 2 3
F(x) 1 1 0 -1 -2
![Page 21: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/21.jpg)
1
0
1 - 1/2
-1 1/6
0 0 - 1/24
-1 0
-1 0
-1
-2
![Page 22: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/22.jpg)
Mas qual o valor de d?
],...,[
],,[
],[
)(
10
2102
101
00
nn xxxfd
xxxfd
xxfd
xfd
====
![Page 23: Mn aula06-interpolacao](https://reader034.vdocuments.pub/reader034/viewer/2022052623/559e95cc1a28ab0b3d8b4820/html5/thumbnails/23.jpg)
Assim,
( )
))...()(](,...,[
...))(](,,[
)](,[)(
02110
01210
0100
xxxxxxxxxf
xxxxxxxf
xxxxfxfxp
nnn −−−++−−+−+=
−−