Metoda iteracija

Metoda jednostavnih iteracija

f[x_] := 
      Exp[x] - x - 5/4;  a = 0;  b = 1. ;

    slf = 
        Plot[f[x], {x, a, b}, 
          Ticks -> {{0,  .5, 1}, {- .2,  .2,  .4}}, 
          DisplayFunction -> Identity];

    fi1 = 
        Plot[{x, Exp[x] - 5/4}, {x, a, b}, 
          Ticks -> {{ .5, 1}, {- .2,  .5, 1}}, 
          AspectRatio -> 1, 
          DisplayFunction -> Identity];

    fi2 = 
        Plot[{x, Log[x + 5/4]}, {x, a, b}, 
          Ticks -> {{ .5, 1}, { .2,  .5, 1}}, AspectRatio -> 1,  
          DisplayFunction -> Identity];

    Show[GraphicsArray[{slf, fi1, fi2}], 
        DisplayFunction -> $DisplayFunction];

Ilustracija iterativnog postupka

phi[x_] := Log[x + 5/4]
fi2 = 
        Plot[{x, Log[x + 5/4]}, {x, a, b}, 
          PlotStyle -> {Hue[1], Hue[ .4]}, Ticks -> None, 
          AspectRatio -> 1,  
          DisplayFunction -> Identity];
crte1 = 
        Show[Graphics[{Dashing[{0.01, 0.01}], 
              Line[{{ .2, 0}, { .2, phi[ .2]}, {phi[ .2], 
                    phi[ .2]}, {phi[ .2], 0}}] }], 
          DisplayFunction -> Identity];
crte2 = 
        Show[Graphics[{Dashing[{0.01, 0.01}], 
              Line[{{phi[ .2], phi[ .2]}, {phi[ .2], 
                    phi[phi[ .2]]}, {phi[phi[ .2]], 
                    phi[phi[ .2]]}, {phi[phi[ .2]], 0}}] }], 
          DisplayFunction -> Identity];
crte3 = 
        Show[Graphics[{Dashing[{0.01, 0.01}], 
              Line[{{phi[phi[ .2]], phi[phi[ .2]]}, {phi[phi[ .2]], 
                    phi[phi[phi[ .2]]]}, {phi[phi[phi[ .2]]], 
                    phi[phi[phi[ .2]]]}, {phi[phi[phi[ .2]]], 0}}] }], 
          DisplayFunction -> Identity];
Show[fi2, crte1, crte2, crte3, 
        DisplayFunction -> $DisplayFunction];

Iterativni postupak

phi[x_] := Log[x + 5/4]
Plot[phi'[x], {x, a, b}]; m1 = phi'[1. ]

x0 =  .2; k = 0; 
    eps =  .005;

x1 = phi[x0];  
    x0 = x1; k = k + 1;

    Print[k, "  ", x1]

While[
      x1 = phi[x0]; e = Abs[f[x1]]/m1; e > eps, x0 = x1; 
      k = k + 1; 
Print["k=", k, "  x=", 
        x1, "  error=", e]]