unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ls; type TExerBox1 = class(TForm) Label1: TLabel; Diametr: TEdit; Button1: TButton; ComboBox1: TComboBox; Label2: TLabel; Label3: TLabel; ComboBox2: TComboBox; Label4: TLabel; Edit1: TEdit; Label5: TLabel; Button2: TButton; Material: TComboBox; Frequance: TEdit; Label6: TLabel; procedure Button1Click(Sender: TObject); procedure DiametrChange(Sender: TObject); procedure Edit1Change(Sender: TObject); procedure ComboBox1Change(Sender: TObject); procedure ComboBox2Change(Sender: TObject); procedure Button2Click(Sender: TObject); procedure MaterialChange(Sender: TObject); procedure FrequanceChange(Sender: TObject); private { Private declarations } public { Public declarations } end; var ExerBox1: TExerBox1; d: Real; function Krt(f: Real): Real; function Fkr(ert: Real): Real; {Функцая Бесселя F} function Qkr(f: Real): Real; {Функцая Бесселя Q} function Hkr(f: Real): Real; {Функцая Бесселя H} function Gkr(f: Real): Real; {Функцая Бесселя G} implementation uses Unit5, Unit6, Unit7; {$R *.DFM} label L1; var l: Byte; bs, cs: String; procedure TExerBox1.DiametrChange(Sender: TObject); var i: Integer; begin cs:=Diametr.Text; Val(cs, d, i); If (d<0.1) or (d>4) then begin ShowMessage('Ошибка: Введите диаметр жилы в пределах от 1 до 4!!!'); Diametr.Text:='1'; Diametr.AutoSelect:=True; end; end; procedure TExerBox1.FrequanceChange(Sender: TObject); var i: Integer; fs: String; begin fs:=Frequance.Text; Val(fs, f, i); end; procedure TExerBox1.Edit1Change(Sender: TObject); var i: Integer; begin bs:=Edit1.Text; Val(bs, b, i); end; procedure TExerBox1.ComboBox1Change(Sender: TObject); begin s1:=ComboBox1.Text; If s1='Звездная' then Scrut:=5; If s1='Парная' then Scrut:=1; end; procedure TExerBox1.ComboBox2Change(Sender: TObject); begin s2:=ComboBox2.Text; end; procedure TExerBox1.MaterialChange(Sender: TObject); begin If Material.Text='Медь' then begin l:=1; ro:=1.7e-8; end else if Material.Text='Алюминий' then begin l:=2; ro:=2.5e-8; end else if Material.Text='Сталь' then begin l:=3; ro:=2e-8; end; end; function Krt(f: Real): Real; begin Case l of 1: Krt:=0.0105*d*Sqrt(f); 2: Krt:=0.0082*d*Sqrt(f); 3: Krt:=0.0375*d*Sqrt(f); end; end; function Fkr(ert: Real): Real; var krf: Real; begin krf:=Krt(f); If krf<=0.5 then Fkr:=0.000326*(krf/0.5) else if (krf>0.5) and (krf<=1) then Fkr:=((krf-0.5)/0.5)*0.004864+0.000326 else if (krf>1) and (krf<=1.5) then Fkr:=((krf-1)/0.5)*0.02061+0.00519 else if (krf>1.5) and (krf<=2) then Fkr:=((krf-1.5)/0.5)*0.0524+0.0258 else if (krf>2) and (krf<=2.5) then Fkr:=((krf-2)/0.5)*0.0974+0.0782 else if (krf>2.5) and (krf<=3) then Fkr:=((krf-2.5)/0.5)*0.1424+0.1756 else if (krf>3) and (krf<=3.5) then Fkr:=((krf-3)/0.5)*0.174+0.318 else if (krf>3.5) and (krf<=4) then Fkr:=((krf-3.5)/0.5)*0.186+0.492 else if (krf>4) and (krf<=4.5) then Fkr:=((krf-4)/0.5)*0.184+0.678 else if (krf>4.5) and (krf<=5) then Fkr:=((krf-4.5)/0.5)*0.18+0.862 else if (krf>5) and (krf<=7) then Fkr:=((krf-5)/2)*0.701+1.042 else if (krf>7) and (krf<=10) then Fkr:=((krf-7)/3)*1.056+1.743 else if krf>10 then Fkr:=(Sqrt(2)*krf-3)/4; end; function Gkr(f: Real): Real; var krf: Real; begin krf:=Krt(f); If krf<0.5 then Gkr:=0 else if krf=0.5 then Gkr:=0.00097 else if (krf>0.5) and (krf<=1) then Gkr:=((krf-0.5)/0.5)*0.014215+0.000975 else if (krf>1) and (krf<=1.5) then Gkr:=((krf-1)/0.5)*0.05391+0.01519 else if (krf>1.5) and (krf<=2) then Gkr:=((krf-1.5)/0.5)*0.1033+0.0691 else if (krf>2) and (krf<=2.5) then Gkr:=((krf-2)/0.5)*0.1226+0.1724 else if (krf>2.5) and (krf<=3) then Gkr:=((krf-2.5)/0.5)*0.11+0.295 else if (krf>3) and (krf<=3.5) then Gkr:=((krf-3)/0.5)*0.094+0.405 else if (krf>3.5) and (krf<=4) then Gkr:=((krf-3.5)/0.5)*0.085+0.499 else if (krf>4) and (krf<=4.5) then Gkr:=((krf-4)/0.5)*0.085+0.584 else if (krf>4.5) and (krf<=5) then Gkr:=((krf-4.5)/0.5)*0.086+0.669 else if (krf>5) and (krf<=7) then Gkr:=((krf-5)/2)*0.354+0.755 else if (krf>7) and (krf<=10) then Gkr:=((krf-7)/3)*0.532+1.109 else if krf>10 then Gkr:=(Sqrt(2)*krf-1)/8; end; function Hkr(f: Real): Real; var krf: Real; begin krf:=Krt(f); If krf<=0.5 then Hkr:=(krf/0.5)*0.0003+0.0417 else if (krf>0.5) and (krf<=1) then Hkr:=((krf-0.5)/0.5)*0.011+0.042 else if (krf>1) and (krf<=1.5) then Hkr:=((krf-1)/0.5)*0.039+0.053 else if (krf>1.5) and (krf<=2) then Hkr:=((krf-1.5)/0.5)*0.077+0.092 else if (krf>2) and (krf<=2.5) then Hkr:=((krf-2)/0.5)*0.094+0.169 else if (krf>2.5) and (krf<=3) then Hkr:=((krf-2.5)/0.5)*0.085+0.263 else if (krf>3) and (krf<=3.5) then Hkr:=((krf-3)/0.5)*0.068+0.348 else if (krf>3.5) and (krf<=4) then Hkr:=((krf-3.5)/0.5)*0.05+0.416 else if (krf>4) and (krf<=4.5) then Hkr:=((krf-4)/0.5)*0.037+0.466 else if (krf>4.5) and (krf<=5) then Hkr:=((krf-4.5)/0.5)*0.027+0.503 else if (krf>5) and (krf<=7) then Hkr:=((krf-5)/2)*0.066+0.530 else if (krf>7) and (krf<=10) then Hkr:=((krf-7)/3)*0.047+0.596 else if krf>10 then Hkr:=0.750; end; function Qkr(f: Real): Real; var krf: Real; begin krf:=Krt(f); If krf<=0.5 then Qkr:=0.9998-(krf-0.5/0.5)*0.0002 else if (krf>0.5) and (krf<=1) then Qkr:=0.997-((krf-1)/0.5)*0.0028 else if (krf>1) and (krf<=1.5) then Qkr:=0.987-((krf-1.5)/0.5)*0.01 else if (krf>1.5) and (krf<=2) then Qkr:=0.961-((krf-2)/0.5)*0.026 else if (krf>2) and (krf<=2.5) then Qkr:=0.913-((krf-2.5)/0.5)*0.048 else if (krf>2.5) and (krf<=3) then Qkr:=0.845-((krf-3)/0.5)*0.068 else if (krf>3) and (krf<=3.5) then Qkr:=0.766-((krf-3.5)/0.5)*0.079 else if (krf>3.5) and (krf<=4) then Qkr:=0.686-((krf-4)/0.5)*0.08 else if (krf>4) and (krf<=4.5) then Qkr:=0.616-((krf-4.5)/0.5)*0.07 else if (krf>4.5) and (krf<=5) then Qkr:=0.556-((krf-5)/0.5)*0.06 else if (krf>5) and (krf<=7) then Qkr:=0.4-((krf-7)/2)*0.156 else if (krf>7) and (krf<=10) then Qkr:=0.286-((krf-10)/3)*0.114; end; procedure TExerBox1.Button1Click(Sender: TObject); var i: Integer; Err1: Integer; begin Err1:=0; Kor1Box.Caption:=s2; Kor2Box.Caption:=s2; PolyBox.Caption:=s2; If cs='' then Err1:=1; If bs='' then Err1:=2; If s1='' then Err1:=3; If s2='' then Err1:=4; If Err1=0 then begin If s2='Кордельно-стирофлексная' then begin ExerBox1.Close; Kor1Box.Show; end; If s2='Кордельно-бумажная' then begin ExerBox1.Close; Kor2Box.Show; end; If (s2='Сплошная полиэтиленовая') or (s2='Пористо-полиэтиленовая') or(s2='Баллонно-полиэтиленовая') then begin ExerBox1.Close; PolyBox.Show; end; end else begin If Err1=1 then begin ShowMessage('Ошибка: Введите диаметр жилы!!!'); Diametr.Text:='1'; end; If Err1=2 then ShowMessage('Ошибка: Введите коэффициент укрутки!!!'); If Err1=3 then ShowMessage('Ошибка: Введите тип скрутки!!!'); If Err1=4 then ShowMessage('Ошибка: Введите тип изоляции!!!'); end; end; procedure TExerBox1.Button2Click(Sender: TObject); begin Close; end; end.