Documentos de Académico
Documentos de Profesional
Documentos de Cultura
>> syms x;
𝑿 >> x= -1.6:0.0001:-1.2;
𝒚 = 𝒄𝒐𝒔(𝒙 + √𝟐) + 𝒙( 𝟐 + √𝟐 )
>> syms x; >> y = cos(x + sqrt(2)) + x.*(x/2 + sqrt(2));
>> x= -10:0.0001:10; >> plot(x,y,'r'), grid on, title 'y = cos(x + sqrt(2)) +
>> y = cos(x + sqrt(2)) + x.*(x/2 + sqrt(2)); x.*(x/2 + sqrt(2))'
>> plot(x,y,'r'), grid on, title 'y = cos(x + sqrt(2)) +
x.*(x/2 + sqrt(2))'
𝑿
>> syms x; la ecuacion 𝒚 = 𝒄𝒐𝒔(𝒙 + √𝟐) + 𝒙( + √𝟐 )
𝟐
>> x= -2:0.0001:2; posee una raiz en los intervalos [-1.6;-1,3]
>> y = cos(x + sqrt(2)) + x.*(x/2 + sqrt(2));
>> plot(x,y,'r'), grid on, title 'y = cos(x + sqrt(2)) +
x.*(x/2 + sqrt(2))'
C
𝒚 = 𝒆𝟔𝒙 + 𝟑𝒍𝒏(𝟐)𝒆𝟐𝒙 − 𝒍𝒏(𝟖)𝒆𝟒𝒙 − 𝒍𝒏𝟐𝟑
>> syms x ;
>> x = -5:0.00001:5;
>> y= exp(6.*x) + 3*log(2)*exp(2.*x) - log(8)*exp(4.*x)
- (log(2)).^3;
>> plot(x,y,'r'), grid on, title 'y= exp(6.*x) +
3*log(2)*exp(2.*x) - log(8)*exp(4.*x) - (log(2)).^3'
>> syms x ;
>> x = -1:0.00001:0;
>> y= exp(6.*x) + 3*log(2)*exp(2.*x) - log(8)*exp(4.*x)
- (log(2)).^2;
>> plot(x,y,'r'), grid on, title 'y= exp(6.*x) +
3*log(2)*exp(2.*x) - log(8)*exp(4.*x) - (log(2)).^3'
1. Encuentre el o los intervalos donde existe al menos una
raíz en a cada una de las siguientes ecuaciones. (Describa
muy bien el intervalo que se escoja para mostrar la raíz)
a. 𝒚 = 𝒙𝟐 − 𝟐𝒙𝒆−𝒙 + 𝒆−𝟐𝒙 +
>> syms x;
>> x= -10:0.0001:10;
>> y= x.^2 - 2*x.*exp(-x) + exp(-2*x);
>> plot(x,y,'r'), grid on, title ' y= x.^2 - 2*x.*exp(-x) +
exp(-2*x)'
>> syms x;
>> x= -2:0.0001:2;
>> y= x.^2 - 2*x.*exp(-x) + exp(-2*x);
>> plot(x,y,'r'), grid on, title ' y= x.^2 - 2*x.*exp(-x) +
exp(-2*x)'
2. Aplique los métodos siguientes para obtener una
solución con exactitud de 𝟏𝟎−𝟒 para los problemas:
xa(i+1)=xr(i);f1=subs(f,x,xa(i+1));
f1=subs(f,x,fx(1));
f2=subs(f,x,fx(2));
xb(i+1)=xb(i);f2=subs(f,x,xb(i+1));
end
xr(i+1)=(xa(i+1)+xb(i+1))/2; ea(1)=100;
f3=subs(f,x,xr(i+1));
ea(i+1)=abs((xr(i+1)- i=1;
xr(i))/(xr(i+1))*100); j=2;
fprintf('%2d \t %11.7f \t
%11.7f \t %11.7f \t %7.3f \n',... while abs(ea(i))>=tol
xf(j+1)=(xf(j-1)*f2-xf(j)*f1)/(f2-
i+1,xa(i+1),xr(i+1),xb(i+1),ea(i+1)); f1); f1=f2; f2=subs(f,x,xf(j+1));
i=i+1; ea(i+1)=(xf(j+1)-xf(j))/xf(j+1)*100;
end j=j+1;
else i=i+1;
fprintf('No existe una raíz en ese end
intervalo');
end
fprintf(' i xf(i) Error xb(i+1)=xr(i);f2=subs(f,x,xb(i+
aprox (i) \n'); 1));
%fprintf('%2d\t%11.7f\t\n',0,x(1)); end
for k=2:j; if f1*f3> 0
fprintf('%2d\t%11.7f\t%7.3f\n',k- xa(1)=xr(i);
1,xf(k),ea(k-1)); xb(1)=xb(i);
end end
xf(1)=input('Ingrese el valor inicial: xr(i+1)=xa(i+1)-f1*(xb(i+1)-
'); xa(i+1))/(f2-f1);
tol=input('Ingrese el porcentaje de ea(i+1)=abs((xr(i+1)-
error: '); xr(i))/(xr(i+1)))*100;
syms x; fprintf('%2d \t %11.7f \t %11.7f
f=input('Ingrese la función f(x), \t %11.7f \t %7.3f \n',...
despejada g(f(x)): '); i+1,xa(i+1),xr(i+1),xb(i+1
),ea(i+1));
i=1; i=i+1;
ea(1)=100; end
while abs(ea(i))>=tol, else
xf(i+1) = subs(f,x,xf(i)); fprintf('No existe una raíz en ese
ea(i+1) = abs((xf(i+1)- intervalo');
xf(i))/xf(i+1))*100; end
i=i+1;
end
fprintf('i xf(i) Error aprox
(i) \n');
for j=1:i;
fprintf('%2d \t %11.7f \t %7.3f
\n',j-1,xf(j),ea(j));
end