PROGRAM NESTABILITA; CONST n=100; h=10/n; VAR i:integer; xh,x1,x2,yh,y1,y2,yp:real; fileout1,fileout2:text; BEGIN ASSIGN(fileout1,'metoda1.dat'); ASSIGN(fileout2,'metoda2.dat'); REWRITE(fileout1); REWRITE(fileout2); x1 := 0; xh := h; y1 := 1; yh:= exp(-xh); WRITELN(fileout1,x1,y1,' ',0); WRITELN(fileout1,xh,yh,' ',0); FOR i:= 2 TO n DO BEGIN x2:=xh+h; y2:=yh*(1-h); yp:=exp(-x2); WRITELN(fileout1,x2,' ',y2,' ',(y2-yp)/yp); xh:=x2; yh:=y2; END; CLOSE(fileout1); x1 := 0; xh := h; y1 := 1; yh:= exp(-xh); WRITELN(fileout2,x1,y1,' ',0); WRITELN(fileout2,xh,yh,' ',0); FOR i:= 2 TO n DO BEGIN x2:=xh+h; y2:=y1-2*h*yh; yp:=exp(-x2); WRITELN(fileout2,x2,' ',y2,' ',(y2-yp)/yp); xh:=x2; y1:=yh; yh:=y2; END; CLOSE(fileout2); END.