Académique Documents
Professionnel Documents
Culture Documents
ESCUELA PROFESIONAL DE
INGENIERÍA CIVIL
MÉTODO DE BISECCIÓN
ALUMNOS:
GAMBOA FERNÁNDEZ, PEDRO (166007F)
IRIGOIN BUSTAMANTE, WILSON (152019G)
VASQUEZ MERA, EDINSON ABAD (165124I)
CUMPA REYES, EDY YERSI (160433C)
PROFESORA:
CURSO:
MATEMÁTICA BÁSICA II
CICLO:
2016 – II
k=0;
ya=feval(f,a);
yb=feval(f,b);
if ya*yb<0
while abs(a-b)>tol
c = (a+b)/2;
yc=feval(f,c);
fprintf('%5d%15.11f%15.11f%15.11f%15.11f\n',k,a,b,c,yc);
k=k+1;
if ya*yc==0
a=b;
elseif ya*yc<0
b=c;yb=yc;
else
a=c;ya=yc;
end
end
else
fprintf('Cambiar limites');
end
clc
clear
x=[-2:0.01:5];
y1=x.^3;
y2=exp(-x)+4;
plot(x,y1,'m',x,y2,'g','linewidth',2)
grid on
axis([-2.5 5.5 -20 140])
GRÁFICO N°1
function y=f01(x)
y=x.^3-exp(-x)-4;
end
I) .
a=1,b=2,tol=10^(-6)
a= 1
b= 2
tol = 1.0000e-06
c = 1.613329887390137
clc
clear
x=[0:0.01:9];
y1=3*log(2*x+5);
y2=12-x;
plot(x,y1,'b',x,y2,'g','linewidth',2)
grid on
axis([-0.5 9.5 2 13])
GRAFICA N°2
function y=f02(x)
y=3*log(2*x+5)+x-12;
end
I) .
a=4,b=5,tol=10^(-5)
a=4
b= 5
tol = 9.999999999999999e-06
c = 4.209831237792969
clc
clear
x=[-1:0.01:5];
y1=x.^3;
y2=(x-3).^2+1;
plot(x,y1,'b',x,y2,'g','linewidth',2)
grid on
axis([-1.5 5.5 -20 140])
GRAFICA N°31
function y=f03(x)
y=x.^3-(x-3).^2-1;
end
I) .
a=1,b=2,tol=10^(-6)
a=1
b=2
tol = 1.000000000000000e-06
c = 1.487120628356934
programa
for k=1:N
p1 = p0 - feval(f,p0)/feval(df,p0);
end
p0=p1;
end
clc
clear
x=[0:0.001:4];
f1=x.^2;
f2=x+3;
plot(x,f1,'r',x,f2,'k','linewidth',2)
grid on
16
14
12
10
0
0 0.5 1 1.5 2 2.5 3 3.5 4
GRÁFICO N°04
y=x^2-x-3; y=2*x-1;
end end
I) .
po=2, tol=10^(-7),N=50
1 2.333333333333
2 2.303030303030
3 2.302775655717
4 2.302775637732
p1 = 2.302775637731995
II) .
po=3, tol=10^(-7),N=50
[p1]= newton('fn17','dfn17',p0,tol,N)
1 2.400000000000
2 2.305263157895
3 2.302777351542
4 2.302775637733
5 2.302775637732
p1 = 2.302775637731995
III) .
po=4, tol=10^(-7),N=50
[p1]= newton('fn17','dfn17',p0,tol,N)
1 2.714285714286
2 2.341013824885
3 2.303172744733
4 2.302775681459
5 2.302775637732
p1 = 2.302775637731995
IV) .
po=10, tol=10^(-7),N=50
[p1]= newton('fn17','dfn17',p0,tol,N)
1 5.421052631579
2 3.290740219533
3 2.477652899338
4 2.310507544741
5 2.302792147574
6 2.302775637808
7 2.302775637732
p1 = 2.302775637731995
V) .
po=10, tol=10^(-7),N=50
[p1]= newton('fn17','dfn17',p0,tol,N)
1 50.266331658291
2 25.415818426712
3 13.023128824937
4 6.891324316939
5 3.949913064763
6 2.695982894349
7 2.337978996341
8 2.303112767933
9 2.302775669249
10 2.302775637732
p1 = 2.302775637731995
C). Podemos ver que si empleamos p0=2 como punto inicial obtenemos menos iteraciones para
la precisión pedida, por lo cual es más recomendable tomar como punto inicial uno cercano al
cero hallado gráficamente, ya que converge con mayor rapidez, conforme tomamos puntos
clc
clear
x=[-4:0.001:4];
f1=x.^2-1;
f2=-10*cos(x);
plot(x,f1,'r',x,f2,'k','linewidth',2)
grid on
15
10
-5
-10
-4 -3 -2 -1 0 1 2 3 4
GRÁFICO N°05
y=x^2+10*cos(x)-1; y=2*x-1;
end end
I) .
po=0, tol=10^(-7),N=50
[p1]= newton('fn18','dfn18',p0,tol,N)
1 -Inf
2 NaN
3 NaN
4 NaN
5 NaN
…
49 NaN
50 NaN
p1 = NaN
II) .
po=1, tol=10^(-7),N=50
p1 = 1.794792964829379
III) .
po=2, tol=10^(-7),N=50
[p1]= newton('fn18','dfn18',p0,tol,N)
1 1.771946940178
2 1.794623038381
3 1.794792954940
4 1.794792964829
p1 = 1.794792964829379
IV) .
po=100, tol=10^(-7),N=50
[p1]= newton('fn18','dfn18',p0,tol,N)
1 51.197480022202
2 23.368377889823
3 13.763470918443
4 3.219325719464
5 3.303279735376
6 3.298157530919
7 3.298138433969
8 3.298138433703
p1 = 3.298138433703030
V) .
po=-1, tol=10^(-7),N=50
[p1]= newton('fn18','dfn18',p0,tol,N)
1 -1.842286430196
2 -1.793934438371
3 -1.794792712789
4 -1.794792964829
5 -1.794792964829
p1 = -1.794792964829379
VI) .
po=-2, tol=10^(-7),N=50
[p1]= newton('fn18','dfn18',p0,tol,N)
1 -1.771946940178
2 -1.794623038381
3 -1.794792954940
4 -1.794792964829
p1 = -1.794792964829379
VII) .
po=-3, tol=10^(-7),N=50
[p1]= newton('fn18','dfn18',p0,tol,N)
1 -3.414035259627
2 -3.306410450859
3 -3.298187633640
4 -3.298138435466
5 -3.298138433703
p1 = -3.298138433703030
VIII) .
po=-100, tol=10^(-7),N=50
[p1]= newton('fn18','dfn18',p0,tol,N)
1 -51.197480022202
2 -23.368377889823
3 -13.763470918443
4 -3.219325719464
5 -3.303279735376
6 -3.298157530919
7 -3.298138433969
8 -3.298138433703
p1 = -3.298138433703030
C) Al observar la Gráfica obtenida con 4 ceros, nos damos cuenta que los puntos iniciales
convergen hacia los ceros más cercanos, y aquellos que poseen simetría vertical, con respecto a