Está en la página 1de 12

1)

Metodo Velocidad #Iteraciones P exp C Exp

Biseccion 223499999.983+- 33 0.999998103 0.499997237


0.017

Regula Falsi 244294829.299+- 117 0.999993323 0.839965542


0.018

Newton-Raphson 244294829.325+- 87 0.999829184 0.8039990137


0.017

Secante 244294829.3944+- 11 1.617250639 6.416893877


0.001

2)

Velocidad (Uk) vs Numero de iteraciones(k)


288000000
268000000
248000000
Velocidad Uk

228000000
208000000
188000000
168000000
1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 101106111116
Numero de iteraciones

N Iteracion M. Biseccion M. Regula Falsi


M. Newton Rhapson M. Secante

3)
Velocidad (Uk) vs Numero de iteraciones(k)
288000000
268000000
248000000
Velocidad Uk

228000000
208000000
188000000
168000000
1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 101106111116
Numero de iteraciones

N Iteracion M. Biseccion M. Regula Falsi


M. Newton Rhapson M. Secante

4)

Metodo [a b]
M. Newton Raphson 226159780,984229 244294829,324774
M. Secante 168844065,269447 244294829,394428

5)

Según lo visto experimentalmente el método con mayor rapidez convergencia fue el Método de la
secante llegando a la convergencia solo en 11 iteraciones, en caso contrario el meto de Regula Falsi,
fue el método que mas costo computacional se requirió, ya que se tuvo que iterar 117 veces.
Podimos obtener el orden de convergencia esperado teóricamente, de los métodos de bisección.

ANEXO

Programas en phyton

Método de Biseccion)

def biseccion(funcion, x_i, x_f, iteraciones=1000, error_r=0.02):

solucion = None

contador = 0

error_cal = 10000000000

if funcion(x_i) * funcion(x_f) <= 0:


while contador <= iteraciones and error_cal >= error_r:

contador += 1

solucion = (x_i + x_f)/2

error_cal = abs((solucion - x_i))

if funcion(x_i) * funcion(x_f) >= 0:

x_i = solucion

else:

x_f = solucion

print(solucion)

print('La solucion aproximada es {:.3f}'.format(solucion))

print('Encontrada en: {:.0f}'.format(contador) + 'iteraciones')

print('Con un error de: {:.3f}'.format(error_cal))

else:

print ('No existe solucion en este intervalo')

biseccion(lambda x: (((x)*(25))/(((1)-((x/300000000)**2))**0.5))-10522300000, 150000000,


297000000, 10000, 0.02)

Método de Regula Falsi)

def falsap(funcion, x_i, x_f, iteraciones=1000, error_r=0.02):

#Inicializar las variables

solucion = None

contador = 0

error_calculado = 1000000000000

#Evaluar si la raiz esta dentro del intervalo

if funcion(x_i) * funcion(x_f) <= 0:

#calcular la solucion

while contador <= iteraciones and error_calculado >= error_r:

contador += 1
solucion = x_f - ((funcion(x_f) * (x_f - x_i))/ (funcion(x_f) - funcion(x_i)))

error_calculado = abs((solucion - x_i))

# Reedifinir el nuevo intervalo

if (funcion(x_i)) * (funcion(solucion)) >= 0:

x_i = solucion

else:

x_f = solucion

print(solucion)

#Imprime los resultados

print('La solucion aproximada es: {:.3f}'.format(solucion))

print('Encontrada en: {:.0f}'.format(contador) + 'iteraciones')

print('Con un error de: {:.3f}'.format(error_calculado))

else:

print ('No existe solucion en este intervalo')

falsap(lambda x: (((x)*(25))/(((1)-((x/300000000)**2))**0.5))-10522300000, 150000000, 297000000,


10000, 0.02)

Método de Newton Rhapson)

def newton(f, df, tol, itmax=1000):

x0 = 200000000

error = 1000000

n=0

while error > tol:

x1 = x0 - (f(x0)/df(x0))

error = abs(x1-x0)

x0 = x1

n += 1
print (x0)

print ("solucion aproximada: {:.3f}".format(x0))

print('Encontrada en: {:.0f}'.format(n) + 'iteraciones')

print('Con un error de: {:.3f}'.format(error))

newton(lambda x: (((x)*(25))/(((1)-((x/300000000)**2))**0.5))-10522300000, lambda x: (25/((1-


((x**2)/(300000000**2)))**2))*(1+((x**2)/((300000000**2)-(x**2)))), 0.02, 100)

Método de la Secante)

def secante(funcion, x1, x2, tol):

error = 1000000000

n=0

x3 = 0

while error > tol:

x3 = x1-((x2-x1)/(funcion(x2) - funcion(x1))) * funcion(x1)

x1 = x2

x2 = x3

error = abs(funcion(x3))

n += 1

print(x3)

print("La solucion aproximada es: {:.4f}".format(x3))

print("numero de iteraciones: {:d}".format(n))

print('Con un error de: {:.3f}'.format(error))

secante(lambda x: (((x)*(25))/(((1)-((x/300000000)**2))**0.5))-10522300000, 150000000,


297000000, 0.02)

Datos obtenidos por métodos:

Errores

Numero de Regula biseccion Secante Newton-Rapshon


iteracion Falsi
1 18844065, 73500000 541561724 907011,799
3 8
2 14602911, 36750000 472620323 794141,8141
7 5
3 11458022, 18375000 1,1187E+10 686865,842
4
4 9083521,5 9187500 294773409 587575,1659
4 5
5 7263721,5 4593750 176519227 497758,9685
6 5
6 5851302,3 2296875 749429200 418097,7867
5
7 4743102,3 1148437,5 133921107 348619,6594
5
8 3865381,2 574218,75 9069405,7 288877,158
1
9 3164495,7 287109,37 116028,534 238114,7871
4 5
10 2600818,1 143554,68 99,5395164 195409,3623
5 8
11 2144669,7 71777,343 0,00109291 159776,9822
5 8
12 1773545,4 35888,671 130247,6065
9 9
13 1470185,8 17944,335 105912,1691
7 9
14 1221216,7 8972,1679 85948,50329
2 7
15 1016176,1 4486,0839 69632,14154
4 8
16 846809,52 2243,0419 56337,09435
9 9
17 706552,84 1121,521 45530,53051
4
18 590149,45 560,76049 36764,1743
5 8
19 493363,09 280,38024 29664,31857
7 9
20 412760,58 140,19012 23921,65755
5 5
21 345545,71 70,095062 19281,6455
9 3
22 289431,13 35,047531 15535,75021
6 1
23 242538,56 17,523765 12513,75185
9 6
24 203320,55 8,7618827 10077,10472
3 8
25 170498,50 4,3809413 8113,303499
5 9
26 143013,38 2,1904707 6531,157675
6
27 119986,13 1,0952353 5256,862785
9 5
28 100685,77 0,5476176 4230,756649
7 7
29 84503,496 0,2738088 3404,655458
4 4
30 70931,586 0,1369044 2739,675269
1 2
31 59546,164 0,0684522 2204,456362
1
32 49993,000 0,0342260 1773,719778
1 9
33 41975,832 0,0171130 1427,096334
6
34 35246,710 1148,178274
4
35 29598,000 923,7522414
6
36 24855,743 743,1795605
37 20874,132 597,8959745
1
38 17530,917 481,0080778
4
39 14723,568 386,967936
1
40 12366,071 311,3108596
6
41 10386,257 250,4441477
42 8723,5572 201,476944
2
43 7327,1358 162,0832336
8
44 6154,3187 130,3915471
8
45 5169,2796 104,8961781
46 4341,9384 84,38572598
6
47 3647,0383 67,88558936
8
48 3063,3706 54,61168942
6
49 2573,1251 43,93323278
50 2161,3447 35,34274966
7
51 1815,4684 28,43198648
5
52 1524,9465 22,87251016
7
53 1280,9188 18,40010318
5
54 1075,9435 14,8022089
8
55 903,77043 11,90783131
4
56 759,14964 9,579408973
4
57 637,67176 7,706278056
2
58 535,63312 6,199412972
1
59 449,92283 4,987195671
5
60 377,92790 4,012011826
6
61 317,45352 3,227512747
3
62 266,65612 2,596412569
4
63 223,98717 2,08871612
9
64 188,14596 1,680293351
7
65 158,03991 1,351732612
9
66 132,75130 1,087417841
3
67 111,50924 0,874786586
6
68 93,666231 0,703732759
4
69 78,678356 0,566126406
2
70 66,088754 0,455427289
71 55,513664 0,366374046
5
72 46,630735 0,294734061
7
73 39,169197 0,237102419
2
74 32,901606 0,19073993
3
75 27,636914 0,153443038
5
76 23,214644 0,123439133
77 19,499995 0,099302113
8
78 16,379740 0,079884797
6
79 13,758767 0,064264297
6
80 11,557184 0,051698178
8
81 9,7078842 0,04158923
8
82 8,1544961 0,033456981
83 6,8496704 0,026914865
1
84 5,7536338 0,021651983
9
85 4,8329775 0,017418206
3
86 4,0596382
3
87 3,4100433
88 2,8643920
1
89 2,4060520
5
90 2,0210524
5
91 1,6976577
6
92 1,4260104
9
93 1,1978302
9
94 1,0061619
95 0,8451629
96 0,7099258
6
97 0,5963285
98 0,5009082
99 0,4207564
100 0,3534299
1
101 0,2968765
5
102 0,2493724
2
103 0,2094696
2
104 0,1759517
5
105 0,1477971
7
106 0,1241477
1
107 0,1042824
7
108 0,0875959
1
109 0,0735794
3
110 0,0618057
5
111 0,0519160
6
112 0,0436087
8
113 0,0366308
1
114 0,0307694
4
115 0,0258459
2
116 0,0217102
2
117 0,0182363
1

Datos de la velocidad:

N Iteracion M. M. Regula M. Newton M. Secante


Biseccion Falsi Rhapson
1 223500000 168844065 226159781 168844065
2 186750000 183446977 232328040 183446977
3 205125000 194904999 235769695 283555660
4 214312500 203988521 237983781 213178731
5 218906250 211252242 239513276 227855290
6 221203125 217103545 240616073 249763138
7 222351563 221846647 241433980 243233972
8 222925781 225712028 242052649 244223832
9 223212891 228876524 242527321 244295737
10 223356445 231477342 242895378 244294829
11 223428223 233622012 243183055 244294829
12 223464111 235395558 243409286
13 223482056 236865743 243588040
14 223491028 238086960 243729804
15 223495514 239103136 243842561
16 223497757 239949946 243932452
17 223498878 240656499 244004244
18 223499439 241246648 244061664
19 223499720 241740011 244107643
20 223499860 242152772 244144494
21 223499930 242498317 244174051
22 223499965 242787749 244197771
23 223499982 243030287 244216816
24 223499991 243233608 244232114
25 223499996 243404106 244244405
26 223499998 243547120 244254283
27 223499999 243667106 244262223
28 223499999 243767792 244268606
29 223500000 243852295 244273739
30 223500000 243923227 244277866
31 223500000 243982773 244281185
32 223500000 244032766 244283854
33 223500000 244074742 244286001
34 244109988 244287728
35 244139586 244289117
36 244164442 244290234
37 244185316 244291133
38 244202847 244291856
39 244217571 244292437
40 244229937 244292905
41 244240323 244293281
42 244249047 244293584
43 244256374 244293828
44 244262528 244294024
45 244267697 244294181
46 244272039 244294308
47 244275686 244294410
48 244278750 244294492
49 244281323 244294558
50 244283484 244294611
51 244285300 244294654
52 244286825 244294688
53 244288105 244294716
54 244289181 244294738
55 244290085 244294756
56 244290844 244294770
57 244291482 244294782
58 244292018 244294791
59 244292468 244294799
60 244292845 244294805
61 244293163 244294809
62 244293430 244294813
63 244293654 244294816
64 244293842 244294819
65 244294000 244294821
66 244294133 244294823
67 244294244 244294824
68 244294338 244294825
69 244294416 244294826
70 244294482 244294827
71 244294538 244294827
72 244294585 244294828
73 244294624 244294828
74 244294657 244294828
75 244294684 244294828
76 244294708 244294829
77 244294727 244294829
78 244294743 244294829
79 244294757 244294829
80 244294769 244294829
81 244294778 244294829
82 244294787 244294829
83 244294793 244294829
84 244294799 244294829
85 244294804 244294829
86 244294808 244294829
87 244294811 244294829
88 244294814
89 244294817
90 244294819
91 244294820
92 244294822
93 244294823
94 244294824
95 244294825
96 244294826
97 244294826
98 244294827
99 244294827
100 244294828
101 244294828
102 244294828
103 244294828
104 244294828
105 244294829
106 244294829
107 244294829
108 244294829
109 244294829
110 244294829
111 244294829
112 244294829
113 244294829
114 244294829
115 244294829
116 244294829
117 244294829

También podría gustarte