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, Buttons, ExtCtrls, TeeProcs, TeEngine, Chart, Series,
- Grids;
- type
- TForm1 = class(TForm)
- lbl1: TLabel;
- lbl2: TLabel;
- edt1: TEdit;
- lbl3: TLabel;
- lbl4: TLabel;
- lbl5: TLabel;
- edt2: TEdit;
- lbl6: TLabel;
- edt3: TEdit;
- lbl7: TLabel;
- lbl8: TLabel;
- edt4: TEdit;
- lbl9: TLabel;
- mmo1: TMemo;
- mmo2: TMemo;
- lbl10: TLabel;
- lbl11: TLabel;
- cht1: TChart;
- btn1: TBitBtn;
- fstlnsrsSeries1: TFastLineSeries;
- lbl14: TLabel;
- edt6: TEdit;
- fstlnsrsSeries2: TFastLineSeries;
- strngrd1: TStringGrid;
- procedure btn1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- Txl11,q:Real;
- implementation
- function func11(Txl22,Tst1:Real):Real;
- begin
- Result:=(0.041/(810*0.00009948))*(Txl11-Txl22)+(298.3*0.066/(2430*810*0.00009948))*(Tst1-Txl22);
- end;
- function func22(Txl22,Tst1:Real):Real;
- begin
- Result:=((10*298.3*0.066)/(903.7*2697*(0.704*0.001+0.066*0.001)))*(Txl22-Tst1)-((0.9*0.0000000567*0.704*Tst1*Tst1*Tst1*Tst1*10+q)/(903.7*2697*(0.704+0.066)*0.001));
- end;
- {$R *.dfm}
- procedure TForm1.btn1Click(Sender: TObject);
- var
- h,Txl22i,Tst1i,Txl22i_pred,Tst1i_pred:Real;
- i:Integer;
- spisok1,spisok2:TStringList;
- begin
- fstlnsrsSeries1.Clear;
- fstlnsrsSeries2.Clear;
- spisok1:=TStringList.Create;
- spisok2:=TStringList.Create;
- Form1.mmo1.Clear;
- Form1.mmo2.Clear;
- spisok1:=TStringList.Create;
- spisok2:=TStringList.Create;
- q:=StrToFloat(Form1.edt1.Text);
- Txl11:=StrToFloat(Form1.edt2.Text);
- Txl22i:=StrToFloat(Form1.edt3.Text);
- Tst1i:=StrToFloat(Form1.edt4.Text);
- h:=StrToFloat(Form1.edt6.Text);
- for i:=1 to 3 do begin
- repeat
- Txl22i_pred:=Txl22i;
- Tst1i_pred:=Tst1i;
- Txl22i:=Txl22i+h*func11(Txl22i,Tst1i);
- Tst1i:=Tst1i+h*func22(Txl22i,Tst1i);
- spisok1.Add('Txl22i='+FloatToStr(Txl22i));
- spisok2.Add('Tst1i='+FloatToStr(Tst1i));
- fstlnsrsSeries1.Add(Txl22i);
- fstlnsrsSeries2.Add(Tst1i);
- until ((Abs(Txl22i_pred-Txl22i)<0.00001)and(Abs(Tst1i_pred-Tst1i)<0.0001));
- Txl11:=Txl11+5;
- Form1.strngrd1.Rows[i].Add(FloatToStr(Txl22i));
- Form1.strngrd1.Rows[i].Add(FloatToStr(Tst1i));
- end;
- Form1.mmo1.Lines:=spisok1;
- Form1.mmo2.Lines:=spisok2;
- end;
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- mmo1.Clear;
- mmo2.Clear;
- strngrd1.Cells[1,0]:='Txl22';
- strngrd1.Cells[2,0]:='Tst1';
- strngrd1.Cells[0,1]:='1)';
- strngrd1.Cells[0,2]:='2)';
- strngrd1.Cells[0,3]:='3)';
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement