Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Ejercicios de Metodo de Biseccion y Newton PDF
Ejercicios de Metodo de Biseccion y Newton PDF
b 1 a1
|C Cn |
2n
51
10 5
2n
51
ln(2) ln( )
10 5
12,899
n
ln(2)
n 18
iteraciones
y = w2 4,9sinh(x) + 4,9sin(x).
raz de la funcin:0
Programa empleado:
function [raiz]=mbiseccion()
clear all
clc
fprintf(Metodo de la Biseccin);
1
syms x;
f=input(\nIngrese f(x) = );
y=inline(f);
t=linspace(-10,0.1,10);
plot(t,y(t));
grid on;
a=input(Ingrese el limite inferior : );
%a=str2mun(a)
b=input(Ingrese el limite superior : );
e=input(Ingrese el error : );
if (y(a)*y(b))>0
fprintf(Los limites ingresado son incorectos);
fprintf(\nNo existe raiz);
return;
end
while abs(b-a)>e
c=(a+b)/2;
if y(c)==0
raiz=c;
break
end
if y(a)*y(c)<0
b=c;
else
a=c;
end
end
raiz = c
2
Grfica de la funcin:
3.
s
2gh
sin() =
V0
s
2 9,8 1
sin( =
102
f (x) = sin() 0,44272
f 0 (x) = cos()
3
f (0 0,3987
1 = 0
f 0 (0 ) 1
=1
0,5403 1
= 0,2621
0,1836
2 = 0,2621
0,9658 2
= 0,4522
0,1836
2 = 0,2621
0,9658 2
= 0,4522
5,773210 3
3 = 0,4522 0,99998
3 = 0,45797
4 = 0,4585
Error= 0.4585-0.45797 0,4548Error=0,11
Programa empleado:
function [raiz]=mnewton()
clear all
clc
fprintf(Metodo de Newton);
syms x;
f=input(\nIngrese f(x) = );
y=inline(f);
t=linspace(-1,0.001,2);
plot(t,y(t));
grid on;
x0=input(Ingrese un punto inicial x0 cercano a la raiz : );
e=input(Ingrese el error : );
fp=diff(f);
yp=inline(fp);
xx=0;
xy=0;
e1=0;
while y(x0)>=e
x1=x0-(y(x0)/yp(x0));
if y(x0)==0
raiz=x0;
break
else
x0=x1;
end
e=(x1-x0)/x1;
xx=[xx;x0];
xy=[xy;x1];
e1=[e1;e];
end
4
raiz =x0
resultados=[xx xy e]
Grfica de la funcin:
5.
Programa empleado:
5
function [raiz]=mbiseccion()
clear all
clc
fprintf(Metodo de la Biseccin);
syms x;
f=input(\nIngrese f(x) = );
y=inline(f);
a=input(Ingrese el limite inferior : );
b=input(Ingrese el limite superior : );
x=-10:0.0001:10;
fplot(y,x,c)
grid on;
6
7.
8.
Con x0 = 1 Y x2
f (x0
x2 = x0 x1 x0 )Resuelvalassiguientesecuaciones :
(
(2)
xlogx 10 = 0., porelmtododelasecante.
Con x0 = 1 Y x2
f (x0
x2 = x0 x1 x0 )f (x1 ) f (x0 )
(
(10)
x2 = 1 2 1)8,614 (10)
(
(5)
x2 = 8,21501
(8,614)
x3 = 2 8,614 2)7,3005 + 8,21501
(
7
(7)
x3 = 5,449
x4 = 5,7102
x5 = 5,7291
function [raiz]=msecante()
clear all
clc
fprintf(Metodo de Secante);
syms x;
f=input(\nIngrese f(x) = );
y=inline(f)
t=linspace(-2,0.01,5);
plot(t,y(t));
grid on;
x0=input(Ingrese un punto x0 cercano a la raiz : );
x1=input(Ingrese un punto x1 cercano a la raiz : );
e=input(Ingrese el error : );
x2=x0-((y(x0)*(x1-x0))/(y(x1)-y(x0)));
xt1=0;
xt2=0;
xt3=0;
while y(x2)>=e
if y(x2)==0
raiz = x2;
break
else
x0=x1;
x1=x2;
end
x2=x0-((y(x0)*(x1-x0))/(y(x1)-y(x0)))
xt1=[xt1;x0];
8
xt2=[xt2;x1];
xt3=[xt3;x2];
end
raiz=x2;
resultados=[xt1 xt2 xt3]
Resultado en el programa:
Grfica de la funcin: