Добавил:
Upload
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:МТУ курсовик / Unit1
.pas unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, Buttons, Unit2, XPMan;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
BitBtn1: TBitBtn;
Edit6: TEdit;
Label3: TLabel;
BitBtn2: TBitBtn;
XPManifest1: TXPManifest;
Label4: TLabel;
Edit7: TEdit;
Label5: TLabel;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
y1,y2, yu, vu, yz,
yn, ye, vn, ve,
k, T, ttr, dT:real;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
y1:=strtofloat(edit2.Text);
y2:=strtofloat(edit3.Text);
yu:=strtofloat(edit4.Text);
vu:=strtofloat(edit1.Text);
yz:=strtofloat(edit5.Text);
yn:=(y1+y2)/2;
ye:=yn*0.01*yu+yn;
vn:=100;
ve:=vn+vu;
t:=strtofloat(edit7.Text)/6;
ttr:=strtofloat(edit8.Text);
dT:=0.1*t;
while (frac(ttr/dt)>0.0001) do Dt:=dT+0.1;
k:=(ye-yn)/(ve-vn);
Edit9.Text:=floattostr(dT);
Edit10.Text:=floattostr(k);
Edit6.text:='y(l)='+floattostr(2*t*t/(t*t+dt*dt))+'y(l-1)-'
+floattostr(t*t/(t*t+dt*dt))+'y(l-2)+'+floattostr(k*dt*dt/(t*t+dt*dt))+'V(l-2)';
Label3.visible:=true;
Edit6.visible:=true;
bitbtn2.Visible:=true;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
form2.Visible:=true;
form1.Visible:=false;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, Buttons, Unit2, XPMan;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
BitBtn1: TBitBtn;
Edit6: TEdit;
Label3: TLabel;
BitBtn2: TBitBtn;
XPManifest1: TXPManifest;
Label4: TLabel;
Edit7: TEdit;
Label5: TLabel;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
y1,y2, yu, vu, yz,
yn, ye, vn, ve,
k, T, ttr, dT:real;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
y1:=strtofloat(edit2.Text);
y2:=strtofloat(edit3.Text);
yu:=strtofloat(edit4.Text);
vu:=strtofloat(edit1.Text);
yz:=strtofloat(edit5.Text);
yn:=(y1+y2)/2;
ye:=yn*0.01*yu+yn;
vn:=100;
ve:=vn+vu;
t:=strtofloat(edit7.Text)/6;
ttr:=strtofloat(edit8.Text);
dT:=0.1*t;
while (frac(ttr/dt)>0.0001) do Dt:=dT+0.1;
k:=(ye-yn)/(ve-vn);
Edit9.Text:=floattostr(dT);
Edit10.Text:=floattostr(k);
Edit6.text:='y(l)='+floattostr(2*t*t/(t*t+dt*dt))+'y(l-1)-'
+floattostr(t*t/(t*t+dt*dt))+'y(l-2)+'+floattostr(k*dt*dt/(t*t+dt*dt))+'V(l-2)';
Label3.visible:=true;
Edit6.visible:=true;
bitbtn2.Visible:=true;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
form2.Visible:=true;
form1.Visible:=false;
end;
end.
Соседние файлы в папке МТУ курсовик