0% found this document useful (0 votes)
40 views

Punto Fijo: F (X) Cos (X) + X

The document contains the results of several numerical methods applied to different functions: 1) Fixed point method applied to the functions cos(x)+x, exp(-x)+sin(x), x^2-4x+4. 2) Newton-Raphson method applied to the functions cos(x)+x, sin(x)+ln(x). 3) Code in MATLAB to implement Newton-Raphson method for a generic function.

Uploaded by

Ka Gia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Punto Fijo: F (X) Cos (X) + X

The document contains the results of several numerical methods applied to different functions: 1) Fixed point method applied to the functions cos(x)+x, exp(-x)+sin(x), x^2-4x+4. 2) Newton-Raphson method applied to the functions cos(x)+x, sin(x)+ln(x). 3) Code in MATLAB to implement Newton-Raphson method for a generic function.

Uploaded by

Ka Gia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

PUNTO FIJO

f ( x )=cos ( x ) + x
i
xf(i)
Error aprox (i)
0
0.0000000
100.000
1
-1.0000000
100.000
2
-0.5403023
85.082
3
-0.8575532
36.995
4
-0.6542898
31.066
5
-0.7934804
17.542
6
-0.7013688
13.133
7
-0.7639597
8.193
8
-0.7221024
5.797
9
-0.7504178
3.773
10
-0.7314040
2.600
11
-0.7442374
1.724
12
-0.7356047
1.174
13
-0.7414251
0.785
14
-0.7375069
0.531
15
-0.7401473
0.357
16
-0.7383692
0.241
17
-0.7395672
0.162
18
-0.7387603
0.109
19
-0.7393039
0.074
20
-0.7389378
0.050

cos(x)+x
8
6
4
2
0
-2
-4
-6
-6

-4

-2

0
x

x
6
4
2
0
-2
-4
-6
-6

-4

-2

0
x

sin(x)+(3060512324672075/1125899906842624)-x

f ( X )=sen ( x ) +ex
200

xf(i)

Error aprox (i)


0
0.0000000
100.000
1
1.0000000
100.000
2
2.2093505
54.738
3
3.1220809
29.235
4
3.1856568
1.996
5
3.1829580
0.085

180
160
140
120
100
80
60
40
20
0
-6

-4

-2

0
x

3.1830673

0.003

x
6
4
2
0
-2
-4
-6
-6

-4

-2

0
x

f ( x )=x 24 x+ 4
i
xf(i)
Error aprox
0
0.0000000
100.000
1
-1.0000000
100.000
2
-1.3333333
25.000
3
-1.5000000
11.111
4
-1.6000000
6.250
5
-1.6666667
4.000
6
-1.7142857
2.778
7
-1.7500000
2.041
8
-1.7777778
9
-1.8000000
10
-1.8181818
11
-1.8333333
12
-1.8461538
13
-1.8571429
14
-1.8666667

(i)

(x+2)2
70
60
50
40
30
20
10
0
-6

1.562
1.235
1.000
0.826
0.694
0.592
0.510

-4

-2

0
x

15
0.444
16
0.391
17
0.346
18
0.309
19
0.277
20
0.250
21
0.227
22
0.207
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

-1.8750000

x
6

-1.8823529

-1.8888889

-1.8947368

-1.9000000

-2
-4

-1.9047619

-6

-1.9090909

-6

-1.9130435
-1.9166667
-1.9200000
-1.9230769
-1.9259259
-1.9285714
-1.9310345
-1.9333333
-1.9354839
-1.9375000
-1.9393939
-1.9411765
-1.9428571
-1.9444444
-1.9459459
-1.9473684
-1.9487179
-1.9500000
-1.9512195
-1.9523810
-1.9534884
-1.9545455
-1.9555556
-1.9565217

f ( x )=sen ( x )+ ln ( x )

0.189
0.174
0.160
0.148
0.137
0.128
0.119
0.111
0.104
0.098
0.092
0.087
0.082
0.077
0.073
0.069
0.066
0.063
0.059
0.057
0.054
0.052
0.049

-4

-2

0
x

i
xf(i)
Error aprox
(i)
0
0.0000000
100.000
1
1.0000000
100.000
2
0.4310761
131.978
3
0.6584620
34.533
4
0.5423190
21.416
5
0.5968297
9.133
6
0.5700547
4.697
7
0.5829360
2.210
8
0.5766745
9
0.5797031
10
0.5782347
11
0.5789459
12
0.5786013
13
0.5787682

sin(x)+log(x)

1.5

0.5

-0.5
0

1.086
0.522
0.254
0.123
0.060
0.029
x

6
4
2
0
-2
-4
-6
-6

-4

-2

0
x

NEWTON-RAPSHON
f ( x )=cos ( x ) + x
i
0
1
2
3
4

xf(i)

Error aprox (i)

0.0000000
-1.0000000
-0.7503639
-0.7391129
-0.7390851

100.000
100.000
33.269
1.522
0.004

fx(i)=input('Ingrese el valor inicial: ');


tol=input('Ingrese el porcentaje de error: ');
f=input('Ingrese la funcin: ');
i=1;
syms x;
f1=subs(f,x,fx(i));
z=diff(f);
d=subs(z,x,fx(i));
ea(1)=100;
while abs(ea(i))>=tol;
fx(i+1)=fx(i)-f1/d; f1=subs(f,x,fx(i+1)); d=subs(z,x,fx(i+1));
ea(i+1)=abs((fx(i+1)-fx(i))/fx(i+1)*100);
i=i+1;
end
fprintf('i
fx(i)
Error aprox (i) \n');
for j=1:i;
fprintf('%2d \t %11.7f \t %7.3f \n',j-1,fx(j),ea(j));
end

You might also like