Ms.Ing. G.Poémape R.
UNT - Page 1
APROXIMACIÓN FUNCIONAL
E Interpolación
Prof: Mg Gloria Poémape Rojas
Ms.Ing. G.Poémape R. UNT - Page 2
Dos problemas:
Primer problema:
Aproximar una
función en un
intervalo por medio
de una función simple
Ms.Ing. G.Poémape R. UNT - Page 3
Segundo
problema:
Encontrar valores
intermedios
(interpolar)
Ms.Ing. G.Poémape R. UNT - Page 4
Las funciones de aproximación
• Se obtienen por combinaciones lineales de familia de funciones
denominadas elementales.
De la forma:
• 𝑎0 𝑔0 𝑥 + 𝑎1 𝑔1 𝑥 + … + 𝑎𝑛 𝑔𝑛 𝑥 …..(1)
• Donde ai, 0<i<n, son constantes por determinar y
• gi(x) funciones de una familia en particular.
Ms.Ing. G.Poémape R. UNT - Page 5
¿ gi(x)?
• 𝑎0 𝑔0 𝑥 + 𝑎1 𝑔1 𝑥 + … + 𝑎𝑛 𝑔𝑛 𝑥 …..(1)
• gi(x) son funciones de una familia en particular.
• Los monomios en x (x0, x, x2, ….) constituye la familia o
grupo más empleado, sus combinaciones generan
aproximaciones de tipo polinomial.
• a0 + a1x + a2x2 + … anxn
Ms.Ing. G.Poémape R. UNT - Page 6
𝒂𝟎 𝒈𝟎 𝒙 + 𝒂𝟏 𝒈𝟏 𝒙 + … + 𝒂𝒏 𝒈𝒏 𝒙 …..(1)
¿ gi(x)? ¿Función de Aproximación?
Aproximaciones de tipo polinomial.
(x0, x, x2, ….) Monomios a0 + a1x + a2x2 + … anxn
1, sen x, cos x, sen 2x, cos 2x,
Funciones de Fourier
1, e x , e2x, … 𝑎𝑖 𝑒 𝑖𝑥
𝑖=0
Funciones exponenciales
Ms.Ing. G.Poémape R. UNT - Page 7
Aproximar f(x) por medio de Polinomios
Regresión por mínimos
Ajuste exacto
cuadrados
Ms.Ing. G.Poémape R. UNT - Page 8
¿Cuando ajuste exacto o Mínimos cuadrados?
• Cuando la información tabular es aproximada hasta cierto número
de cifras significativas se recomienda usar ajuste exacto.
• Si la aproximación tiene errores considerables como el caso de los
datos experimentales, no tiene sentido encontrar un polinomio
que pase por esos puntos sino mas bien que pase entre ellos se
recomienda el método de mínimos cuadrados.
Ms.Ing. G.Poémape R. UNT - Page 9
¿Qué es interpolación?
Usado para obtener información adicional de la función tabular
Involucra encontrar valores intermedios cuando los valores están
dados como un conjunto finito de datos
Ms.Ing. G.Poémape R. UNT - Page 10
Métodos de ajuste exacto
Aproximación simple
Polinomios de Lagrange
Polinomios de Newton
Ms.Ing. G.Poémape R. UNT - Page 11
METODO DE APROXIMACION SIMPLE
𝑃 𝑥 = 𝑎1 + 𝑎2 ∗ 𝑥
Primer grado
𝑎1 + 𝑎2 ∗ 𝒙𝟏 = 𝒚𝟏
x y 𝑎1 + 𝑎2 ∗ 𝒙𝟐 = 𝒚𝟐
𝑥1 𝑦1
𝑥2 𝟏 𝒙𝟏 𝒂𝟏 𝒚𝟏
𝑦2 = 𝒚
𝟏 𝒙𝟐 𝒂𝟐 𝟐
A 𝒂 y
𝒂= 𝑨−𝟏 ∗ 𝒚
Ms.Ing. G.Poémape R. UNT - Page 12
METODO DE APROXIMACION SIMPLE
Primer grado 𝑃 𝑥 = 𝒂 𝟏 + 𝒂𝟐 ∗ 𝑥
x y P(x*)= a1 + a2 x*
𝑥1 𝑦1
𝑥2 𝑦2
Para x=x*
Hallar y
Ms.Ing. G.Poémape R. UNT - Page 13
Segundo grado
x y 𝑃 𝑥 = 𝑎1 + 𝑎2 ∗ 𝑥 + 𝑎3 ∗ 𝑥 2
𝑥1 𝑦1 𝑎1 + 𝑎2 ∗ 𝑥1 + 𝑎3 ∗ 𝑥12 = 𝑦1
𝑥2 𝑦2
𝑥3 𝑦3 𝑎1 + 𝑎2 ∗ 𝑥2 + 𝑎3 ∗ 𝑥22 = 𝑦2
𝑎1 + 𝑎2 ∗ 𝑥3 + 𝑎3 ∗ 𝑥32 = 𝑦3
1 𝑥1 𝑥12 𝑎1 𝑦1
1 𝑥2 𝑥22 𝑎2 = 𝑦2
𝑎3 𝑦3
1 𝑥3 𝑥32
A 𝑎 y
𝒂= 𝑨−𝟏 ∗ 𝒚
Ms.Ing. G.Poémape R. UNT - Page 14
Ejemplo
x 140 180 220 240
y 12800 7500 5000 3800
x=210 y=?
𝑷𝟑 𝒙 = 𝒂𝟏 + 𝒂𝟐 ∗ 𝒙 + 𝒂𝟑 ∗ 𝒙𝟐 + 𝒂𝟒 ∗ 𝒙𝟑
Matriz de Vandermonde es 𝑎1 12800
una matriz mal 1 140 1402 1403 7500
𝑎2
condicionada que magnifica 1 180 1802 1803 =
los errores de redondeo en 1 220 2202 2203 𝑎3 5000
la solución del sistema. 3 𝑎4 3800
1 240 2402 240
Ms.Ing. G.Poémape R. UNT - Page 15
Solución
• Resolviendo el sistema la solución seria:
a1 = 99600
a2 = -1209.166667
𝟐 𝟑
a3 =5.375 𝑷 𝟑 𝒙 = 𝒂 𝟏 + 𝒂 𝟐 ∗ 𝒙 + 𝒂 𝟑 ∗ 𝒙 + 𝒂 𝟒 ∗ 𝒙
a4 =-0.008333333
• Luego para x=210 el valor de P(x) sería:
P3(x)= 99600 - 1209.1667 x +5.375 x2 – 0.008333 x3
• P(210)=5537.5
y = -0.0083x3 + 5.375x2 - 1209.2x + 99600
Ms.Ing. G.Poémape R. UNT - Page 16
• El inconveniente de este método es que requiere la solución de un
sistema de ecuaciones algebraicas lineales que cuando el grado del
polinomio es alto, puede presentar inconvenientes( Matriz de
Vadeermonde).
Ms.Ing. G.Poémape R. UNT - Page 17
POLINOMIOS DE LAGRANGE x F(x)
X0 Y0
• PRIMER GRADO: x1 y1
• P(x)= a0(x-x1)+ a1(x-x0)
P(x)= a0(x-x1)+ a1(x-x0)
• P(x)= a0(x-x1)+ a1(x-x0)
• ¿Qué pasa si x=x0? 𝑷 𝒙 =
𝑦0
𝒙 − 𝒙𝟏 +
𝑦1
𝑥 − 𝑥0
• P(x0)= a0(x0 -x1) = y0 𝑥0 − 𝑥1 𝑥1 − 𝑥0
𝑦0
• Despejando a0 = P(x)= Lo(x). yo + L1(x) y1
𝑥0 −𝑥1
• ¿Qué pasa si x=x1? Generalizando 𝑛
• P(x1)=a1(x1-x0) =y1 𝑃𝑛 𝑥 = 𝐿𝑖 𝑥 𝑦𝑖
𝒏
𝑦1 𝒙 − 𝒙𝒋
• Despejando a1= 𝑳𝒊 𝒙 = ෑ
𝑖=0
𝑥1 −𝑥0
𝒋=𝟎
𝒙𝒊 − 𝒙𝒋
𝒋≠𝒊
Ms.Ing. G.Poémape R. UNT - Page 18
Ejemplo
x y
x0 1 56.5 y0 • P1(x)= Lo(x). yo + L1(x) . y1
x1 5 113 y1 𝑥−𝑥1 𝑥−5 𝑥−5
• Lo = = = = −0.25𝑥 + 1.25
x= 2 y=? 𝑥0 −𝑥1 1−5 −4
𝑥−𝑥0 𝑥−1 𝑥−1
• 𝐿1 = = = = 0.25𝑥 − 0.25
𝑥1 −𝑥0 5−1 4
• Aplicar • P1(x)=[-0.25x + 1.25] (56.5)+ [0.25x-0.25](113)
Polinomios de
Lagrange de • P1(x)= 42.375 + 14.125 x
Primer grado • P1(2)=70.625
P1(x)
Observe que Li(x) son polinomios.
Ms.Ing. G.Poémape R. UNT - Page 19
Ejemplo Como x=2 (valor a
x y interpolar)
x0 1 56.5 y0
x1 5 113 y1
x= 2 y=? • P1(x)= Lo(x). yo + L1(x) . y1
𝑥−𝑥1 𝑥−5 2−5
• Lo = = = = 0.75
𝑥0 −𝑥1 1−5 −4
• Aplicar 𝑥−𝑥0 𝑥−1 2−1
• 𝐿1 = = = = 0.25
Polinomios de 𝑥1 −𝑥0 5−1 4
Lagrange de • P1(x)=(0.75)(56.5)+ (0.25)(113)
Primer grado
• P1(x)= 70.625
P1(x)
Observe que Li(x) son polinomios, que se
convierten en constantes al remplazar x
por el valor a interpolar
Ms.Ing. G.Poémape R. UNT - Page 20
POLINOMIO DE LAGRANGE
Un polinomio de interpolación de
Lagrange, P, se define en la forma:
En donde Li son polinomios que
i= 0, 1, 2,…n dependen sólo de los nodos tabulados,
pero no de las ordenadas.
𝐿𝑖 = 1
Ms.Ing. G.Poémape R. UNT - Page 21
Ejemplo
X0 X1 X2 X3
x 140 180 220 240
y 1280 7500 5000 3800
n=3 x=210
𝑃 𝑥 = 𝐿0 ∗ 𝑦0 + 𝐿1 ∗ 𝑦1 + 𝐿2 ∗ 𝑦2 + 𝐿3 ∗ 𝑦3
𝑥 − 𝑥1 𝑥 − 𝑥2 𝑥 − 𝑥3 𝑖 = 0, 𝑗 = 1,2,3
𝐿0 = ∗ ∗
𝑥0 − 𝑥1 𝑥0 − 𝑥2 𝑥0 − 𝑥3
210−180 210−220 210−240
𝐿0 = ∗ ∗ = −0.028125
140−180 140−220 140−240
Ms.Ing. G.Poémape R. UNT - Page 22
𝑥 − 𝑥0 𝑥 − 𝑥2 𝑥 − 𝑥3
𝐿1 = ∗ ∗ 𝑖 = 1, 𝑗 = 0,2,3
𝑥1 − 𝑥0 𝑥1 − 𝑥2 𝑥1 − 𝑥3
210−140 210−220 210−240
𝐿1 = ∗ ∗ = 0.21875
180−140 180−220 180−240
𝑥 − 𝑥0 𝑥 − 𝑥1 𝑥 − 𝑥3
𝐿2 = ∗ ∗ 𝑖 = 2, 𝑗 = 0,1,3
𝑥2 − 𝑥0 𝑥2 − 𝑥1 𝑥2 − 𝑥3
210−140 210−180 210−240
𝐿2 = ∗ ∗ = 0.984375
220−140 220−180 220−240
Ms.Ing. G.Poémape R. UNT - Page 23
𝑥 − 𝑥0 𝑥 − 𝑥1 𝑥 − 𝑥2
𝐿3 = ∗ ∗ 𝑖 = 3, 𝑗 = 0,1,2
𝑥3 − 𝑥0 𝑥3 − 𝑥1 𝑥3 − 𝑥2
210−140 210−180 210−220
𝐿3 = ∗ ∗ = −0.175
240−140 240−180 240−220
𝑃 𝑥 = (−0.028125) ∗ (12800) + (0.21875) ∗ (7500) + (0.984375) ∗ (5000) + (−0.175) ∗ (3800)
𝑃 𝑥 = 5537.5
Ms.Ing. G.Poémape R. UNT - Page 24
POLINOMIO DE NEWTON
En ocasiones sería deseable pasar de un polinomio de interpolación a otro
de un grado mayor, por ejemplo en el caso que uno busque el grado del
polinomio a usar.
Es un método de interpolación polinomial. Aunque sólo existe un único
polinomio que interpola una serie de puntos, existen diferentes formas de
calcularlo. Este método es útil para situaciones que requieran un número
bajo de puntos para interpolar, ya que a medida que crece el número de
puntos, también lo hace el grado del polinomio.
Existen ciertas ventajas en el uso de este polinomio respecto al polinomio
interpolador de Lagrange. Por ejemplo, si fuese necesario añadir algún nuevo
punto o nodo a la función, tan sólo habría que calcular este último punto,
dada la relación de recurrencia existente y demostrada anteriormente.
Ms.Ing. G.Poémape R. UNT - Page 25
Polinomio de Newton- Primer grado - F(x)
X0 Y0
x1 y1
• P(x)= a0 + a1(x-x0)
• ¿Qué pasa si x=x0?
• P(x0) =a0 x F(x) Primera
• a0=y0 x0 Y0 𝑦1 − 𝑦0
x1 y1 𝑥1 − 𝑥0
• ¿Qué pasa si x=x1
• P(x1)= a0 + a1(x1-x0) =y1
𝑦1 −𝑦0
• 𝑎1 = P(x)= a0 + a1 (x-x0)
𝑥1 −𝑥0
Ms.Ing. G.Poémape R. UNT - Page 26
x y Primera Segunda
𝑦1 − 𝑦0
𝑥0 𝑦0 𝑓 𝑥0 , 𝑥1 = 𝑓 𝑥1 , 𝑥2 − 𝑓 𝑥0 , 𝑥1
𝑥1 − 𝑥0 𝑓 𝑥0 , 𝑥1 , 𝑥2 =
𝑥2 − 𝑥0
𝑥1 𝑦1 𝑦2 − 𝑦1
𝑓 𝑥1 , 𝑥2 =
𝑥2 − 𝑥1
𝑓 𝑥2 , 𝑥3 − 𝑓 𝑥1 , 𝑥2
𝑥2 𝑦2 𝑓 𝑥1 , 𝑥2 , 𝑥3 =
𝑦3 − 𝑦2 𝑥3 − 𝑥1
𝑓 𝑥2 , 𝑥3 =
𝑥3 − 𝑥2 𝑓 𝑥3 , 𝑥4 − 𝑓 𝑥2 , 𝑥3
𝑥3 𝑦3 𝑓 𝑥2 , 𝑥3 , 𝑥4 =
𝑦4 − 𝑦3 𝑥4 − 𝑥2
𝑥4 𝑦4 𝑓 𝑥3 , 𝑥4 =
𝑥4 − 𝑥3
. .
. .
. .
P x = 𝑎0 + 𝑎1 𝑥 − 𝑥0 + 𝑎2 𝑥 − 𝑥0 𝑥 − 𝑥1 + … .
Ms.Ing. G.Poémape R. UNT - Page 27
Ejemplo
x 140 180 220 240
y 12800 7500 5000 3800
x=210
x y Primera Segunda Tercera
140 12800
-132.5
180 7500 0.875
-62.5 −𝟎. 𝟎𝟎𝟖𝟑𝟑
220 5000 0.4167
-60
240 3800
Ms.Ing. G.Poémape R. UNT - Page 28
x 140 180 220 240
x=210 y=?
y 12800 7500 5000 3800
x y Primera Segunda Tercera
140 12800
-132.5
180 7500 0.875
-62.5 −𝟎. 𝟎𝟎𝟖𝟑𝟑
220 5000 0.4167
-60
240 3800
P(x)= 12800 - 132.5 (x-140) + 0.875 (x-140)(x-180) – 0.00833(x-140)(x-180)(x-220)
P(210)=?
Ms.Ing. G.Poémape R. UNT - Page 29
INTERPOLACION BIDIMENSIONAL
Y
10 20 30
DATOS
10 √ √ √
X CONOCIDOS
20 √ √ √ F( x ; y )= √
30 √ √ √
SE PIDE HALLAR:
F( 25;15)=?
F( x ; y)
Ms.Ing. G.Poémape R. UNT - Page 30
INTERPOLACION BIDIMENSIONAL
Y
10 15 20 30 DATOS
10 √ 40.18 √ CONOCIDOS
X F(10;20)= 40.18
20 √ √ √
25 Rpta F( ; )= √
30 √ √ √
SE PIDE HALLAR:
F( 25;15)=?
Ms.Ing. G.Poémape R. UNT - Page 31
INTERPOLACION BIDIMENSIONAL
Y
10 15 20 30 DATOS
10 30.5 40.18 52.4 CONOCIDOS
X F(10;20)=40.18
20 34.2 42.7 58.9
25 Rpta F( ; )= √
30 36.9 48.4 60.3
SE PIDE HALLAR:
F( 25;15)=?
Ms.Ing. G.Poémape R. UNT - Page 32
INTERPOLACION BIDIMENSIONAL
Interpolación Bidimensional – Usando Polinomios de Primer Grado
Y
10 15 20
20 34.2 *1 42.7 *1) Hallar F(20,15)
X *2) Hallar F(30,15)
25 *3)Rpta
*3) Hallar F(25,15) (Rpta)
30 36.9 *2 48.4
SE PIDE HALLAR:
F( 25;15)=?
Ms.Ing. G.Poémape R. UNT - Page 33
INTERPOLACION BIDIMENSIONAL
Interpolación Bidimensional – Usando Polinomios de Primer Grado
Y
*1) Hallar F(20,15)
10 15 20 x y
20 34.2 *1=38.45 42.7 10 34.2
X 20 42.7
25 Rpta
x=15 y=? (38.45)
30 36.9 *2=42.65 48.4
*3) Rpta: Hallar F(25, 15) *2) Hallar F(30,15)
SE PIDE HALLAR: x y x y
F( 25;15)=? 20 38.45 10 36.9
30 42.65 20 48.4
x=25 y=? x=15 y=?(42.65)
Ms.Ing. G.Poémape R. UNT - Page 34
Interpolación inversa
Ms.Ing. G.Poémape R. UNT - Page 35
No olvidar que hay examen la próxima clase.