Documente Academic
Documente Profesional
Documente Cultură
5
Facultad de Ingeniera de Minas, Geologa y Civil
Departamento acadmico de ingeniera de minas y civil
METODOS
NUMERICOS
Ingeniera Civil
Capitulo V
Ecuaciones Algebraicas
No Lineales:
Temas Especiales
Bsqueda de Varias
Races de Ecuaciones
No Lineales
Mtodos Numricos
Aplicados a la Ingeniera
f(x)
x0
2 races
3 races
x1
x3
x2
x
2 races
x4
x
x5
x
x6
x
x7
x
x8
x
x9
x
1.5
0.5
0
3.00
3.50
4.00
4.50
-0.5
-1
-1.5
-2
-2.5
5.00
f(x)
f'(x)
3.00
-1.899161886
0.306159043
3.50
-0.903719597
-6.397834771
4.00
1.588967119
-5.059661863
4.50
1.445824188
2.841866609
5.00
-1.022062767
7.698796764
races
revisar
1
1
1
1
1.5
0.5
0
3.00
3.20
3.40
3.60
3.80
4.00
4.20
4.40
4.60
4.80
-0.5
-1
-1.5
-2
5.00
f(x)
f'(x)
races
revisar
3.00
-1.899161886
0.306159043
3.20
-0.433261175
8.865213949
3.40
-0.185182966
-6.386078685
3.60
-1.18610876
1.663171794
3.80
0.689859445
12.30872202
4.00
1.588967119
-5.059661863
4.20
0.082913038
-4.100722292
4.40
0.823585883
8.222212542
4.60
1.232603226
-7.152866457
4.80
-1.028072018
-9.298416724
5.00
-1.022062767
7.698796764
1
1
1
1
1.5
0.5
0
3.00
3.10
3.20
3.30
3.40
3.50
3.60
3.70
3.80
3.90
4.00
4.10
4.20
4.30
4.40
4.50
4.60
4.70
4.80
4.90
-0.5
-1
-1.5
-2
5.00
f(x)
f'(x)
3.00
-1.899161886
3.10
races
revisar
f(x)
f'(x)
0.306159043
4.00
1.588967119
-5.059661863
-1.396262971
8.774060308
4.10
0.806109949
-9.083697401
3.20
-0.433261175
8.865213949
4.20
0.082913038
-4.100722292
3.30
0.110720707
1.239840209
4.30
0.113085296
4.568709698
3.40
-0.185182966
-6.386078685
4.40
0.823585883
8.222212542
3.50
-0.903719597
-6.397834771
4.50
1.445824188
2.841866609
3.60
-1.18610876
1.663171794
4.60
1.232603226
-7.152866457
3.70
-0.539302106
10.63779828
4.70
0.160731508
-12.92128286
3.80
0.689859445
12.30872202
4.80
-1.028072018
-9.298416724
3.90
1.611391725
4.952380075
4.90
-1.487337039
0.468684944
4.00
1.588967119
-5.059661863
5.00
-1.022062767
7.698796764
races
revisar
1.5
0.5
3.00 3.10 3.20 3.30 3.40 3.50 3.60 3.70 3.80 3.90 4.00 4.10 4.20 4.30 4.40 4.50 4.60 4.70 4.80 4.90 5.00
-0.5
-1
-2
0.1
0.08
0.06
0.04
0.02
detalle
0
4.20
-0.02
4.21
4.22
4.23
4.24
4.25
4.26
4.27
4.28
4.29
4.30
2.
3.
4.
5.
6.
El proceso se repite n veces hasta que el punto de interseccin xn coincide prcticamente con el valor exacto de la raz
x1
f (x)
f (x)
f(x)
x1
f(x1)
f(x1)
f(x)
(x)
f '(x)
x1
(x1)
x1
2
[f '(x)]
[f '(x)]2
(xi )
xi1 xi
'(xi )
xi1 xi
f(xi )f '(xi )
xi1 xi
[f '(xi )]2 f(xi )f "(xi )
(xi )
xi1 xi
'(xi )
(x2)
x1
x2
f(xi )f '(xi )
xi1 xi
[f '(xi )]2 f(xi )f "(xi )
x1
x2
triple raz
1
0
0
-1
-2
-3
0.2
0.4
0.6
0.8
1.2
1.4
1.6
1.8
2.2
2.4
2.6
2.8
3.2
3.4
Xi
f(Xi)
f'(Xi)
f"(Xi)
Xi
'(Xi)
e(%)
-10
24
-0.3
0.28
100.00
1.07142857
-0.00070283
-0.02915452
-0.79591837
0.02410714
0.341875
7.14
100.00
1.00091408
-1.5268E-09
-5.0102E-06
-0.01095889
0.00030474
0.33343478
0.09
7.05
1.00000014
-1.1191E-13
-1.6623E-06
0.00
0.09
1.00000014
-1.1191E-13
-1.6623E-06
0.00
0.00
Recurrencia
Funcin
x1 = 1, x2 = 1, x3 = 1
e*(%)
Xi
f(Xi)
f'(Xi)
e(%)
e*(%)
-10
100.00
0.3
0.9261
-4.312
70.00
100.00
0.51477273
0.28392375
-1.86965136
48.52
41.72
0.66663192
0.08644807
-0.81500014
33.34
22.78
0.77270315
0.02615522
-0.35695527
22.73
13.73
0.84597625
0.0078707
-0.15695571
15.40
8.66
0.89612227
0.00235824
-0.06922711
10.39
5.60
0.93018753
0.00070426
-0.03060369
6.98
3.66
0.95319963
0.00020981
-0.01355167
4.68
2.41
10
0.96868175
6.2398E-05
-0.00600787
3.13
1.60
11
0.97906779
1.8535E-05
-0.00266563
2.09
1.06
12
0.98602119
5.5013E-06
-0.00118337
1.40
0.71
13
0.99067004
1.6319E-06
-0.00052554
0.93
0.47
14
0.99377522
4.839E-07
-0.00023345
0.62
0.31
15
0.995848
1.4345E-07
-0.00010372
0.42
0.21
16
0.99723105
4.2519E-08
-4.6088E-05
0.28
0.14
17
0.99815361
1.2601E-08
-2.048E-05
0.18
0.09
18
0.99876888
3.7342E-09
-9.1014E-06
0.12
0.06
19
0.99917917
1.1065E-09
-4.0448E-06
0.08
0.04
20
0.99945274
3.2789E-10
-1.7976E-06
0.05
0.03
21
0.99963515
9.7155E-11
-7.9891E-07
0.04
0.02
22
0.99975675
2.8788E-11
-3.5507E-07
0.02
0.01
x1 = 1
x2 = 1
x3 = 1
Xi
f(Xi)
f'(Xi)
e(%)
3.4
5.5296
20.736
240.00
3.13333333
1.29453827
11.5294815
213.33
8.51
3.02105263
0.17379579
8.51327832
202.11
3.72
3.00063796
0.00510855
8.01531833
200.06
0.68
3.00000061
4.8777E-06
8.00001463
200.00
0.02
4.4444E-12
200.00
0.00
Recurrencia
Funcin
X4 = 3
e*(%)
Xi
f(Xi)
f'(Xi)
f"(Xi)
Xi
'(Xi)
e(%)
3.4
5.5296
20.736
40.32
0.26666667
0.48148148
240.00
2.84615385
-0.96803333
4.71916249
18.7455621
-0.20512821
1.81481481
184.62
19.46
2.95918367
-0.30694416
7.05012367
22.5506039
-0.04353741
1.13925926
195.92
3.82
2.99739922
-0.02072518
7.93770296
23.9064531
-0.00261098
1.00786364
199.74
1.27
2.99998983
-8.1379E-05
7.99975586
23.9996338
-1.0173E-05
1.00003052
200.00
0.09
-1.2418E-09
24
-1.5522E-10
200.00
0.00
Recurrencia
Funcin
x4 = 3
e*(%)
Races de Polinomios
de Ecuaciones
No Lineales
Mtodos Numricos
Aplicados a la Ingeniera
Definicin
Un polinomio de grado n es una expresin de la forma:
P(x) = anxn + an-1xn-1 + ... +a1x + a0
Donde an <> 0
Corolario
Si P(x) es un polinomio de grado n >= 1, entonces existen
constantes nicas x1, x2, ... xk, posiblemente complejas, y
enteros positivos m1, m2, ..., mk, tales que:
k
m
i 1
P ( x) an x x1
m1
x x2 m ...x xk m
2
Mtodo de Horner
Sea
P(x) = anxn + an-1xn-1 + ... +a1x + a0
Si bn = an y
Ejercicios
Evaluar:
en x0 = 2
en x0 = 3
en x0 = 1
Mtodo de Horner en C
double horner(double p[],int n, double x){
double y = p[0];
int i;
for(i = 1; i<n; i++){
y = x*y + p[i];
}
return y;
}
double eval(double p[],int n, double x){
double s = 0;
int i;
for(i = 0; i<n; i++){
s = s + p[i]*pow(x,n-i-1);
}
return s;
}
Evaluacin de la derivada
Dado que:
P(x) = (x x0) Q(x) + b0
donde
Q(x) = bnxn1 + bn-1xn-2 + ... +b2x + b1
Derivando
P(x) = Q(x)+(x x0)Q(x)
En x = x0,
P(x0) = Q(x0)
Evaluacin de la derivada en C
void hornerDer(double p[],int n, double
x,double &y,double &z){
y = p[0];
z = p[0];
int i;
for(i = 1; i<n-1; i++){
y = x*y + p[i];
z = x*z + y;
}
y = x*y + p[n-1];
}
Mtodo horner
Entrada: grado n, a0, a1, ..., an, x0
Salida: y =P(x0), z = P(x0)
1.
2.
3.
4.
5.
6.
7.
y = an
//calcule bn para P
z = an
//calcule bn-1 para Q
Para j = n 1, n 2, .... , 1
y = x0*y + aj
z = x0*z + y
y = x0*y + a0
regresar y, z
P xn
P xn
xn 1 xn
xn
P ' xn
Q xn
Mtodo de Mller
Se aproxima el siguiente valor utilizando una parbola en lugar
de una recta como en el mtodo de la secante.
f(x)
f(x)
parbola
Lnea
recta
Raz
estimada
Raz
estimada
x1
raz
x
x0
x2 x1 x0
Mtodo de Mller
Utiliza tres aproximaciones: x0, x1, x2.
Determina la siguiente aproximacin x3 encontrando la
interseccin con el eje x de la parbola definida por los
puntos (x0,f(x0)), (x1,f(x1)), (x2,f(x2)).
x0 x1
x2 x3
Mtodo de Mller
Se considera el polinomio
P(x) = a(x x2)2 + b(x x2) + c
Se puede encontrar a, b y c resolviendo
f(x0) = a(x0 x2)2 + b(x0 x2) + c
f(x1) = a(x1 x2)2 + b(x1 x2) + c
f(x2) = a(x2 x2)2 + b(x2 x2) + c
Mtodo de Mller
Se llega a
c f ( x2 )
2
2
x0 x2 f ( x1 ) f ( x2 ) x1 x2 f ( x0 ) f ( x2 )
b
x0 x2 x1 x2 x0 x1
x1 x2 f ( x0 ) f ( x2 ) x0 x2 f ( x1 ) f ( x2 )
a
x0 x2 x1 x2 x0 x1
Mtodo de Mller
Los clculos pueden simplificarse usando
h0 x1 x0
h1 x2 x1
f x1 f x0
d0
h0
f x2 f x1
d1
h1
d1 d 0
a
h1 h0
b ah1 d1
c f x2
Mtodo de Mller
Para minimizar el error al resolver la cuadrtica P(x) = 0, se
calcula x3 con
x3 x2
2c
b signo(b) b 2 4ac
Mller en MatLab
function y = muller(p,x0,x1,x2,ee,ni)
i = 3;
while i<=ni
h1 = x1-x0;
h2 = x2-x1;
[fx0 muda] = horner(p,x0);
[fx1 muda] = horner(p,x1);
[fx2 muda] = horner(p,x2);
d1 = (fx1-fx0)/h1;
d2 = (fx2-fx1)/h2;
a = (d2-d1)/(h2+h1);
b = d2+h2*d1;
c = fx2;
D = sqrt(b*b-4.0*a*c);
if(abs(b-D)<abs(b+D))
E = b+D;
else
E = b-D;
end
h = -2.0*c/E;
x3 = x2+h;
if(abs(h)<ee)
break;
end
x0 = x1;
x1 = x2;
x2 = x3;
i=i+1;
end
y = x3;
Ejemplo
P(x) = 16x4 40x3 + 5x2 + 20x + 6
x0 =
i
0.5
x1 = -0.5
x2 =
0.0
xi
P(xi)
-0.555556 + ( -0.598352)i
-29.400701 + (
3.898725)i
-0.435450 + ( -0.102101)i
1.332225 + (
1.193097)i
-0.390631 + ( -0.141852)i
0.375058 + (
0.670168)i
-0.357698 + ( -0.169926)i
-0.146750 + (
0.007446)i
-0.356051 + ( -0.162856)i
-0.001840 + ( -0.000538)i
-0.356062 + ( -0.162758)i
0.000002 + ( -0.000001)i
Ejemplo
x0 =
2.5
x1 =
2.0
x2 =
2.3
xi
1.960592 + (
0.000000)i
-0.611310 + (
0.000000)i
1.970564 + (
0.000000)i
0.007455 + (
0.000000)i
1.970447 + (
0.000000)i
0.000029 + (
0.000000)i
x0 =
0.5
x1 =
1.0
P(xi)
x2 =
1.5
xi
P(xi)
1.287855 + (
0.000000)i
-1.376275 + (
0.000000)i
1.237459 + (
0.000000)i
0.126945 + (
0.000000)i
1.241605 + (
0.000000)i
0.002193 + (
0.000000)i
1.241677 + (
0.000000)i
-0.000001 + (
0.000000)i
Actividad
Encontrar las races reales y complejas del
siguiente polinomio por el mtodo de Mller en
MatLab.
Mtodo de Bairstow
El enfoque de Bairstow es el de utilizar el Mtodo de Newton
para ajustar los coeficientes r y s en la cuadrtica x2 rx + s
hasta que sus races sean tambin races del polinomio que se
quiere resolver.
Con estos coeficientes se determina la cuadrtica
correspondiente que se utiliza para simplificar la expresin,
eliminando estas races del conjunto buscado.
El proceso se repite hasta que el polinomio se convierta en uno
cuadrtico o lineal, momento en que todas las races quedan
determinadas.
P x ai x i
i 0
Q x bi x i
i 0
Px x 2 rx s bi x i b1 x r b0
i 2
cn = b n
cn1 = bn1 + rcn
ci = bi + rci+1 + sci+2 (i = n 2,, 1)
Donde:
b1
b
, c3 1
r
s
b
b
c0 0 , c2 0
r
s
c2
Ejemplo
Encontrar las races del siguiente polinomio en Excel
P( x) = x5 3.5x4 + 2.75x3 + 2.125x2 3.88x +1.25
Comience en r = -1 y s = -1
2
2.125
-4.625
-2.5
-6.25
-8.75
1
-3.875
3.875
5E-07
8.375
8.375
7E-08
1E-08
0r
s
valores calculados x1
x2
1.25
-0.5
0.5
-1
-1 #NUM!
#NUM!
-1.250000456 Dr
Ds
-0.6442 0.1381
0.1697
-0.8139
-4.55699E-07 7E-08 1E-08 -0.5111 0.4697
0.4759
-0.9870
Error r Error s -0.4997 0.5002
0.5002
-0.9999
1E-05 2E-06 -0.5000 0.5000
0.5000
-1.0000
-0.5
0.5
Muchas Gracias