You are on page 1of 3

PREGUNTA 1

La función se intersecta entre 0 y 1

bisec

function f=f1(x);
f=9*exp(-0.7*x)*cos(4*x)-3.5;
bisect('f1',0,1,0.0001,10)

_______________________________________________

iter a b c f(c) |b-a|/2

_______________________________________________

0 0.0000 1.0000 0.500000 -6.139283 0.500000

1 0.0000 0.5000 0.250000 0.582045 0.250000

2 0.2500 0.5000 0.375000 -3.010347 0.125000

3 0.2500 0.3750 0.312500 -1.219682 0.062500

4 0.2500 0.3125 0.281250 -0.312899 0.031250

5 0.2500 0.2813 0.265625 0.136998 0.015625

6 0.2656 0.2813 0.273438 -0.087464 0.007813

7 0.2656 0.2734 0.269531 0.024904 0.003906

8 0.2695 0.2734 0.271484 -0.031248 0.001953

9 0.2695 0.2715 0.270508 -0.003164 0.000977

10 0.2695 0.2705 0.270020 0.010872 0.000488


NEWTON

REGULA FALSA

function f=f1(x);
f=9*exp(-0.7*x)*cos(4*x)-3.5;
falsep('f1',1,0,0.0001,10)

_______________________________________________

iter a b c f(c) |b-a|

_______________________________________________

0 1.0000 0.0000 0.461359 -5.267157 1.000000

1 0.4614 0.0000 0.235668 0.984364 0.461359

2 0.4614 0.2357 0.271205 -0.023216 0.225691

3 0.2712 0.2357 0.270386 0.000329 0.035537

4 0.2712 0.2704 0.270398 0.000000 0.000819

PREGUNTA 2

x=[-3;0;5;9;15;22];

>> y=[21.4;16.3;11;7.4;3.2;1.2];

>> lagrange(x,y,23)

c=

1.0e-03 *

-0.1651 0.3659 -0.4044 0.2196 -0.0282 0.0014

p(a)= 0.794638
x=[-3;0;5;9;15;22;23];

>> y=[21.4;16.3;11;7.4;3.2;1.2;0.98];

>> lagrange(x,y,23)

c=

1.0e-04 *

0.0635 -0.1591 0.2247 -0.1569 0.0353 -0.0141 0.0081

p(a)= 0.980000

PREGUNTA 3

You might also like