x = 0:0.001:1; f = inline('sin(2*x)-1 + x'); g1 = inline('1-sin(2*x)'); g2 = inline('1/2*(asin(1-x))'); h = inline('x'); plot(x, f(x), '--.b', x, g1(x), '-.b', x, g2(x), '--b', x, h(x),'b'); legend('f', 'y=1-sin(2x)', 'y=1/2*(Arcsin(1-x))', 'y=x'); grid on; ylabel('y(x)'); xlabel('x');
-2 | 0 | 2 | |
-2.125 | 0.25 | 1.875 | |
-2.114975450 | 0.254098301 | 1.860978520 | |
-2.114907545 | 0.254101688 | 1.860805877 | |
-2.114907541 | 0.254101688 | 1.860805853 | |
-2.114907541 | 0.254101688 | 1.860805853 | |
x = 0:0.001:1; f = inline('exp(x)+3*sqrt(x)-2'); plot(x, f(x)) grid on; ylabel('f(x)'); xlabel('x'); title('graphe de f');
g = inline('exp(t) + 3*sqrt(t)-2'); Nit = 0; epsilon = 1e-10; borneinf = 0; bornesup = 1; pmilieu = (borneinf + bornesup)/2;
while and(g(pmilieu) ~= 0, (bornesup-borneinf) >= epsilon ) Nit = Nit+1; if g(pmilieu)*g(borneinf) < 0 bornesup = pmilieu; else borneinf = pmilieu; end pmilieu = (borneinf + bornesup)/2; end pmilieu g(pmilieu) Nit - 1 n_theorique = 10*log(10)/log(2) - 1
x = -pi/2:0.0001:pi/2; g = inline('sin(x)'); plot(x, g(x), '--', x, x, '-') grid on; ylabel('g(x)'); xlabel('x'); axis on; title('graphe de g');
x = -1:0.0001:2; g = inline('sinh(x)'); plot(x, g(x), '--', x, x, '-') grid on; ylabel('g(x)'); xlabel('x'); axis on; title('graphe de g');
x = 0.1:.001:3; x0 = 2; x1 = 2*(1 - log(2)); plot(x, x.^-1 - 1 , '-b', x, -(1/x0)^2*(x - x0) + (1/x0 -1), '--b') grid on; ylabel('y'); xlabel('x'); title('Illustration de la methode de Newton');