Implementacion Metodos Numericos en Excel

Descargar como pdf o txt
Descargar como pdf o txt
Está en la página 1de 9

TRABAJO PRCTICO NRO. 1: RESOLUCIN DE ECUACIONES Y SISTEMAS DE ECUACIONES NO-LINEALES.

Mtodo de Sustitucin Directa.

f ( x*) = 0
Solucin iterativa valor inicial o semilla (x0) secuencia de x0, x1, x2 x3 xn

lm x
n

= x*

f ( x) + x = 0 + x = x
F ( x) = f ( x) + x

Y si x* es solucin de f(x) entonces

F ( x*) = x *

Valor de arranque: x0

F ( x 0 ) = x1
F ( x n 1 ) = x n

Criterio de terminacin:

x n x n 1
< y f (x) <
xn

Interpretacin geomtrica.

0 < F ' / x) < 1 (Converge)

1 < F ' / x) < 0 (Converge)

F ' / x) > 1 (Diverge)

F ' / x) < 1 (Diverge)


1

Mtodo de Newton Raphson (o de las tangentes). Interpretacin geomtrica.

x n +1 = xn

f ( xn )
f ' ( xn )

Criterio de terminacin:

x n +1 x n
< y f ( x n +1 ) <
xn

Mtodo de Wegstein

F ( x) = f ( x) + x

x n +1 = q ~
x n + (1 q ) x n +1
Algoritmo de mejora: ~

donde el acelerador es q =

F (~
xn ) F (~
x n 1 )
~
~
x n x n 1

se calcula xn+2 , se corrige y contina.


Se necesita inicializar el mtodo con tres valores:

x0

F ( x0 ) = x1 = ~
x1

x3 = F ( ~
x2 )

~
x3 = q ~
x 2 + (1 q ) x3

x4 = F ( ~
x3 )

Criterio de terminacin:

x2 = F ( ~
x1 ) = ~
x2

F (~
x2 ) F ( ~
x1 )
~
~
x 2 x1

~
x n +1 ~
xn
xn = F ( ~
xn )
< o ~
~
xn
2

IMPLEMENTACIN DE MTODOS NUMRICOS EN PLANILLA EXCEL

Sea:

f ( x) = Ln( x) + x 3 , queremos hallar las races de dicha funcin.

4
3
2
1
0
0

0.5

1.5

2.5

3.5

4.5

-1
-2
-3
-4

Resolucin de Ecuaciones No Lineales


1- Mtodo de Sustitucin Directa

F ( xn 1 ) = xn
x n xn 1
<
xn

Iteracin
1
2
3
4
5
6
7
8
9

x
2.2
2.18845736
2.16011161
2.09038312
1.91811361
1.48756942
0.37228238
-3.24353789
#NUM!

F(x)
2.18845736
2.160111615
2.090383123
1.918113608
1.487569424
0.372282376
-3.243537886
#NUM!
#NUM!

error (%)

6
5

-1.29523865
-3.2280041
-8.24104984
-22.4462296
-74.9737814
-971.257437
#NUM!
#NUM!

F ( x)

3
2
1
0
-1
-2
-3
-4

0.5

1.5

2.5

3.5

F ' ( x) =

4.5

1
+2
x

2- Mtodo de Newton Raphson

x n +1 = xn

It
1
2
3
4
5
6
7

x
2.5
2.20263249
2.20793841
2.20794003
2.20794003
2.20794003
2.20794003

x+h
2.501
2.203632489
2.208938414
2.208940032
2.208940032
2.208940032
2.208940032

f(x)
0.41629073
-0.00771428
-2.3501E-06
1.6559E-10
-1.1546E-14
0
0

f(x+h)
0.41769065
-0.00626038
0.00145046
0.00145281
0.00145281
0.00145281
0.00145281

der
1.39992002
1.45389917
1.45280865
1.45280832
1.45280832
1.45280832
1.45280832

f ( xn )
f ' ( xn )

xm
error (%)
2.20263249
2.20793841 0.24089015
2.20794003 7.3264E-05
2.20794003 -5.1623E-09
2.20794003 3.6204E-13
2.20794003
0
2.20794003
0

3- Mtodo de Wegstein

Iter
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

xn
2.5
2.91629073
3.90289398
2.15464827
2.07330777
2.21158382
2.21708721
2.20768989
2.20731183
2.2079572
2.20798314
2.20793885
2.20793707
2.20794011
2.20794023
2.20794003
2.20794002
2.20794003
2.20794003
2.20794003
2.20794003
2.20794003

F(x)
2.916290732
3.902893975
6.167506273
2.07692404
1.87576083
2.216876559
2.230368688
2.207326456
2.20639908
2.207982139
2.208045778
2.207937142
2.207932774
2.20794023
2.20794053
2.207940018
2.207939997
2.207940033
2.207940034
2.207940032
2.207940031
2.207940032

F (~
x2 ) F ( ~
x1 )
~
x2 ~
x1

Xn+1
2.91629073
3.90289398
6.16750627
2.07692404
1.87576083
2.21687656
2.23036869
2.20732646
2.20639908
2.20798214
2.20804578
2.20793714
2.20793277
2.20794023
2.20794053
2.20794002
2.20794
2.20794003
2.20794003
2.20794003
2.20794003
2.20794003

q=

xm
2.91629073
3.90289398
2.15464827
2.07330777
2.21158382
2.21708721
2.20768989
2.20731183
2.2079572
2.20798314
2.20793885
2.20793707
2.20794011
2.20794023
2.20794003
2.20794002
2.20794003
2.20794003
2.20794003
2.20794003
2.20794003
2.20794003

~
x3 = q ~
x2 + (1 q ) x3

2.29536271
0.04445841
2.42864178
0.03827662
2.41332636
0.03867449
2.41432647
0.03864706
2.4142576
0.03864895
2.41426233
0.03864882
2.41426201
0.03864882
2.41426202
0.03864876
2.41426144
0.03864895
2.41427656
0.03863455

1.77198455
-0.04652693
1.69996553
-0.03980003
1.70755066
-0.04023038
1.70705033
-0.0402007
1.70708476
-0.04020274
1.7070824
-0.0402026
1.70708256
-0.0402026
1.70708255
-0.04020254
1.70708284
-0.04020274
1.70707528
-0.04018717

Error (%)

58.0239256
-3.60728167
-9.52810498
0.23931896
0.59905076
-0.0164623
-0.04135141
0.00112961
0.00283678
-7.7525E-05
-0.00019469
5.3205E-06
1.3361E-05
-3.6514E-07
-9.1699E-07
2.5059E-08
6.2932E-08
-1.7198E-09
-4.319E-09
1.1798E-10

Resolucin de Sistemas de Ecuaciones No Lineales

Resolver el siguiente sistema de ecuaciones:

1- Mtodo de Sustitucin Directa

It
1
2
3
4
5
6
7
8
9
10

x1
0.9
0.946785375
0.921907031
0.908722869
1.051986043
3.491266069
10.66282901
29.75646955
13657.74471
#NUM!

x2
3
3.162463758
3.328956394
3.711429809
4.463588674
5.469878551
24.04971672
42724.26058
8.37665E+12
#NUM!

F1
0.946785375
0.921907031
0.908722869
1.051986043
3.491266069
10.66282901
29.75646955
13657.74471
#NUM!
#NUM!

F2
3.162463758
3.328956394
3.711429809
4.463588674
5.469878551
24.04971672
42724.26058
8.37665E+12
#NUM!
#NUM!
6

2- Mtodo de Newton Raphson

Iter
1
2
3
4
5
6
7
8
9

x1
0.90000
0.94230
0.94647
0.94670
0.94670
0.94670
0.94670
0.94670
0.94670

J11
-1.556138792
-1.045383927
-0.924169782
-0.917019107
-0.917033858
-0.917033767
-0.917033768
-0.917033768
-0.917033768

x1+h
0.90100
0.94330
0.94747
0.94770
0.94770
0.94770
0.94770
0.94770
0.94770
J12
-0.45024
-0.33511
-0.29689
-0.29461
-0.29461
-0.29461
-0.29461
-0.29461
-0.29461

x2
3.00000
2.95771
2.96903
2.96976
2.96976
2.96976
2.96976
2.96976
2.96976
J21
-2.9757
-2.8694
-2.8587
-2.8581
-2.8581
-2.8581
-2.8581
-2.8581
-2.8581

x2+h
3.00100
2.95871
2.97003
2.97076
2.97076
2.97076
2.97076
2.97076
2.97076
J22
0.86526
0.86526
0.86526
0.86526
0.86526
0.86526
0.86526
0.86526
0.86526

f1(x1,x2)
0.046785375
0.00815649
0.000423536
-8.62146E-07
5.32255E-09
-3.20463E-11
1.92846E-13
-1.11022E-15
0
Det
-2.686256
-1.866098
-1.648357
-1.635476
-1.635503
-1.635503
-1.635503
-1.635503
-1.635503

A11
-0.32
-0.46
-0.52
-0.53
-0.53
-0.53
-0.53
-0.53
-0.53

f1(x1+h,x2)
0.045229236
0.007111106
-0.00050063
-0.00091788
-0.00091703
-0.00091703
-0.00091703
-0.00091703
-0.00091703
A12
-0.1676
-0.1796
-0.1801
-0.1801
-0.1801
-0.1801
-0.1801
-0.1801
-0.1801

f1(x1,x2+h)
0.046335133
0.007821377
0.000126645
-0.000295472
-0.000294609
-0.000294614
-0.000294614
-0.000294614
-0.000294614

A21
-1.1078
-1.5376
-1.7343
-1.7476
-1.7475
-1.7475
-1.7475
-1.7475
-1.7475

A22
0.579
0.56
0.561
0.561
0.561
0.561
0.561
0.561
0.561

f2(x1,x2)
0.1624638
0.0021798
1.702E-05
-2.25E-07
6.405E-10
-3.78E-12
2.309E-14
0
0

x1
0.942300237
0.946473616
0.946699004
0.946698507
0.94669851
0.94669851
0.94669851
0.94669851
0.94669851

f2(x1+h,x2)
0.15948803
-0.0006896
-0.0028416
-0.0028583
-0.0028581
-0.0028581
-0.0028581
-0.0028581
-0.0028581

x2
2.95771233
2.96903302
2.96975799
2.96975661
2.96975662
2.96975662
2.96975662
2.96975662
2.96975662

f2(x1,x2+h)
0.163329
0.0030451
0.0008823
0.000865
0.0008653
0.0008653
0.0008653
0.0008653
0.0008653
Norma
0.059812684
0.012065449
0.000759204
1.4671E-06
9.41034E-09
5.66954E-11
3.41117E-13
1.86107E-15
0

3- Mtodo de Wegstein

Itre
1
2
3
52
53

x1
0.90000
0.94679
0.92191
0.99041
0.99048

x2
3.00000
3.16246
3.32896
3.11087
3.11133

F1(x1,x2)
0.946785375
0.921907031
0.908722869
0.974707928
0.974908029

F2(x1,x2)
3.162463758
3.328956394
3.711429809
3.110466989
3.111147478

w1

q1

0.529945332 -1.12741
237.334786 1.00423
3.011475283 1.49715

w2

q2

2.29724
1.86074
1.47108

1.77087
2.16179
3.12278

x1 M
0.94679
0.92191
0.89385888
0.99047787
0.99821839

x2 M
3.1624638
3.3289564
3.0341199
3.1113277
3.1117103

Norma

0.168341111
0.191576429
0.000467325

0.167341
0.190576
-0.00053

También podría gustarte