
15.05.2009, 17:32
|
Прохожий
|
|
Регистрация: 17.04.2009
Сообщения: 23
Репутация: 10
|
|
Код:
//расчет потерь в КУ
procedure TForm3.Button2Click(Sender: TObject);
var
w,L,sher,v,t,tst,dl,p,rr,yy,Ptr,a,b,d,lamda,Re,Reky,tt,ksi:real;
k,i,j,z:integer;
aa,bb,cc,dd:real;
begin
v:=strtofloat(Form1.StringGrid2.Cells[1,1]);
p:= strtofloat(Form1.StringGrid2.Cells[1,2]);
a:=strtofloat(Form1.StringGrid1.Cells[1,5]);
b:=strtofloat(Form1.StringGrid1.Cells[1,6]);
for z := 0 to StringGrid2.RowCount - 1 do
StringGrid2.Rows[z].Clear();
Ln:=StrToFloat(Form1.Edit1.Text);
Lk:=StrToFloat(Form1.Edit3.Text);
Step:=StrToFloat(Form1.Edit5.Text);
L:=Ln;
i:=1;
k:=0;
While l<=Lk do
begin
w:=l/(3600*a*b);
Reky:=(w*dtr)/v;
aa:=1/Reky;
tt:=0.2/(sqr(fi));
yy:=fi-0.94;
bb:=Power(aa,2/10);
if fi<1 then
begin
cc:=0;
dd:=0 ;
end
else
begin
cc:=Power(yy,(-59/100));
dd:=Power(aa,tt);
end;
begin
//расчет для КУ
//пароперегреватель
if (sigma1<=sigma2) and (fi>=0.06) and (fi<=1) then
ksi:=2*(1/(sqrt(sigma1-1)))*bb*Zparo
else
if (sigma1>sigma2) and (fi>1) and (fi<=8) then
ksi:=0.38*(1/(sqrt(sigma1-1)))*cc*dd*Zparo
else
if (sigma1>sigma2) and (fi>8) and (fi<=15) then
ksi:=0.118*(1/(sqrt(sigma1-1)))*Zparo;
// end;
Form3.StringGrid2.Cells[0,0]:='Re';
Form3.StringGrid2.Cells[1,0]:='Коэф сопр паропер';
Form3.StringGrid2.Cells[0,i]:=FloatToStr(Reky);
Form3.StringGrid2.Cells[1,i]:=FloatToStr(ksi);
i:=i+1;
W:=W+step;
k:=k+1;
end; end;
Form3.StringGrid2.RowCount:=k+1;
end;
Вот вся процедура, при нажатии на баттон зависает
|