You are on page 1of 72

CALCULO NUMERICO

Prof. Miguel Arellano


miguel_arellano@cantv.net
marellan@engineer.com
UNIVERSIDAD CENTRAL DE VENEZUELA
FACULTAD DE INGENIERIA
ESCUELA DE INGENIERIA ELECTRICA
DEPARTAMENTO DE ELECTRONICA, COMPUTACION Y CONTROL
SOLUCION DE ECUACIONES NO LINEALES
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Preliminares Matemticos
*
x x
x
x x
*

Error Absoluto = Error Relativo =


Si x
*
es una aproximacin a x, entonces
Siempre y cuando x 0
Si x
*
es una aproximacin a x, entonces
1
*
4 *
3 *
3
10 * 3333 . 0
10 * 1 . 0
10 * 3100 . 0
10 * 3000 . 0

=
=
=
x
x x
x x
x
x
1
*
*
1 *
1
10 * 3333 . 0
1 . 0
10 * 3100 . 0
10 * 3000 . 0

=
=
=
x
x x
x x
x
x
1
*
3 *
4 *
4
10 * 3333 . 0
10 * 1 . 0
10 * 3100 . 0
10 * 3000 . 0

=
=
=
x
x x
x x
x
x
Consecuentemente, como una medida de precisin, el error absoluto puede ser engaoso y el error relativo
ms significativo.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
9 Biseccin f(x) , [ a, b ] , , N
0
9 Secante f(x) , [ x
1
, x
2
] , , N
0
9 Regula Falsi Modificado f(x) , [ a, b ] , , N
0
9 Tangente Newton f(x) , f(x) , x
1
, , N
0
9 Iteracin de Punto Fijo f(x) , g(x) , g(x) , x
1
, , N
0
9 Convergencia para el mtodo del punto fijo
Proceso de Aitken
Algoritmo de Steffensen f(x) , g(x) , x
1
, x
2
, x
3
, , N
0
Mtodos iterativos para obtener la solucin de ecuaciones no lineales
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
-3 -2 -1 0 1 2 3
-25
-20
-15
-10
-5
0
5
10
15
20
25
x
f
(
x
)
( ) 1
3
= x x x f
Raz exacta = 1.32471795724475
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
( ) 1
3
= x x x f
Mtodo de Biseccin
Funcin
Intervalo
Tolerancia
5
10 * 1

= t
Iteraciones estimadas
| | | | 2 , 1 , = b a
17 6096 . 16
2
~ = s

n n
a b
n
t
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-2
0
2
4
6
8
10
12
14
Mtodo de Biseccin
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-2
0
2
4
6
8
10
12
14
Mtodo de Biseccin
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-2
0
2
4
6
8
10
12
14
Mtodo de Biseccin
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-2
0
2
4
6
8
10
12
14
Mtodo de Biseccin
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
ALGORITMO DE BISECCION (Anlisis Numrico Richard L. Burden)
Para encontrar una solucin de f(x)=0 dada la funcin continua f en el intervalo [a,b]
donde f(a) y f(b) tienen signos opuestos:
ENTRADA extremos a, b; tolerancia TOL; mximo nmero de iteraciones N
0
.
SALIDA solucin aproximada p o mensaje de fracaso
Paso 1 Tomar i = 1
Paso 2 Mientras que i <= No (seguir Pasos 3-6)
Paso 3 Tomar p = a + (b-a)/2
Paso 4 Si f(p) = 0 (b-a)/2 < TOL
Entonces SALIDA (p); (Procedimiento completado satisfactoriamente)
PARAR
Paso 5 Tomar i = i + 1.
Paso 6 Si f(a)*f(p)>0
Entonces
tomar a=p (Calcular ai, bi).
Si no
tomar b=p
Paso 7 SALIDA (El mtodo fracas despus de N
0
iteraciones, N
0
= , N
0
);
(Procedimiento completado sin xito).
PARAR.
Nota: Otros criterio de paro (Paso 4)
c s
1 N N
p p c s


N
N N
p
p p
1
( ) c s
N
p f
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Resultados Mtodo de Biseccin
It. a c b f(a) f(c) f(b) |(b-a)/2|
1, 1.000000, 1.500000, 2.000000 -1.000000, 0.875000, 5.000000, 0.500000
2, 1.000000, 1.250000, 1.500000 -1.000000, -0.296875, 0.875000, 0.250000
3, 1.250000, 1.375000, 1.500000 -0.296875, 0.224609, 0.875000, 0.125000
4, 1.250000, 1.312500, 1.375000 -0.296875, -0.051514, 0.224609, 0.062500
5, 1.312500, 1.343750, 1.375000 -0.051514, 0.082611, 0.224609, 0.031250
6, 1.312500, 1.328125, 1.343750 -0.051514, 0.014576, 0.082611, 0.015625
7, 1.312500, 1.320313, 1.328125 -0.051514, -0.018711, 0.014576, 0.007813
8, 1.320313, 1.324219, 1.328125 -0.018711, -0.002128, 0.014576, 0.003906
9, 1.324219, 1.326172, 1.328125 -0.002128, 0.006209, 0.014576, 0.001953
10, 1.324219, 1.325195, 1.326172 -0.002128, 0.002037, 0.006209, 0.000977
11, 1.324219, 1.324707, 1.325195 -0.002128, -0.000047, 0.002037, 0.000488
12, 1.324707, 1.324951, 1.325195 -0.000047, 0.000995, 0.002037, 0.000244
13, 1.324707, 1.324829, 1.324951 -0.000047, 0.000474, 0.000995, 0.000122
14, 1.324707, 1.324768, 1.324829 -0.000047, 0.000214, 0.000474, 0.000061
15, 1.324707, 1.324738, 1.324768 -0.000047, 0.000084, 0.000214, 0.000031
16, 1.324707, 1.324722, 1.324738 -0.000047, 0.000018, 0.000084, 0.000015
17, 1.324707, 1.324715, 1.324722 -0.000047, -0.000014, 0.000018, 0.000008
Se satisface la tolerancia.
Resultado final: Raz = 1.324715
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
( ) 1
3
= x x x f
Funcin
Intervalo
Tolerancia
5
10 * 1

= t
| | | | 2 , 1 , = b a
Mtodo de la Secante
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-4
-2
0
2
4
6
8
10
12
14
Mtodo de Secante
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-4
-2
0
2
4
6
8
10
12
14
Mtodo de Secante
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-4
-2
0
2
4
6
8
10
12
14
Mtodo de Secante
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-4
-2
0
2
4
6
8
10
12
14
Mtodo de Secante
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
ALGORITMO DE LA SECANTE (Anlisis Numrico Richard L. Burden)
Para encontrar una solucin de f(x)=0 dada las aproximaciones iniciales p
0
y p
1
ENTRADA aproximaciones iniciales p
0
y p
1
; tolerancia TOL; mximo nmero de iteraciones N
0
.
SALIDA solucin aproximada p o mensaje de fracaso
Paso 1 Tomar i = 2
q
0
= f(p
0
);
q
1
= f(p
1
).
Paso 2 Mientras que i <= No (seguir Pasos 3-6)
Paso 3 Tomar p = p
1
q
1
*(p
1
p
o
)/(q
1
q
0
). (Calcular p
i
)
Paso 4 Si |p - p
1
| < TOL
Entonces
SALIDA (p); (Procedimiento completado satisfactoriamente)
PARAR
Paso 5 Tomar i = i + 1.
Paso 6 Tomar
p
0
= p
1
; (Redefinir p
0
, q
0
, p
1
, q
1
).
q
0
= q
1
;
p
1
=p;
q
1
=f(p).
Paso 7 SALIDA (El mtodo fracas despus de N
0
iteraciones, N
0
= , N
0
);
(Procedimiento completado sin xito).
PARAR.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Resultados Mtodo de la Secante
It. x1 x2 f(x1) f(x2) x3 f(x3) |(x2-x1)|
1, 1.000000, 2.000000, -1.000000 5.000000, 1.166667, -0.578704, 0.833333
2, 2.000000, 1.166667, 5.000000 -0.578704, 1.253112, -0.285363, 0.086445
3, 1.166667, 1.253112, -0.578704 -0.285363, 1.337206, 0.053881, 0.084094
4, 1.253112, 1.337206, -0.285363 0.053881, 1.323850, -0.003698, 0.013356
5, 1.337206, 1.323850, 0.053881 -0.003698, 1.324708, -0.000043, 0.000858
6, 1.323850, 1.324708, -0.003698 -0.000043, 1.324718, 0.000000, 0.000010
7, 1.324708, 1.324718, -0.000043 0.000000, 1.324718, -0.000000, 0.000000
Se satisface la tolerancia.
Resultado final: Raz = 1.324718
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
( ) 1
3
= x x x f
Funcin
Intervalo
Tolerancia
5
10 * 1

= t
| | | | 2 , 1 , = b a
Punto Inicial 1
0
= w
Mtodo de Regula Falsi Modificado
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-4
-2
0
2
4
6
8
10
12
14
Mtodo de Regula Falsi Modificado
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-4
-2
0
2
4
6
8
10
12
14
Mtodo de Regula Falsi Modificado
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-4
-2
0
2
4
6
8
10
12
14
Mtodo de Regula Falsi Modificado
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
ALGORITMO DE REGULA FALSI MODIFICADO (Anlisis Numrico S.D. CONTE)
Dada f(x) continua sobre [a
0
, b
0
] y tal que f(a
0
)*f(b
0
)<0
ENTRADA extremos a, b; tolerancia TOL; mximo nmero de iteraciones N
0
.
SALIDA solucin aproximada p o mensaje de fracaso
Paso 1 Tomar
a
0
F = f(a
0
)
b
0
G = f(b
0
)
w
0
= a
0
fw
0
= f(w
0
)
Paso 2 Para n = 0, 1, 2, , hoc
Paso 3 w
n+1
= (G*a
n
F*b
n
)/(G - F).
Paso 4 Si f(a
n
)*f(w
n+1
)0
a
n+1
= a
n
b
n+1
= w
n+1
G = f(w
n+1
)
Si f(w
n
)*f(w
n+1
)>0
F = F / 2
Si no
a
n+1
= w
n+1
F = f(w
n+1
)
b
n+1
= b
n
Si f(wn)*f(wn+1)>0
G = G / 2
Paso 5 Entonces f(x) tienes una raz en el intervalo [ a
n+1
, b
n+1
]
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Mtodo de Regula Falsi Modificado
It. A b F = f(a) G = f(b) w f(w) |(w1-w0)|
1, 1.000000, 2.000000, -1.000000 5.000000, 1.000000, -1.000000, 0.166667
2, 1.166667, 2.000000, -0.578704 2.500000, 1.166667, -0.578704, 0.156642
3, 1.323308, 2.000000, -0.006004 2.500000, 1.323308, -0.006004, 0.001621
4, 1.323308, 1.324929, -0.006004 0.000902, 1.324929, 0.000902, 0.000212
5, 1.324718, 1.324929, -0.000001 0.000902, 1.324718, -0.000001, 0.000000
Se satisface la tolerancia.
Resultado final: Raz = 1.324718
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
( ) 1
3
= x x x f
Funcin
Punto Inicial
Tolerancia
5
10 * 1

= t
1
1
= x
( ) 1 * 3 '
2
= x x f
Funcin Derivada
Mtodo de la Tangente Newton
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-4
-2
0
2
4
6
8
10
12
14
Mtodo de Newton-Raphson
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-4
-2
0
2
4
6
8
10
12
14
Mtodo de Newton-Raphson
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0.5 1 1.5 2 2.5
-4
-2
0
2
4
6
8
10
12
14
Mtodo de Newton-Raphson
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
ALGORITMO DE LA TANGENTE O NEWTON (Anlisis Numrico Richard L. Burden)
Para encontrar una solucin de f(x) = 0 dada una aproximacin inicial p
0
ENTRADA aproximacin inicial p
0
; tolerancia TOL; mximo nmero de iteraciones N
0
.
SALIDA solucin aproximada p o mensaje de fracaso
Paso 1 Tomar i = 1
Paso 2 Mientras que i N
0
Paso 3 Tomar p = p
0
f(p
0
) / f(p
0
). (Calcular p
i
)
Paso 4 Si |p - p
0
| 0
SALIDA (p); (Procedimiento completado satisfactoriamente).
PARAR.
Paso 5 Tomar i = i + 1
Paso 6 Tomar p
0
= p. (Redefinir p
0
)
Paso 7 SALIDA (El mtodo fracas despus de N
0
iteraciones, N
0
= , N
0
);
(Procedimiento completado sin xito).
PARAR.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Mtodo de Newton
It. x1 f(x1) f(x1) x2 |(x2-x1)|
1, 1.000000, -1.000000, 2.000000 1.500000, 0.500000
2, 1.500000, 0.875000, 5.750000 1.347826, 0.152174
3, 1.347826, 0.100682, 4.449905 1.325200, 0.022626
4, 1.325200, 0.002058, 4.268468 1.324718, 0.000482
5, 1.324718, 0.000001, 4.264635 1.324718, 0.000000
Se satisface la tolerancia.
Resultado final: Raz = 1.324718
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Mtodo Iteracin de Punto Fijo
Para que este algoritmo sea til, debemos probar:
i.) Para el punto de partida dado x
0
, podemos calcular sucesivamente x
1
, x
2
, .
ii.) La sucesin x
1
, x
2
, converge al mismo punto .
iii.) El lmite es un punto fijo de g(x), esto es = g().
Para establecer (i, ii y iii), suponemos lo siguiente:
Hiptesis 1.
Hay un intervalo I = [a,b] tal que para todo xI, g(x) est definida y g(x)I; o sea que la funcin g(x) se aplica
sobre s misma.
De esta hiptesis se sigue, por induccin sobre n, que si x
0
I, entonces para todo n, x
n
I; por consiguiente
x
n+1
=g(x
n
) est definida y est en I.
Hiptesis 2.
La funcin de iteracin g(x) es continua sobre I=[a,b].
Hiptesis 3.
La funcin de iteracin es diferenciable sobre I=[a,b].. Adems, existe una constante no negativa K<1 tal que
para todo x I, | g(x) | K < 1
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
( ) 1
3
= x x x f
Funcin f(x)
Tolerancia
5
10 * 1

= t
( )
3
1 + = = x x g x
( )
( )
3
2
1
1
*
3
1
'
+
=
x
x g
Funcin g(x)
Funcin g(x)
Punto Inicial 1
1
= x
Mtodo de Punto Fijo
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
x
g
(
x
)
( )
3
1 + = = x x g x
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
x
g
p
(
x
)
( )
( )
3
2
1
1
*
3
1
'
+
=
x
x g
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
Mtodo del Punto Fijo
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
Mtodo del Punto Fijo
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
Mtodo del Punto Fijo
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Mtodo del Punto Fijo
It. x1 g(x1) |g(x1)| |x2 - x1|
1, 1.000000, 1.259921, 0.209987, 0.259921,
2, 1.259921, 1.312294, 0.193560, 0.052373,
3, 1.312294, 1.322354, 0.190627, 0.010060,
4, 1.322354, 1.324269, 0.190076, 0.001915,
5, 1.324269, 1.324633, 0.189971, 0.000364,
6, 1.324633, 1.324702, 0.189951, 0.000069,
7, 1.324702, 1.324715, 0.189948, 0.000013,
8, 1.324715, 1.324717, 0.189947, 0.000002,
Se satisface la tolerancia.
Resultado final: Raz = 1.324717
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
Mtodo del Punto Fijo
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
Mtodo del Punto Fijo
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
Mtodo del Punto Fijo
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Resultados Mtodo de Punto Fijo
It. x1 g(x1) |g(x1)| |x2 - x1|
1, 2.500000, 1.518294, 0.144599, 0.981706,
2, 1.518294, 1.360511, 0.180084, 0.157783,
3, 1.360511, 1.331482, 0.188022, 0.029029,
4, 1.331482, 1.326002, 0.189579, 0.005481,
5, 1.326002, 1.324962, 0.189877, 0.001040,
6, 1.324962, 1.324764, 0.189933, 0.000197,
7, 1.324764, 1.324727, 0.189944, 0.000038,
8, 1.324727, 1.324720, 0.189946, 0.000007,
Se satisface la tolerancia.
Resultado final: Raz = 1.324720
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
ALGORITMO DE PUNTO FIJO (Anlisis Numrico Richard L. Burden)
Para encontrar una solucin de p = g(p)=0 dada una aproximacin inicial p
0
.
ENTRADA aproximacin inicial p
0
; tolerancia TOL; mximo nmero de iteraciones N
0
.
SALIDA solucin aproximada p o mensaje de fracaso
Paso 1 Tomar i = 1
Paso 2 Mientras que i <= No (seguir Pasos 3-6)
Paso 3 Tomar p = g(p
0
). (Calcular p
i
).
Paso 4 Si |p p
0
| < TOL
Entonces SALIDA (p); (Procedimiento completado satisfactoriamente)
PARAR
Paso 5 Tomar i = i + 1.
Paso 6 Tomar p
0
= p. (Redefinir p
0
)
Paso 7 SALIDA (El mtodo fracas despus de No iteraciones, N
0
= , N
0
);
(Procedimiento completado sin xito).
PARAR.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Aceleracin de Convergencia para iteracin de Punto Fijo
Suponemos que
1.- la funcin g(x) es continuamente diferenciable.
2.- Partiendo de algn punto x0, la sucesin x1, x2, generada por iteracin de punto fijo converge a algn punto
(). Este punto es entonces un punto fijo de g(x).
Proceso
2
de Aitken
Es una tcnica la cual puede ser usada para acelerar la convergencia de cualquier sucesin que converja
linealmente, independientemente de su origen.
Dada una Sucesin x0, x1, x2, que converge a , calcular la sucesin x1, x2,
Supongamos que es una sucesin linealmente convergente con lmite ; esto es si
o sea que, para
{ }

=0 n n
x
n n
x e =
1 0 < < =
+

n
n
n
e
e
Lim
1
Para investigar la construccin de una sucesin que converja ms rpidamente a , supongamos que (n)
es lo suficientemente grande para que el cociente pueda usarse para aproximar el lmite.

=
)
`

0
^
n
n
x
^ ^
n n
e e *
1
=
+
n n
e e *
1
=
+
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Aceleracin de Convergencia para iteracin de Punto Fijo
n n
e e *
1
=
+ 1 2
*
+ +
=
n n
e e

1
1
2
*
+
+
+
=
n
n
n
n
e
e
e
e
( )
( )
( )
( )
1
1
2
*
+
+
+

=
n
n
n
n
x
x
x
x

Eliminando
Resolviendo para
n n n
n n n
x x x
x x x
+

=
+ +
+ +
1 2
2
1 2
* 2
*

n n n
n n n n n n n n n
x x x
x x x x x x x x x
+
+ +
=
+ +
+ + + +
1 2
1 1
2 2 2
1 2
* 2
* * 2 * * 2 *

( ) ( )
n n n
n n n n n n n n n
x x x
x x x x x x x x x
+
+ +
=
+ +
+ + + +
1 2
2
1
2
1 1 2
2
* 2
* * 2 * * 2 *

( ) ( )
n n n
n n n n n n
x x x
x x x x x x
+
+
=
+ +
+ + +
1 2
2
1 1 2
* 2
* 2 *

( )
n n n
n n
n
x x x
x x
x
+

=
+ +
+
1 2
2
1
* 2

Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003


Solucin de Ecuaciones No Lineales.-
Aceleracin de Convergencia para iteracin de Punto Fijo
( )
n n n
n n
n n
x x x
x x
x x
+

=
+ +
+
1 2
2
1
^
* 2
El mtodo de
2
de Aitken est basado en la suposicin de que la sucesin definida por

=
)
`

0
^
n
n
x
Converge ms rapidamente a que la sucesin original { }

=0 n n
x
Como x
n+2
mejor aproxmacin a que x
n
, entonces
( )
n n n
n n
n n
x x x
x x
x x
+

=
+ +
+
+
1 2
2
1
2
^
* 2
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Aceleracin de Convergencia para iteracin de Punto Fijo
La notacin asociada con esta tcnica tiene su origen en la siguiente definicin
Definicin:
Dada la sucesin , se define la diferencia progresiva x
n
mediante
{ }

=0 n n
x
n n n
x x x = A
+1 Para n 0
Las potencias mayores se definen recursivamente mediante
n
k
x A
) (
1
n
k
n
k
x x A A = A

Para k 2
Debido a la definicin
( )
n n n
x x x + A = A
+1
2
n n n
x x x A A = A
+1
2
( ) ( )
n n n n n
x x x x x = A
+ + + 1 1 2
2
n n n n
x x x x + = A
+ + 1 2
2
* 2
( )
n
n
n n
x
x
x x
2
2
2
^
A
A
=
+
Por lo tanto, la frmula para , se puede escribir como
^
n
x
Para n 0
0 lim
^
=


n
n
n
x
x

El mtodo de Steffensen construye los primeros cuatro trminos x


0
, x
1
, x
2
y x
0
.
^
X
n+2
mejor aproxmacin a que x
n
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
( ) 1
3
= x x x f
Funcin f(x)
Tolerancia
5
10 * 1

= t
( )
3
1 + = = x x g x Funcin g(x)
Punto Inicial 1
1
= x
Mtodo de Steffensen
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
Mtodo de Steffensen
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
Mtodo de Steffensen
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5
2
2.5
3
Mtodo de Steffensen
1 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4
1
1.05
1.1
1.15
1.2
1.25
1.3
1.35
1.4
Mtodo de Steffensen
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
ALGORITMO DE STEFFENSEN (Anlisis Numrico Richard L. Burden)
Para encontrar una solucin de p = g(p) dada una aproximacin inicial p
0
;
ENTRADA aproximacin inicial p
0
; tolerancia TOL; mximo nmero de iteraciones N
0
.
SALIDA solucin aproximada p o mensaje de fracaso
Paso 1 Tomar i = 1
Paso 2 Mientras que i <= No (seguir Pasos 3-6)
Paso 3 Tomar
p
1
= g(p
0
); (Calcular p
1
(i-1)
)
p
2
= g(p
1
); (Calcular p
2
(i-1)
)
p = p
2
(p
2
p
1
)
2
/(p
2
2*p
1
+p
0
). (Calcular p
0
(i)
)
Paso 4 Si |p - p
0
| < TOL
Entonces
SALIDA (p); (Procedimiento completado satisfactoriamente)
PARAR
Paso 5 Tomar i = i + 1.
Paso 6 Tomar
p
0
= p; (Redefinir p
0
).
Paso 7 SALIDA (El mtodo fracas despus de N
0
iteraciones, N
0
= , N
0
);
(Procedimiento completado sin xito).
PARAR.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
Resultados Mtodo de Steffensen
It. x1 x2 x3 xs |x1-xs|
1, 1.000000, 1.259921, 1.312294, 1.325510, 0.325510,
2, 1.325510, 1.324868, 1.324747, 1.324718, 0.000792,
3, 1.324718, 1.324718, 1.324718, 1.324718, 0.000000,
Se satisface la tolerancia.
Resultado final: Raz = 1.324718
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
PROBLEMA:
Acontinuacin se muestra un circuito rectificador de media onda, se pide obtener la ecuacin para determinar el
tiempo t
x
, para los valores de R y C dados:
) * sin( * ) ( t A t v e =
f * * 2 t e =
| | O R | | F C
| | V
| | Hz f | | s rad /
V i
V R C
D
V o
A
-A
tx
T
t [s]
V [Volt]
Vi
Vo
Vx
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
La escalera en la mina. Dos tiros de una mina se cortan formando un ngulo de 123, el ancho del tiro horizontal
mide 7 pies, y el tiro de entrada mide 9 pies de ancho, ver figura adjunta. Cul es la escalera ms larga que
puede franquear la vuelta en la interseccin de los dos tiros?. Desprecie el grosor de la escalera y suponga que la
escalera no se deforma a medida que es maniobrada alrededor de la esquina.
123
7
9
PROBLEMA:
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
1. ANALISIS NUMERICO
S.D. CONTE CARL DE BOOR
2. ANALISIS NUMERICO
RICHARD L. BURDEN J. DOUGLAS FAIRES
3. ANALISIS NUMERICO Y VISUALIZACION GRAFICA CON MATLAB
SHOICHIRO NAKAMURA
BIBLIOGRAFIA:
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
CALCULO NUMERICO
Prof. Miguel Arellano
miguel_arellano@cantv.net
marellan@engineer.com
UNIVERSIDAD CENTRAL DE VENEZUELA
FACULTAD DE INGENIERIA
ESCUELA DE INGENIERIA ELECTRICA
DEPARTAMENTO DE ELECTRONICA, COMPUTACION Y CONTROL
SOLUCION DE SISTEMAS DE ECUACIONES LINEALES
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
SISTEMAS LINEALES DE ECUACIONES A . x = b
Para resolver un sistema lineal estn permitidas tres operaciones en las ecuaciones:
1. La ecuacin E
i
puede multiplicarse por cualquier constante diferente de cero y se puede usar la
ecuacin resultante en lugar de E
i
. Esta operacin se denotar por (.E
i
E
i
).
2. La ecuacin E
j
puede multiplicarse por cualquier constante , sumarla a la ecuacin E
i
, y usar la ecuacin
resultante en lugar de E
i
. Esta operacin se denotar por (E
i
+ .E
j
)(E
i
)
3. Las ecuaciones E
i
y E
j
se pueden intercambiar. Esta operacin se denotar por (E
i
)(E
j
)
a
n 1 ,
x
1
a
n 2 ,
x
2
+ .... + a
n n ,
x
n
+ b
n
E
n
. . . . .
. . . . .
. . . . .
a
2 1 ,
x
1
a
2 2 ,
x
2
+ .... + a
2 n ,
x
n
+ b
2
E
2
a
1 1 ,
x
1
a
1 2 ,
x
2
+ .... + a
1 n ,
x
n
+ b
1
E
1
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Sistema Lineal A.x = b
Sustitucin regresiva

x
n
b
n
u
n n ,
.
x
i
b
i
i 1 +
n
j
u
i j ,
x
j

_
=

\
|
|
|
.
u
i i ,
a
,
x a
,
x + .... + a
,
x + b E
. . . . .
. . . . .
. . . . .
a
2 1 ,
x
1
a
2 2 ,
x
2
+ .... + a
2 n ,
x
n
+ b
2
E
2
a
1 1 ,
x
1
a
1 2 ,
x
2
+ .... + a
1 n ,
x
n
+ b
1
E
1 E
1
u
1 1 ,
x
1
u
1 2 ,
x
2
+ .... + u
1n
x
n
+ b
1
E
2
u
2 2 ,
x
2
.... + u
2 n ,
x
n
+ b
2
. . .
. . .
. . .
n n n , n n
Para i = (n-1)1
^
^
^
^
^
n 1 1 n 2 2 n n n n n
E u x b
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Eliminacin Gaussiana con sustitucin hacia atras
1
2
3
1
1
1
1
2
0
1
1
3
3
1
2
1
|

\
|
|
|
|
|
.
x
1
x
2
x
3
x
4
|

\
|
|
|
|
|
.

4
1
3
4
|

\
|
.
E1
E2
E3
E4
|

\
|
|
|
|
|
.
1
2
3
1
1
1
1
2
0
1
1
3
3
1
2
1
4
1
3
4
|

\
|
|
|
|
|
.
E2
E3
E4
|

\
|
|
|
|
.
E2 2 E1
E3 3 E1
E4 E1 +
|

\
|
.
E1
E2
E3
E4
|

\
|
|
|
|
|
.
1
0
0
0
1
1
4
3
0
1
1
3
3
5
7
2
4
7
15
8
|

\
|
|
|
|
|
.
E1
E2
E3
E4
|

\
|
|
|
|
|
.
1
0
0
0
1
1
0
0
0
1
3
0
3
5
13
13
4
7
13
13
|

\
|
.
E1
E2
E3
E4
|

\
|
|
|
|
|
.
1
2
3
1
1
1
1
2
0
1
1
3
3
1
2
1
4
1
3
4
|

\
|
|
|
|
|
.

E1
E2
E3
E4
|

\
|
|
|
|
|
.
1
0
0
0
1
1
4
3
0
1
1
3
3
5
7
2
4
7
15
8
|

\
|
|
|
|
|
.
E3
E4
|

\
|
|
.
E3 4 E2
E4 3 E2 +
|

\
|
.
Sistema Lineal A.x = b Matriz Ampliada w

Matriz Ampliada w en proceso

Aplicando sustitucin regresiva


x
4
13
13
x
4
1
x
3
13 13 x
4
( )
3
x
3
0
x
2
7 x
3
+ 5 x
4
+ ( )
1
x
2
2
x
1
4 x
2
3 x
4
( ) x
1
1
Solucin del Sistema:
x
1
x
2
x
3
x
4
|

\
|
|
|
|
|
|
.
1
0
2
1
|

\
|
|
|
|
.
.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Algoritmo de eliminacin Gaussiana con sustitucin hacia atrs (Burden R. Anlisis Numrico)
Para resolver el sistema lineal A.x = b de orden nxn
ENTRADA nmero de incgnitas y de ecuaciones n; matriz aumentada A = (a
i,j
) donde 1i n y 1 j n+1.
SALIDA solucin x1, x2, , xn o mensaje de que el sistema lineal no tiene solucin nica.
PASO 1 Para i = 1, , n-1 seguir los Pasos 2-4. (Proceso de Eliminacin)
PASO 2 Sea p el menor entero con i p n y a
p,i
0
S p no puede encontrarse
Entonces SALIDA (No existe solucin nica);
PARAR.
PASO 3 Si p i entonces efectuar (E
p
) (E
i
)
PASO 4 Para j = i + 1, , n seguir los Pasos 5 y 6.
PASO 5 Tomar m
j, i
= a
j, i
/ a
i, i
PASO 6 Efectuar (E
j
m
j, i
.E
i
) (E
j
)
PASO 7 Si an, n = 0 entonces SALIDA (No existe solucin nica);
PASO 8 Tomar x
n
= a
n, n+1
/ a
n, n
(Empieza la sustitucin hacia atrs)
PASO 9 Para i = n 1, , 1 tomar ........... x
i
a
i n 1 + ,
i 1 +
n
j
a
i j ,
x
j

_
=

\
|
|
|
.
a
i i ,
.
PASO 10 SALIDA (X1, X2, , Xn); (Procedimiento completado satisfactoriamente)
PARAR.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Eliminacin Gaussiana con pivoteo mximo de columna
2
4
2
3
4
3
1
3
1
|

\
|
|
|
.
x
1
x
2
x
3
|

\
|
|
|
|
.

5
3
1
|

\
|
.
2
4
2
3
4
3
1
3
1
5
3
1
|

\
|
.

p
1
2
3
|

\
|
|
|
.
Sistema Lineal A.x = b Matriz Ampliada w Vector pivotacin
Matriz Amplida w
2
4
2
3
4
3
1
3
1
5
3
1
|

\
|
.
d
2
4
2
|

\
|
|
|
.
Mximo columna 1
p
2
1
3
|

\
|
|
|
.
Vector pivotacin
E
1
E
1
1
2
E
2

E
3
E
3
1
2
E
2
+
Actualizando filas
Matriz Amplida w Mximo columna 2 Vector pivotacin Actualizando filas
d
1
5
|

\
|
.
1
2
4
1
2

1
4
5
1
2
3
5
2

7
2
3
5
2
|

\
|
.
p
2
3
1
|

\
|
.
E
1
E
1
1
5
E
3

Matriz Amplida (w) Vector pivotacin final Matriz Ampliada (w) final
1
2
4
1
2

1
5
4
5
1
3
5
2

3
3
5
2
|

\
|
.
p
2
3
1
|

\
|
|
|
.
Matriz pivotacin final
p
0
0
1
1
0
0
0
1
0
|

\
|
|
|
.
4
1
2

1
2
4
5
1
5
3
5
2

1
3
5
2
3
|

\
|
.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Matriz Ampliada (w) final
4
1
2

1
2
4
5
1
5
3
5
2

1
3
5
2
3
|

\
|
.
Sistema Lineal A.x = b Sistema Lineal equivalente U.x = bn
2
4
2
3
4
3
1
3
1
|

\
|
|
|
.
x
1
x
2
x
3
|

\
|
|
|
|
.

5
3
1
|

\
|
.
4
0
0
4
5
0
3
5
2

1
|

\
|
|
|
|
|
.
x
1
x
2
x
3
|

\
|
|
|
|
.

3
5
2
3
|

\
|
.
x
3
3
1
x
3
3
Solucin del sistema lineal U.x = bn, aplicando sustitucin regresiva
x
2
5
2
5
2
x
3
+
|

\
|
|
.
5
x
2
2
x
1
3 4 x
2
3 x
3
+ ( )
4
x
1
1
x
1
x
2
x
3
|

\
|
|
|
|
.
1
2
3
|

\
|
|
|
.
Vector solucin
Eliminacin Gaussiana con pivoteo mximo de columna
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Algoritmo de eliminacin Gaussiana con pivoteo mximo de columna (Burden R. Anlisis Numrico)
Para resolver el sistema lineal A.x = b de orden nxn
ENTRADA nmero de incgnitas y de ecuaciones n; matriz aumentada A = (a
i,j
) donde 1i n y 1 j n+1.
SALIDA solucin x1, x2, , xn o mensaje de que el sistema lineal no tiene solucin nica.
PASO 1 Para i = 1, , n tomar NROW(i) = i. (Inicializar el indicador del rengln)
PASO 3 Sea p el menor entero con i p n y |a
NROW(p) , i
| = mx
i j n
| a
NROW(p) , j
|.
PASO 4 Si a
NROW(p) , i
= 0 entonces SALIDA (No existe solucin nica)
PASO 5 Si NROW(i) NROW(p) entonces tomar (intercambio de renglones simulado)
PASO 2 Para i = 1, , (n-1) seguir los Pasos 3-6 (Proceso de eliminacin).
PARAR.
NCOPY = NROW(i);
NROW(i) = NROW(p);
NROW(p) = NCOPY.
PASO 6 Para j = i + 1, , n seguir los Pasos 7 y 8.
PASO 7 Tomar m
NROW(j) , i
= a
NROW(j) , i
/ a
NROW(i) , i
PASO 8 Efectuar (E
NROW(j)
m
NROW(j) , i
. E
NROW(i)
) (E
NROW(j)
)
PASO 9 Si a
NROW(n) , n
= 0 entonces SALIDA (No existe solucin nica);
PASO 10 Tomar x
n
= a
NROW(n) , n+1
/ a
NROW(n) , n
(Empieza la sustitucin hacia atrs)
PASO 11 Para i = n 1, , 1 tomar ............
PASO 12 SALIDA (X1, X2, , Xn); (Procedimiento completado satisfactoriamente). PARAR
PARAR.
x
i
a
NROW i ( ) n 1 + ,
i 1 +
n
j
a
NROW i ( ) j ,
x
j

_
=

\
|
|
|
.
a
NROW i ( ) i ,
.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Eliminacin Gaussiana con pivoteo escalado de columna
2
4
2
3
4
3
1
3
1
|

\
|
|
|
.
x
1
x
2
x
3
|

\
|
|
|
|
.

5
3
1
|

\
|
.
2
4
2
3
4
3
1
3
1
5
3
1
|

\
|
.

p
1
2
3
|

\
|
|
|
.
Sistema Lineal A.x = b Matriz Ampliada w Vector pivotacin
Matriz Amplida w
2
4
2
3
4
3
1
3
1
5
3
1
|

\
|
.
Mximo fila
p
2
1
3
|

\
|
.
Vector pivotacin
E
1
E
1
1
2
E
2

E
3
E
3
1
2
E
2
+
Actualizando filas
s
3
4
3
|

\
|
.
a
i 1 ,
s
i
2
3
4
4
2
3
|

\
|
.
Razn mxima
Matriz Amplida w Mximo fila Vector pivotacin
Actualizando filas
1
2
4
1
2

1
4
5
1
2
3
5
2

7
2
3
5
2
|

\
|
.
p
2
3
1
|

\
|
|
|
.
E
1
E
1
1
5
E
3

s
3
4
3
|

\
|
.
a
i 2 ,
s
i
1
3
5
3
|

\
|
.
Razn mxima
Matriz Amplida (w) Vector pivotacin final
1
2
4
1
2

1
5
4
5
1
3
5
2

3
3
5
2
|

\
|
.
p
2
3
1
|

\
|
|
|
.
Matriz pivotacin final
p
0
0
1
1
0
0
0
1
0
|

\
|
|
|
.
4
1
2

1
2
4
5
1
5
3
5
2

1
3
5
2
3
|

\
|
.
Matriz Ampliada (w) final
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Matriz Ampliada (w) final
4
1
2

1
2
4
5
1
5
3
5
2

1
3
5
2
3
|

\
|
.
Sistema Lineal A.x = b Sistema Lineal equivalente U.x = bn
2
4
2
3
4
3
1
3
1
|

\
|
|
|
.
x
1
x
2
x
3
|

\
|
|
|
|
.

5
3
1
|

\
|
.
4
0
0
4
5
0
3
5
2

1
|

\
|
|
|
|
|
.
x
1
x
2
x
3
|

\
|
|
|
|
.

3
5
2
3
|

\
|
.
x
3
3
1
x
3
3
Solucin del sistema lineal U.x = bn, aplicando sustitucin regresiva
x
2
5
2
5
2
x
3
+
|

\
|
|
.
5
x
2
2
x
1
3 4 x
2
3 x
3
+ ( )
4
x
1
1
x
1
x
2
x
3
|

\
|
|
|
|
.
1
2
3
|

\
|
|
|
.
Vector solucin
Eliminacin Gaussiana con pivoteo escalado de columna
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Algoritmo de eliminacin Gaussiana con pivoteo escalado de columna (Burden R. Anlisis Numrico)
Para resolver el sistema lineal A.x = b de orden nxn
ENTRADA nmero de incgnitas y de ecuaciones n; matriz aumentada A = (a
i,j
) donde 1i n y 1 j n+1.
SALIDA solucin x1, x2, , xn o mensaje de que el sistema lineal no tiene solucin nica.
PASO 1 Para i = 1, , n tomar s
i
= mx
1 j n
| a
i , j
|, Si s
i
=0 PARAR (No existe Sol. nica); NROW(i) = i.
PASO 3 Sea p el menor entero con i p n y |a
NROW(p) , i
|/s
NROW(p)
= mx
i j n
|a
NROW(p) , j
|/s
NROW(j)
PASO 4 Si a
NROW(p) , i
= 0 entonces SALIDA (No existe solucin nica)
PASO 5 Si NROW(i) NROW(p) entonces tomar (intercambio de renglones simulado)
PASO 2 Para i = 1, , (n-1) seguir los Pasos 3-6 (Proceso de eliminacin).
PARAR.
NCOPY = NROW(i);
NROW(i) = NROW(p);
NROW(p) = NCOPY.
PASO 6 Para j = i + 1, , n seguir los Pasos 7 y 8.
PASO 7 Tomar m
NROW(j) , i
= a
NROW(j) , i
/ a
NROW(i) , i
PASO 8 Efectuar (E
NROW(j)
m
NROW(j) , i
. E
NROW(i)
) (E
NROW(j)
)
PASO 9 Si a
NROW(n) , n
= 0 entonces SALIDA (No existe solucin nica);
PASO 10 Tomar x
n
= a
NROW(n) , n+1
/ a
NROW(n) , n
(Empieza la sustitucin hacia atrs)
PASO 11 Para i = n 1, , 1 tomar ............
PASO 12 SALIDA (X1, X2, , Xn); (Procedimiento completado satisfactoriamente). PARAR
PARAR.
x
i
a
NROW i ( ) n 1 + ,
i 1 +
n
j
a
NROW i ( ) j ,
x
j

_
=

\
|
|
|
.
a
NROW i ( ) i ,
.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Matriz L, U y P
Matriz L
l
1
1
2

1
2
0
1
1
5
0
0
1
|

\
|
.
Matriz U
u
4
0
0
4
5
0
3
5
2

1
|

\
|
|
|
|
|
.
Vector bn
bn
3
5
2
3
|

\
|
.
Matriz Ampliada (w)
4
1
2

1
2
4
5
1
5
3
5
2

1
3
5
2
3
|

\
|
.
Vector bn
bn
bn
2
bn
3
bn
1
|

\
|
.
Matriz P
p
0
0
1
1
0
0
0
1
0
|

\
|
.
A x b
Sistema lineal
Si A es una matriz cuadrada de orden nxn, entonces tenemos que
A p
1
l u
Donde (p) es la matriz de pivotacin, (l) es la matriz de multiplicadores y (u) es una matriz triangular superior
todas de orden nxn.
p
1
l u x b
u x bn
Sistema lineal equivalente

bn l
1
p b u x bn p
1
l bn b
Caso anterior
lu
u
21
m
31
m
12
u
22
u
32
m
12
u
23
u
33
u
13
|

\
|
.
Matriz LU Matriz L
l
1
m
31
m
11
0
1
m
12
0
0
1
|

\
|
.
Matriz U
u
u
21
0
0
u
22
u
32
0
u
23
u
33
u
13
|

\
|
.
Matriz P
p
0
0
1
1
0
0
0
1
0
|

\
|
|
|
.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Calculo de la Inversa de A
A x b
Sistema lineal
Si A es una matriz cuadrada de orden nxn, entonces tenemos que
A p
1
l u
Donde (p) es la matriz de pivotacin, (l) es la matriz de multiplicadores y (u) es una matriz triangular superior
todas de orden nxn.
p
1
l u x b

A
1
u
1
l
1
p
Calculo de la inversa de A
A
1
u
1
l
1
p
Si hacemos
A
1
( )
j
( )
u
1
l
1
p
j
( )

Columna (j) de la matriz inversa de A, para todo j = 1,2, , n


y
j
( )
l
1
p
j
( )

A
1
( )
j
( )
u
1
y
j
( )

Aplicamos sustitucin progresiva para


hallar y
( j )
l y
j
( )
p
j
( )
A
1
( )
j ( )
u
1
y
j ( )

z
j
( )
u
1
y
j
( )
u z
j
( )
y
j
( )
A
1
( )
j
( )
z
j
( )

Ahora
Si hacemos
Aplicamos sustitucin regresiva para
hallar z
( j )

Columna <j> de la matriz A


-1
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Calculo de la Inversa de A
l y
1 ( )
p
1 ( )
1
1
2

1
2
0
1
1
5
0
0
1
|

\
|
|
|
|
|
.
y
1
y
2
y
3
|

\
|
|
|
|
.

0
0
1
|

\
|
.
y
1
y
2
y
3
|

\
|
|
|
|
.
0
0
1
|

\
|
|
|
.
=
u z
1 ( )
y
1 ( )
4
0
0
4
5
0
3
5
2

1
|

\
|
|
|
|
.
z
1
z
2
z
3
|

\
|
|
|
|
.

0
0
1
|

\
|
.
z
3
1
z
2
0
5
2
z
3
+
|
\
|
.
5
z
1
0 4 z
2
3 z
3
+ ( )
4
z
1
z
2
z
3
|

\
|
|
|
|
.
1
4
1
2
1
|

\
|
|
|
|
|
.
=
Columna j = 1 de la matriz A
-1
Sustitucin progresiva
Sustitucin regresiva
A
1
( )
1 ( )
1
4
1
2
1
|

\
|
|
|
|
|
.
=
y
1
0
y
2
1
2
y
1

y
3
1
1
2
y
1
+
1
5
y
2

Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Calculo de la Inversa de A
Columna j = 2 de la matriz A
-1
Sustitucin progresiva
Sustitucin regresiva
l y
2 ( )
p
2 ( )
1
1
2

1
2
0
1
1
5
0
0
1
|

\
|
|
|
|
|
.
y
1
y
2
y
3
|

\
|
|
|
|
.

1
0
0
|

\
|
.
y
1
1
y
2
1
2
y
1

y
3
1
2
y
1

1
5
y
2

y
1
y
2
y
3
|

\
|
|
|
|
.
1
1
2
3
5

\
|
|
|
|
|
.
=
u z
2 ( )
y
2 ( )
4
0
0
4
5
0
3
5
2

1
|

\
|
|
|
|
.
z
1
z
2
z
3
|

\
|
|
|
|
.

1
1
2
3
5

\
|
.
z
3
3
5

z
2
1
2
5
2
z
3
+
|
\
|
.
5
z
1
1 4 z
2
3 z
3
+ ( )
4
z
1
z
2
z
3
|

\
|
|
|
|
.
0
1
5

3
5

\
|
|
|
|
|
.
= A
1
( )
2 ( )
0
1
5

3
5

\
|
|
|
|
|
.
=
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
z
1
z
2
z
3
|

\
|
|
|
|
.
1
4

1
10
1
5

\
|
|
|
|
|
|
|
.
=
y
1
y
2
y
3
|

\
|
|
|
|
.
0
1
1
5

\
|
|
|
|
.
=
Calculo de la Inversa de A
Columna j = 3 de la matriz A
-1
Sustitucin progresiva
Sustitucin regresiva
4
0
0
4
5
0
3
5
2

1
|

\
|
|
|
|
.
z
1
z
2
z
3
|

\
|
|
|
|
.

1
1
2
3
5

\
|
.
z
3
3
5

z
2
1
2
5
2
z
3
+
|
\
|
.
5
z
1
1 4 z
2
3 z
3
+ ( )
4
A
1
( )
3 ( )
1
4

1
10
1
5

\
|
|
|
|
|
|
|
.
=
l y
3 ( )
p
3 ( )
1
1
2

1
2
0
1
1
5
0
0
1
|

\
|
|
|
|
|
.
y
1
y
2
y
3
|

\
|
|
|
|
.

0
1
0
|

\
|
.
y
1
0
y
2
1
1
2
y
1
+
y
3
1
2
y
1

1
5
y
2

u z
3 ( )
y
3 ( )
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Calculo de la Inversa de A
Matriz inversa de A A
-1
A
2
4
2
3
4
3
1
3
1
|

\
|
|
|
.
= A
1
1
4
1
2
1
0
1
5

3
5

1
4

1
10
1
5

\
|
|
|
|
|
|
|
.
=
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Calculo del Determinante det(A)
Asociado con cada matriz cuadrada A de nmeros hay un nmero llamado el determinante de la matriz y
denotado por det(A). Si A = (a
ij
) es una matriz nxn, entonces el determinante de A se define por
det A ( )
p
o
p
a
1 p
1
,
a
2 p
2
,
.... a
n p
n
,

_
donde la suma se toma sobre todas las n! permutaciones, p de grado n y
p
es 1 -1, dependiendo de si p es
par o impar. De modo que, si
n 1 det A ( ) det a
11
( ) a
11
n 2 det A ( ) det
a
11
a
21
a
12
a
22
|

\
|
|
.
a
11
a
22
a
12
a
21

n m deben sumarse (m!) productos de m factores .
n 3
deben sumarse seis productos de tres factores
.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Teorema
Sea A una matriz nxn; entonces A es invertible si y slo si det(A) 0.
Regla 1: Si A = (a
ij
) es una matriz triangular superior (inferior), entonces det(A) = a
11
*a
12
*..*a
nn
Regla 2: Si P es la matriz de permutacin nxn dada por , j=1,.,n con alguna permutacin p, etonces
det P ( )
1 si p es par
-1 si p es impar
Regla 3: Si la matriz B resulta de la matriz A por intercambio de dos columnas (filas) de A, entonces
......det(B) = -det(A). En consecuencia, si dos columnas (filas) de la matriz A coinciden (de modo que su
...intercambio deja a A inalterada), entonces det(A) = 0
Regla 4: Si la matriz B se obtiene a partir de la matriz A multiplicando todas las entradas de una columna (fila)
de A por el mismo nmero , entonces det(B) = * det(A).
Regla 5: Supongamos que las tres matrices A
1
, A
2
, A
3
, nxn, difieren slo en una columna (fila), digamos la
.j-.sima, y que la j-sima columna (fila) de A
3
es la suma vectorial de la j-sima columna (fila) de A
1
y
.la j-sima columna (fila) de A
2
;.entonces : det(A
1
) + det(A
2
) = det(A
3
)
P i
j
i
p
j
Calculo del Determinante det(A)
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Las reglas 1 a 5 implican los teoremas que siguen
Teorema: Si A y B son matrices nxn, entonces det(A*B) = det(A)*det(B)
Teorema: Si A es una matriz nxn y x = (x
i
) y b son vectores de orden n tales que A.x = b entonces, para j=1,,n,
...det(A
(j)
) = x
j
* det(A), donde A
(j)
es la matriz que se obtiene reemplazando la j-sima columna de A
por b.
Si A es invertible, (teorema) det(A) 0, entonces se puede resolver det(A
(j)
) = x
j
* det(A) con
...respecto a x
j
y obtener
x
j
det A
j ( )

det A ( )
j 1 ..... , n ,
Esta es la regla de Cramer para las entradas de la solucin x del
sistema lineal A.x = b. Debido a la dificultad de calcular
determinantes, la regla de Cramer es, en general, slo de inters
terico.
En efecto, el mtodo ms rapido que se conoce para calcular det(A) para una matriz arbitraria A, nxn, es aplicar
el algoritmo de eliminacin Gaussiana a la matriz A, (sin tener en cuenta el vector b).
A P L U A: matriz original
P: matriz de permutacin, determinada por la estrategia de pivotacin
L: matriz triangular inferior con todas las entradas diagonales iguales a 1
U: matriz coeficiente final triangular superior
det A ( ) det P ( ) det L ( ) det U ( )
det P ( )
1 si p es par
-1 si p es impar
det L ( ) 1 det U ( ) u
11
u
22
..... u
nn

det A ( ) 1 ( )
i
u
11
u
22
..... u
nn
.
i: nmero de intercambio durante el algoritmo de
eliminacin.
Calculo del Determinante det(A)
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Regla 6: Desarrollo de un determinante por menores. El menor Mij de la matriz nxn, A = (aij) es, por definicin, el
determinante de la matriz de orden (n-1) obtenida a partir a A quitando la i-sima fila y la j-sima
columna. Se tiene
Para cualquier i det A ( ) a
i1
1 ( )
i 1 +
M
i1
a
i2
1 ( )
i 2 +
M
i2
+ ....... + a
in
1 ( )
i n +
M
in
+
Para cualquier j
det A ( ) a
1j
1 ( )
1 j +
M
1j
a
2j
1 ( )
2 j +
M
2j
+ ....... + a
nj
1 ( )
n j +
M
nj
+
A
2
4
2
3
4
3
1
3
1
|

\
|
.
det A ( ) 2 4 1 ( ) 4 3 1 ( ) + 3 3 ( ) 2 ( ) + [ ] 1 ( ) 4 2 ( ) 4 3 1 ( ) + 3 ( ) 3 2 + [ ]
det A ( ) 20
U
4
0
0
4
5
0
3
5
2

1
|

\
|
.
P
0
0
1
1
0
0
0
1
0
|

\
|
|
|
|
.
i = 2 , intercambio de filas
det U ( ) 1 ( )
i
4 5 1
det U ( ) 20
Calcular el determinante de A
Calculo del Determinante det(A)
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
En el circuito mostrado a continuacin, se pide calcular la cada de tensin en cada resistencia aplicando los
mtodos estudiados en clase.
R1 R2 R3
R6 R7
R8 E4
R4 R5 E3 E1
E2
O R
8
2 = O R
7
1 = O R
6
2 = O R
5
1 =
O R
4
2 = O R
3
1 = O R
2
2 = O R
1
1 =
V E
4
6 = V E
3
10 = V E
2
7 = V E
1
4 =
PROBLEMA:
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
1. ANALISIS NUMERICO
S.D. CONTE CARL DE BOOR
2. ANALISIS NUMERICO
RICHARD L. BURDEN J. DOUGLAS FAIRES
3. ANALISIS NUMERICO Y VISUALIZACION GRAFICA CON MATLAB
SHOICHIRO NAKAMURA
BIBLIOGRAFIA:
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
CALCULO NUMERICO
Prof. Miguel Arellano
miguel_arellano@cantv.net
marellan@engineer.com
UNIVERSIDAD CENTRAL DE VENEZUELA
FACULTAD DE INGENIERIA
ESCUELA DE INGENIERIA ELECTRICA
DEPARTAMENTO DE ELECTRONICA, COMPUTACION Y CONTROL
SOLUCION DE SISTEMAS DE ECUACIONES LINEALES
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Mtodos iterativos para resolver sistemas lineales
Los mtodos iterativos ms simples y mejor conocidos para la solucin de sistemas lineales son
generalizacin de iteracin de punto fijo.
x
n 1 +
g x
n
( ) n 0 1 , 2 , .... ,
Una tcnica iterativa para resolver un sistema lineal A.x = b de nxn empieza con una aproximacin x
(0)
a la
solucin x. La mayora de estas tcnicas iterativas involucran un proceso que convierte el sistema A.x = b en
un sistema equivalente de la forma x = T.x + c para alguna matriz T de nxn y un vector c.
Dado el sistema lineal A.x = b
a
11
x
1
a
12
x
2
+ .. + a
1n
x
n
+ b
1
a
21
x
1
a
22
x
2
+ .. + a
2n
x
n
+ b
2
....
a
n1
x
1
a
n2
x
2
+ .. + a
nn
x
n
+ b
n
f x ( ) 0

x
1
a
12
a
11
x
2
....
a
1 n
a
11
x
n

b
1
a
11
+
x
2
a
21
a
22
x
1
....
a
2 n
a
22
x
n

b
2
a
22
+
.........
x
n
a
n1
a
nn
x
1
....
a
n n 1 ( )
a
nn
x
n 1 ( )

b
n
a
nn
+
a
11
x
1
a
12
x
2
+ .. + a
1n
x
n
+ b
1
a
21
x
1
a
22
x
2
+ .. + a
2n
x
n
+ b
2
....
a
n1
x
1
a
n2
x
2
+ .. + a
nn
x
n
+ b
n

A x b
x T x c +
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Mtodos iterativos para resolver sistemas lineales
x
1
a
12
a
11
x
2
....
a
1 n
a
11
x
n

b
1
a
11
+
x
2
a
21
a
22
x
1
....
a
2 n
a
22
x
n

b
2
a
22
+
.........
x
n
a
n1
a
nn
x
1
....
a
n n 1 ( )
a
nn
x
n 1 ( )

b
n
a
nn
+
a
11
x
1
a
12
x
2
+ .. + a
1n
x
n
+ b
1
a
21
x
1
a
22
x
2
+ .. + a
2n
x
n
+ b
2
....
a
n1
x
1
a
n2
x
2
+ .. + a
nn
x
n
+ b
n

A x b
x T x c +
T
0
a
21
a
22

a
31
a
33

a
n1
a
nn

a
12
a
11

0
a
31
a
33

a
n2
a
nn

a
13
a
11

a
23
a
22

0
a
n3
a
nn

....
....
....
....
....
a
1n
a
11

a
2n
a
22

a
3n
a
33

0
|

\
|
|
|
|
|
|
|
|
|
|
|
|
|
.
c
b
1
a
11
b
2
a
22
b
3
a
33
b
n
a
nn
|

\
|
.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Mtodo Iterativo de Jacobi
Dado el sistema lineal A.x = b, Si todas las entradas diagonales de la matriz coeficiente A del sistema lineal
son diferentes de cero, entonces podemos construir una ecuacin vectorial equivalente de la forma
Mtodos iterativos para resolver sistemas lineales
a
11
x
1
a
12
x
2
+ .. + a
1n
x
n
+ b
1
a
21
x
1
a
22
x
2
+ .. + a
2n
x
n
+ b
2
....
a
n1
x
1
a
n2
x
2
+ .. + a
nn
x
n
+ b
n

A x b
El vector inicial x
(0)
genera la sucesin de vectores solucin x
k 1 + ( )
T x
k ( )
c + k 0 1 , 2 , ..... ,
x
1
( )
k 1 + ( )
a
12
a
11
x
2
( )
k ( )
....
a
1 n
a
11
x
n
( )
k ( )

b
1
a
11
+
x
2
( )
k 1 + ( )
a
21
a
22
x
1
( )
k ( )
....
a
2 n
a
22
x
n
( )
k ( )

b
2
a
22
+
.........
x
n
( )
k 1 + ( )
a
n1
a
nn
x
1
( )
k ( )
....
a
n n 1 ( )
a
nn
x
n 1
( )
k ( )

b
n
a
nn
+
x
k 1 + ( )
T x
k ( )
c +
La iteracin de Jacobi converge si las entradas diagonales de A son mucho ms grandes que las
extradiagonales. Decimos que la matriz A = (a
i , j
) de orden n es estrictamente (por filas) diagonalmente
dominante si
a
i i ,
j i = ( )
a
i j ,
_
>
x
k 1 + ( )
x
k ( )
c s
x
k 1 + ( )
x
k ( )

x
k 1 + ( )
c s k > It ; para algn It dado
Criterios de paro
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Jacobi
"It"
0.000000
1.000000
2.000000
3.000000
4.000000
5.000000
6.000000
7.000000
1.000000
0.000000
1.200000
0.960000
1.008000
0.998400
1.000320
0.999936
1.000013
2.000000
0.000000
1.200000
0.960000
1.008000
0.998400
1.000320
0.999936
1.000013
3.000000
0.000000
1.200000
0.960000
1.008000
0.998400
1.000320
0.999936
1.000013
"Err"
"-"
1.000000
0.250000
0.047619
0.009615
0.001919
0.000384
0.000077
|

\
|
|
|
|
|
|
|
|
|
|
|
|
.
= .
It x
1
x
2
x
3

Mtodo Iterativo de Jacobi
10 x
1
x
2
+ x
3
+ 12
x
1
10 x
2
+ x
3
+ 12
x
1
x
2
+ 10 x
3
+ 12

Criterio de paro
x
1
( )
k 1 + ( )
1
10
x
2
( )
k ( )

1
10
x
3
( )
k ( )

12
10
+
x
2
( )
k 1 + ( )
1
10
x
1
( )
k ( )

1
10
x
3
( )
k ( )

12
10
+
x
3
( )
k 1 + ( )
1
10
x
1
( )
k ( )

1
10
x
2
( )
k ( )

12
10
+
Algoritmo iterativo de Jacobi
Mtodos iterativos para resolver sistemas lineales
Solucin exacta
x
1.000000
1.000000
1.000000
|

\
|
|
|
|
.
= .
x
k 1 + ( )
x
k ( )

x
k 1 + ( )
c s
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Jacobi
1 2 3 4 5
1
2
3
4
5
6
7
8
9
10
11
12
"It" 1.000000 2.000000 3.000000 "Err"
0.000000 0.000000 0.000000 0.000000 "-"
1.000000 1.200000 1.200000 1.200000 1.000000
2.000000 -0.240000 -0.600000 -0.840000 2.428571
3.000000 2.088000 2.100000 1.896000 1.302857
4.000000 -1.177200 -1.759200 -2.359200 1.803662
5.000000 3.731040 4.029600 3.666840 1.495444
6.000000 -3.381588 -4.338780 -5.381616 1.681364
7.000000 7.136521 8.072407 7.714453 1.622325
8.000000 -8.236321 -10.024921 -11.680795 1.660439
9.000000 14.389017 16.654508 16.632625 1.700045
10.000000 -18.770092 -22.402773 -25.073721 1.663349
= .
It x
1
x
2
x
3

Mtodo Iterativo de Jacobi

x
k 1 + ( )
x
k ( )

x
k 1 + ( )
c s
Criterio de paro
Algoritmo iterativo de Jacobi
Mtodos iterativos para resolver sistemas lineales
Solucin exacta
10 x
1
5 x
2
+ 7 x
3
+ 12
6 x
1
10 x
2
+ 9 x
3
+ 12
9 x
1
8 x
2
+ 10 x
3
+ 12
x
1
( )
k 1 + ( )
5
10
x
2
( )
k ( )

7
10
x
3
( )
k ( )

12
10
+
x
2
( )
k 1 + ( )
6
10
x
1
( )
k ( )

9
10
x
3
( )
k ( )

12
10
+
x
3
( )
k 1 + ( )
9
10
x
1
( )
k ( )

8
10
x
2
( )
k ( )

12
10
+
x
1.186813
1.318681
0.923077
|

\
|
|
|
|
.
= .
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Algoritmo iterativo de Jacobi ( Anlisis Numrico Burden Richard )
Mtodos iterativos para resolver sistemas lineales
Para resolver A.x = b con una aproximacin inicial x
(0)
:
ENTRADA el nmero de ecuaciones e incgnitas n; las componentes a
i j
, 1 i, j n de la matriz A; las
componentes b
i
, 1 i n del trmino no homogneo b; las componentes X0
i
, 1 i n de X0 = x
(0)
; la
tolerancia TOL; el nmero mximo de iteraciones N.
SALIDA la solucin aproximada x
1
, x
2
, , x
n
o un mensaje de que el nmero de iteraciones fue excedido.
PASO 1 Tomar k = 1
PASO 2 Mientras que ( k N ) seguir los Pasos 3-6
PASO 3 Para i = 1, 2, , n
Tomar
( )
ii
a
i
b
n
j
i
XO
ij
a
i
x
+ _
=

=
1
*
Para
i j =
PASO 4 Si || x X0 || < TOL entonces
SALIDA (x
1
, x
2
, ., x
n
); (Procedimiento completado satisfactoriamente)
PARAR.
PASO 5 Tomar k = k + 1
PASO 6 Para i = 1, 2, ., n tomar XO
i
= x
i
.
PASO 7 SALIDA (Nmero mximo de iteraciones excedido);
PARAR ( Procedimiento completado sin xito ).
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Mtodo Iterativo de Gauss-Seidel
Dado el sistema lineal A.x = b, Si todas las entradas diagonales de la matriz coeficiente A del sistema lineal
son diferentes de cero, entonces podemos construir una ecuacin vectorial equivalente de la forma
Mtodos iterativos para resolver sistemas lineales
a
11
x
1
a
12
x
2
+ .. + a
1n
x
n
+ b
1
a
21
x
1
a
22
x
2
+ .. + a
2n
x
n
+ b
2
....
a
n1
x
1
a
n2
x
2
+ .. + a
nn
x
n
+ b
n

A x b
El vector inicial x
(0)
genera la sucesin de vectores solucin x
k 1 + ( )
T x
k ( )
c + k 0 1 , 2 , ..... ,
x
k 1 + ( )
T x
k ( )
c +
x
1
( )
k 1 + ( )
a
12
a
11
x
2
( )
k ( )
....
a
1 n
a
11
x
n
( )
k ( )

b
1
a
11
+
x
2
( )
k 1 + ( )
a
21
a
22
x
1
( )
k 1 + ( )
....
a
2 n
a
22
x
n
( )
k ( )

b
2
a
22
+
.........
x
n
( )
k 1 + ( )
a
n1
a
nn
x
1
( )
k 1 + ( )
....
a
n n 1 ( )
a
nn
x
n 1
( )
k 1 + ( )

b
n
a
nn
+
x
k 1 + ( )
x
k ( )

x
k 1 + ( )
c s k > It ; para algn It dado
Criterios de paro
x
k 1 + ( )
x
k ( )
c s
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
10 x
1
x
2
+ x
3
+ 12
x
1
10 x
2
+ x
3
+ 12
x
1
x
2
+ 10 x
3
+ 12

Criterio de paro
Mtodo Iterativo de Gauss-Seidel
Gauss_Seidel
"It"
0.000000
1.000000
2.000000
3.000000
4.000000
1.000000
0.000000
1.200000
0.994800
0.999649
0.999995
2.000000
0.000000
1.080000
1.003320
1.000016
0.999997
3.000000
0.000000
0.972000
1.000188
1.000033
1.000001
"Err"
"-"
1.000000
0.102600
0.001616
0.000086
|

\
|
|
|
|
|
|
|
|
.
= .
It x
1
x
2
x
3

x
1
( )
k 1 + ( )
1
10
x
2
( )
k ( )

1
10
x
3
( )
k ( )

12
10
+
x
2
( )
k 1 + ( )
1
10
x
1
( )
k 1 + ( )

1
10
x
3
( )
k ( )

12
10
+
x
3
( )
k 1 + ( )
1
10
x
1
( )
k 1 + ( )

1
10
x
2
( )
k 1 + ( )

12
10
+
Algoritmo iterativo de Gauss-Seidel
x
k 1 + ( )
x
k ( )

x
k 1 + ( )
c s
Mtodos iterativos para resolver sistemas lineales
Solucin exacta
x
1.000000
1.000000
1.000000
|

\
|
|
|
|
.
= .
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Gauss_Seidel
1 2 3 4 5
1
2
3
4
5
6
7
8
9
10
11
12
"It" 1.000000 2.000000 3.000000 "Err"
0.000000 0.000000 0.000000 0.000000 "-"
1.000000 1.200000 0.480000 -0.264000 1.000000
2.000000 1.144800 0.750720 -0.430896 0.135360
3.000000 1.126267 0.912046 -0.543277 0.053775
4.000000 1.124271 1.014387 -0.623354 0.025585
5.000000 1.129154 1.083526 -0.683059 0.013828
6.000000 1.136379 1.132926 -0.729082 0.008233
7.000000 1.143894 1.169837 -0.765374 0.005273
8.000000 1.150843 1.198331 -0.794424 0.003631
9.000000 1.156931 1.220823 -0.817896 0.002608
10.000000 1.162116 1.238837 -0.836974 0.001908
= .
It x
1
x
2
x
3

Mtodo Iterativo de Gauss-Seidel

x
k 1 + ( )
x
k ( )

x
k 1 + ( )
c s
Criterio de paro
Algoritmo iterativo de Gauss-Seidel
Mtodos iterativos para resolver sistemas lineales
Solucin exacta
10 x
1
5 x
2
+ 7 x
3
+ 12
6 x
1
10 x
2
+ 9 x
3
+ 12
9 x
1
8 x
2
+ 10 x
3
+ 12
x
1.186813
1.318681
0.923077
|

\
|
|
|
|
.
= .
x
1
( )
k 1 + ( )
5
10
x
2
( )
k ( )

7
10
x
3
( )
k ( )

12
10
+
x
2
( )
k 1 + ( )
6
10
x
1
( )
k 1 + ( )

9
10
x
3
( )
k ( )

12
10
+
x
3
( )
k 1 + ( )
9
10
x
1
( )
k 1 + ( )

8
10
x
2
( )
k 1 + ( )

12
10
+
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones Lineales.-
Algoritmo iterativo de Gauss-Seidel ( Anlisis Numrico Burden Richard )
Mtodos iterativos para resolver sistemas lineales
Para resolver A.x = b con una aproximacin inicial x
(0)
:
ENTRADA el nmero de ecuaciones e incgnitas n; las componentes a
i j
, 1 i, j n de la matriz A; las
componentes b
i
, 1 i n del trmino no homogneo b; las componentes X0
i
, 1 i n de X0 = x
(0)
; la
tolerancia TOL; el nmero mximo de iteraciones N.
SALIDA la solucin aproximada x
1
, x
2
, , x
n
o un mensaje de que el nmero de iteraciones fue excedido.
PASO 1 Tomar k = 1
PASO 2 Mientras que ( k N ) seguir los Pasos 3-6
PASO 3 Para i = 1, 2, , n
Tomar
PASO 4 Si || x X0 || < TOL entonces
SALIDA (x
1
, x
2
, ., x
n
); (Procedimiento completado satisfactoriamente)
PARAR.
PASO 5 Tomar k = k + 1
PASO 6 Para i = 1, 2, ., n tomar XO
i
= x
i
.
PASO 7 SALIDA (Nmero mximo de iteraciones excedido);
PARAR ( Procedimiento completado sin xito ).
( ) ( )
ii
a
i
b
n
i j
i
XO
ij
a
i
j
j
x
ij
a
i
x
+ _
+ =
_

=

=
1
*
1
1
*
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Ecuaciones No Lineales.-
1. ANALISIS NUMERICO
S.D. CONTE CARL DE BOOR
2. ANALISIS NUMERICO
RICHARD L. BURDEN J. DOUGLAS FAIRES
3. ANALISIS NUMERICO Y VISUALIZACION GRAFICA CON MATLAB
SHOICHIRO NAKAMURA
BIBLIOGRAFIA:
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
CALCULO NUMERICO
Prof. Miguel Arellano
miguel_arellano@cantv.net
marellan@engineer.com
UNIVERSIDAD CENTRAL DE VENEZUELA
FACULTAD DE INGENIERIA
ESCUELA DE INGENIERIA ELECTRICA
DEPARTAMENTO DE ELECTRONICA, COMPUTACION Y CONTROL
SOLUCION DE SISTEMAS DE ECUACIONES NO LINEALES
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones No Lineales.-
Soluciones numricas a sistemas no lineales de ecuaciones
La forma general de un sistema de ecuaciones no lineales es:
f
1
x
1
x
2
, .. , x
n
, ( ) 0
f
2
x
1
x
2
, .. , x
n
, ( ) 0
.....
f
n
x
1
x
2
, .. , x
n
, ( ) 0
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones No Lineales.-
Soluciones numricas a sistemas no lineales de ecuaciones
Mtodo de punto fijo
x
1
( )
k 1 +
( )
x
2
( )
k 1 +
( )
x
3
( )
k 1 +
( )

(
(
(
(
(

g
1
x
1
( )
k
( )
x
2
( )
k
( )
, x
3
( )
k
( )
,

g
2
x
1
( )
k
( )
x
2
( )
k
( )
, x
3
( )
k
( )
,

g
3
x
1
( )
k
( )
x
2
( )
k
( )
, x
3
( )
k
( )
,

(
(
(
(
(

1
3
cos x
2
( )
k
( )
x
3
( )
k
( )

1
6
+
1
9
x
1
( )
k
( )

2
sin x
3
( )
k
( )

+ 1.06 + 0.1
1
20
e
x
1
( )
k
( )
x
2
( )
k
( )

10 t 3 ( )
60

(
(
(
(
(
(
(
(

PF
"It"
0.000000
1.000000
2.000000
3.000000
4.000000
5.000000
"Sol. Exacta"
1.000000
0.100000
0.499983
0.499996
0.500000
0.500000
0.500000
0.500000
2.000000
0.100000
0.009441
0.000026
0.000012
0.000000
0.000000
0.000000
3.000000
0.100000
0.523101
0.523363
0.523598
0.523598
0.523599
0.523599
"Err"
"-"
0.808832
0.017991
0.000448
0.000023
0.000001
0.000000
|

\
|
|
|
|
|
|
|
|
|
|
|
.
=
It x
1
x
2
x
3

Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones No Lineales.-
Soluciones numricas a sistemas no lineales de ecuaciones
x
1
( )
k 1 +
( )
x
2
( )
k 1 +
( )
x
3
( )
k 1 +
( )

(
(
(
(
(

g
1
x
1
( )
k
( )
x
2
( )
k
( )
, x
3
( )
k
( )
,

g
2
x
1
( )
k 1 +
( )
x
2
( )
k
( )
, x
3
( )
k
( )
,

g
3
x
1
( )
k 1 +
( )
x
2
( )
k 1 +
( )
, x
3
( )
k
( )
,

(
(
(
(
(

1
3
cos x
2
( )
k
( )
x
3
( )
k
( )

1
6
+
1
9
x
1
( )
k 1 +
( )

2
sin x
3
( )
k
( )

+ 1.06 + 0.1
1
20
e
x
1
( )
k 1 +
( )
x
2
( )
k 1 +
( )

10 t 3 ( )
60

(
(
(
(
(
(
(
(

GS
"It"
0.000000
1.000000
2.000000
3.000000
4.000000
"Sol. Exacta"
1.000000
0.100000
0.499983
0.499977
0.500000
0.500000
0.500000
2.000000
0.100000
0.022230
0.000028
0.000000
0.000000
0.000000
3.000000
0.100000
0.523046
0.523598
0.523599
0.523599
0.523599
"Err"
"-"
0.808812
0.042402
0.000054
0.000000
0.000000
|

\
|
|
|
|
|
|
|
|
|
.
=
It x
1
x
2
x
3

Mtodo de Gauss-Seidel
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones No Lineales.-
Soluciones numricas a sistemas no lineales de ecuaciones
Mtodo de Newton
g x ( ) x
f x ( )
x
f x ( )
d
d

a x ( )
x
f x ( )
d
d
g x ( ) x
f x ( )
a x ( )

g x ( ) x a x ( )
1
f x ( ) G x ( ) x A x ( )
1
F x ( )
G x ( ) x A x ( )
1
F x ( )
A p ( )
1
J p ( ) I
A p ( ) J p ( )
F p ( ) 0
G x ( ) x J x ( )
1
F x ( )
Ax J x ( )
1
F x ( )
G x ( ) x Ax +
Ax J x ( )
1
F x ( ) J x ( ) Ax F x ( )
x
k 1 +
( )
G x
k
( )
( )
x
k
( )
Ax
k
( )
+ J x
k
( )
( )
Ax
k
( )
F x
k
( )
( )

Si hacemos
Si hacemos
Siendo F(x) un funcin de R
n
en R
n
Si p es una solucin de F(x) = 0, entonces
Si adems A(x) es no-singular cerca de una solucin p, tenemos que
De
;
Se obtiene el sistema lineal Resolviendo para x
Para una iteracin k

Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003


Solucin de Sistemas de Ecuaciones No Lineales.-
Soluciones numricas a sistemas no lineales de ecuaciones
Mtodo de Newton
J x
1
x
2
, x
3
, ( )
x
1
f
1
x
1
x
2
, x
3
, ( )
c
c
x
1
f
2
x
1
x
2
, x
3
, ( )
c
c
x
1
f
3
x
1
x
2
, x
3
, ( )
c
c
x
2
f
1
x
1
x
2
, x
3
, ( )
c
c
x
2
f
2
x
1
x
2
, x
3
, ( )
c
c
x
2
f
3
x
1
x
2
, x
3
, ( )
c
c
x
2
f
1
x
1
x
2
, x
3
, ( )
c
c
x
3
f
2
x
1
x
2
, x
3
, ( )
c
c
x
3
f
3
x
1
x
2
, x
3
, ( )
c
c

(
(
(
(
(
(
(
(
(

3
2 x
1

x
2
e
x
1
x
2

x
3
sin x
2
x
3
( )
162 x
2
0.1 + ( )
x
1
e
x
1
x
2

x
2
sin x
2
x
3
( )
cos x
3
( )
20

(
(
(
(

.
F x
1
x
2
, x
3
, ( )
f
1
x
1
x
2
, x
3
, ( )
f
2
x
1
x
2
, x
3
, ( )
f
3
x
1
x
2
, x
3
, ( )

(
(
(
(

3 x
1
cos x
2
x
3
( )
1
2

x
1
( )
2
81 x
2
0.1 + ( )
2
sin x
3
( ) + 1.06 +
e
x
1
x
2

20 x
3
+
10 t 3
( )
3
+

(
(
(
(
(
(
(

.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones No Lineales.-
Soluciones numricas a sistemas no lineales de ecuaciones
Mtodo de Newton
NEWTON
"It"
0.000000
1.000000
2.000000
3.000000
4.000000
5.000000
"Sol. Exacta"
1.000000
0.100000
0.499870
0.500014
0.500000
0.500000
0.500000
0.500000
2.000000
0.100000
0.019467
0.001589
0.000012
0.000000
0.000001
0.000000
3.000000
0.100000
0.521520
0.523557
0.523598
0.523599
0.523599
0.523599
"Err"
"-"
0.808253
0.034148
0.003010
0.000024
0.000001
0.000001
|

\
|
|
|
|
|
|
|
|
|
|
|
.
=
It x
1
x
2
x
3
Para k = 0
x
1
( )
0
( )
x
2
( )
0
( )
x
3
( )
0
( )

(
(
(
(
(

0.100000
0.100000
0.100000
|

\
|
.
F x
1
( )
0
( )
x
2
( )
0
( )
, x
3
( )
0
( )
,

1.199950
2.269833
8.462025
|

\
|
.
J x
1
( )
0
( )
x
2
( )
0
( )
, x
3
( )
0
( )
,

3.000000
0.200000
0.099005
0.001000
32.400000
0.099005
0.001000
0.995004
20.000000
|

\
|
.
Ax
0
( )
J x
1
( )
0
( )
x
2
( )
0
( )
, x
3
( )
0
( )
,

1
F x
1
( )
0
( )
x
2
( )
0
( )
, x
3
( )
0
( )
,

Ax
0
( )
0.399870
0.080533
0.421520
|

\
|
.
x
1
( )
x
0
( )
Ax
0
( )
+

x
1
( )
1
( )
x
2
( )
1
( )
x
3
( )
1
( )

(
(
(
(
(

0.499870
0.019467
0.521520
|

\
|
.
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
Solucin de Sistemas de Ecuaciones No Lineales.-
Soluciones numricas a sistemas no lineales de ecuaciones
Problema
H
L2
L1
W
Dos escaleras se cruzan en un pasillo. Cada escalera est colocada de la base de una pared a algn punto de
la pared opuesta. Las escaleras se cruzan a una altura H arriba del pavimento. Dado que las longitudes de la
escaleras L1, L2 y H, encuentre W, el ancho del pasillo.
Dados:
L1 = 20 m
L2 = 30 m
H = 8 m
Se pide:
1. Plantear la ecuacin f(w)=0 y resolver por el mtodo de Newton
2. Plantear el sistema de ecuaciones y resolver por el
Mtodo de Gauss-Seidel y
Mtodo de Newton
3. Realizar todos los clculos y grficos con Matlab
Prof. Miguel Arellano UCV EIE Clculo Numrico. Semestre 01/2003
UNIVERSIDAD CENTRAL DE VENEZUELA
FACULTAD DE INGENIERIA
ESCUELA DE INGENIERIA ELECTRICA
DEPARTAMENTO DE ELECTRONICA, COMPUTACION Y CONTROL
CALCULO NUMERICO
Prof. Miguel Arellano
miguel_arellano@cantv.net
marellan@engineer.com
Interpolacin y aproximacin
Aproximacin discreta de mnimos cuadrados.-
Aproximacin de datos por mnimos cuadrados.-
El problema general de aproximar un conjunto de datos { ( xi , yi ) | i = 0, 1, ..., M } con un polinomio
P
n
x ( )
0
n
k
a
k
x
k

_
=
= de grado n M <
usando el procedimiento de mnimos cuadrados y requiere de la eleccin de las constantes a
0
a
1
, .. , a
n
,
para minimizar el error de mnimos cuadrados
E
0
M
i
y
i
P x
i ( ) ( )
2
_
=
=
Caso particular
P
1
x ( ) a
0
a
1
x + =
E
0
M
i
y
i
P
1
x
i ( )

2
_
=
=
E
0
M
i
y
i
a
0
a
1
x
i
+ ( )

2
_
=
=
E
0
M
i
y
i
a
0
a
1
x
i
( )
2
_
=
=
Prof. Miguel Arellano
Interpolacin y aproximacin
Condicin para minimizar el error de mnimos cuadrados
a
0
E
c
c
0 =
a
1
E
c
c
0 =
Resolviendo la primera ecuacin
a
0
E
c
c
2
0
M
i
y
i
a
0
a
1
x
i
( ) 1 ( )
_
=
=
2
0
M
i
y
i
a
0
a
1
x
i
( ) 1 ( )
_
=
0 = ==>
0
M
i
y
i
1 ( )
_
=
a
0
0
M
i
1 ( )
_
=
+ a
1
0
M
i
x
i ( )
_
=
+ 0 =
a
0
0
M
i
x
i ( )
0
_
=
a
1
0
M
i
x
i ( )
1
_
=
+
0
M
i
y
i
x
i ( )
0

_
=
=
Para la segunda ecuacin
a
1
E
c
c
2
0
M
i
y
i
a
0
a
1
x
i
( ) x
i
( )
_
=
=
2
0
M
i
y
i
a
0
a
1
x
i
( ) x
i
( )
_
=
0 = ==>
0
M
i
y
i
x
i
( )
_
=
a
0
0
M
i
x
i ( )
_
=
+ a
1
0
M
i
x
i ( )
2
_
=
+ 0 =
a
0
0
M
i
x
i ( )
1
_
=
a
1
0
M
i
x
i ( )
2
_
=
+
0
M
i
y
i
x
i ( )
1

_
=
=
Prof. Miguel Arellano
Interpolacin y aproximacin
a
0
0
M
i
x
i ( )
n
_
=
a
1
0
M
i
x
i ( )
n 1 +
_
=
+ a
2
0
M
i
x
i ( )
n 2 +
_
=
+ .... + a
n
0
M
i
x
i ( )
2 n
_
=
+
0
M
i
y
i
x
i ( )
n

_
=
=
.
.
.
.
a
0
0
M
i
x
i ( )
1
_
=
a
1
0
M
i
x
i ( )
2
_
=
+ a
2
0
M
i
x
i ( )
3
_
=
+ .... + a
n
0
M
i
x
i ( )
n 1 +
_
=
+
0
M
i
y
i
x
i ( )
1

_
=
=
a
0
0
M
i
x
i ( )
0
_
=
a
1
0
M
i
x
i ( )
1
_
=
+ a
2
0
M
i
x
i ( )
2
_
=
+ .... + a
n
0
M
i
x
i ( )
n
_
=
+
0
M
i
y
i
x
i ( )
0

_
=
=
a
0
a
1
, .... , a
n
, Sistema lineal para determinar
P
n
x ( ) a
0
a
1
x + a
2
x
2
+ .. + a
n
x
n
+ =
Caso general
a
0
a
1
|

\
|
|
.
0
M
i
x
i ( )
0
_
=
0
M
i
x
i ( )
1
_
=
0
M
i
x
i ( )
1
_
=
0
M
i
x
i ( )
2
_
=

(
(
(
(
(
(
(

1
0
M
i
y
i
x
i ( )
0

_
=
0
M
i
y
i
x
i ( )
1

_
=

(
(
(
(
(
(
(

=
0
M
i
x
i ( )
0
_
=
0
M
i
x
i ( )
1
_
=
0
M
i
x
i ( )
1
_
=
0
M
i
x
i ( )
2
_
=

(
(
(
(
(
(
(

a
0
a
1
|

\
|
|
.

0
M
i
y
i
x
i ( )
0

_
=
0
M
i
y
i
x
i ( )
1

_
=

(
(
(
(
(
(
(

=
a
1
y a
0
Sistema lineal para determinar
Prof. Miguel Arellano
Interpolacin y aproximacin
Ejemplo
Ajuste los datos que se muestran en la tabla con el polinomio de mnimos cuadrados discreto de grado dos.
P
2
x ( ) a
0
a
1
x
1
+ a
2
x
2
+ = Polinomio de grado dos
Para este problema n 2 := Grado del polinomio
x
0
x
1
x
2
x
3
x
4
y
0
y
1
y
2
y
3
y
4
|

\
|
|
|
|
|
|
|
.
0.0000
0.2500
0.5000
0.7500
1.0000
1.0000
1.2840
1.6487
2.1170
2.7183
|

\
|
|
|
|
|
|
.
:=
M 5 := Nmero de datos
j 0 1 , M 1 ( ) .. :=
Ecuaciones normales
a
0
0
M 1
k
x
k ( )
0
_
=
a
1
0
M 1
k
x
k ( )
1
_
=
+ a
2
0
M 1
k
x
k ( )
2
_
=
+
0
M 1
k
y
k
x
k ( )
0

_
=
=
a
0
0
M 1
k
x
k ( )
1
_
=
a
1
0
M 1
k
x
k ( )
2
_
=
+ a
2
0
M 1
k
x
k ( )
3
_
=
+
0
M 1
k
y
k
x
k ( )
2

_
=
=
a
0
0
M 1
k
x
k ( )
2
_
=
a
1
0
M 1
k
x
k ( )
3
_
=
+ a
2
0
M 1
k
x
k ( )
4
_
=
+
0
M 1
k
y
k
x
k ( )
3

_
=
=
Prof. Miguel Arellano
Interpolacin y aproximacin
Solucin del sistema lineal A c b =
A
0
M 1
k
x
k ( )
0
_
=
0
M 1
k
x
k ( )
1
_
=
0
M 1
k
x
k ( )
2
_
=
0
M 1
k
x
k ( )
1
_
=
0
M 1
k
x
k ( )
2
_
=
0
M 1
k
x
k ( )
3
_
=
0
M 1
k
x
k ( )
2
_
=
0
M 1
k
x
k ( )
3
_
=
0
M 1
k
x
k ( )
4
_
=

(
(
(
(
(
(
(
(
(
(
(

:= b
0
M 1
k
y
k
x
k ( )
0

_
=
0
M 1
k
y
k
x
k ( )
1

_
=
0
M 1
k
y
k
x
k ( )
2

_
=

(
(
(
(
(
(
(
(
(
(
(

:=
A
5.0000
2.5000
1.8750
2.5000
1.8750
1.5625
1.8750
1.5625
1.3828
|

\
|
|
|
|
.
= b
8.7680
5.4514
4.4015
|

\
|
|
|
|
.
=
A c b = ==> c A
1
b =
c A
1
b := ==> c
1.0051
0.8642
0.8437
|

\
|
|
|
|
.
=
Coeficientes a c := ==>
a
0
a
1
a
2
|

\
|
|
|
|
.
1.0051
0.8642
0.8437
|

\
|
|
|
|
.
=
Prof. Miguel Arellano
Interpolacin y aproximacin
P2 X ( ) a
0
a
1
X
1
+ a
2
X
2
+ := X x
0
x
0
x
M 1
x
0
( )
10
+

(
(

, x
M 1
.. :=
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
0
0.5
1
1.5
2
2.5
3
y
j
P2 X ( )
x
j
X ,
Error de mnimos cuadrados
E
0
M 1
k
y
k
P2 x
k ( ) ( )
2
_
=
:= ==> E 2.7413 10
4
=
Prof. Miguel Arellano
Interpolacin y aproximacin
b e
a
0
=
a a
1
=
regresamos los cambios para determinar a y b a
1
y a
o
luego de aplicar mnimos cuadrados para determinar
X
j
Y
j ( ) ln x
j ( ) ln y
j ( ) ( ) = x
j
Y
j ( ) x
j
ln y
j ( ) ( ) =
nueva tabla de datos nueva tabla de datos
Y X ( ) a
0
a
1
X + = Y x ( ) a
0
a
1
x + =
ln y x ( ) ( ) ln b ( ) a ln x ( ) + = ln y x ( ) ( ) ln b ( ) a x + =
y x ( ) b x
a
= y x ( ) b e
a x
=
Caso 2 Caso 1
Aproximacin exponencial por mnimos cuadrados.-
Prof. Miguel Arellano
UNIVERSIDAD CENTRAL DE VENEZUELA
FACULTAD DE INGENIERIA
ESCUELA DE INGENIERIA ELECTRICA
DEPARTAMENTO DE ELECTRONICA, COMPUTACION Y CONTROL
CALCULO NUMERICO
Prof. Miguel Arellano
Cel.: 0412 - 706 41 40
miguel_arellano@cantv.net
marellan@engineer.com
Diferenciacin e integracin numrica
Diferenciacin Numrica.-
Tcnicas numricas para aproximar f '(x0)
f x ( ) P
n
x ( )
f
n 1 + ( )
x ( ) ( )
n 1 + ( )!
0
n
i
x x
i
( )
[
=
+ = P
n
x ( )
0
n
k
f x
k ( )
0
n
i
x x
i
( )
x
k
x
i
( )
[
=

(
(
(

_
=
=
i k =
x
i
x
0
i h + = i 0 = 1 ,
f x ( ) f x
0 ( )
x x
1
( )
x
0
x
1
( )
f x
1 ( )
x x
0
( )
x
1
x
0
( )
+
f
2 ( )
x ( ) ( )
2!
x x
0
( ) x x
1
( ) + =
f x ( ) f x
0 ( )
x x
1
( )
x
1
x
0
( )
f x
1 ( )
x x
0
( )
x
1
x
0
( )
+
f
2 ( )
x ( ) ( )
2!
x x
0
( ) x x
1
( ) + =
f x ( ) f x
1 ( )
x x
0
( )
x
1
x
0
( )
f x
0 ( )
x x
1
( )
x
1
x
0
( )

f
2 ( )
x ( ) ( )
2!
x x
0
( ) x x
1
( ) + =
f x ( ) f x
1 ( )
x x
0
( )
h
f x
0 ( )
x x
0
h ( )
h

f
2 ( )
x ( ) ( )
2!
x x
0
( ) x x
0
h ( ) + =
f x ( )
f x
0
h + ( ) x x
0
( ) f x
0 ( ) x x
0
h ( )
h
f
2 ( )
x ( ) ( )
2!
x x
0
( ) x x
0
h ( ) + =
x
f x ( )
d
d
f
1 ( )
x ( ) =
f x
0
h + ( ) f x
0 ( )
h
1
2
f
3 ( )
x ( ) ( )
1 ( )
x ( ) x x
0
( ) x x
0
h ( )

f
2 ( )
x ( ) ( ) 2 x x
0
( ) h

+ =
Prof. Miguel Arellano
Diferenciacin e integracin numrica
f
1 ( )
x
0 ( )
1
12 h
f x
0
2 h ( ) 8 f x
0
h ( ) 8 f x
0
h + ( ) + f x
0
2 h + ( ) ( )
h
4
30
f
5 ( )
x
0 ( ) ( ) =
Frmulas de cinco puntos
f
1 ( )
x
0 ( )
1
2 h
f x
0
h + ( ) f x
0
h ( ) ( )
h
2
2
f
3 ( )
x
0 ( ) ( ) =
Frmulas de tres puntos
para x [ a , b ] f
2 ( )
x ( ) donde M es una cota para
h
2
M con un error acotado por
se puede usar para aproximar
f x
0
h + ( ) f x
0 ( )
h
Para valores de h pequeo, el cociente de la diferencia
Formula de diferencia progresiva h 0 <
f
1 ( )
x
0 ( )
Formula de diferencia progresiva h 0 >
x
0
x
0 ( ) < x
0
h + ( ) < f
1 ( )
x
0 ( )
1
h
f x
0
h + ( ) f x
0 ( ) ( )
h
2
f
2 ( )
x
0 ( ) ( ) =
f
1 ( )
x
0 ( )
f x
0
h + ( ) f x
0 ( )
h
1
2
f
3 ( )
x
0 ( ) ( )
1 ( )
x
0 ( ) x
0
x
0
( ) x
0
x
0
h ( )

f
2 ( )
x
0 ( ) ( ) 2 x
0
x
0
( ) h

+ =
Prof. Miguel Arellano
Diferenciacin e integracin numrica
l1 X ( ) f x
0 ( ) fp x
0 ( ) X x
0
( ) + :=
f
1 ( )
x
0 ( )
con pendiente x
0
f x
0 ( ) , ( )
Recta tangente a la curva en el punto
fp x
0 ( ) fp5P 127.8135 10
3
= fp5P 29.428411 =
fp5P
1
12 h
f x
0
2 h ( ) 8 f x
0
h ( ) 8 f x
0
h + ( ) + f x
0
2 h + ( ) ( ) :=
Frmula de cinco puntos
fp x
0 ( ) fp3P 1.8783 10
0
= fp3P 31.434506 =
fp3P
1
2 h
f x
0
h + ( ) f x
0
h ( ) ( ) :=
Frmula de tres puntos
fp x
0 ( ) fp2P 11.3869 10
0
= fp2P 40.943121 =
fp2P
1
h
f x
0
h + ( ) f x
0 ( ) ( ) :=
Frmula de dos puntos
h 0.5 := fp x
0 ( ) 29.556224 = x
0
2.0 := fp x ( )
x
f x ( )
d
d
:=
f x ( ) x 1 + ( ) e
x
:=
Ejemplo
Prof. Miguel Arellano
Diferenciacin e integracin numrica
l2 X ( ) f x
0
h + ( ) fp2P X x
0
h + ( )

+ := l2 X ( ) f x
0
h ( ) fp3P X x
0
h ( )

+ :=
0.5 1 1.5 2 2.5 3 3.5
40
20
0
20
40
60
80
100
120
140
160
f X ( )
l1 X ( )
l2 X ( )
X
0.5 1 1.5 2 2.5 3 3.5
40
20
0
20
40
60
80
100
120
140
160
f X ( )
l1 X ( )
l2 X ( )
X
Prof. Miguel Arellano
Diferenciacin e integracin numrica
l2a X ( ) f x
0
h ( ) fp5P X x
0
h ( )

+ :=
l2b X ( ) f x
0
2 h ( ) fp5P X x
0
2 h ( )

+ :=
0.5 1 1.5 2 2.5 3 3.5
40
20
0
20
40
60
80
100
120
140
160
f X ( )
l1 X ( )
l2a X ( )
l2b X ( )
X
Prof. Miguel Arellano
Diferenciacin e integracin numrica
Integracin Numrica: Reglas Bsicas
f x ( ) P
n
x ( ) E x ( ) + = P
n
x ( )
0
n
k
f x
k
x
k 1
, .... , x
0
, ( )
0
k 1
j
x x
j
( )
[
=

(
(
(

_
=
=
Regla del rectngulo
a b
f(a)
f(b)
f(x)
x
a b
f(a)
f(b)
f(x)
x
f x ( )
0
n
k
f x
k
x
k 1
, .... , x
0
, ( )
0
k 1
j
x x
j
( )
[
=

(
(
(

_
=
f
n 1 + ( )
( )
n 1 + ( )!
0
n
k
x x
k
( )
[
=
+ =
n 0 = ==> f x ( ) f x
0 ( )
f
1 ( )
( )
1 ( )!
x x
0
( ) + = x
0
a =
Prof. Miguel Arellano
Diferenciacin e integracin numrica
f x ( ) f a ( )
f
1 ( )
( )
1 ( )!
x a ( ) + = ==>
a
b
x f x ( )
(
(
]
d
a
b
x f a ( )
(
(
]
d
a
b
x
f
1 ( )
( )
1 ( )!
x a ( )
(
(
(
]
d + =
Integral por defecto Integral por exceso
a
b
x f x ( )
(
(
]
d b a ( ) f a ( ) f
1 ( )
( )
b a ( )
2
2
+ =
a
b
x f x ( )
(
(
]
d b a ( ) f b ( ) f
1 ( )
( )
b a ( )
2
2
+ =
Regla del punto medio
a b
f(a)
f(b)
f(x)
x
(a+b)/2
f[(a+b)/2]
f x ( )
0
n
k
f x
k
x
k 1
, .... , x
0
, ( )
0
k 1
j
x x
j
( )
[
=

(
(
(

_
=
f
n 2 + ( )
( )
n 2 + ( )!
0
n 1 + ( )
k
x x
k
( )
[
=
+ =
Prof. Miguel Arellano
Diferenciacin e integracin numrica
n 0 = ==> f x ( ) f x
0 ( )
f
2 ( )
( )
2 ( )!
x x
0
( ) x x
1
( ) + = x
0
x
1
=
a b +
2
|

\
|
|
.
=
f x ( ) f
a b +
2
|

\
|
|
.
f
2 ( )
( )
2 ( )!
x
a b +
2
|

\
|
|
.

(
(

2
+ = ==>
a
b
x f x ( )
(
(
]
d
a
b
x f
a b +
2
|

\
|
|
.
(
(
(
]
d
a
b
x
f
2 ( )
( )
2 ( )!
x
a b +
2
|

\
|
|
.

(
(

(
(
(
]
d + =
a
b
x f x ( )
(
(
]
d b a ( ) f
a b +
2
|

\
|
|
.
f
2 ( )
( )
b a ( )
3
24
+ =
Regla del trapecio
a b
f(a)
f(b)
f(x)
x
f x ( )
0
n
k
f x
k
x
k 1
, .... , x
0
, ( )
0
k 1
j
x x
j
( )
[
=

(
(
(

_
=
f
n 2 + ( )
( )
n 2 + ( )!
0
n 1 + ( )
k
x x
k
( )
[
=
+ =
Prof. Miguel Arellano
Diferenciacin e integracin numrica
n 1 =
f x ( ) f x
0 ( ) f x
1
x
0
, ( ) x x
0
( ) +
f
2 ( )
( )
2 ( )!
x x
0
( ) x x
1
( ) + =
x
0
a = x
1
b =
f x ( ) f a ( ) f b a , ( ) x a ( ) +
f
2 ( )
( )
2 ( )!
x a ( ) x b ( ) + =
a
b
x f x ( )
(
(
]
d
a
b
x f a ( )
(
(
]
d
a
b
x f b a , ( ) x a ( ) [ ]
(
(
]
d +
a
b
x
f
2 ( )
( )
2 ( )!
x a ( ) x b ( )
(
(
(
]
d + =
a
b
x f x ( )
(
(
]
d
1
2
b a ( ) f a ( ) f b ( ) + ( ) f
2 ( )
( )
b a ( )
3
12
=
Prof. Miguel Arellano
Diferenciacin e integracin numrica
Regla de Simpson
a b
f(a)
f(b)
(a+b)/2
f[(a+b)/2]
f(x)
x
f x ( )
0
n
k
f x
k
x
k 1
, .... , x
0
, ( )
0
k 1
j
x x
j
( )
[
=

(
(
(

_
=
f
n 2 + ( )
( )
n 2 + ( )!
0
n 1 + ( )
k
x x
k
( )
[
=
+ =
n 2 =
f x ( ) f x
0 ( ) f x
1
x
0
, ( ) x x
0
( ) + f x
2
x
1
, x
0
, ( ) x x
0
( ) x x
1
( ) +
f
4 ( )
( )
4 ( )!
x x
0
( ) x x
1
( ) x x
2
( ) x x
3
( ) + =
x
0
a = x
1
a b +
2
= x
2
b = x
3
a b +
2
=
f x ( ) f a ( ) f b a , ( ) x a ( ) + f b
a b +
2
, a ,
|

\
|
|
.
x a ( ) x
a b +
2

\
|
|
.
+
f
4 ( )
( )
4 ( )!
x a ( ) x
a b +
2

\
|
|
.
2
x b ( ) + =
Prof. Miguel Arellano
Diferenciacin e integracin numrica
a
b
x f x ( )
(
(
]
d
a
b
x f a ( )
(
(
]
d
a
b
x f b a , ( ) x a ( ) [ ]
(
(
]
d +
a
b
x f b
a b +
2
, a ,
|

\
|
|
.
x a ( ) x
a b +
2

\
|
|
.

(
(
(
]
d + .... + =
....
a
b
x
f
4 ( )
( )
4 ( )!
x a ( ) x
a b +
2

\
|
|
.
2
x b ( )
(
(
(
]
d +
a
b
x f x ( )
(
(
]
d
b a
6
f a ( ) 4 f
a b +
2
|

\
|
|
.
+ f b ( ) +
|

\
|
|
.
f
4 ( )
( )
1
90

b a
2
|

\
|
|
.
5
=
Regla del trapecio corregido
a b
f(a)
f(b)
f(x)
x
I f ( )
b a
2
f a ( ) f b ( ) + ( )
b a ( )
2
12
f
1 ( )
a ( ) f
1 ( )
b ( )

+ f
4 ( )
( )
b a ( )
5
720
+ =
Prof. Miguel Arellano
Diferenciacin e integracin numrica
a
b
x f x ( )
(
(
]
d h
1
N
i
f x
i 1 ( )
_
=
f
1 ( )
( ) b a ( )
h
2
2
+ =
N h b a ( ) = ==> h
b a
N
=
a
b
x f x ( )
(
(
]
d h
1
N
i
f x
i 1 ( )
_
=
N f
1 ( )
( )
h
2
2
+ = ==>
a
b
x f x ( )
(
(
]
d
1
N
i
h f x
i 1 ( )
_
= 1
N
i
f
1 ( )
( )
h
2
2

(
(

_
=
+ =
x
i 1
x
i
x f x ( )
(
(
]
d h f x
i 1 ( ) f
1 ( )
( )
h
2
2
+ = ==>
x
i 1
x
i
x f x ( )
(
(
]
d x
i
x
i 1
( ) f x
i 1 ( ) f
1 ( )
( )
x
i
x
i 1
( )
2
2
+ =
Regla del rectngulo
h
b a
N
= i 0 = 1 , 2 , .... , N , x
i
a i h + =
I f ( )
a
b
x f x ( )
(
(
]
d =
1
N
i
x
i 1
x
i
x f x ( )
(
(
]
d
|

\
|
|
|
.
_
=
=
h x
i
x
i 1
= a x
0
x
1
< x
2
< .... < x
N
< = b = I
a
b
x f x ( )
(
(
]
d =
Integracin Numrica: Reglas Compuestas
Prof. Miguel Arellano
Diferenciacin e integracin numrica
Regla compuesta de Simpson
a x
i 1
=
a b +
2
x
i
1
2

= b x
i
= x
i
x
i 1
h =
x
i 1
x
i
x f x ( )
(
(
]
d
h
6
f x
i 1 ( ) 4 f x
i
1
2

\
|
|
.
+ f x
i ( ) +
|

\
|
|
.
f
4 ( )
( )
x
i
x
i 1

2
|

\
|
|
.
5
90
= x
i 1
< x
i
<
x
i 1
x
i
x f x ( )
(
(
]
d
h
6
f
i 1
4 f
i
1
2

+ f
i
+
|

\
|
|
.
f
4 ( )
( )
h
2
|

\
|
|
.
5
90
=
I f ( )
1
N
i
x
i 1
x
i
x f x ( )
(
(
]
d
_
=
=
h
6
1
N
i
f
i 1
4 f
i
1
2

+ f
i
+
|

\
|
|
.
_
=

1
N
i
f
4 ( )
( )
h
2
|

\
|
|
.
5
90

_
=
=
a
b
x f x ( )
(
(
]
d
h
6
f
0
f
N
+ 2
1
N 1
i
f
i
_
=
+ 4
1
N
i
f
i
1
2

_
=
+
|

\
|
|
|
.

1
N
i
f
4 ( )
( )
h
2
|

\
|
|
.
5
90

(
(
(

_
=
=
a
b
x f x ( )
(
(
]
d
h
6
f
0
f
N
+ 2
1
N 1
i
f
i
_
=
+ 4
1
N
i
f
i
1
2

_
=
+
|

\
|
|
|
.
N f
4 ( )
( )
h
2
|

\
|
|
.
5
90
=
Prof. Miguel Arellano
Diferenciacin e integracin numrica
h
b a
N
= ==> N h b a ( ) =
a
b
x f x ( )
(
(
]
d
h
6
f
0
f
N
+ 2
1
N 1
i
f
i
_
=
+ 4
1
N
i
f
i
1
2

_
=
+
|

\
|
|
|
.
f
4 ( )
( ) b a ( )
h
2
|

\
|
|
.
4
180
= a < b <
x
i
a i h + = x
i
1
2

a i
1
2

\
|
|
.
h + =
Regla del punto medio compuesta
I f ( ) h
1
N
i
f
i
1
2

_
=
f
4 ( )
( ) b a ( )
h
2
24
+ =
Regla del trapecio compuesta
I f ( ) h
1
N 1 ( )
i
f
i
_
=

h
2
f
0
f
N
+ ( ) + f
2 ( )
( ) b a ( )
h
2
12
=
Regla del trapecio corregida compuesta
I f ( ) h
1
N 1 ( )
i
f
i
_
=

h
2
f
0
f
N
+ ( ) +
h
2
12
f
1 ( )
a ( ) f
1 ( )
b ( )

+ f
4 ( )
( ) b a ( )
h
4
720
+ =
Prof. Miguel Arellano
Diferenciacin e integracin numrica
h
12 c
max f
2 ( )
( ) b a ( )
=
max f
2 ( )
( ) f2 0 ( ) = 2 =
0 0.2 0.4 0.6 0.8 1
0
1
2
f2 X ( )
X
f2 x ( )
2
x
f x ( )
d
d
2
:=
a < b < c max f
2 ( )
( ) b a ( )
h
2
12
=
c 5 10
7
:= a b ( ) 0 1 ( ) := f X ( ) e
X
2

:=
Solucin
la aproximacin.
se puede calcular de manera precisa y calcular e
x
2

correctos despus del punto decimal, suponiendo que


con seis dgitos
0
1
x e
x
2

(
(
]
d Determinar a N de modo que la regla del trapecio compuesta d el valor de
Ejemplo
Prof. Miguel Arellano
Diferenciacin e integracin numrica
h
12 c
2 b a ( )
:= h 1.7321 10
3
=
N
b a ( )
h
:= N 577.3503 = ==> N 578 :=
h
b a ( )
N
:= h 1.7301 10
3
=
a
b
x f x ( )
(
(
]
d h
1
N 1 ( )
i
f
i
_
=

h
2
f
0
f
N
+ ( ) + f
2 ( )
( ) b a ( )
h
2
12
= x
0
x
N ( ) a b ( ) :=
Iexacta
a
b
X f X ( )
(
(
]
d := Iexacta 0.7468241 =
Iaprox h
1
N 1 ( )
i
f x
0
i h + ( )
_
=

h
2
f x
0 ( ) f x
N ( ) + ( ) + := Iaprox 0.7468239 =
Iexacta Iaprox 0.0000002 =
Prof. Miguel Arellano
Diferenciacin e integracin numrica
Ejemplo
Use la regla compuesta de Simpson para encontrar una aproximacin, exacta a 10
4
al valor de la integral
0
48
x 1 cos x ( )
2
+
(
(
]
d f x ( ) 1 cos x ( )
2
+ := a b ( ) 0 48 ( ) := c 10
4
:=
Iexacta
0
48
x 1 cos x ( )
2
+
(
(
]
d := Iexacta 58.47047034 =
c max f
4 ( )
( ) b a ( )
h
2
|

\
|
|
.
4
180
= h
4
180 2
4
c
max f
4 ( )
( ) b a ( )
=
f4 x ( )
4
x
f x ( )
d
d
4
:= f5 x ( )
5
x
f x ( )
d
d
5
:=
0 5 10 15 20 25 30 35 40 45
0
5
10
f4 X ( )
X
Prof. Miguel Arellano
Diferenciacin e integracin numrica
X 1.5 := X root f5 X ( ) X , ( ) := f4 X ( ) 7.0000 = max f
4 ( )
( ) 7 =
h
4
180 2
4
c
7 b a ( )
:= h 171.1052 10
3
=
N
b a ( )
h
:= N 280.5291 = ==> N 281 :=
h
b a ( )
N
:= h 170.8185 10
3
= x
0
x
N ( ) a b ( ) :=
Iaprox
h
6
f x
0 ( ) f x
N ( ) + 2
1
N 1
i
f x
0
i h + ( )
_
=
+ 4
1
N
i
f x
0
i
1
2

\
|
|
.
h +

(
(

_
=
+

(
(
(

:= Iaprox 58.47046965 =
Iexacta Iaprox 693.76082 10
9
=
Prof. Miguel Arellano
Diferenciacin e integracin numrica
x
Prof. Miguel Arellano
UNIVERSIDAD CENTRAL DE VENEZUELA
FACULTAD DE INGENIERIA
ESCUELA DE INGENIERIA ELECTRICA
DEPARTAMENTO DE ELECTRONICA, COMPUTACION Y CONTROL
CALCULO NUMERICO
Prof. Miguel Arellano
Cel.: 0412 - 706 41 40
miguel_arellano@cantv.net
marellan@engineer.com
Ecuaciones Diferenciales Ordinarias
Integracin Numrica por serie de Taylor.-
Mtodos numricos para integrar ecuaciones diferenciales
y t
i 1 + ( ) y t
i ( )
y
1
( )
t
i ( )
1!
t
i 1 +
t
i
( ) +
y
2
( )
t
i ( )
2!
t
i 1 +
t
i
( )
2
+ .... +
y
k
( )
t
i ( )
k!
t
i 1 +
t
i
( )
k
+
y
k 1 +
( )
( )
k 1 + ( )!
t
i 1 +
t
i
( )
k 1 +
+ =
y
1 ( )
f t y , ( ) =
y
2 ( )
f
1 ( )
t y , ( ) = f
t
f
y
y
1 ( )
+ = f
t
f
y
f + =
y
3 ( )
f
2 ( )
t y , ( ) = f
t t ,
f
t y ,
f + f
y t ,
f + f
y y ,
f
2
+ f
y
f
t
+ f
y ( )
2
f + =
f
2 ( )
t y , ( ) f
t t ,
2 f
t y ,
f + f
y y ,
f
2
+ f
t
f
y
+ f
y ( )
2
f + =
y t
i 1 + ( ) y t
i ( )
f t
i
y
i
, ( )
1!
t
i 1 +
t
i
( ) +
f
1
( )
t
i
y
i
, ( )
2!
t
i 1 +
t
i
( )
2
+ .... +
f
k 1
( )
t
i
y
i
, ( )
k!
t
i 1 +
t
i
( )
k
+
f
k
( )
y ( ) , ( )
k 1 + ( )!
t
i 1 +
t
i
( )
k 1 +
+ =
Para algn
i
donde t
i

i
< t
i 1 +
< usando h t
i 1 +
t
i
=
y t
i 1 + ( ) y t
i ( )
f t
i
y
i
, ( )
1!
h +
f
1
( )
t
i
y
i
, ( )
2!
h
2
+ .... +
f
k 1
( )
t
i
y
i
, ( )
k!
h
k
+
f
k
( )
y ( ) , ( )
k 1 + ( )!
h
k 1 +
+ =
y t
i 1 + ( ) y t
i ( ) h f t
i
y
i
, ( ) f
1 ( )
t
i
y
i
, ( )
h
1
2!
+ .... + f
k 1
( )
t
i
y
i
, ( )
h
k 1 ( )
k!
+

(
(

+
f
k
( )
y ( ) , ( )
k 1 + ( )!
h
k 1 +
+ =
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
tf 1 := h 0.1 := y0 1 := t0 0 := f t y , ( ) y t
2
+ 1 + :=
y
1 ( )
t ( ) f t y , ( ) = y t
2
+ 1 + =
Solucin
? y 1 ( ) __ = h 0.1 = y 0 ( ) 1 = y
1 ( )
y t
2
+ 1 + =
Ejemplo
E
h
2
2
f
1 ( )

i
y
i ( ) , ( ) = y t
i 1 + ( ) y t
i ( ) h f t
i
y t
i ( ) , ( ) + =
t
i

i
< t
i 1 +
< y t
i 1 + ( ) y t
i ( ) h f t
i
y t
i ( ) , ( ) +
h
2
2
f
1 ( )

i
y
i ( ) , ( ) + =
k 1 =
Mtodo de Euler.-
k 1 = 2 , .... , Taylor de orden k, T
k
t
i
y
i
, ( ) f t
i
y
i
, ( ) f
1 ( )
t
i
y
i
, ( )
h
1
2!
+ .... + f
k 1
( )
t
i
y
i
, ( )
h
k 1 ( )
k!
+ =
y t
i 1 + ( ) y t
i ( ) h T
k
t
i
y
i
, ( ) +

h
k 1 +
k 1 + ( )!
y
k 1 +
( )
( ) + =
Mtodo de Taylor de orden mayor (orden k)
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
Solucin exacta ye t ( ) 2 e
t
t
2
+ 2 t 3 + :=
Euler h ( ) it
0
"i"
t
0
"ti"
ya
0
"yai"
yr
0
"yri"
c
0
"|yr-ya|"
N ceil
tf t0
h
|

\
|
|
.

it
i 1 +
i
t
i 1 +
t0
ya
i 1 +
y0
yr
i 1 +
ye t
i 1 + ( )
c
i 1 +
yr
i 1 +
ya
i 1 +

i 0 = if
it
i 1 +
i
t
i 1 +
t
i
h +
ya
i 1 +
ya
i
h f t
i
ya
i
, ( ) +
yr
i 1 +
ye t
i 1 + ( )
otherwise
i 0 N .. e for
:=
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
c
i 1 +
yr
i 1 +
ya
i 1 +

euler
0 ( )
it
euler
1 ( )
t
euler
2 ( )
ya
euler
3 ( )
yr
euler
4 ( )
c
Euler h ( )
0 1 2 3 4
0
1
2
3
4
5
6
7
8
9
10
11
"i" "ti" "yai" "yri" "|yr-ya|"
0.000000 0.000000 1.000000 1.000000 0.000000
1.000000 0.100000 1.000000 1.000325 0.000325
2.000000 0.200000 1.001000 1.002538 0.001538
3.000000 0.300000 1.004900 1.008364 0.003464
4.000000 0.400000 1.013410 1.019360 0.005950
5.000000 0.500000 1.028069 1.036939 0.008870
6.000000 0.600000 1.050262 1.062377 0.012115
7.000000 0.700000 1.081236 1.096829 0.015594
8.000000 0.800000 1.122112 1.141342 0.019230
9.000000 0.900000 1.173901 1.196861 0.022960
10.000000 1.000000 1.237511 1.264241 0.026730
=
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
Mtodo de Runge-Kutta.-
Runge-Kutta de orden dos
y t
i 1 + ( ) y t
i ( )
1
2
k
1
k
2
+ ( ) + =
k
1
h f t
i
y t
i ( ) , ( ) =
k
2
h f t
i
h + y t
i ( ) k
1
+ , ( ) =
RK2do h ( ) it
0
"i"
t
0
"ti"
ya
0
"yai"
k1
0
"k1"
k2
0
"k2"
yr
0
"yri"
c
0
"|yr-ya|"
N ceil
tf t0
h
|

\
|
|
.

it
i 1 +
i
t
i 1 +
t0
ya
i 1 +
y0
i 0 = if
i 0 N .. e for
:=
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
ya
i 1 +
y0
k1
i 1 +
h f t
i 1 +
ya
i 1 +
, ( )
k2
i 1 +
h f t
i 1 +
h + ya
i 1 +
k1
i 1 +
+ , ( )
yr
i 1 +
ye t
i 1 + ( )
c
i 1 +
yr
i 1 +
ya
i 1 +

it
i 1 +
i
t
i 1 +
t
i
h +
ya
i 1 +
ya
i
1
2
k1
i
k2
i
+ ( ) +
k1
i 1 +
h f t
i 1 +
ya
i 1 +
, ( )
k2
i 1 +
h f t
i 1 +
h + ya
i 1 +
k1
i 1 +
+ , ( )
yr
i 1 +
ye t
i 1 + ( )
c
i 1 +
yr
i 1 +
ya
i 1 +

otherwise
RK2do
0 ( )
it
RK2do
1 ( )
t
RK2do
2 ( )
ya
RK2do
3 ( )
k1
RK2do
4 ( )
k2
RK2do
5 ( )
yr
RK2do
6 ( )
c
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
RK2do h ( )
0 1 2 3 4 5 6
0
1
2
3
4
5
6
7
8
9
10
11
"i" "ti" "yai" "k1" "k2" "yri" "|yr-ya|"
0.000000 0.000000 1.000000 0.000000 0.001000 1.000000 0.000000
1.000000 0.100000 1.000500 0.000950 0.003855 1.000325 0.000175
2.000000 0.200000 1.002903 0.003710 0.008339 1.002538 0.000364
3.000000 0.300000 1.008927 0.008107 0.014297 1.008364 0.000563
4.000000 0.400000 1.020129 0.013987 0.021588 1.019360 0.000769
5.000000 0.500000 1.037916 0.021208 0.030088 1.036939 0.000978
6.000000 0.600000 1.063564 0.029644 0.039679 1.062377 0.001188
7.000000 0.700000 1.098226 0.039177 0.050260 1.096829 0.001396
8.000000 0.800000 1.142944 0.049706 0.061735 1.141342 0.001602
9.000000 0.900000 1.198665 0.061134 0.074020 1.196861 0.001804
10.000000 1.000000 1.266241 0.073376 0.087038 1.264241 0.002000
=
Runge-Kutta de orden cuatro
y t
i 1 + ( ) y t
i ( )
1
6
k
1
2 k
2
+ 2 k
3
+ k
4
+ ( ) + =
k
1
h f t
i
y t
i ( ) , ( ) =
k
2
h f t
i
h
2
+ y t
i ( )
1
2
k
1
+ ,
|

\
|
|
.
=
k
3
h f t
i
h
2
+ y t
i ( )
1
2
k
2
+ ,
|

\
|
|
.
=
k
4
h f t
i
h + y t
i ( ) k
3
+ , ( ) =
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
RK4to h ( ) it
0
"i"
t
0
"ti"
ya
0
"yai"
k1
0
"k1"
k2
0
"k2"
k3
0
"k3"
k4
0
"k4"
yr
0
"yri"
c
0
"|yr-ya|"
N ceil
tf t0
h
|

\
|
|
.

it
i 1 +
i
t
i 1 +
t0
ya
i 1 +
y0
k1
i 1 +
h f t
i 1 +
ya
i 1 +
, ( )
k2
i 1 +
h f t
i 1 +
h
2
+ ya
i 1 +
1
2
k1
i 1 +
+ ,
|

\
|
|
.

k3
i 1 +
h f t
i 1 +
h
2
+ ya
i 1 +
1
2
k2
i 1 +
+ ,
|

\
|
|
.

( )
i 0 = if
i 0 N .. e for
:=
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
k4
i 1 +
h f t
i 1 +
h + ya
i 1 +
k3
i 1 +
+ , ( )
yr
i 1 +
ye t
i 1 + ( )
c
i 1 +
yr
i 1 +
ya
i 1 +

it
i 1 +
i
t
i 1 +
t
i
h +
ya
i 1 +
ya
i
1
6
k1
i
2 k2
i
+ 2 k3
i
+ k4
i
+ ( ) +
k1
i 1 +
h f t
i 1 +
ya
i 1 +
, ( )
k2
i 1 +
h f t
i 1 +
h
2
+ ya
i 1 +
1
2
k1
i 1 +
+ ,
|

\
|
|
.

k3
i 1 +
h f t
i 1 +
h
2
+ ya
i 1 +
1
2
k2
i 1 +
+ ,
|

\
|
|
.

k4
i 1 +
h f t
i 1 +
h + ya
i 1 +
k3
i 1 +
+ , ( )
yr
i 1 +
ye t
i 1 + ( )
c
i 1 +
yr
i 1 +
ya
i 1 +

otherwise
RK4to
0 ( )
it
RK4to
1 ( )
t
RK4to
2 ( )
ya
RK4to
3 ( )
k1
RK4to
4 ( )
k2
5 ( )
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
RK4to
5 ( )
k3
RK4to
6 ( )
k4
RK4to
7 ( )
yr
RK4to
8 ( )
c
RK4to h ( )
0 1 2 3 4 5 6 7 8
0
1
2
3
4
5
6
7
8
9
10
11
"i" "ti" "yai" "k1" "k2" "k3" "k4" "yri" "|yr-ya|"
0.000000 0.000000 1.000000 0.000000 0.000250 0.000238 0.000976 1.000000 0.000000
1.000000 0.100000 1.000325 0.000967 0.002169 0.002109 0.003757 1.000325 0.000000
2.000000 0.200000 1.002539 0.003746 0.005809 0.005706 0.008176 1.002538 0.000000
3.000000 0.300000 1.008364 0.008164 0.011005 0.010863 0.014077 1.008364 0.000000
4.000000 0.400000 1.019360 0.014064 0.017611 0.017433 0.021321 1.019360 0.000000
5.000000 0.500000 1.036939 0.021306 0.025491 0.025282 0.029778 1.036939 0.000000
6.000000 0.600000 1.062377 0.029762 0.034524 0.034286 0.039334 1.062377 0.000000
7.000000 0.700000 1.096830 0.039317 0.044601 0.044337 0.049883 1.096829 0.000000
8.000000 0.800000 1.141343 0.049866 0.055622 0.055335 0.061332 1.141342 0.000001
9.000000 0.900000 1.196861 0.061314 0.067498 0.067189 0.073595 1.196861 0.000001
10.000000 1.000000 1.264242 0.073576 0.080147 0.079818 0.086594 1.264241 0.000001
=
n rows Euler h ( ) ( ) := n 12 = i 1 2 , n 1 ( ) .. :=
c_Euler Euler h ( )
4 ( )
:=
ti Euler h ( )
1 ( )
:=
c_RK2do RK2do h ( )
6 ( )
:=
c_RK4to RK4to h ( )
8 ( )
:=
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
0
0.005
0.01
0.015
0.02
0.025
0.03
c_Euler
i
c_RK2do
i
c_RK4to
i
ti
i
Prof. Miguel Arellano
Ecuaciones Diferenciales Ordinarias
Mtodos multipaso.-
Tcnica de Adams-Bashforth de cuarto orden (mtodo explicito)
y
0
y t
0 ( ) = y
1
y t
1 ( ) = y
2
y t
2 ( ) = y
3
y t
3 ( ) =
i 3 = 4 , .... , N 1 ( ) ,
y
i 1 +
y
i
h
24
55 f t
i
y
i
, ( ) 59 f t
i 1
y
i 1
, ( ) 37 f t
i 2
y
i 2
, ( ) + 9 f t
i 3
y
i 3
, ( ) ( ) + =
y
0
y t
0 ( ) = y
1
y t
1 ( ) = y
2
y t
2 ( ) =
i 2 = 3 , .... , N 1 ( ) ,
y
i 1 +
y
i
h
24
9 f t
i 1 +
y
i 1 +
, ( ) 19 f t
i
y
i
, ( ) + 5 f t
i 1
y
i 1
, ( ) f t
i 2
y
i 2
, ( ) + ( ) + =
Prof. Miguel Arellano

You might also like