unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons, ComCtrls, TeEngine, Series,
TeeProcs, Chart, Math, Grids;
type
TForm1 = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label20: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Edit11: TEdit;
Edit12: TEdit;
Edit13: TEdit;
Edit14: TEdit;
Edit20: TEdit;
TabSheet3: TTabSheet;
Chart1: TChart;
Chart2: TChart;
Chart3: TChart;
Edit15: TEdit;
Label15: TLabel;
Series2: TLineSeries;
Series3: TLineSeries;
Series1: TLineSeries;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Chart4: TChart;
Series4: TLineSeries;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type mas1=array[1..8] of extended;
mas2=array[1..5] of extended;
mas3=array[1..1201] of extended;
var
Form1: TForm1;
m,n,k_schet,k:integer;
l,l1,l2,lc,hmax,v,th,tmax,tnach,cn1,ksh1,ksh2,ks2,kc,csh1,csh2,cc,Jn,mn,mp,mc,hc
,HH1,HH:extended;
Fr: TextFile;
c: mas2;
znach,zh,z2,z1,koef_rks,d,z: mas1;
y,yp,h1,h1p,h2,h2p: mas3;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
DecimalSeparator:='.';
AssignFile(Fr,'A.dat');
Reset(Fr);
for m:=1 to 1201 do readln(Fr,y[m],yp[m]);
CloseFile(Fr);
end;
procedure dwig(n:integer; var tnach:extended; var z1,z2:mas1);
begin
h1[m]:=y[m]; h1p[m]:=yp[m];
h2[m]:=y[m]; h2p[m]:=yp[m];
z2[1]:=z1[2];
z2[2]:=(-2*csh1*(z1[1]-h1[m])+2*cn1*(z1[3]-z1[5]*l1-z1[1])-2*ksh2*(z1[2]-h1p[m]))/mn;
z2[3]:=z1[4];
z2[4]:=(-2*cn1*(z1[3]-z1[5]*l1-z1[1])-2*csh2*(z1[3]+z1[5]*l2-h2[m])+cc*(z1[7]-z1[5]*lc-z1[3])-2*ksh2*(z1[4]+z1[6]*l2-h2p[m])+kc*(z1[8]-z1[6]*lc-z1[4]))/mp;
z2[5]:=z1[6];
z2[6]:=(2*l1*cn1*(z1[3]-z1[5]*l1-z1[1])-2*l2*csh2*(z1[3]+z1[5]*l2-h2[m])+lc*cc*(z1[7]-z1[5]*lc-z1[3])-2*l2*ksh2*(z1[4]+z1[6]*l2-h2p[m])+lc*kc*(z1[8]-z1[6]*lc-z1[4]))/Jn;
z2[7]:=z1[8];
z2[8]:=(-cc*(z1[7]-z1[5]*lc-z1[3])-kc*(z1[8]-z1[6]*lc-z1[4]))/mc;
end;
procedure rks(n:integer; var HH1,tnach,th:extended; var z1,zh,koef_rks,d:mas1; var c:mas2);
var i,j:integer;
begin
th:=tnach;
for i:=1 to n do
begin
zh[i]:=z1[i];
d[i]:=z1[i];
end;
for j:=1 to 4 do
begin
dwig(n,th,d,koef_rks);
th:=tnach+c[j];
for i:=1 to n do
begin
zh[i]:=zh[i]+c[j+1]*koef_rks[i]/3;
d[i]:=z1[i]+c[j]*koef_rks[i]
end;
end;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
close;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
var i:integer;
begin
decimalseparator:=',';
n:=8;
HH:=0.03;
series1.Clear;
series2.Clear;
series3.Clear;
series4.Clear;
l1:=strtofloat(edit13.text);
l2:=strtofloat(edit20.text);
lc:=strtofloat(edit14.text);
mp:=strtofloat(edit2.text);
mn:=strtofloat(edit1.text);
mc:=strtofloat(edit3.text);
cn1:=strtofloat(edit4.text);
csh1:=strtofloat(edit5.text);
csh2:=strtofloat(edit6.text);
cc:=strtofloat(edit7.text);
kc:=strtofloat(edit12.text);
ksh1:=strtofloat(edit8.text);
ksh2:=strtofloat(edit9.text);
v:=strtofloat(edit11.text)/3.6;
Jn:=strtofloat(edit15.text);
tmax:=14;
c[1]:=HH/2; c[2]:=c[1]; c[5]:=c[1];
c[3]:=HH; c[4]:=HH;
k:=0;k_schet:=10;
z1[1]:=0; z1[2]:=0; z1[3]:=0;
z1[4]:=0; z1[5]:=0; z1[6]:=0;
z1[7]:=0; z1[8]:=0; tnach:=0; z2[8]:=0;
m:=1;
repeat
rks(n,HH,tnach,th,z1,zh,z2,d,c);
series1.addxy(tnach,z1[7]);
series4.addxy(tnach,h1[m]);
series2.addxy(tnach,z1[8]);
series3.AddXY(tnach,z2[8]);
for i:=1 to n do z1[i]:=zh[i];
m:=m+1;
tnach:=tnach+0.05;
until m>1201;
PageControl1.ActivePageIndex:=1;
end;
end.