D:\jknuba_2025_spring\jknuba_NM\jknuba_NM_Job6с.wxmx

Insert command FOR  (original - jknuba_NM_Job6.wxmx)

Insert TEXT about iterations (original - jknuba_NM_Job6b.wxmx)

# Метод ітерацій (Method of iterations)

kill(all);

Y1(x):=0.9*x;

Y2(x):=2.2*(x+1)-5;

X(n):=((n+5)/2.2)-1;

R(x):=Y1(x)-Y2(x);

 plot2d([Y1(x),Y2(x)],[x,0,5],
   [legend, "Y1(x):=0.9·x","Y2(x):=2.2·(x+1)-5"],
   [style, [lines, 3,5],  [lines, 3,1]]); 

Iteration 1    i - x1[0], m - Y1[0], o -x2[0], M - Y1, N - Y2

delta:0.1;

x_start:0;

x1[0]:x_start;

Y1[0]:Y1(x1[0]);x2[0]:X(Y1[0]);

if (Y1(x2[0])-Y2(x2[0])<delta)then display("OK")else display(Y1(x2[0])-Y2(x2[0]));

x2[0];Y2(x2[0]);

plot2d([Y1(x),Y2(x),[discrete,[x1[0],x2[0]],[Y1(x1[0]),Y2(x2[0])]], [discrete,[x2[0]],[Y2(x2[0])]]],[x,0,5],
   [legend, "Y1(x):=0.9·x","X(n):=(n+5)/2.2-1", "Iteration", "point"],
   [style, [lines, 3,5],  [lines, 3,1], [lines, 2,2], [points,6,1 ]]); 

# Command FOR

 i - x1[0], m - Y1[0], o -x2[0], M - Y1, N - Y2

delta:0.01;

x_start:0;for i:1 thru 6 step 1 do (x1[i]:x_start,Y1[i]:Y1(x1[i]),x2[i]:X(Y1[i]),
    if (Y1(x2[i])-Y2(x2[i])<delta)then display("OK")else
    (del:Y1(x2[i])-Y2(x2[i]),display(del)),x_start:x2[i],display(x2[i]),
plot2d([Y1(x),Y2(x),[discrete,[x1[i],x2[i]],[Y1(x1[i]),Y2(x2[i])]],
            [discrete,[x2[i],x2[i]],[Y1(x2[i]),Y2(x2[i])]],
            [discrete,[x2[i]],[Y2(x2[i])]]],[x,0,5],
   [legend, "Y1(x):=0.9·x","X(n):=(n+5)/2.2-1", "Iteration","Iteration_2",  "point"],
   [style, [lines, 3,5],  [lines, 3,1], [lines, 2,2],[lines, 5,3],  [points,6,1 ]]))$

for i:1 thru 6 step 1 do display(x2[i]);

Iteration 2

plot2d([Y1(x),Y2(x),
        [discrete,[x1[1],x2[1]],[Y1(x1[1]),Y2(x2[1])]],
        [discrete,[x2[1],x2[1]],[Y1(x2[1]),Y2(x2[1])]],
        [discrete,[x2[1]],[Y2(x2[1])]]
    ],[x,0,5],
   [legend, "Y1(x):=0.9·x","X(n):=(n+5)/2.2-1", "Iteration","Iteration_2",  "point"],
   [style, [lines, 3,5],  [lines, 3,1], [lines, 2,2],[lines, 5,3],  [points,6,1 ]])$

plot2d([Y1(x),Y2(x),
        [discrete,[x1[1],x2[1]],[Y1(x1[1]),Y2(x2[1])]],
        [discrete,[x2[1],x2[1]],[Y1(x2[1]),Y2(x2[1])]],
        [discrete,[x2[1]],[Y2(x2[1])]],
    [discrete,[x1[2],x2[2]],[Y1(x1[2]),Y2(x2[2])]],
        [discrete,[x2[2],x2[2]],[Y1(x2[2]),Y2(x2[2])]],
        [discrete,[x2[2]],[Y2(x2[2])]],
    [discrete,[x1[3],x2[3]],[Y1(x1[3]),Y2(x2[3])]],
        [discrete,[x2[3],x2[3]],[Y1(x2[3]),Y2(x2[3])]],
        [discrete,[x2[3]],[Y2(x2[3])]]
    ],[x,0,3],
   [legend, "Y1(x):=0.9·x","X(n):=(n+5)/2.2-1", "Iteration_1","Iteration_1d",  "point_1",
        "Iteration_2","Iteration_2d",  "point_2",
    "Iteration_3","Iteration_3d",  "point_3"],
   [style, [lines, 3,5],  [lines, 3,1], [lines, 2,2],[lines, 5,3],  [points,4,2 ],[lines, 2,2],[lines, 5,3],  [points,4,7 ]
    ,[lines, 2,2],[lines, 5,3],  [points,4,2 ]])$

maxima_tempdir;

D:\jknuba_2025_spring\jknuba_NM\j_Job6\j_Job6a.jpg