Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, TeEngine, Series, ExtCtrls, TeeProcs, Chart;
- type
- TForm1 = class(TForm)
- lbl3: TLabel;
- edt2: TEdit;
- lbl4: TLabel;
- lbl5: TLabel;
- lbl6: TLabel;
- edt3: TEdit;
- lbl9: TLabel;
- edt5: TEdit;
- lbl10: TLabel;
- lbl11: TLabel;
- lbl12: TLabel;
- edt6: TEdit;
- mmo1: TMemo;
- mmo2: TMemo;
- mmo3: TMemo;
- lbl13: TLabel;
- lbl14: TLabel;
- lbl15: TLabel;
- btn1: TButton;
- lbl16: TLabel;
- lbl17: TLabel;
- lbl18: TLabel;
- lbl19: TLabel;
- edt7: TEdit;
- edt8: TEdit;
- cht1: TChart;
- fstlnsrsSeries1: TFastLineSeries;
- fstlnsrsSeries2: TFastLineSeries;
- fstlnsrsSeries3: TFastLineSeries;
- mmo4: TMemo;
- procedure btn1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- Tgor1,Txl1:Real;
- implementation
- {$R *.dfm}
- function func1(Txl2,Tst:Real):Real;
- begin
- Result:=(0.041/(0.002376*810*0.1472))*(Txl1-Txl2)+((54.9*0.549)/(2430*810*0.1472*0.002376))*(Tst-Txl2);
- end;
- function func2(Txl2,Tgor2,Tst:Real):Real;
- begin
- Result:=((54.9*0.549)/(903.7*2697*0.00015*1.7831))*(Txl2-Tst)+((52.536*1.736)/(903.7*2697*1.7831*0.00015))*(Tgor2-Tst);
- end;
- function func3(Tgor2,Tst:Real):Real;
- begin
- Result:=(0.04/(0.972*0.011*0.132))*(Tgor1-Tgor2)+((52.536*1.736)/(1009*0.972*0.011*0.132))*(Tst-Tgor2);
- end;
- procedure TForm1.btn1Click(Sender: TObject);
- var
- h,Tgor2i,Txl2i,Tsti,Tgor2i_pred,Txl2i_pred,Tsti_pred:Real;
- i,n:Integer;
- spisok3,spisok4,spisok5:TStringList;
- begin
- fstlnsrsSeries1.Clear;
- fstlnsrsSeries2.Clear;
- fstlnsrsSeries3.Clear;
- Form1.mmo1.Clear;
- Form1.mmo2.Clear;
- Form1.mmo3.Clear;
- Form1.mmo4.Clear;
- spisok3:=TStringList.Create;
- spisok4:=TStringList.Create;
- spisok5:=TStringList.Create;
- Tgor1:=StrToFloat(Form1.edt7.Text);
- Tgor2i:=StrToFloat(Form1.edt2.Text);
- Txl1:=StrToFloat(Form1.edt8.Text);
- Txl2i:=StrToFloat(Form1.edt3.Text);
- Tsti:=StrToFloat(Form1.edt6.Text);
- h:=StrToFloat(Form1.edt5.Text);
- for i:=1 to 3 do begin
- n:=0;
- repeat
- Tgor2i_pred:=Tgor2i;
- Txl2i_pred:=Txl2i;
- Tsti_pred:=Tsti;
- Txl2i:=Txl2i+h*func1(Txl2i,Tsti);
- Tsti:=Tsti+h*func2(Txl2i,Tgor2i,Tsti);
- Tgor2i:=Tgor2i+h*func3(Tgor2i,Tsti);
- spisok3.Add('Tgor2i='+FloatToStr(Tgor2i));
- spisok4.Add('Txl2i='+FloatToStr(Txl2i));
- spisok5.Add('Tsti='+FloatToStr(Tsti));
- fstlnsrsSeries1.Add(Txl2i);
- fstlnsrsSeries2.Add(Tgor2i);
- fstlnsrsSeries3.Add(Tsti);
- inc(n);
- until ((Abs(Tgor2i_pred-Tgor2i)<0.00001) and (Abs(Txl2i_pred-Txl2i)<0.00001) and (Abs(Tsti_pred-Tsti)<0.00001));
- Tgor1:=Tgor1+5;
- Form1.mmo4.Lines.Add('Âðåìÿ âûõîäà ('+IntToStr(i)+'-ñòàöèîíàð):'+FloatToStr(h*n));
- end;
- Form1.mmo1.Lines:=spisok4;
- Form1.mmo2.Lines:=spisok3;
- Form1.mmo3.Lines:=spisok5;
- end;
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- mmo1.Clear;
- mmo2.Clear;
- mmo3.Clear;
- mmo4.Clear;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement