Advertisement
Guest User

Untitled

a guest
May 16th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 2.73 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls, Buttons, ExtCtrls, TeeProcs, TeEngine, Chart, Series,
  8.   Grids;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     lbl1: TLabel;
  13.     lbl2: TLabel;
  14.     edt1: TEdit;
  15.     lbl3: TLabel;
  16.     lbl4: TLabel;
  17.     lbl5: TLabel;
  18.     edt2: TEdit;
  19.     lbl6: TLabel;
  20.     edt3: TEdit;
  21.     lbl7: TLabel;
  22.     lbl8: TLabel;
  23.     edt4: TEdit;
  24.     lbl9: TLabel;
  25.     mmo1: TMemo;
  26.     mmo2: TMemo;
  27.     lbl10: TLabel;
  28.     lbl11: TLabel;
  29.     cht1: TChart;
  30.     btn1: TBitBtn;
  31.     fstlnsrsSeries1: TFastLineSeries;
  32.     lbl14: TLabel;
  33.     edt6: TEdit;
  34.     fstlnsrsSeries2: TFastLineSeries;
  35.     strngrd1: TStringGrid;
  36.     procedure btn1Click(Sender: TObject);
  37.     procedure FormCreate(Sender: TObject);
  38.   private
  39.     { Private declarations }
  40.   public
  41.     { Public declarations }
  42.   end;
  43.  
  44. var
  45.   Form1: TForm1;
  46.   Txl11,q:Real;
  47. implementation
  48.      function func11(Txl22,Tst1:Real):Real;
  49.  begin
  50.    Result:=(0.041/(810*0.00009948))*(Txl11-Txl22)+(298.3*0.066/(2430*810*0.00009948))*(Tst1-Txl22);
  51.  end;
  52.      function func22(Txl22,Tst1:Real):Real;
  53.  begin
  54.    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));
  55.  end;
  56. {$R *.dfm}
  57.  
  58. procedure TForm1.btn1Click(Sender: TObject);
  59. var
  60.    h,Txl22i,Tst1i,Txl22i_pred,Tst1i_pred:Real;
  61.    i:Integer;
  62.    spisok1,spisok2:TStringList;
  63. begin
  64.     fstlnsrsSeries1.Clear;
  65.     fstlnsrsSeries2.Clear;
  66.     spisok1:=TStringList.Create;
  67.     spisok2:=TStringList.Create;
  68.  
  69.  
  70.   Form1.mmo1.Clear;
  71.   Form1.mmo2.Clear;
  72.  
  73.   spisok1:=TStringList.Create;
  74.   spisok2:=TStringList.Create;
  75.   q:=StrToFloat(Form1.edt1.Text);
  76.   Txl11:=StrToFloat(Form1.edt2.Text);
  77.   Txl22i:=StrToFloat(Form1.edt3.Text);
  78.   Tst1i:=StrToFloat(Form1.edt4.Text);
  79.   h:=StrToFloat(Form1.edt6.Text);
  80.   for i:=1 to 3 do begin
  81.  
  82.  repeat
  83.    Txl22i_pred:=Txl22i;
  84.    Tst1i_pred:=Tst1i;
  85.    Txl22i:=Txl22i+h*func11(Txl22i,Tst1i);
  86.    Tst1i:=Tst1i+h*func22(Txl22i,Tst1i);
  87.    spisok1.Add('Txl22i='+FloatToStr(Txl22i));
  88.    spisok2.Add('Tst1i='+FloatToStr(Tst1i));
  89.    fstlnsrsSeries1.Add(Txl22i);
  90.    fstlnsrsSeries2.Add(Tst1i);
  91.  
  92.   until ((Abs(Txl22i_pred-Txl22i)<0.00001)and(Abs(Tst1i_pred-Tst1i)<0.0001));
  93.   Txl11:=Txl11+5;
  94.  
  95.    Form1.strngrd1.Rows[i].Add(FloatToStr(Txl22i));
  96.    Form1.strngrd1.Rows[i].Add(FloatToStr(Tst1i));
  97.   end;
  98.   Form1.mmo1.Lines:=spisok1;
  99.   Form1.mmo2.Lines:=spisok2;
  100. end;
  101.  
  102. procedure TForm1.FormCreate(Sender: TObject);
  103. begin
  104.  mmo1.Clear;
  105.  mmo2.Clear;
  106.  
  107. strngrd1.Cells[1,0]:='Txl22';
  108. strngrd1.Cells[2,0]:='Tst1';
  109. strngrd1.Cells[0,1]:='1)';
  110. strngrd1.Cells[0,2]:='2)';
  111. strngrd1.Cells[0,3]:='3)';
  112. end;
  113.  
  114. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement