(vx + k1_1/2), y + dt * (vy + k1_2/2), 1); _ 2:=fu (q1, q2, m, x + dt * (vx + k1_1/2), y + dt * (vy + k1_2/2), 2); _ 1:=fu (q1, q2, m, x + dt * (vx + k1_2/2), y + dt * (vy + k2_2/2), 1); _ 2:=fu (q1, q2, m, x + dt * (vx + k2_1/2), y + dt * (vy + k2_2/2), 2); _ 1:=fu (q1, q2, m, x + dt * (vx + k3_1), y + dt * (vy + k3_2), 1); _ 2:=fu (q1, q2, m, x + dt * (vx + k3_1), y + dt * (vy + k3_2), 2) ;:=vy + dt * (k1_2 + 2 * k2_2 + 2 * k3_2 + k4_2)/6 ;:=vx + dt * (k1_1 + 2 * k2_1 + 2 * k3_1 + k4_1)/6 ;:=x + dt * vx ;:=y + dt * vy;
t:=t + dt; vis=0 then. chart1. Series [0]. AddXY (x, y, , clgreen) ;. StringGrid1. Rows [round (form4. StringGrid1. RowCount - 1)]. Strings [0]:=floattostr (t) ;. StringGrid1. Rows [round (form4. StringGrid1. RowCount - 1)]. Strings [1]:=floattostr (x) ;. StringGrid1. Rows [round (form4. StringGrid1. RowCount - 1)]. Strings [2]:=floattostr (y) ;. StringGrid1. RowCount:=form4. StringGrid1. RowCount + 1 ;;:=vis + 1; vis=dv then vis:=0;
end ;. StringGrid1. RowCount:=form4. StringGrid1. RowCount - 1;
end ;;; tform1. fu;
beginn of
: fu:=(1/(4 * pi * 0.85e - 12)) * (q1 * q2/m) * (x/sqrt (x * x + y * y));
2: fu:=(1/(4 * pi * 0.85e - 12)) * (q1 * q2/m) * (y/sqrt (x * x + y * y));
end ;; TForm1. Button2Click (Sender: TObject) ;. show ;. LabeledEdit1. Text:=LabeledEdit1. Text ;. LabeledEdit6. Text:=LabeledEdit6. Text ;. LabeledEdit7. Text:=LabeledEdit7. Text ;; tform1. podgon; K1_1, k2_1, k3_1, k4_1, k1_2, k2_2, k3_2, k4_2, y1, f0, g0: double; prover then:=f;
repeat:=0 ;:=-a ;:=0;
vx:=v * cos ((f/180) * pi) ;:=v * sin ((f/180) * pi); (x lt; c) and (y gt;=0) do
begin_1:=fu (q1, q2, m, x, y, 1); _ 2:=fu (q1, q2, m, x, y, 2); _ 1:=fu (q1, q2, m, x + dt * (vx + k1_1/2), y + dt * (vy + k1_2/2), 1); _ 2:=fu (q1, q2, m, x + dt * (vx + k1_1/2), y + dt * (vy + k1_2/2), 2); _ 1:=fu (q1, q2, m, x + dt * (vx + k1_2/2), y + dt * (vy + k2_2/2), 1); _ 2:=fu (q1, q2, m, x + dt * (vx + k2_1/2), y + dt * (vy + k2_2/2), 2); _ 1:=fu (q1, q2, m, x + dt * (vx + k3_1), y + dt * (vy + k3_2), 1); _ 2:=fu (q1, q2, m, x + dt * (vx + k3_1), y + dt * (vy + k3_2), 2) ;:=vy + dt * (k1_2 + 2 * k2_2 + 2 * k3_2 + k4_2)/6 ;:=vx + dt * (k1_1 + 2 * k2_1 + 2 * k3_1 + k4_1)/6 ;:=x + dt * vx ;:=y + dt * vy;
t:=t + dt ;; (abs (yd) gt; (d/100)) theny lt;=0 then y:=d/10; n of
: begin:=v * sqrt (d/y) ;;
: begin:=f * sqrt (d/y) ;;
: beginq2 gt; 0 thenq1 gt; 0 then q1:=q1 * sqr (d/y)
else q1:=q1 * sqr (sqr (y/d))
endq1 lt; 0 then q1:=q1 * (d/y)
else q1:=q1 * sqr (sqr (y/d)) ;;;; f gt; 89 then begin showmessage ( при даних v і q попадаеніе неможливо ); f:=f0; break; end;
until (abs (y-d) lt; (d/100)) ;. Text:=floattostr (v) ;. Text:=floattostr (f) ;:=y ;. Text:=floattostr (q1);
end ;;.
Вікно графіка:
unit Unit2 ;, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ,, TeEngine, Series, ExtCtrls, TeeProcs, Chart;=class (TForm): TChart ;: TLineSeries; FormResize (Sender: TObject);
private ;: TForm2;
implementation
{$ R *. dfm} TForm2. FormResize (Sender: TObject) ;. Width:=form2. ClientWidth ;. Height:=form2. ClientHeight ;;
end.
Вікно налаштування влучення в мішень:
unit Unit3 ;, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ,, StdCtrls, ExtCtrls;=class (TForm): TLabeledEdit ;: TLabeledEdit ;: TLabeledEdit ;: TButton ;: TRadioGroup; Button1Click (Sender: TObject) ;;: TForm3; Unit1;
{$ R *. dfm} TForm3. Button1Click (Sender: TObject) ;. LabeledEdit1. Text:=LabeledEdit1. Text ;. LabeledEdit6. Text:=LabeledEdit6. Text ;. LabeledEdit7. Text:=LabeledEdit7. Text ;. Hide ;. podgon (radiogroup1. ItemIndex) ;;.
Вікно таблиці:
unit Unit4 ;, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ,, Grids, Menus;=class (TForm): TMainMenu ;: TMenuItem ;: TMenuItem ;: TStringGrid ;: TSaveDialog; FormCreate (Sender: TObject); Savetofile1Click (Sender: TObject);
private ;: TForm4;
implementation
{$ R *. dfm} TForm4. FormCreate (Sender: TObject) ;. Rows [0]. Strings [0]:= час raquo ;;. Rows [0]. Strings [1]:= x raquo ;;. Rows [0]. Strings [2]:= y raquo ;;; TForm4. Savetofile1Click (Sender: TObject); savedialog1. Execute thensavedialog1. FileName lt; gt; then begin. cols [0]. SaveToFile (savedialog1. FileName + t. Txt );
stringgrid1. cols [1]. SaveToFile (savedialog1. FileName + x. Txt ) ;. cols [2]. SaveToFile (savedialog1. FileName + y. Txt ) ;;;.