Baixe o app para aproveitar ainda mais
Prévia do material em texto
Cálculo Numérico Interpolação Lauro / Nunes 1 1. Determine iL ( kx ) para i =0,1,2, k =0,1,2 e n =2. Resolução: i =0 Þ 0L ( x )= ))(( ))(( 2010 21 xxxx xxxx -- -- k =0 Þ 0L ( 0x )=1 k =1 Þ 0L ( 1x )=0 k =2 Þ 0L ( 2x )=0 i =1 Þ 1L ( x )= ))(( ))(( 2101 20 xxxx xxxx -- -- k =0 Þ 1L ( 0x )=0 k =1 Þ 1L ( 1x )=1 k =2 Þ 1L ( 2x )=0 · i =2 Þ 2L ( x )= ))(( ))(( 1202 10 xxxx xxxx -- -- k =0 Þ 2L ( 0x )=0 k =1 Þ 2L ( 1x )=0 k =2 Þ 2L ( 2x )=1 Cálculo Numérico Interpolação Lauro / Nunes 2 2. Interpolar o ponto x =1,5 na tabela abaixo, empregando o polinômio interpolador de Lagrange. i 0 1 2 3 ix -1 0 1 2 iy 1 3 1 1 Resolução: n =3 é o grau máximo de 3P ( x ). 3P ( x )=å = 3 0i ii xLy )( Þ 3P ( x )=1× 0L ( x )+3× 1L ( x )+1× 2L ( x )+1× 3L ( x ) iL ( x )=Õ ¹ = - -3 0 ij j ji j xx xx )( )( 0L ( x )= ))()(( ))()(( 302010 321 xxxxxx xxxxxx --- --- = ))()(( ))()(( 211101 210 ------ --- xxx = 6 23 23 - +- xxx 1L ( x )= ))()(( ))()(( 312101 320 xxxxxx xxxxxx --- --- = ))()(( ))()(( 201010 211 --+ --+ xxx = 2 22 23 +-- xxx 2L ( x )= ))()(( ))()(( 321202 310 xxxxxx xxxxxx --- --- = ))()(( ))()(( 210111 201 --+ --+ xxx = 2 223 - -- xxx 3L ( x )= ))()(( ))()(( 231303 210 xxxxxx xxxxxx --- --- = ))()(( ))()(( 120212 101 --+ --+ xxx = 6 3 xx - Logo: 3P ( x )= 6 23 23 - +- xxx +3× 2 22 23 +-- xxx + 2 223 - -- xxx + 6 3 xx - Þ 3P ( x )= 3x -2 2x - x +3 3P (1,5)= 3P ( 2 3 )= 32 3 )( -2 22 3 )( - 2 3 +3 3P (1,5)= 8 27 - 2× 4 9 - 2 3 +3 3P (1,5)= 8 3 Þ 3P (1,5)=0,375 y x x( )P 1 3 -1 2 2 1 3 3 2 3 8 0 Cálculo Numérico Interpolação Lauro / Nunes 3 3. Interpolar o ponto x =1,5 na tabela abaixo, empregando a forma de Newton. i 0 1 2 3 ix -1 0 1 2 iy 1 3 1 1 Resolução: n =3 é o grau máximo de 3P ( x ). Tabela de diferenças divididas: x ordem 0 ordem 1 ordem 2 ordem 3 -1 1 )( 10 13 -- - =2 0 3 )( 11 22 -- -- =-2 01 31 - - =-2 )( )( 12 21 -- -- =1 1 1 02 20 - -- )( =1 12 11 - - =0 2 1 3P ( x )= f [ 0x ]+( x - 0x )× f [ 0x , 1x ]+( x - 0x )×( x - 1x )× f [ 0x , 1x , 2x ]+ +( x - 0x )×( x - 1x )×( x - 2x )× f [ 0x , 1x , 2x , 3x ] 3P ( x )=1+( x +1)×2+( x +1)×( x )×(-2)+( x +1)×( x )×( x -1)×(1) 3P ( x )=1+2 x +2-2 2x -2 x + 3x - x 3P ( x )= 3x -2 2x - x +3 Cálculo Numérico Interpolação Lauro / Nunes 4 4. Seja f ( x ) dada em forma de tabela de valores, como segue: x 0,2 0,34 0,4 0,52 0,6 0,72 f ( x ) 0,16 0,22 0,27 0,29 0,32 0,37 · a) Obter f (0,47) usando um polinômio de grau 2; · b) Dar uma estimativa para o erro. Resolução: Tabela de diferenças divididas: x ordem 0 ordem 1 ordem 2 ordem 3 0,2 0,16 0,4286 0,34 0,22 2,0235 0,8333 -17,8963 0,4 0,27 -3,7033 0,1667 18,2494 0,52 0,29 1,0415 0,375 -2,6031 0,6 0,32 0,2085 0,4167 0,72 0,37 Deve-se escolher 3 pontos próximos de 0,47 para a obtenção de 2P ( x ). 2P ( x )= f [ 0x ]+( x - 0x )× f [ 0x , 1x ]+( x - 0x )×( x - 1x )× f [ 0x , 1x , 2x ] 2P ( x )=0,27+( x -0,4)×0,1667+( x -0,4)×( x -0,52)×1,0415 2P ( x )=1,0415 2x -0,79148 x +0,419952 · a) 2P (0,47)=0,278» f (0,47) · b) | nE (0,47)|»|(0,47-0,4)(0,47-0,52)(0,47-0,6)|×|18,2492| | nE (0,47)|»8,303× 310- . Cálculo Numérico Interpolação Lauro / Nunes 5 5. Prove a igualdade seguinte. 1P ( x )= f ( 0x )× 10 1 xx xx - - + f ( 1x )× 01 0 xx xx - - = f [ 0x ]+( x - 0x )× f [ 0x , 1x ] Resolução: x ordem 0 ordem 1 0x f [ 0x ]= 0y f [ 0x , 1x ]= 01 01 xx yy - - 1x f [ 1x ]= 1y Þ 1P ( x )= f [ 0x ]+( x - 0x )× f [ 0x , 1x ] 1P ( x )= f [ 0x ]+( x - 0x )× f [ 0x , 1x ] Û 1P ( x )= 0y +( x - 0x )× 01 01 xx yy - - Û 1P ( x )= 0y + 1y × 01 0 xx xx - - - 0y × 01 0 xx xx - - Û 1P ( x )= 0y - 0y × 01 0 xx xx - - + 1y × 01 0 xx xx - - Û 1P ( x )= 0y × çç è æ 1- ÷÷ ø ö - - 01 0 xx xx + 1y × 01 0 xx xx - - Û 1P ( x )= 0y × ÷÷ ø ö çç è æ - +-- 01 001 xx xxxx + 1y × 01 0 xx xx - - Û 1P ( x )= 0y × 01 1 xx xx - - + 1y × 01 0 xx xx - - Û 1P ( x )= f ( 0x )× 10 1 xx xx - - + f ( 1x )× 01 0 xx xx - - 6. Encontre x tal que f ( x )=2 pela tabela abaixo: x 0,5 0,6 0,7 0,8 0,9 1,0 f ( x ) 1,65 1,82 2,01 2,23 2,46 2,72 Resolução: Fazendo interpolação linear por 0x =0,6 e 1x =0,7: 1P ( x )= f ( 0x )× 10 1 xx xx - - + f ( 1x )× 01 0 xx xx - - 1P ( x )=1,82× 10 70 , , - -x +2,01× 10 60 , ,-x 1P ( x )=-1,82 x +12,74+20,1 x -12,06 Þ 1P ( x )=1,9 x +0,68. 1P ( x )=2 Û 1,9 x +0,68=2 Û x = 91 6802 , ,- x =0,6947368. Cálculo Numérico Interpolação Lauro / Nunes 6 7. Considere a tabela a seguir: x 0 0,1 0,2 0,3 0,4 0,5 y = xe 1 1,1052 1,2214 1,3499 1,4918 1,6487 Obter x , tal que xe =1,3165, usando um processo de interpolação quadrática. Usar a forma de Newton para obter 2P ( y ). Construir a tabela de diferenças divididas. Resolução: y ordem 0 ordem 1 ordem 2 ordem 3 1 0 0,9506 1,1052 0,1 -0,4065 0,8606 0,1994 1,2214 0,2 -0,3367 0,7782 0,1679 1,3499 0,3 -0,2718 0,7047 0,1081 1,4918 0,4 -0,2256 0,6373 1,6487 0,5 2P ( y )= g [ 0y ]+( y - 0y )× g [ 0y , 1y ]+( y - 0y )×( y - 1y )× g [ 0y , 1y , 2y ] 2P ( y )=0,2+( y -1,2214)×0,7782+( y -1,2214)×( y -1,3499)×(-0,2718) 2P (1,3165)=0,27487. Assim, 274870,e »1,3165 Na calculadora = 1,316359. Erro cometido: | 2E ( y )| £ |( y - 0y )×( y - 1y )×( y - 2y )|× !3 3M | 2E (1,3165)| £ |(1,3165-1,2214)×(1,3165-1,3499)×(1,3165-1,4918)|× !3 3M | 2E (1,3165)| £ 5,5681× 410- × !3 3M Þ 3M = )('''max yg , y Î[ 0y , 2y ]. · 1o Caso: !3 3M pode ser aproximado por 0,1994 (tabela de diferenças divididas de ordem 3). | 2E (1,3165)| » 5,5681× 410- ×0,1994 Þ | 2E ( y )| » 1,11028× 410- . · 2o Caso: f ( x )= xe Þ g ( y )= 1-f ( y )= yln Þ 'g ( y )= y 1 Þ "g ( y )=- 2 1 y Þ '"g ( y )= 3 2 y Logo: 3M = 322141 2 ),( Þ 3M =1,0976, então !3 3M = ! , 3 09761 =0,18293. | 2E (1,3165)| £ 5,5681× 410- ×0,18293 Þ | 2E ( y )| £ 1,0186× 410- (limite superior). Cálculo Numérico Interpolação Lauro / Nunes 7 8. Achar a função spline linear que interpola a função f ( x ) tabelada a seguir. 0x 1x 2x 3x x 1 2 5 7 y = f ( x ) 1 2 3 2,5 y x x( )s 1 1 1 0 x( )f 2 3 4 5 6 7 3 2 2,5 x( )s2 x( )s3 Resolução: Pela definição, pode-se definir 3 splines lineares para os 4 pontos: 1s ( x ), 2s ( x ) e 3s ( x ). · 1s ( x )= 0y 01 1 xx xx - - + 1y 01 0 xx xx - - 1s ( x )=1 12 2 - - x +2 12 1 - -x =2- x +2 x -2= x Þ 1s ( x )= x , x Î[1,2]. · 2s ( x )= 1y 12 2 xx xx - - + 2y 12 1 xx xx - - 2s ( x )=2 25 5 - - x +3 25 2 - -x = 3 2 (5- x )+ x -2= 3 1 ( x +4) Þ 2s ( x )= 3 1 ( x +4) , x Î[2,5]. · 3s ( x )= 2y 23 3 xx xx - - + 3y 23 2 xx xx - - 3s ( x )=3 57 7 - - x +2,5 57 5 - -x Þ 3s ( x )= 2 1 (-0,5 x +8,5) , x Î[5,7]. Então, no intervalo [a ,b ]=[1,7], a spline linear 1S ( x ) é dada por: 1S ( x )= ï î ï í ì Î Î Î .75se , ;52se , ;21se , 3 2 1 ],[)( ],[)( ],[)( xxs xxs xxs tal que ï ï î ïï í ì +-= +== .5850 2 1 e 4 3 1 , 3 21 ),,()( )()()( xxs xxsxxs Cálculo Numérico Interpolação Lauro / Nunes 8 9. Encontrar uma aproximação para f (0,25) por spline cúbica natural, interpolando a tabela: 0x 1x 2x 3x 4x x 0 0,5 1,0 1,5 2,0 y = f ( x ) 3 1,8616 -0,5571 -4,1987 -9,0536 Resolução: n =4, logo, procura-se 1s ( x ), 2s ( x ), 3s ( x ) e 4s ( x ). Spline Natural Þ k =1,2,¼,( n -1) Þ k =1,2,3 Þ Utilizando a (15), segue que: Þ 1-kk gh +2( kh + 1+kh ) kg + 11 ++ kk gh =6 ç ç è æ - + + 1 1 k kk h yy - ÷ ÷ ø ö- - k kk h yy 1 kh = kx - 1-kx Þ kh =0,5 k" . Þ kh = h =0,5 . Equação (15) Þ h 1-kg +4h kg + h 1+kg = h 6 ( 11 2 -+ +- kkk yyy ) , com k =1,2,3.Desenvolvendo o sistema A g =b : ( ) ( ) ( ) ï ï ï î ïï ï í ì +-=++ +-=++ +-=++ 234432 123321 012210 2 6 4 2 6 4 2 6 4 yyy h hghghg yyy h hghghg yyy h hghghg 0g = 4g =0 (Spline Natural). Então, A g = b Þ ú ú ú û ù ê ê ê ë é hh hhh hh 40 4 04 × ú ú ú û ù ê ê ê ë é 3 2 1 g g g = h 6 ú ú ú û ù ê ê ê ë é +- +- +- 234 123 012 2 2 2 yyy yyy yyy . Substituindo os valores: ú ú ú û ù ê ê ê ë é 2500 50250 0502 , ,, , × ú ú ú û ù ê ê ê ë é 3 2 1 g g g = ú ú ú û ù ê ê ê ë é - - - 559814 674814 363615 , , , Þ g = ú ú ú û ù ê ê ê ë é - - - 2526 1114 65416 , , , . Forma geral de is ( x ) Þ is ( x )= ia ( x - ix ) 3+ ib ( x - ix ) 2+ ic ( x - ix )+ id , com i =1,2,3,4. f (0,25) » 1s (0,25) 1a = h gg 6 01 - = 3 65416,- Þ 1a =-2,218 1b = 2 1g =-3,327 Þ 1b =-3,327 1c = h yy 01 - + 6 2 01 hghg + =-3,3858 Þ 1c =-3,3858 1d = 1y =1,8616 Þ 1d =1,8616 Logo, 1s (0,25)=-2,218(-0,25) 3-3,327(-0,25)2-3,3858(-0,25)+1,8616 Þ 1s (0,25)=2,5348 » f (0,25) . Cálculo Numérico Interpolação Lauro / Nunes 9 Considerando os próximos 5 exercícios, encontrar uma aproximação para f ( x ) por spline cúbica natural, interpolando a tabela: 0x 1x 2x 3x 4x x 0 0,5 1,0 1,5 2,0 y = f ( x ) 3 1,8616 -0,5571 -4,1987 -9,0536 n =4, logo, procura-se 1s ( x ), 2s ( x ), 3s ( x ) e 4s ( x ). Do exercício anterior, a forma geral de is ( x ) é dada por: is ( x )= ia ( x - ix ) 3+ ib ( x - ix ) 2+ ic ( x - ix )+ id , com i =1,2,3,4. 10. f (0,8). Resolução: f (0,8) » 2s (0,8) 2a = h gg 6 12 - =0,8477 Þ 2a =0,8477 2b = 2 2g =-2,0555 Þ 2b =-2,0555 2c = h yy 12 - + 6 2 12 hghg + =-6,0771 Þ 2c =-6,0771 2d = 2y =-0,5571 Þ 2d =-0,5571 Logo, 2s (0,8)=0,8477(-0,2) 3-2,0555(-0,2)2-6,0771(-0,2)-0,5571 Þ 2s (0,8)=0,5693 » f (0,8) . 11. f (1,1). Resolução: f (1,1) » 3s (1,1) 3a = h gg 6 23 - =-0,7137 Þ 3a =-0,7137 3b = 2 3g =-3,1260 Þ 3b =-3,1260 3c = h yy 23 - + 6 2 23 hghg + =-8,6678 Þ 3c =-8,6678 3d = 3y =-4,1987 Þ 3d =-4,1987 Logo, 3s (1,1)=-0,7137(-0,4) 3-3,1260(-0,4)2-8,6678(-0,4)-4,1987 Þ 3s (1,1)=-1,1861 » f (1,1) . Cálculo Numérico Interpolação Lauro / Nunes 10 12. f (1,2). Resolução: f (1,2) » 3s (1,2) 3a = h gg 6 23 - =-0,7137 Þ 3a =-0,7137 3b = 2 3g =-3,1260 Þ 3b =-3,1260 3c = h yy 23 - + 6 2 23 hghg + =-8,6678 Þ 3c =-8,6678 3d = 3y =-4,1987 Þ 3d =-4,1987 Logo, 3s (1,2)=-0,7137(-0,3) 3-3,1260(-0,3)2-8,6678(-0,3)-4,1987 Þ 3s (1,2)=-1,8604 » f (1,2) . 13. f (1,3). Resolução: f (1,3) » 3s (1,3) 3a = h gg 6 23 - =-0,7137 Þ 3a =-0,7137 3b = 2 3g =-3,1260 Þ 3b =-3,1260 3c = h yy 23 - + 6 2 23 hghg + =-8,6678 Þ 3c =-8,6678 3d = 3y =-4,1987 Þ 3d =-4,1987 Logo, 3s (1,3)=-0,7137(-0,2) 3-3,1260(-0,2)2-8,6678(-0,2)-4,1987 Þ 3s (1,3)=-2,5845 » f (1,3) . 14. f (1,7). Resolução: f (1,7) » 4s (1,7) 4a = h gg 6 34 - =2,0840 Þ 4a =2,0840 4b = 2 4g =0 Þ 4b =0 4c = h yy 34 - + 6 2 34 hghg + =-10,2308 Þ 4c =-10,2308 4d = 4y =-9,0536 Þ 4d =-9,0536 Logo, 4s (1,7)=2,0840(-0,3) 3+0(-0,3)2-10,2308(-0,3)-9,0536 Þ 4s (1,7)=-6,0406 » f (1,7) .
Compartilhar