17
StringGrid2.Visible:=true;
Label2.Visible:=true;
image2.Visible:=false;
StringGrid2.RowCount:=N;
StringGrid2.ColCount:=N;
end
else ShowMessage('Не задано кол-во узлов!');
end;
procedure TForm1.Button2Click(Sender: TObject);
var
g,i,j:integer;
Ro,w,Nq,Nz,U:array[1..50] of real;
P:array [1..50,1..10] of real;
gmi,gmo,wc,Nqc,Nzc,Uc:real;
bad:boolean;
begin
for i:=1 to N do begin
gm[i]:=strtoval(StringGrid1.cells[1,i]);
mu[i]:=strtoval(StringGrid1.cells[2,i]);
m[i]:=strtoint(StringGrid1.cells[3,i]);
k[i]:=strtoint(StringGrid1.cells[4,i]);
end;
gmo:=0;
for i:=1 to N do gmo:=gmo+gm[i];
for i:=0 to N-1 do
for j:=0 to N-1 do
R[i+1,j+1]:=strtoval(StringGrid2.cells[j,i]);
for i:=1 to N do
for j:=1 to N do
if i=j then A[i,j]:=R[i,j]-1
else A[i,j]:=R[j,i];
for i:=1 to N do la[i]:=-gm[i];
Simq(N,A,la);
for i:=1 to N do if mu[i]<=la[i] then
begin
mu[i]:=la[i]+0.1;
StringGrid1.cells[2,i]:=floattostr(mu[i]);
end;
for i:=1 to N do begin
SMO(la[i],mu[i],m[i],k[i], Ro[i],w[i],Nq[i],Nz[i],U[i],P[i]);
StringGrid3.Cells[1,i]:=floattostrf(Ro[i],ffGeneral,3,3);;
StringGrid3.Cells[2,i]:=floattostrf(w[i],ffGeneral,3,3);
StringGrid3.Cells[3,i]:=floattostrf(Nq[i],ffGeneral,3,3);
StringGrid3.Cells[4,i]:=floattostrf(Nz[i],ffGeneral,3,3);
StringGrid3.Cells[5,i]:=floattostrf(P[i,1],ffGeneral,3,3);
StringGrid3.Cells[6,i]:=floattostrf(P[i,2],ffGeneral,3,3);
StringGrid3.Cells[7,i]:=floattostrf(P[i,3],ffGeneral,3,3);
end;
for i:=1 to N do Nqc:=Nqc+Nq[i];
LENq.Text:=floattostrf(Nqc,ffGeneral,3,3);