Курсовая работа: Решение системы линейных уравнений
end;
{$R *.DFM}
procedure Tformk1.decision;
begin
delta:=E+1;
number_of_iteration:=0;
for i:=1 to 6 do X[i]:=B[i]/A[i,i];
while (delta>E) and (number_of_iteration < 100) do
begin
for i:=1 to 6 do Xp[i]:=X[i];
for i:=1 to 6 do
begin
sum:=0;
for j:=1 to 6 do sum:=sum+A[j,i]*X[j];
X[i]:=W*(B[i]- sum + A[i,i]*X[i])/A[i,i] + (1-W)*Xp[i];
end;
delta:=abs(X[1]-Xp[1]);
for i:=1 to 6 do
if abs(X[i]-Xp[i])>delta then delta:=abs(X[i]-Xp[i]);
inc(number_of_iteration);
end;
end;
procedure TFormk1.FormCreate(Sender: TObject);
begin
n:=6;m:=6;
matrix;
randomize;
stringgrid2.cells[0,0]:='*1';
for j:=1 to m do