Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Coecientes indeterminados
Diferenciacin Numrica
Mtodos Numricos
Prof. Juan Alfredo Gmez
Conferencia 20
Errores de redondeo
Frmulas de diferencias
Conferencia 20
Frmulas de diferencias
Frmulas de tres y de cinco puntos
Clculo a travs del Polinomio de Taylor
Segunda derivada
Coecientes indeterminados
Errores de redondeo
Coecientes indeterminados
Errores de redondeo
Frmulas de diferencias
Coecientes indeterminados
Motivacin
Problema de diferenciacin numrica
Encontrar una aproximacin con error estimable de:
Soluciones a mano:
I) Aproximar el lmite con valores de
h cercanos a 0:
f [x0 , x1 , . . . , xn ] = f n!()
(n )
Errores de redondeo
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Deduccin
Polinomio de Lagrange en dos puntos
Dados f C 2 [a, b],
(x ) [a, b ]:
x ,x
0
f (x ) = P0,1 (x ) +
Tomando
f (x )
f 00 ((x ))
= x0 + h y derivando obtenemos:
f (x0 )(x x0 h)
h
= f (x 0 ) +
f 0 (x ) =
(x x0 )(x x1 )
f (x0 + h)(x x0 )
h
(x x0 )(x x0 h)
2
f 00 ((x ))
f (x0 + h) f (x0 )
(x x0 )2 (x x0 )h 00
(x x0 ) +
f ((x ))
h
2
f (x0 + h) f (x0 )
h
(x x0 ) h
f 00 ((x )) +
(x x0 )2 (x x0 )h
2
00 (( ))
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Denicin
Denicin
Evaluando en
f 0 (x ) =
x = x la expresin
0
f (x0 + h) f (x0 )
h
(x x0 ) h
f 00 ((x )) +
(x x0 )2 (x x0 )h
2
00
00 (( ))
f 0 (x ).
0
()
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Ejemplo
Ejercicio
Dados f (x ) = ln x y
Desarrollo
Aproximando
= 1.8, estimar
|h|
|h|
( . )2
2 1 8
f (1.8 + h)
f (1.8 + h) f (1.8)
h
2(1.8)2
0.100
0.64185389
0.5406722
0.0154321
0.010
0.59332685
0.5540180
0.0015432
0.001
0.58834207
0.5554013
0.0001543
0.000
0.58778666
f 0 (1.8)=0.5555556
| |
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Deduccin general
Polinomio de Lagrange en (n + 1) puntos
Pn
k =0 f (xk )Lk (x ) +
(x x0 ) (x xn ) (n+1)
f
((x ))
(n + 1)!
donde
Lk (x ) =
(x x0 ) (x xk 1 )(x xk +1 ) (x xn )
(xk x0 ) (xk xk 1 )(xk xk +1 ) (xk xn )
Pn
f (n+1) ((xj ))
(xj
(n + 1)!
Frmulas de diferencias
Coecientes indeterminados
Calculando Lk (x ) y L0k (x )
L0 (x ) =
(x x1 )(x x2 )
;
(x0 x1 )(x0 x2 )
L2 (x ) =
L00 (x ) =
(x x0 )(x x2 )
;
(x1 x0 )(x1 x2 )
(x x0 )(x x1 )
(x2 x0 )(x2 x1 )
2x x1 x2
;
(x0 x1 )(x0 x2 )
L02 (x ) =
L1 (x ) =
L01 (x ) =
2x x0 x2
;
(x1 x0 )(x1 x2 )
2x x0 x1
(x2 x0 )(x2 x1 )
Errores de redondeo
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
2x x1 x2
;
(x0 x1 )(x0 x2 )
L02 (x ) =
L01 (x ) =
2x x0 x2
;
(x1 x0 )(x1 x2 )
2x x0 x1
(x2 x0 )(x2 x1 )
Pn
f (n+1) ((xj ))
(xj
(n + 1)!
x2 = x0 + 2h) obtenemos:
f 0 (x0 ) =
1 3
1
h2 (3)
h 2 f (x0 ) + 2f (x1 ) 2 f (x2 ) + 3 f (0 )
f 0 (x1 ) =
f 0 (x2 ) =
1 1 f (x ) + 1 f (x ) h2 f (3) ( )
0
2
1
2
2
6
1 1 f (x ) 2f (x ) 3 f (x ) + h2 f (3) ( )
0
1
2
2
2
2
3
Frmulas de diferencias
Coecientes indeterminados
Caso equidistante
x ,x
0
f 0 (x 0 ) =
f 0 (x0 + 2h) =
f (x0 h) =
0
+ 2h
1 1 f (x ) + 1 f (x + 2h) h2 f (3) ( )
0
0
1
2
2
6
f 0 (x0 + h) =
Caso equidistante
+ h,
1 3
1
h 2 ( 3)
h 2 f (x0 ) + 2f (x0 + h) 2 f (x0 + 2h) + 3 f (0 )
1 1 f (x ) 2f (x + h) 3 f (x + 2h) + h2 f (3) ( )
0
0
0
2
2
2
3
h,
x ,x
0
+h
1
h 2 ( 3)
1 3
h 2 f (x0 h) + 2f (x0 ) 2 f (x0 + h) + 3 f (0 )
1 1 f (x h) + 1 f (x + h) h2 f (3) ( )
0
0
1
2
2
6
f 0 (x0 ) =
f 0 (x0 + h) =
1 1 f (x h) 2f (x ) 3 f (x + h) + h2 f (3) ( )
0
0
0
2
2
2
3
Errores de redondeo
Frmulas de diferencias
Frmulas de aproximacin de
Frmulas de tres puntos
f ( x0 ) =
0
1
2h
fx
Coecientes indeterminados
(x0 )
f x0 + h) f (x0 + 2h)] + h3 f 3 (0 )
2
[3 ( 0 ) + 4 (
( )
( )
f ( x0 ) =
fx
fx h
fx h
f
fx h fx h
f (x0 ) = 121h [f (x0 2h) 8f4(x0 h) + 8f (x0 + h)
f (x0 + 2h)] + h30 f 5 (3 )
donde 2 [x0 , x0 + 4h] y 3 [x0 2h, x0 + 2h].
0
Errores de redondeo
1
12h
[25 ( 0 ) + 48 ( 0 + ) 36 ( 0 + 2 )
4
+16 ( 0 + 3 ) 3 ( 0 + 4 )] + h5 (5) (2 )
( )
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Ejemplo
Ejercicio
Dados los siguientes valores tabulados de f (x ) = xe x aproximar f 0 (2.0) =
22.167168 utilizando frmulas de tres y cinco puntos.
x
f (x )
1.8
1.9
2.0
2.1
2.2
10.889365
12.703199
14.778112
17.148957
19.855030
Desarrollo
Utilizando la frmula de tres puntos:
f 0 (x0 ) = 21h [3f (x0 ) + 4f (x0 + h) f (x0 + 2h)] +
para
h2
3
f (3) (0 )
h = 0.1 y h = 0.1
f 0 (2.0)
1
0.2 [3f (2.0) + 4f (2.1) f (2.2)] =
f 0 (2.0)
0 .2
22 032310
Ea
22 054525
= 1.35 101
Ea
= 1.13 101
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Ejemplo
Ejercicio
Dados los siguientes valores tabulados de f (x ) = xe x aproximar f 0 (2.0) =
22.167168 utilizando frmulas de tres y cinco puntos.
x
f (x )
1.8
1.9
2.0
2.1
2.2
10.889365
12.703199
14.778112
17.148957
19.855030
Desarrollo
Utilizando la frmula de tres puntos:
f 0 (x0 ) = 21h [f (x0 + h) f (x0 h)]
para
h2
6
f (3) (1 )
h = 0.2 y h = 0.1
.
Ea
= 2.47 101
Ea
= 6.16 102
f 0 (2.0)
1
0.4 [f (2.2) f (1.8)] =
22 414163
f 0 (2.0)
1
0.2 [f (2.1) f (1.9)] =
22 228790
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Ejemplo
Ejercicio
Dados los siguientes valores tabulados de f (x ) = xe x aproximar f 0 (2.0) =
22.167168 utilizando frmulas de tres y cinco puntos.
x
f (x )
1.8
1.9
2.0
2.1
2.2
10.889365
12.703199
14.778112
17.148957
19.855030
Desarrollo
Utilizando la frmula de cinco puntos:
f 0 (x0 ) =
para
f
1
12h [f (x0 2h) 8f (x0 h) + 8f (x0 + h) f (x0 + 2h)] +
h4
30
f (5) (3 )
h = 0.1
(2.0)
1
1.2 [f (1.8) 8f (1.9) + 8f (2.1) f (2.2)] =
22 166999
Ea
= 1.69 104
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Deduccin
Desarrollo de Taylor de orden tres
f (x0 + h) =
f (x 0 h ) =
4
1 ( 4)
24 f (1 )h
4
1 (4)
24 f (1 )h
Despejando
f
00
f 00 (x ):
0
i
2 h
(x0 ) = h12 [f (x0 h) 2f (x0 ) + f (x0 + h)] h24 f (4) (1 ) + f (4) (1 )
f 00 (x
( )
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Ejemplo
Ejercicio
Dados los siguientes valores tabulados de f (x ) = xe x aproximar f 00 (2.0) =
29.556224 utilizando la frmula de tres puntos.
x
f (x )
1.8
1.9
2.0
2.1
2.2
10.889365
12.703199
14.778112
17.148957
19.855030
Desarrollo
Utilizando la frmula de tres puntos:
2
f 00 (x0 ) = h12 [f (x0 h) 2f (x0 ) + f (x0 + h)] h12 f (4) ()
para
h = 0.2 y h = 0.1
.
Ea
= 1.48 101
Ea
= 3.70 102
f 00 (2.0)
1
0.04 [f (1.8) 2f (2.0) + f (2.2)] =
29 704275
f 00 (2.0)
1
0.01 [f (1.9) 2f (2.0) + f (2.1)] =
29 593200
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Coecientes indeterminados
Formulacin
Para determinar la f (k ) (), la idea es encontrar los coecientes
i = 1, . . . , n tales que
Ai
R,
f (k ) () =
n
X
i =0
Para el clculo de los coecientes Ai impondremos la exactitud de la frmula sobre los polinomios x j , 0 j n,
n
X
i =0
Ai x j =
d k (x j )
,
dx k x =
0k n
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Coecientes indeterminados
o equivalentemente
n
X
i =0
n
X
i =0
Ai x j
0,
Ai x j
j (j 1) (j k + 1)j k ,
0j k 1
k j n.
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Coecientes indeterminados
Ejemplo
Calcular
Desarrollo
f 000 (5) Af (x0 ) + A1 f (x1 ) + A2 f (x2 ) + A3 f (x3 ) debemos resolver el siguiente sistema:
la solucin es
A
A
A
A
+ A1 + A2 + A3 = 0
+ 2A1 + 3A2 + 4A3 = 0
0 + 4A1 + 9A2 + 16A3 = 2
0 + 8A1 + 27A2 + 64A3 = 6 5
0
= 2,
= 7,
= 8,
= 3, por tanto:
f 00 (5) 7 (2) + 2 7 3 = 3
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Coecientes indeterminados
Ejemplo
Para calcular
h, x0 + 2h.
2h, x0 h, x0 , x0 +
Desarrollo
f 000 (x
x0 2h
x0 2 h ) 2
x0 2 h ) 3
x0 2h)4
(
(
(
x0 h
x0 h)2
x0 h)3
x0 h)4
(
(
(
x0
x0 )2
x0 )3
x0 )4
(
(
(
x0 + h
x0 + h ) 2
x0 + h)3
x0 + h)4
(
(
(
x 0 + 2h
x0 + 2h)2
x0 + 2h)3
x0 + 2h)4
(
(
(
A !
B
C
=
D
E
0
0
0
321
4 3 2 x0
Frmulas de diferencias
Coecientes indeterminados
Por ende:
f 0 (x0 )
f(x0 + h) f(x0 h)
2h
e (x0 + h) e (x0 h)
2h
2
h6 f (3) (1 )
+
0
2h
h
h2
6
Errores de redondeo
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Reduciendo el error
Observacin
De la desigualdad
f(x0 + h) f(x0 h)
0
+
f (x0 )
2h
h
h2
6
h=
h2
6
r
3 3
Frmulas de diferencias
Coecientes indeterminados
Errores de redondeo
Ejemplo
Considere f (x ) = sin x , x0 = 0.9 y una aritmtica de redondeo a cinco
dgitos. Estimar el valor de f 0 (x0 ) = cos (0.9) = 0.62161 calculando para
distintos valores de h la frmula de tres puntos:
f 0 (x0 ) 21h [f (x0 + h) f (x0 h)]
Clculos
h
x0 h
f (x0 h)
x0 + h
f (x0 + h)
0.001
0.899
0.78270
0.901
0.78395
0.002
0.898
0.78208
0.902
0.005
0.895
0.78021
0.905
0.010
0.890
0.77707
0.020
0.880
0.050
0.100
f (x0 + h) f (x0 h)
2h
Error
0.62500
0.00339
0.78457
0.62250
0.00089
0.78643
0.62200
0.00039
0.910
0.78950
0.62150
0.00011
0.77074
0.920
0.79560
0.62150
0.00011
0.850
0.75128
0.950
0.81342
0.62140
0.00021
0.800
0.71736
1.000
0.84147
0.62055
0.00106
max [0.8,1]
h=
|f 000 (x )| =
r
3 3 =
max [0.8,1]
|cos (x )| =
r
3 3(0.000005)
=
0.028
0.69671