Приложение
Блок-схема
алгоритма расчета профиля концентраций
хлора по высоте абсорбера и листинг
программы в Delphi ХЕ:
Листинг программы:
unit
Unit1;
interface
uses
Windows,
Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,
StdCtrls, math, Grids, TeEngine, Series, ExtCtrls, TeeProcs, Chart;
type
TForm1
= class(TForm)
Button1:
TButton;
StringGrid1:
TStringGrid;
Chart1:
TChart;
Series1:
TFastLineSeries;
Label1:
TLabel;
Label2:
TLabel;
procedure
Button1Click(Sender: TObject);
procedure
StringGrid1Click(Sender: TObject);
private
{
Private declarations }
public
{
Public declarations }
end;
var
Form1:
TForm1;
i,j,
m,n:integer;
k1,k2,k3,k4,h,z,y,S,Gvm,Grv,C0,d,eps:real;
t,q:textfile;
a:real;
yc:array
of real;
l:integer;
implementation
{$R
*.dfm}
Function
f(y:real):real;
begin
Grv:=110;
C0:=45;
d:=0.35;
Gvm:=0.00042*(100-C0)*Grv;
S:=pi*sqr(d)/4;
f:=-0.5*S/Gvm*sqr(1-y)*ln(1/(1-y))*exp(0.8*ln(((71*y/(1-y)+29)*Gvm)/S));
end;
procedure
TForm1.Button1Click(Sender: TObject);
begin
h:=0.01;
z:=0;
y:=0.45; i:=0;
eps:=0.5/100;
m:=1;
Repeat
Stringgrid1.RowCount:=m+1;
z:=z+h;
i:=i+1;
k1:=h*f(y);
k2:=h*f(y+k1/2);
k3:=h*f(y+k2/2);
k4:=h*f(y+k3);
y:=y+1/6*(k1+2*k2+2*k3+k4);
Series1.AddXY(z,y);
Stringgrid1.Cells[0,m]:=
floattostr(Roundto(y, -5));
Stringgrid1.Cells[1,m]:=
floattostr(Roundto(z, -5));
m:=m+1;
until(y<=eps);
Label2.Caption:=floattostr(z);
end;
procedure
TForm1.StringGrid1Click(Sender: TObject);
begin
StringGrid1.Cells[0,0]:='H';
StringGrid1.Cells[1,0]:='y';
end;
end.