. , , ,

,,,

2.


2.1.


( , , , - ) , .

, , , - - .

, . .

, , .

2.2.


, :

- 400-500 .

- .

, D = 30. . D + , , -, . D, a0 W: D = a0 - W. D D: D D - 90.


2.2.1.


. - :

- 1 , .

- , .

- .

- . - , . , , , , .

, = 574 i = 97,6.

500 800 ( , ). -19 () .


2.2.3.


. , . 7, 2200 .

:

- - 574 .

- - 97,6.

- - 4 ..

- - 7.

(, , , , , , --, -), (, , -), . 3 9 .

:

- - 574 .

- , , / - 6.

- , - 41.

- , - 153.

- , - 9,1.


2.2.4.


i = 97,6 = 574 - . ( , , ) .

:

1. .

- i 65. 180 ( ) - , 100 , . , , 700 600 .

2. ().

- i 54 65. ( ).

3. .

i 72 93. i = 97,6 .

i = 93. = 190 , L = 300 . 1,2 . . t = 318 . V = 5550 /. 6700 .

.

:

- R, - 2000.

- R, - 324.

- , - 7.

- , - 20.

- , - 7.

= 190 = 270 (t = 905,5 ) u = 104,1 :

- , - 190.

- , - 574.

- , - 6747.

- e - 0,02548

- i, - 93,4.

- , - 1,53.

- w, - 128,38.

- , W, - 48,37.

, dV1 = 2,36 /, 600 .

. , :

- j 76.

- l 238.

(t = 1231 ) :

- j 53.

- l 227.

. (t = 1,12 ) .

dV2 = 0,12 /, ( 20 ) :

- , - 574.

- i, - 93,4.

- , - 1,6.

. , :

- j 1,5.

- l 35,8.

, - i = 97,6. (t = 1,3 ).

dV3 = 0,62 /, ( 90 ) - :

- , - 574.

- i, - 97,6.

- , - 1,6.

- N - 15.

. , :

- j 0.

- l 28,1.

.

, :

t,

4946,5

X,

4638800

Y,

5120280

Z,

689680

Vx, /

241,23

Vy, /

-1233

Vz, /

7473,5

l,

28,1

T, c

5761,67

e

0,0009

i,

97,595

Ra,

6940000

R,

6952000

2.3.


2.3.1.


, , :

- , e = 0.

- -, W

W = 2p / 365,2422 = 0,0172 / = 0,98 /.

- , (n = 15).

.

- = 5765 .

- = 574 .

- i = 97,6.

- l = 28,1.

() OXYZ

l - s0,

s0 - , X, .

. = 0.

W = l = 28,1.

, , :

t,

4946.5

X,

4638800

Y,

5120280

Z,

689506,95

Vx, /

241,23

Vy, /

-1233

Vz, /

7472,65

:

l,

28,1

T, c

5761,67

e

0,0009

i,

97,595

Ra,

6940000

R,

6952000

:

t,

4946.5

X,

6137262,9

Y,

3171846,1

Z,

689506,95

Vx, /

-201,3

Vy, /

-1247,03

Vz, /

7472,65

l,

28,1

:

- (3s) - 7 .

- (3s) - 5 /.

DT - 10 .

:

, - (3s)2.

K11 = K22 = K33 = (3s)2 = 72 = 49 .

K44 = K55 = K66 = (3s)2 = 52 = 25 /.

Kij = Kji = rijsisj Kij = Kji = rjj(3si)(3sj), rjj - i j. Kij = Kji = 0.

:

t,

4946.5

X,

6144262,9

Y,

3178846,1

Z,

696506,95

Vx, /

-206,3

Vy, /

-1252,03

Vz, /

7477,65

l,

28,1

:

l,

28,13

T, c

5795,7

W,

28,13

p,

6973,5

,

6973,6

e

0,00314

i,

97,637


2.3.2.


1) .

2) , , .

3) .

2.4.


2.4.1.


m . Fz. Fz m :

,

- ,

ro - , m,

,

- -, . .m.

r - m.

Fz, .

m :

(1), (2)

(3), (4)

p1 - -, m.

p2 - -, .

.

(3) (4), m :

m<<, , , m . . , .

, , ,

,

m = fM - .

() OXYZ:

- - .

- X g.

- Z .

- Y .

OXYZ Fz, F.

m = 597 - .

OXYZ

ax, ay, az - .

:

- .

- .

- .

- .

- .


2.4.2. ,


1) , .

. , . - , .

, , , . .

.

mz = fMz - .

r0 - .

nm, dnm - , , .

L - .

j - .

Pnm(sinj) - m n ( m 0).

Pnm(sinj) - n ( m = 0).

(mz/r)(r0/r)ncn0Pn0(sinj) - n-. .. n- n , Pn0(sinj) n , n+1 , + - . .

(mz/r)(r0/r)ncnmcos(mL)Pnm(sinj) (mz/r)(r0/r)ndnmsin(mL)Pnm(sinj)

- n- m. 0 2m , cos(mL) = 0 sin(mL) = 0 n-m , Pnm(sinj) = 0 dmPnm(sinj)/d(sinj)m = 0, n+m+1 , .

(mz/r)(r0/r)ncnncos(nL)Pnn(sinj) (mz/r)(r0/r)ndnnsin(nL)Pnn(sinj)

- n- m. , cos(nL) = 0 sin(nL) = 0, 2n , .

n :

Pn0(z) = 1/(2nn!)(dn(z2 - 1)n/dzn)

n m :

Pnm(z) = (1-z2)m/2dmPn0(z)/dzm

U = U’ + DU’ = (U - mz/r) + DU’

DU’ - .

U’ - , .

,

.

, n-m - .

- .

10-3, - 10-6 . (n=2, m=0) (n=2, m=2). DU’.

,

U = (mz/r)(r0/r)2[c20P20(sinj) + (c22cos(2L) + d22sin(2L))P22(sinj)],

c20 = - 0,00109808,

c22 = 0,00000574,

d22 = - 0,00000158.

P20(x) = 1/222!d2(x2 - 1)2/dx2.

P20(x) = (3x2 - 1)/2.

sinj = z/r, P20(sinj) = (3(z/r)2 - 1)/2.

P22(x) = (1 - x2)2/2d2P20(x)/dx2 = 1/2(1 - x2)d2(3x2 - 1)/dx2

P22(x) = 3(1 - x2).

sinj = z/r, P22(sinj) = 3(1 - (z/r)2).

OXYZ, U X, Y, Z, r = (x2 + y2 + z2).

,

2) , .

Rx, :

Cx = 2 - .

S = 2,5 2 - - , .

V - .

r - .

- = 574 , , 574 . = 574 . = 580 r = 5,09810-13 /3.

aa:

axa, aya, aza:

aa ,

ea = [Vx/|V|, Vy|V|, Vz/|V|], |V| = (Vx2+Vy2 +Vz2)

,

, ,


3) , .

- Dmc. :

Dmc = pSA2/m

p = 4,6410-6 /2 - .

A = 1,4961011 - 1 .

m - .

S = 8 2 - - , .

,

Dmc = 1,391541015 3/c2.


4) , - .

OXYZ :

mz - .

mc - .

r - - .

rc - - .

, , - :

.

, , , .

, , .

, , - .

rc>>r, r.

| rc - r| = ((xc-x)2+(yc-y)2+(zc-z)2)

xc, yc, zc - - .

: t J = J + wct,

J = W + (90 - D) - .

W = 28,1 - .

D = 30 - .

wc - .

wc = 2p/T = 2p/365,2422243600 = 1,99110-7 /c = 1,1410-5 /c

, :

xce = rccosJ

yce = rcsinJ

zce = 0

rc = 1,4961011 (1 ) -

e = 23,45, rc

xc = xce = rccosJ

yce = ycecose = rccosJcose

zce = rcsinJsine

, :

axc = - mcx/(((xc-x)2+(yc-y)2+(zc-z)2))3

ayc = - mcy/(((xc-x)2+(yc-y)2+(zc-z)2))3

azc = - mcz/(((xc-x)2+(yc-y)2+(zc-z)2))3

axc = - (mc-Dmc)x/(((xc-x)2+(yc-y)2+(zc-z)2))3

ayc = - (mc-Dmc)y/(((xc-x)2+(yc-y)2+(zc-z)2))3

azc = - (mc-Dmc)z/(((xc-x)2+(yc-y)2+(zc-z)2))3


5) , - .

OXYZ :

m = 4,902106 3/c2- .

r - - .

, , - :

r>>r, r.

|r - r| = ((x-x)2+(y-y)2+(z-z)2)

x, y, z - - .

: . , . :

- - .

- i = 5,15.

- ( , ) = 18,6 .

cos(h) = cos(e)cos(i) - sin(e)sin(i)cos(W)

W - , .

e - .

h 18,6 h = e - i = 1818’ h = e + i = 2836’ W = 0.

W t W = t360/18,6365,2422243600.

t

J = t360/27,32243600.

:

x = r(cosJcosW - coshsinJsinW)

y = r(cosJsinW + coshsinJcosW)

z = rsinhsinJ

r = 3,844108 -

, :

ax = - mx/(((x!-x)2+(y-y)2+(z-z)2))3

ay = - my/(((x!-x)2+(y-y)2+(z-z)2))3

az = - mz/(((x!-x)2+(y-y)2+(z-z)2))3

:

d2x/dt2 = - (mz/r2)x + axu + axa + axc + ax + ax

d2y/dt2 = - (mz/r2)y + ayu + aya + ayc + ay + ay

d2z/dt2 = - (mz/r2)z + azu + aza + azc + az + az


2.4.3.


- 5- . x0, y0, z0, Vx0, Vy0, Vz0 - , . (x, y, z, Vx, Vy, Vz) .

. .

) - .

= C2/mz, - .

C = r V, |C| = C = (Cx2+Cy2+Cz2)

Cx = yVz - zVy

Cy = zVx - xVz -

Cz = xVy - yVx

) - .

e = f/mz, f -

f = V C - mzr/r, |f| = f = (fx2+fy2+fz2)

fx = VyCz - VzCy - mzx/r

fy = VzCx - VxCz - mzy/r -

fz = VxCy - VyCx - mzz/r

) .

a = p/(1 - e2)

) - i.

Cx = Csin(i)sinW

Cy = - Csin(i)cosW

Cz = Ccos(i)

i = arccos(Cz/C)

) - W.

sinW = Cx/Csin(i)

cosW = - Cy/Csin(i)

i = 97,6, sin(i).

sinW => 0, W = arccos (-Cy/Csin(i))

sinW < 0, W = 360 - arccos (-Cy/Csin(i))

) - w.

fx = f(coswcosW - sinwsinWcos(i))

fy = f(coswsinW + sinwcosWcos(i))

fz = fsinwsin(i)

cosw = fxcosW/f + fysinW/f

sinw = fz/fsin(i)

sinw > 0, w = arccos (fxcosW/f + fysinW/f)

sinw < 0, w = 360 - arccos (fxcosW/f + fysinW/f)

) - .

T = 2p(a3/mz)

, , 2- ( = 5765 ) . 1-12.

. 13-18.

2.5.


, . , . (), .

, , .

- :

- - .

- - , - .

, , :

- Di = 0,1

- Dl = 0,1

, DT = 1,6 .

:

1) .

2) .


2.5.1.


, - (). , , 2 . .

:

) .

) .

, 20 . , .


) .

:

-

-

- rp r = 6952137 . . DV. ( ) . Drp = rp - r.

:

1) Drp < 0 -

2) Drp > 0 -

. - 20 .

, DV , , DVmax 20 :

DVmax = Pt/m = 2520/597 = 0,8375 /

DV > DVmax DV = DVmax. rp . DV, DV < DVmax, DV. P = (DV/DVmax)Pmax.

= 20 .

, rp .

, , . , , ra = r = 6952137 . ra r.

Dra = ra - r.

:

Dra > 0 - .

. - 20 .

, DV , , DVmax 20 :

DVmax = Pt/m = 2520/597 = 0,8375 /

DV > DVmax, DV = DVmax. ra. DV, DV < DVmax, DV. P = (DV/DVmax)Pmax.

= 20 .

, ra r .

.


) .

- . .

. .


, , . . - 5- .

.19-30.


2.5.2.


, :

m = m0(1 - e-DV/W)

m0 = 597 - ()

W = 2200 / - .

:


t,

t,

Dt,

DV, /c

.

m,

176242

262592

300

12,1

15

3,26

273984

432298

580

24,11

29

6,48


2.5.3.


- , .. .

:

- Di = 0,1

- Dl = 0,1.

Dl :

DT = 1,597 . - .

3 , 3,2 , - 0,001.

, 1 1,5 .

- 1 / - 5 - 40 , DV = 40 /, = 10,8 .

5 Di = 0,02 - .

3 .31-42.

2.6.


2.6.1.


:

Jxwx + (Jz-Jy)wywz = Mxy + Mx

Jywy + (Jx-Jz)wxwz = Myy + My

Jzwz + (Jy-Jx)wywx = Mzy + Mz

Jx, Jy, Jz - ,

My - ,

M - .

, , , , :

Jxwx = Mxy + Mx

Jywy = Myy + My

Jzwz = Mzy + Mz

:

Jx = 532 2, Jy = 563 2, Jz = 697 2.

0.

M - , , , () l , M.

M = Pl,

P = 25 H - ,

l = 4 - .

, M = 250,0004 = 0,1 .


2.6.2.


, :

- - 1 ..

.

:

1) - .

.

2) - .

. T = 1/30 c-1 e = 0,7, 2/.

3) - - .

.

4) - - .

.

5) - - .

, . , .

, , (, ) , , . .

6) .

0,127 = 0,05 .

0,1

7) .

. :

e = K(K1j +K2j), = 1, 1 = 550, 2 = 430.

, , .

. .

. .43.

.44-46.

, , 15 ., - 0,62 .., .


3. -


3.1.


, , .

, , , .

, , . , .1.

1.

. .

2.

.

3.

.

4.

. .

5.

.


3.2.


. , ̻. ().

, :

- 2,

:

, - 1,

, ( ) - 1;

- 2,

:

( ) - 1,

, ( ) - 1;

- ( , ).

- 3 ( , ).

:

() - 1, : , - 1;

- () ( ) - 1;

- Borland ++.

- 11 ( ).

- 22 ( ).

t .

t = t + t + t + t + t,

t - ,

t - ,

t - ,

t - ,

t - .

t = + ,

- , .-,

- , .-.

= t, = t,

t - , .- (t = 29),

- , , ( = 0,65),

- , , ( = 0,35).

= 29*0,65 = 18,85 .-.

= 29*0,35 = 10,15 .-.

t = + =18,85 + 10,15 = 29 .-.

t = + ,

- , .-,

- , .-.

= t, = t,

t - , .- (t = 41),

- , , ( = 0,7),

- , , ( = 0,3).

= 41*0,7 = 28,7 .-.

= 41*0,3 = 12,3 .-.

t = + = 28,7 + 12,3 = 41 .-.

, , :

t = (t + t),

t, t - , .- (t = 9, t = 8),

- ,

- ( = 1,1).

= (n + n + n)/(n + n + n),

, , - , - ( = 0,5, = 0,43, = 1,25),

n, n, n - , - (n = 1, n = 1, n = 0).

= (0,5 + 0,43)/2 = 0,465

t = (8 + 9)*0,465*1,1 = 8,6955 .-.

, , , ,

t = (t + t),

t, t - , .- (t = 5, t = 27),

- ( = 1,07),

- ( = 1,0),

- ( = 0,8),

- , .

= (’n + ’n + ’n)/(n + n + n),

, ’, ’ - , - (’ = 0,48, ’ = 0,29, ’ = 0,24),

n, n, n - , - (n = 1, n = 1, n = 0).

= (0,48 + 0,29)/2 = 0,385

t = (5 + 27)*1,07*1,1*0,8*0,385 = 11,6 .-.

:

t = (t + t) ,

t, t - , .- (t = 8, t = 24).

t = (8 + 24)*0,8*1,07 = 27,392 .-.

t = 29 + 41 + 8,6955 + 11,6 + 27,392 = 117,6875 .-.

Ti = (ti + Q)/ni,

ti - i- , .-,

Q - , , .-,

ni - , i- , .

T = t/2 = 29/2 = 14,5 (15)

T = t/2 = 41/2 = 20,5 (21)

T = t = 8,6955 (9)

T = t/2 = 11,6/2 = 5,8 (6)

T = t = 27,392 (28)

T = Si = 15 + 21 + 9 + 6 + 28 = 79 .


3.3.


. , , :

1. ( , ).

2. ( , ).

3. .

4. .

5. .

6. .

7. .

8. .

, , . 7, 8 . 1, 2 . , , , .

:

1. , .

2. .

3. .

4. .

5. .

6. .


.

= t,

t - , (t = 10).

- (= 0,6).

- , ( 1997 8000 ).

- ( = 1,0).

- (= 1,2).

= 10*0,6*1,2*8000 = 57600 .


.

:

4 500 60000 .

3,5 2 5000 .

= 60000 + 5000*2 = 70000 .


4.2. .

,

, .

, .

1,44

5000

2

10000

4


500

60000

:



70000


.

= Siti/d,

i - i- (300000 ),

ti - , i- (.-),

d - (d = 22).

= 79*300000/22 = 1077300 .


.

“ ” , .

= a,

a - , a = 0,2.

= 1077300*0,2 = 215500 .


.

“ ” .

= ( + )a,

a - , , a = 0,4.

= (1077300 + 215500)*0,4 = 517120 .


.

“ ” , , , .

= a,

a - , a = 1,8.

= 1,8*1077300 = 1939140


.

= + + + + + =

= 57,6 +70 + 1077,3 + 215,5 + 517,12 + 1939,14 = 3876,66 ..


4.3.

4.3.

/


(..)

, %

1

57,6

1,4

2

70

1,9

3

1077,3

27,7

4

215,5

5,5

5

517,12

13,4

6

1939,14

50,1


:

3876,66


4.


4.1.


. , , , , - , , .

- . . , ().

() Ҡ26387-84 - (), , , ̻. ̠ , , , .


4.2.  


- , . , , , ().

:

- - , , , , ;

- , , ;

- , , ;

- , , , , ;

- .

:

- , , , , ;

- , , .

:

- (, , ..);

- ( ).

:

- (, , );

- - ( , , ).

- , , , .

, . , . , , . . , . +110 , . +180Ѡ +240, +170 +220.

. 0.1, 0.5, 0.9 / +220, +240, +260 1000 /.

80-106 . , , .

- . , , , , , . 150 . 100 .

, , . , . . 90-100% , , ( ). 90-100% , . . , . , , .

, . , 80-90%, - 50-60%, - 15-20%, - 15-30% . , . , , (, , ) , . .

- . . , , .

: , ,. .

. , . , 25 40 60 90 . 6-8 , , .

() . : , , , , ..

:

- - - /;

- 300 - 5 /, - 5 /. 150 .

. : ( ) .

19-20%, 1%; , : - 18-29%, - 1-2%. 16% 3% . . , . , , - 20 /, - 3 /, - 200 /, - 5 /, - 100 /, - 1 /.

:

IBM PC 486DX;

Canon Bubble Jet.

220/50, 42 . .

() (, , , , ).

- 30 ( 3-500 ). .

:

, ;

, , , .

- < 320 . 100 . :

( , , , .);

;

2 ;

;

;

( );

/ .

. , () (, ).

. Canon Bubble Jet 1 49 ( 1 ), . , .

, :

;

;

;

.


4.3.


, , .

:

100 /2;

0,4 0,6 ;

0,8;

72 ;

640;

;

31 , 3,8 , 4080 .

() .

, 50 .

,
/

BGA

5 - 1000

0,2

160 - 0,8

10 - 150

0,17

0,8 - 0,6

150 - 300

-

0,6 - 0,42

0,3 - 30

0,00000066

0,42 - 0,73

30 - 300

0,00000066

0,73

, BGA, 2,5 /. , .

, 50 .

,
/

BGA

5 - 1000

4,8

2500 - 177

10 - 150

4,8

87

150 - 300

0,48

87

0,3 - 30

0,0024

87 - 27,5

30 - 300

0,0024

27,5

BGA , 7 /. SSI SEMKO () , 50 /.

12.1.006-84 2963-84.

. .

.

f,

.

0.06-1.5

1.5-3.0

3.0-30

30-50

50-300

300-3*105

, /

50

50

20

10

5

, /

5.0

0.3

I, /2

I0 = e/T

:

: E = 6/T; 1 T 9, - ;

: Hn 8 / ; e = 2 ( r/2) .


4.4.


4 . 5 100 /. , .

Pr = P0e-mr,

Pr - r, /;

P0 - 5 , /.

m - , -1;

r - , ;

m = 3.14*10-2 -1.

r,

5

10

20

30

40

50

60

70

80

90

100

P, /

100

73

53

39

28

21

15

11

8

6

4

50 . , , , .

4

4*21

84 /

5

5*84

420 /

44

44*420

18480 /


4.5.


.

- - :

:

;

;

.

:

;

.

.

2.03.04-87 “ ”.

6 2 . , . . 19,5 3 .

1 , 2- 1,2 . 1 . 1,5 .

, , , .


4.6.


. , - .

, , . - 9-10 2. . , . - . .

, . - .

- ( ).

(, .), . -.

40-45 : , , .

, , .


4.7. .


(). 1000 .

. . - I:

Ialarm KI,

I = Ialarm/K

I - , A;

K - , :

K = 3 - ,

K = 1.4 - ,

Ialarm - , A.

:

Ialarm = Uf/(Rn + Rm/3)

Rn = Rf + R1 + jx1

Uf = 220

Rm = 0,312W

Rf = 0,412W

jx1 = 0,6W

R1 = r/S

r - , [Wmm2/m];

l - , m;

rcu = 0,0175 W mm2 /m,

l = 50 m,

S = 1,5 mm2

R1 = 0,0175(50/15) = 0,58W

Rn = (0,412 + 0,58 + 0,6) = 1,59W

Ialarm = 130 A

I = 43 A

, I = 43 A.


4.8.


, .

: , , , , , , ..

. , , .

, , , , , .

“” ( ). II .

:

C

II

:


, ,

2

1

0,25

,

0,25

0,75

, .

0,25

(). , ().

-1.

-1 , , .

-1:

,

10

,

-30 ...+50

, %

80

:

, i2

,



-1

100

12

15

. , .

:

;

;

;

.

-1.

-1:

-1,

300

, .

30

,

22010

,

180

,

+5 ... +50

, %

80

,

8

, . () .

:

,

2

,

4

114

,

27

,

40

,

125

,

12,5

,

65

,

480

, , 30 .

:

()

G = GWK, G - ,

W - , 3,

G - , /3,

K - , .

G= 0,25 /3, K = 1,2.

W = SH, S - , 2.

H - , .

S = 100 2. H = 3 . W = 300 3.

G = 0,25*300*1,2 = 90 .

N = G/Vra, V - , 3,

r - , /,

a - .

V = 40 , r = 2,17 /, a = 0,9.

N = 90/(40*2,17*0,9) = 2.

W = (+1)(W+W)/(-), - , ,

- , ,

W W - , .

= = 5 , W = 2*40 = 80 , W = 20, = 125 .

W = (5+1)(80+20)/(125-5) = 4,8 .

5. .

  1. / . .., ... ., , 1972.

  2. .. . ., , 1990.

  3. .., .., .. . ., , 1978.

  4. .., .. . ., , 1974.

  5. .., .., .. . ., . ., 1993.

  6. . ++. ., , 1991.

  7. .., .. ++. ., , 1991.

  8. .., .. - , ., . ., 1994.

  9. 2.103-68 . .: - , 1968.

  10. .. - . .: , 1969.

  11. / .., .., .. . , - , 1989.

  12. ̻, 27 1987 . 454/22-70

  13. .. ֻ. ., , 1985.

  14. .., / . ... ., , 1986.

  15. 2.09.04-87 .

  16. / . .., ., , 1995.

  17. . 12.1.006-84.

  18. 2963-84 .

  19. , Computer World 7, 1995.3

6. . BORLAND C++ MATHLAB 4.0 FOR WINDOWS


6.1. MAIN.CPP


#include

#include

#include

#include

#include "rk5.h"

#include "sfun.h"

#include "init.h"

#include


typedef long double real;


const float g_r = M_PI/180.;

const float r_g = 180./M_PI;


real t_beg;

real t_end;

real dt;

real toler;

int Np;

int Curp;

real dTp;

real mu_z;

real mu_s;

real mu_l;

real m;

real m_t;

real W;

real w_s;

real w_z;

real w_l;

real ww_l;

real xs,ys,zs;

real xl,yl,zl;

real Fz,Fs,Fl,Fa,U20;

real J1,J2,J3;

int nomin;

real par[8];

real parn[8];

real a_p,e_p,p_p,Om_p,i_p,om_p,Rp_p,Ra_p;

real y_main[6];

real prmt[5];

int Fl_u;

real u_last;

int Fl_ka;

int Fl_kp;

int Fl_ki;

int Fl_i;

int Fl_p;

int Fl_a;

int Fl_lu;

int Fl_pkT;

real dl;

real T_vd;

real dRa;

real dRp;

int Sig;

int Sig_a;

real Tkor;

real Tkore;

real Vkor[3];

real akor[3];

int Fl_l0;

int Fl_l1;

int Fl_pki;

real dV_ps;

real dV_as;

real dV_is;

real dV_ss;


ofstream m_y ("m_y.dat");

ofstream m_f ("m_f.dat");

ofstream m_s ("m_s.dat");

ofstream m_l ("m_l.dat");

ofstream m_par ("m_par.dat");

ofstream u_f ("u_f.dat");

ofstream u_par ("u_par.dat");

ofstream k_par ("k_par.dat");


void out_p(real,real *,real*,int,int,real*);


void main()

{

clrscr();

init_m();

real dery[]={ .167, .167, .167, .167, .166, .166};

int ihlf;

int ndim = 6;


Drkgs(prmt,y_main,dery,ndim,ihlf,fct,out_p);

clrscr();

if (ihlf<11)

{

cout << '\n' << " " << '\n';

cout << " t0 = " << t_beg << " tk = " << t_end << " dt = " << dt;

cout << '\n' << " =" << ihlf;

}

else

{

cout << '\n' << " " << '\n';

cout << " t0 = " << t_beg << " tk = " << t_end << " dt = " << dt;

cout << '\n' << " =" << ihlf;

}

getch();


m_y.close();

m_f.close();

m_s.close();

m_l.close();

m_par.close();

u_f.close();

u_par.close();

k_par.close();

}


void out_p(real x,real *y,real*,int,int,real*)

{

if (x >= (dTp*Curp))

{

Curp++;

gotoxy(1,20);

cout << " :" << float(Curp)*100./Np << " % " << '\n';


cout.precision(7);


m_y << x << '\t' << y[0] << '\t' << y[1] << '\t' << y[2] << '\t'

<< y[3] << '\t' << y[4] << '\t' << y[5] << '\n';

m_f << x << '\t' << Fz << '\t' << Fs << '\t' << Fl << '\t' << Fa

<< '\t' << U20 << '\n';

m_s << x << '\t' << xs << '\t' << ys << '\t' << zs << '\n';

m_l << x << '\t' << xl << '\t' << yl << '\t' << zl << '\n';

m_par << x << '\t' << par[0] << '\t' << par[1] << '\t' << par[2]

<< '\t' << par[3] << '\t' << par[4] << '\t' << par[5]

<< '\t' << par[6] << '\t' << par[7] << '\n';

}

if (Fl_u && (par[7] > parn[7]))

{

Fl_u = 0;

dl = -(w_z-w_s)*(par[6]-parn[6]);


u_par << x << '\t' << par[0] << '\t' << par[1] << '\t' << par[2]

<< '\t' << par[3] << '\t' << par[4] << '\t' << par[5]

<< '\t' << par[6] << '\t' << par[7] << '\n';

u_f << x << '\t' << Fz << '\t' << Fs << '\t' << Fl

<< '\t' << Fa << '\t' << U20 << '\n';

}

if ((x > 79000) && (x < 81000))

{

k_par << x << '\t' << par[5] << '\t' << par[7] << '\n';

}

}


6.2. , SFUN.CPP


#include "sfun.h"


const real p = 4.64e-6;

const real sm_s = 8.;

const real A = 1.496e11;

const real Cx = 2.;

const real sm_a = 2.5;

const real ro = 5.098e-13;


void korr (real& t, real *f, real *dery);


void fct(real& t, real *f, real *dery)

{

real x = f[0];

real y = f[1];

real z = f[2];

real Vx = f[3];

real Vy = f[4];

real Vz = f[5];


real Tet_s = (28.1+60*g_r)+w_s*t;

real e_0 = 23.45*g_r;


xs = A*cos(Tet_s);

ys = A*sin(Tet_s)*cos(e_0);

zs = A*sin(Tet_s)*sin(e_0);


real Tet_l = 0+w_l*t;

real Om_l = 0-ww_l*t;

real i_l = acos(cos(e_0)*cos(5.15*g_r)-sin(e_0)*sin(5.15*g_r)*cos(Om_l));

real rsr_l = 3.8448e8;


xl = rsr_l*(cos(Tet_l)*cos(Om_l)-cos(i_l)*sin(Tet_l)*sin(Om_l));

yl = rsr_l*(cos(Tet_l)*sin(Om_l)+cos(i_l)*sin(Tet_l)*cos(Om_l));

zl = rsr_l*sin(i_l)*sin(Tet_l);


real R_ka = sqrt(x*x+y*y+z*z);


real Fz_x = -mu_z*x/pow(R_ka,3.);

real Fz_y = -mu_z*y/pow(R_ka,3.);

real Fz_z = -mu_z*z/pow(R_ka,3.);


real mu_sd = p*sm_s*A*A/m;


real R_s = sqrt((x-xs)*(x-xs)+(y-ys)*(y-ys)+(z-zs)*(z-zs));


real Fs_x = -(mu_s-mu_sd)*x/pow(R_s,3.);

real Fs_y = -(mu_s-mu_sd)*y/pow(R_s,3.);

real Fs_z = -(mu_s-mu_sd)*z/pow(R_s,3.);


real R_l = sqrt((x-xl)*(x-xl)+(y-yl)*(y-yl)+(z-zl)*(z-zl));


real Fl_x = -mu_l*x/pow(R_l,3.);

real Fl_y = -mu_l*y/pow(R_l,3.);

real Fl_z = -mu_l*z/pow(R_l,3.);


real V_ka = sqrt(Vx*Vx+Vy*Vy+Vz*Vz);


real Fa_x = (-Cx*sm_a/(2*m))*ro*V_ka*Vx;

real Fa_y = (-Cx*sm_a/(2*m))*ro*V_ka*Vy;

real Fa_z = (-Cx*sm_a/(2*m))*ro*V_ka*Vz;


const real c20 = -1.09808e-3;

const real c22 = 5.74e-6;

const real d22 = -1.58e-6;

const real r_e = 6378137.;


real cr = mu_z*r_e*r_e/pow(R_ka,5);

real lr = 2*atan(y/x);

real mr = 3*(c22*cos(lr)+d22*sin(lr));


real U20_x = cr*x*(c20*(1.5-7.5*z*z/pow(R_ka,2))+mr*(5*z*z/pow(R_ka,2)-3));

real U20_y = cr*y*(c20*(1.5-7.5*z*z/pow(R_ka,2))+mr*(5*z*z/pow(R_ka,2)-3));

real U20_z = cr*z*(c20*(4.5-7.5*z*z/pow(R_ka,2))+5*mr*(z*z/pow(R_ka,2)-1));


dery[0] = Vx;

dery[1] = Vy;

dery[2] = Vz;

dery[3] = (Fz_x+U20_x+Fs_x+Fl_x+Fa_x+akor[0]);

dery[4] = (Fz_y+U20_y+Fs_y+Fl_y+Fa_y+akor[1]);

dery[5] = (Fz_z+U20_z+Fs_z+Fl_z+Fa_z+akor[2]);


Fz = sqrt(Fz_x*Fz_x+Fz_y*Fz_y+Fz_z*Fz_z);

Fs = sqrt(Fs_x*Fs_x+Fs_y*Fs_y+Fs_z*Fs_z);

Fl = sqrt(Fl_x*Fl_x+Fl_y*Fl_y+Fl_z*Fl_z);

Fa = sqrt(Fa_x*Fa_x+Fa_y*Fa_y+Fa_z*Fa_z);

U20 = sqrt(U20_x*U20_x+U20_y*U20_y+U20_z*U20_z);


parn[3] = parn[3]+w_s*t;


par_or(f,par);


korr(t,f,dery);


if ((u_last-par[7]) > 300*g_r)

Fl_u = 1;


u_last = par[7];

}


void korr(real& t, real *f, real *)

{

if (t > (Tkor+172800.))

{

if ((fabs(dl) > 0.1*g_r) && (!Fl_ka) && (!Fl_kp) && (!Fl_ki))

{

Fl_kp = 1;

Fl_ka = 0;

Fl_ki = 0;

cout << " " << '\n';

cout << " . dl=" << dl*r_g << "." << '\n';

cout << " .=" << parn [6] << " .=" << par[6] << '\n';

cout << " " << '\n';

cout << " Rp = " << par[2]*(1-par[1]) << '\n';

cout << " Ra = " << par[2]*(1+par[1]) << '\n';

cout << " p = " << par[0] << '\n';

cout << " a = " << par[2] << " e = " << par[1] << "\n T = "

<< par[6] << " w = " << par[5]*r_g << " u = " << par[7]*r_g

<< '\n';

clrscr();

}

}


Fl_a = 0;

Fl_p = 0;

Fl_lu = 0;


real da;

if (par[5] > par[7])

da = fabs(par[5]-par[7]-M_PI);

else

da = fabs(par[5]-par[7]+M_PI);


if (da < .1*g_r)

{

Fl_a = 1;

}


if (fabs(par[5] - par[7]) < .1*g_r)

{

Fl_p = 1;

}


if (par[7] < .1*g_r )

{

Fl_lu = 1;

}


real Vk;


if (T_vd)


if (t >= (T_vd +20))

{

T_vd = 0;

akor[0] = 0;

akor[1] = 0;

akor[2] = 0;

cout << ".. \n t = " << t;

}

if (((Fl_kp && Fl_a) || (Fl_ka && Fl_p) || (Fl_ki && Fl_lu)) && (!T_vd))

{

cout << " \n \n";

cout << "\n t=" << t << " \n";

int sim;


if ((t-Tkor) < 2500)

{

cout << " !";

return;

}

Tkor = t;


real R_t = sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);

real V_t = sqrt(f[3]*f[3]+f[4]*f[4]+f[5]*f[5]);

real R_n = parn[0];


if (Fl_a)

{

dRa = R_t-R_n;

dRp = par[2]*(1-par[1])-R_n;

cout << " dRp:" << dRp << " \n";

cout << "dRa:" << dRa << " \n";

cout << "w=" << par[5]*r_g << "u=" << par[7]*r_g << '\n';

real l,ln;

l = -(w_z-w_s)*par[6];

ln = -(w_z-w_s)*parn[6];

dl = -(w_z-w_s)*(par[6]-parn[6]);

cout << "T=" << par[6] << "=" << parn[6] << " T-T="

<< par[6]-parn[6] << '\n' << "l=" << l*r_g << "l="

<< ln*r_g << "l-l=" << (l-ln)*r_g << "dl=" << dl

<< '\n';


if (dRp > 0)

Sig_a = -1;

else

Sig_a = 1;


cout << " :" << Sig_a << '\n';

clrscr();


real Rp = par[2]*(1-par[1]);

real Ra_p = par[2]*(1+par[1]);

real Rp_p2 = Rp;

real Ra_p2 = R_t;

cout << "Rp=" << Rp_p2 << "Ra=" << Ra_p2 << '\n';

cout << "Ra_p=" << Ra_p << "\n Rt=" << R_t << '\n';


if (fabs(Rp - R_n) < 500)

{

Fl_kp = 0;

Fl_ka = 1;

cout << " \n" << "dRp=" << Rp-R_n

<< "dRa=" << dRa << "t=" << t << '\n';

cout << " : \n" << "Rp=" << par[2]*(1-par[1])

<< "Ra=" << par[2]*(1+par[1]) << "\n p=" << par[0]

<< "a=" << par[2] << "e=" << par[1] << "\n T="

<< par[6] << "w=" << par[5]*r_g << "u=" << par[7]*r_g

<< '\n';

cout << " =" << dV_ps << '\n';

clrscr();

}

else

{

if (R_t > R_n)

{

Rp_p = R_n;

Ra_p = R_t;

a_p = (Ra_p+Rp_p)/2.;

e_p = 1-Rp_p/a_p;

p_p = a_p*(1-e_p*e_p);


Vk = sqrt(mu_z/p_p)*(1-e_p);

}

else

{

Rp_p = R_t;

Ra_p = R_n;

a_p = (Ra_p+Rp_p)/2.;

e_p = 1-Rp_p/a_p;

p_p = a_p*(1-e_p*e_p);


Vk = sqrt(mu_z/p_p)*(1+e_p);

}

real dV = Vk-V_t;

real dVmax = 20*25./m;


cout << "\n dV=" << dV << "dVmax 20 =" << dVmax;


if (fabs(dV) > dVmax)

{

akor[0] = Sig_a*(25./m)*f[3]/V_t;

akor[1] = Sig_a*(25./m)*f[4]/V_t;

akor[2] = Sig_a*(25./m)*f[5]/V_t;

cout << "\n dV=" << dV << "dVmax=" << dVmax;

cout << "\n :" << akor[0] << '\t' << akor[1]

<< '\t' << akor[2] << '\t' <<

sqrt(akor[0]*akor[0]+akor[1]*akor[1]+akor[2]*akor[2]) << '\n';


dV_ps = dV_ps+dVmax;

cout << " =" << dV_ps << '\n';

}

else

{

akor[0] = Sig_a*(fabs(dV)/dVmax)*(25./m)*f[3]/V_t;

akor[1] = Sig_a*(fabs(dV)/dVmax)*(25./m)*f[4]/V_t;

akor[2] = Sig_a*(fabs(dV)/dVmax)*(25./m)*f[5]/V_t;

cout << "\n dV=" << dV << "dVmax=" << dVmax;

cout << "\n :" << akor[0] << '\t' << akor[1]

<< '\t' << akor[2] << '\t' <<

sqrt(akor[0]*akor[0]+akor[1]*akor[1]+akor[2]*akor[2]) << '\n';


dV_ps = dV_ps+fabs(dV);

cout << " =" << dV_ps << '\n';

}


if (dVmax > fabs(dV))

{

dVmax = fabs(dV);

real Vk_r = Sig_a*dVmax+V_t;

real Ra_r = R_t;

real e_r = -(Vk_r*Vk_r*Ra_r/mu_z)+1;

real a_r = Ra_r/(1+e_r);

real p_r = a_r*(1-e_r*e_r);

real Rp_r = a_r*(1-e_r);

cout << " : \n" << " Rp_r = " << Rp_r

<< " Ra_r = " << Ra_r << "\n p_r = " << p_r << " a_r = "

<< a_r << " e_r = " << e_r << '\n';

}

else

{

real Vk_r = Sig_a*dVmax+V_t;

real Ra_r = R_t;

real e_r = -(Vk_r*Vk_r*Ra_r/mu_z)+1;

real a_r = Ra_r/(1+e_r);

real p_r = a_r*(1-e_r*e_r);

real Rp_r = a_r*(1-e_r);

cout << " : \n" << " Rp_r = " << Rp_r

<< " Ra_r = " << Ra_r << "\n p_r = " << p_r << " a_r = "

<< a_r << " e_r = " << e_r << '\n';

}

T_vd = t;

cout << ".. t=" << T_vd << '\n';

}

}


if (Fl_p)

{

dRp = R_t-R_n;

dRa = par[2]*(1+par[1])-R_n;

cout << " - dRp:" << dRp << " \n";

cout << "dRa:" << dRa << ". \n";

cout << "w=" << par[5]*r_g << "u=" << par[7]*r_g << '\n';

real l,ln;

l = -(w_z-w_s)*par[6];

ln = -(w_z-w_s)*parn[6];

dl = -(w_z-w_s)*(par[6]-parn[6]);

cout << "T=" << par[6] << "T=" << parn[6] << "T-T="

<< par[6]-parn[6] << '\n' << "l=" << l*r_g << "l="

<< ln*r_g << "l-l=" << (l-ln)*r_g << "dl=" << dl << '\n';


if (dRa > 0)

Sig_a = -1;

else

Sig_a = 1;


cout << " :" << Sig_a << '\n';

clrscr();


real Ra = par[2]*(1+par[1]);

real Rp_p1 = R_t;

real Ra_p1 = Ra;

cout << "Rp=" << Rp_p1 << "Ra=" << Ra_p1 << '\n';


if ((fabs(Ra-R_n) < 500) || (fabs(dl*r_g) < .0001))

{

cout << " \n" << "dRa="

<< Ra-R_n << "dRp=" << dRp << "t=" << t << '\n';

cout << " : \n " << "Rp="

<< par[2]*(1-par[1]) << "Ra=" << par[2]*(1+par[1])

<< " \n p=" << par[0] << "a=" << par[2] << "e="

<< par[1] << " \n T=" << par[6] << "w=" << par[5]*r_g

<< "u=" << par[7]*r_g << '\n';


cout << " =" << dV_as << '\n';


clrscr();


Fl_ka = 0;

Fl_ki = 1;

}

else

{

if (R_t > R_n)

{

Rp_p = R_n;

Ra_p = R_t;

a_p = (Ra_p+Rp_p)/2.;

e_p = 1-Rp_p/a_p;

p_p = a_p*(1-e_p*e_p);


Vk = sqrt(mu_z/p_p)*(1-e_p);

}

else

{

Rp_p = R_t;

Ra_p = R_n;

a_p = (Ra_p+Rp_p)/2.;

e_p = 1-Rp_p/a_p;

p_p = a_p*(1-e_p*e_p);


Vk = sqrt(mu_z/p_p)*(1+e_p);

}

real dV = Vk-V_t;

real dVmax = 20*25./m;


cout << "\n dV=" << dV << " dVmax 20 =" << dVmax;


if (fabs(dV) > dVmax)

{

akor[0] = Sig_a*(25./m)*f[3]/V_t;

akor[1] = Sig_a*(25./m)*f[4]/V_t;

akor[2] = Sig_a*(25./m)*f[5]/V_t;

cout << "\n dV=" << dV << "dVmax=" << dVmax;

cout << "\n :" << akor[0] << '\t' << akor[1]

<< '\t' << akor[2] << '\t' <<

sqrt(akor[0]*akor[0]+akor[1]*akor[1]+akor[2]*akor[2]) << '\n';


dV_as = dV_as+dVmax;

cout << " =" << dV_as << '\n';

}

else

{

akor[0] = Sig_a*(fabs(dV)/dVmax)*(25./m)*f[3]/V_t;

akor[1] = Sig_a*(fabs(dV)/dVmax)*(25./m)*f[4]/V_t;

akor[2] = Sig_a*(fabs(dV)/dVmax)*(25./m)*f[5]/V_t;

cout << "\n dV=" << dV << " dVmax=" << dVmax;

cout << "\n :" << akor[0] << '\t' << akor[1]

<< '\t' << akor[2] << '\t' <<

sqrt(akor[0]*akor[0]+akor[1]*akor[1]+akor[2]*akor[2]) << '\n';


dV_as = dV_as+fabs(dV);

cout << " =" << dV_as << '\n';

}


if (dVmax > fabs(dV))

{

dVmax = fabs(dV);

real Vk_r = Sig_a*dVmax+V_t;

real Ra_r = R_t;

real e_r = -(Vk_r*Vk_r*Ra_r/mu_z)+1;

real a_r = Ra_r/(1+e_r);

real p_r = a_r*(1-e_r*e_r);

real Rp_r = a_r*(1-e_r);

cout << " : \n" << "Rp_r=" << Rp_r

<< "Ra_r=" << Ra_r << "\n p_r=" << p_r << "a_r="

<< a_r << "e_r=" << e_r << '\n';

}

else

{

real Vk_r = Sig_a*dVmax+V_t;

real Ra_r = R_t;

real e_r = -(Vk_r*Vk_r*Ra_r/mu_z)+1;

real a_r = Ra_r/(1+e_r);

real p_r = a_r*(1-e_r*e_r);

real Rp_r = a_r*(1-e_r);

cout << " : \n" << "Rp_r=" << Rp_r

<< "Ra_r=" << Ra_r << "\n p_r=" << p_r << "a_r="

<< a_r << "e_r=" << e_r << '\n';

}

T_vd = t;

cout << ".. t=" << T_vd << '\n';

}

}


if (Fl_lu)

{

real di = par[4]-parn[4];

cout << " - di: " << di*r_g << " \n";

cout << "w=" << par[5]*r_g << "u=" << par[7]*r_g << '\n';

real l,ln;

l = -(w_z-w_s)*par[6];

ln = -(w_z-w_s)*parn[6];

dl = -(w_z-w_s)*(par[6]-parn[6]);

cout << "T=" << par[6] << "T=" << parn[6] << "T-T="

<< par[6]-parn[6] << '\n' << "l=" << l*r_g << "l="

<< ln*r_g << "l-l=" << (l-ln)*r_g << "dl=" << dl

<< "\n i=" << par[4]*r_g << "i=" << parn[4]*r_g << '\n';

cout << " : \n " << "Rp="

<< par[2]*(1-par[1]) << "Ra=" << par[2]*(1+par[1])

<< " \n p=" << par[0] << "a=" << par[2] << "e="

<< par[1] << " \n T=" << par[6] << "w=" << par[5]*r_g

<< "u=" << par[7]*r_g << " \n i=" << par[4]*r_g << '\n';

clrscr();


real Vk_x,Vk_y,Vk_z;

if (fabs(di) < .0001*g_r)

{

Fl_ki = 0;

cout << " \n "

<< "di=" << (par[4]-parn[4])*r_g << "t=" << t << '\n';

cout << " : \n " << "Rp="

<< par[2]*(1-par[1]) << "Ra=" << par[2]*(1+par[1])

<< " \n p=" << par[0] << "a=" << par[2] << "e="

<< par[1] << " \n T=" << par[6] << "w=" << par[5]*r_g

<< "u=" << par[7]*r_g << " \n i=" << par[4]*r_g << '\n';

cout << " =" << dV_is

<< '\n';


clrscr();

}

else

{

real teta;

if (par[7] > par[5])

teta = 2*M_PI+par[7]-par[5];

else

teta = par[7]-par[5];


real Vr_i = sqrt(mu_z/par[0])*par[1]*sin(teta);

real Vn_i = sqrt(mu_z/par[0])*(1+par[1]*cos(teta));

V_t = sqrt(f[3]*f[3]+f[4]*f[4]+f[5]*f[5]);


Vk_x = -Vn_i*cos(parn[4])*sin(par[3])+Vr_i*cos(par[3]);

Vk_y = Vn_i*cos(parn[4])*cos(par[3])+Vr_i*sin(par[3]);

Vk_z = Vn_i*sin(parn[4]);

Vk = sqrt(Vk_x*Vk_x+Vk_y*Vk_y+Vk_z*Vk_z);


real dV_x = Vk_x-f[3];

real dV_y = Vk_y-f[4];

real dV_z = Vk_z-f[5];

real dV = sqrt(dV_x*dV_x+dV_y*dV_y+dV_z*dV_z);


real dVmax = 20*25./m;

cout << "V=" << V_t << "V=" << Vk << "teta=" << teta*r_g

<< '\n';

cout << "dV=" << dV << "dVmax 20 =" << dVmax;


if (dV > dVmax)

{

akor[0] = (25./m)*dV_x/dV;

akor[1] = (25./m)*dV_y/dV;

akor[2] = (25./m)*dV_z/dV;

cout << "\n :" << akor[0] << '\t' << akor[1] <<

'\t' << akor[2] << '\t' <<

sqrt(akor[0]*akor[0]+akor[1]*akor[1]+akor[2]*akor[2]) << '\n';


dV_is = dV_is+dVmax;

cout << " =" << dV_is << '\n';

}

else

{

akor[0] = (fabs(dV)/dVmax)*(25./m)*dV_x/dV;

akor[1] = (fabs(dV)/dVmax)*(25./m)*dV_y/dV;

akor[2] = (fabs(dV)/dVmax)*(25./m)*dV_z/dV;

cout << "\n :" << akor[0] << '\t' << akor[1]

<< '\t' << akor[2] << '\t'<<

sqrt(akor[0]*akor[0]+akor[1]*akor[1]+akor[2]*akor[2]) << '\n';


dV_is = dV_is+fabs(dV);

cout << " =" << dV_is << '\n';

}


T_vd = t;

cout << ".. t=" << T_vd << '\n';

}

}


if ((!Fl_ka) && (!Fl_kp) && (!Fl_ki))

{

cout << " !" << '\n';


real m_t;

dV_ss = dV_ps+dV_as+dV_is;

m_t = m*(1-exp(-dV_ss/W));

cout << " : \n - dV_ps="

<< dV_ps << "\n dV_as=" << dV_as

<< "\n =" << dV_ss << " =" << m_t

<< '\n';


dV_ps = 0;

dV_as = 0;

dV_is = 0;

dV_ss = 0;

m_t = 0;

}

}

}


void par_or(real *f, real *par)

{

real x = f[0];

real y = f[1];

real z = f[2];

real Vx = f[3];

real Vy = f[4];

real Vz = f[5];


real c1 = (y*Vz-z*Vy);

real c2 = (z*Vx-x*Vz);

real c3 = (x*Vy-y*Vx);

real C = sqrt(c1*c1+c2*c2+c3*c3);


par[0] = (C/mu_z)*C;


real R_ka = sqrt(x*x+y*y+z*z);

real V_ka = sqrt(Vx*Vx+Vy*Vy+Vz*Vz);


real f1 = (Vy*c3-Vz*c2)-(mu_z*x/R_ka);

real f2 = (Vz*c1-Vx*c3)-(mu_z*y/R_ka);

real f3 = (Vx*c2-Vy*c1)-(mu_z*z/R_ka);

real F = sqrt(f1*f1+f2*f2+f3*f3);


real h = V_ka*V_ka-(2*mu_z/R_ka);


if ((1+h*C*C/(mu_z*mu_z)) < 0)

{

cout << " ! \n";

getch();

}


par[1] = F/mu_z;


if ((1-par[1]*par[1]) < 0)

{

cout << " (1-e*e) < 0 ! \n";

getch();

}


par[2] = par[0]/(1-par[1]*par[1]);


par[4] = acos(c3/C);


real s_Om = c1/(C*sin(par[4]));

real c_Om = -c2/(C*sin(par[4]));


if (s_Om >= 0)

par[3] = acos(c_Om);

else

par[3] = 2*M_PI-acos(c_Om);


real c_om = (f1*cos(par[3])+f2*sin(par[3]))/F;

real s_om = f3/(F*sin(par[4]));


if (s_om > 0)

par[5] = acos(c_om);

else

par[5] = 2*M_PI - acos(c_om);


if (par[2] < 0)

{

cout << " ! \n";

getch();

}


par[6] = 2*M_PI*sqrt((par[2]/mu_z)*par[2]*par[2]);


real c_u = (x*cos(par[3])+y*sin(par[3]))/R_ka;

real s_u = z/(R_ka*sin(par[4]));


if (s_u > 0)

par[7] = acos(c_u);

else

par[7] = 2*M_PI - acos(c_u);

}


#include "rk5.h"

#include


void Drkgs(real *prmt,real *y,real *dery,int ndim,int& ihlf,

void (*fct)(real &,real*,real*),

void (*out_p)(real,real*,real*,int,int,real*))

{

static real a[] = { 0.5, 0.292893218811345248, 1.70710678118665475,

0.16666666666666667 };

static real b[] = { 2.0, 1.0, 1.0, 2.0 };

static real c[] = { 0.5, 0.292893218811345248, 1.70710678118665475, 0.5 };

real *aux[8];

int i,j,imod,itest,irec,istep,iend;

real delt,aj,bj,cj,r,r1,r2,x,xend,h;

for (i=0; i<8; i++) aux[i] = new real[ndim];

for (i=0; i

x = prmt[0];

xend = prmt[1];

h = prmt[2];

prmt[4] = 0.0;


fct(x,y,dery);

r = h*(xend-x);

if (r <= 0.0)

{

ihlf = 13;

if (r == 0.0) ihlf = 12;

goto l39;

}

for(i=0; i

{

aux[0][i] = y[i];

aux[1][i] = dery[i];

aux[2][i] = 0.0;

aux[5][i] = 0.0;

}

irec = 0;

h = h+h;

ihlf = -1;

istep = 0;

iend = 0;

l4: r = (x+h-xend)*h;

if (r >= 0.0)

{

iend = 1;

if (r > 0.0) h = xend-x;

}

out_p(x,y,dery,irec,ndim,prmt);

if (prmt[4] != 0.0) goto l40;

itest = 0;

l9: istep++;

j = 0;

l10: aj = a[j];

bj =b[j];

cj = c[j];

for (i=0; i

{

r1 = h*dery[i];

r2 = aj*(r1-bj*aux[5][i]);

y[i] = y[i]+r2;

r2 = r2+r2+r2;

aux[5][i] += r2-cj*r1;

}

if (j-3 < 0)

{

j++;

if (j-2 != 0) x = x+0.5*h;

fct(x,y,dery);

goto l10;

}

if (itest <= 0)

{

for (i=0; i

itest = 1;

istep = istep+istep-2;

l18: ihlf++;

x = x-h;

h = 0.5*h;

for (i=0; i

{

y[i] = aux[0][i];

dery[i] = aux[1][i];

aux[5][i] = aux[2][i];

}

goto l9;

}

imod = istep/2;

if (istep-imod-imod != 0)

{

fct(x,y,dery);

for (i=0; i

{

aux[4][i] = y[i];

aux[6][i] = dery[i];

}

goto l9;

}

delt = 0.0;

for (i=0; i

delt += aux[7][i]*fabs(aux[3][i]-y[i]);

if (delt-prmt[3] > 0.0)

{

if (ihlf-10 >= 0)

{

ihlf = 11;

fct(x,y,dery);

goto l39;

}

for (i=0; i

istep = istep+istep-4;

x = x-h;

iend = 0;

goto l18;

}

fct(x,y,dery);

for (i=0; i

{

aux[0][i] = y[i];

aux[1][i] = dery[i];

aux[2][i] = aux[5][i];

y[i] = aux[4][i];

dery[i] = aux[6][i];

}

out_p(x-h,y,dery,ihlf,ndim,prmt);

if (prmt[4] != 0) goto l40;

for (i=0; i

{

y[i] = aux[0][i];

dery[i] = aux[1][i];

}

irec = ihlf;

if (iend > 0) goto l39;

ihlf--;

istep = istep/2;

h = h+h;

if (ihlf < 0) goto l4;

imod = istep/2;

if ((istep-2*imod != 0) || (delt-0.02*prmt[3] > 0.0)) goto l4;

ihlf--;

istep = istep/2;

h = h+h;

goto l4;

l39: out_p(x,y,dery,ihlf,ndim,prmt);

l40: for (i=0; i

return;

}


6.3. INIT.H


ifndef _INIT

#define _INIT


#include "def.h"

#include

#include


ifstream if_init;


void nex_ln (void);


void init_m()

{

Np = 150;

t_beg = 0;

t_end = 8000000;

dt = 2;

toler = .05;


dTp = (t_end-t_beg)/float(Np);

Curp = 0;


J1 = 532;

J2 = 563;

J3 = 697;

m = 597.;

W = 2200;


mu_z = 3.9858e14;

mu_s = 1.3249e20;

mu_l = 4.9027e12;


w_s = 2*M_PI/(365.2422*24*3600);

w_z = 2*M_PI/(24*3600);

w_l = 2*M_PI/(27.32*24*3600);

ww_l = 2*M_PI/(18.6*365.2422*24*3600);


parn[0] = 6952137.;

parn[1] = 0;

parn[2] = 6952137;

parn[3] = 28.1*g_r;

parn[4] = 97.6*g_r;

parn[5] = 63.1968*g_r;

parn[6] = 5769.;

parn[7] = 5.751*g_r;


Fl_u = 1;

u_last = parn[7];


Fl_ka = 0;

Fl_kp = 0;

Fl_ki = 0;

Fl_p = 0;

Fl_a = 0;

Fl_i = 0;

Fl_pkT = 0;

Tkor = 0;

T_vd = 0;

akor[0] = 0;

akor[1] = 0;

akor[2] = 0;

dV_ps = 0;

dV_as = 0;

dV_is = 0;

dV_ss = 0;

Fl_l0 = 0;

Fl_l1 = 0;

Fl_pki = 0;


real x0 = 6137262.9+7000;

real y0 = 3171846.1+7000;

real z0 = 689506.95+7000;

real Vx0 = -201.288+5;

real Vy0 = -1247.027+5;

real Vz0 = 7472.65+5;


prmt[0] = t_beg;

prmt[1] = t_end;

prmt[2] = dt;

prmt[3] = toler;

prmt[4] = 0.0;


y_main[0] = x0;

y_main[1] = y0;

y_main[2] = z0;

y_main[3] = Vx0;

y_main[4] = Vy0;

y_main[5] = Vz0;

}


void nex_ln (void)

{

char ch;

if_init.get(ch);

while (ch != '\n')

if_init.get(ch);

}

#endif


6.4 DEF.H


#ifndef _DEFH

#define _DEFH


#include


typedef long double real;


extern const float g_r;

extern const float r_g;


extern int Np;

extern int Curp;

extern real dTp;

extern real t_beg;

extern real t_end;

extern real dt;

extern real toler;

extern real J1,J2,J3;

extern real mu_z;

extern real mu_s;

extern real mu_l;

extern real m;

extern real m_t;

extern real W;

extern real w_s;

extern real w_z;

extern real w_l;

extern real ww_l;

extern real xs,ys,zs;

extern real xl,yl,zl;

extern real Fz,Fs,Fl,Fa,U20;

extern int nomin;

extern real par[8];

extern real parn[8];

extern real a_p,e_p,p_p,Om_p,i_p,om_p,Rp_p,Ra_p;

extern real y_main[6];

extern real prmt[5];

extern int Fl_u;

extern real u_last;

extern int Fl_ka;

extern int Fl_kp;

extern int Fl_ki;

extern int Fl_i;

extern int Fl_p;

extern int Fl_a;

extern int Fl_lu;

extern int Fl_pkT;

extern real dl;

extern real T_vd;

extern real dRa;

extern real dRp;

extern int Sig;

extern int Sig_a;

extern real Vkor[3];

extern real akor[3];

extern real Tkor;

extern real Tkore;

extern real dV_ps;

extern real dV_as;

extern real dV_is;

extern real dV_ss;

extern int Fl_l0;

extern int Fl_l1;

extern int Fl_pki;


#endif


6.5 SFUN.H


#ifndef _SFUN

#define _SFUN


#include "def.h"

#include

#include

#include


void out_p(real x,real *y,real*,int,int,real *);

real interpl(real*,real*,int,real);

void fct(real& ,real *y,real *dery);

void par_or(real *,real *);


#endif


6.5 RK5.H


#ifndef _RK5

#define _RK5

#include "def.h"

#include

#include

#include "sfun.h"


void Drkgs(real *prmt,real *y,real *dery,int ndim,int& ihlf,

void (*fct)(real&,real*,real*),

void (*out_p)(real,real*,real*,int,int,real*));


#endif


6.6


clc

g_r = pi/180;

r_g = 180/pi;

load m_y.dat

t = m_y(:,1);

x = m_y(:,2);

y = m_y(:,3);

z = m_y(:,4);

Vx = m_y(:,5);

Vy = m_y(:,6);

Vz = m_y(:,7);

clear m_y;

s_tmp = size(t);

s_m = s_tmp(1);

clear s_tmp;

load m_f.dat

Fz = m_f(:,2);

Fs = m_f(:,3);

Fl = m_f(:,4);

Fa = m_f(:,5);

U20 = m_f(:,6);

clear m_f;

load m_s.dat

xs = m_s(:,2);

ys = m_s(:,3);

zs = m_s(:,4);

clear m_s;

load m_par.dat

p = m_par(:,2);

e = m_par(:,3);

a = m_par(:,4);

Om = m_par(:,5);

i = m_par(:,6);

omg = m_par(:,7);

T = m_par(:,8);

u = m_par(:,9);

clear m_par;

p_n = 6952137.;

e_n = 0;

a_n = 6952137.;

Om_n0 = 28.1*g_r;

i_n = 97.6*g_r;

omg_n = 346.725*g_r;

T_n = 5765;

ws = 2*pi/(365.2422*24*3600);

for j = 1:s_m, tmp(j) = Om_n0+ws*t(j);

end

Om_n = tmp';

clear tmp;

map = [1,1,1];

colormap(map);

plot(t,p,'y-',[min(t) max(t)],[p_n p_n],'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t,p-p_n,'y-'), title (' dp '), grid on;

print -dwin;

pause;

plot(t,e,'y-',[min(t) max(t)],[e_n e_n],'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t,e-e_n,'y-'), title (' de '), grid on;

print -dwin;

pause;

plot(t,a,'y-',[min(t) max(t)],[a_n a_n],'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t,a-a_n,'y-'), title (' da '), grid on;

print -dwin;

pause;

plot(t,Om*r_g,'y-',t,Om_n*r_g,'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t,Om*r_g-Om_n*r_g,'y-'), title (' dOm '), grid on;

print -dwin;

pause;

plot(t,i*r_g,'y-',[min(t) max(t)],[i_n*r_g i_n*r_g],'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t,i*r_g-i_n*r_g,'y-'), title (' di '), grid on;

print -dwin;

pause;

plot(t,T,'y-',[min(t) max(t)],[T_n T_n], 'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t,T-T_n,'y-'), title (' dT '), grid on;

print -dwin;

pause;

plot3(x,y,z,'b')

axis([min(x) max(x) min(y) max(y) min(z) max(z)])

set(gca,'box','on')

title (' ')

hold on

plt = plot3(0,0,0,'.','erasemode','xor','markersize',24);

dk = ceil(length(y)/2500);

for k = 1:dk:length(y)

set(plt,'xdata',x(k),'ydata',y(k),'zdata',z(k))

drawnow

end

hold off

pause;

plot(t,Fz,'y-'), title (' ' ), grid on;

print -dwin;

pause;

plot(t,Fs,'y-'), title (' '), grid on;

print -dwin;

pause;

plot(t,Fl,'y-'), title (' '), grid on;

print -dwin;

pause;

plot(t,Fa,'y-'), title (' '), grid on;

print -dwin;

pause;

plot(t,U20,'y-'), title (' '), grid on;

print -dwin;

pause;

plot(t,Fz+Fs+Fl+Fa+U20,'y-'), title (' '), grid on;

print -dwin;

pause;

clear all


clc

g_r = pi/180;

r_g = 180/pi;

p_n = 6952137.;

e_n = 0;

a_n = 6952137.;

Om_n0 = 28.1*g_r;

i_n = 97.6*g_r;

omg_n = 346.725*g_r;

T_n = 5765;

load u_par.dat

t_u = u_par(:,1);

p_u = u_par(:,2);

e_u = u_par(:,3);

a_u = u_par(:,4);

Om_u = u_par(:,5);

i_u = u_par(:,6);

omg_u = u_par(:,7);

T_u = u_par(:,8);

u_u = u_par(:,9);

clear u_par;

load u_f.dat;

Fz_u = u_f(:,2);

Fs_u = u_f(:,3);

Fl_u = u_f(:,4);

Fa_u = u_f(:,5);

U20_u = u_f(:,6);

clear u_f;

s_tmp = size(t_u);

s_m_u = s_tmp(1);

clear s_tmp;

ws = 2*pi/(365.2422*24*3600);

for j = 1:s_m_u, tmp(j) = Om_n0+ws*t_u(j);

end

Om_n_u = tmp';

clear tmp;

plot(t_u,p_u,'y-',[min(t_u) max(t_u)],[p_n p_n],'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t_u,p_u-p_n,'y-'), title (' dp '), grid on;

print -dwin;

pause;

plot(t_u,e_u,'y-',[min(t_u) max(t_u)],[e_n e_n],'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t_u,e_u-e_n,'y-'), title (' de '), grid on;

print -dwin;

pause;

plot(t_u,a_u,'y-',[min(t_u) max(t_u)],[a_n a_n],'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t_u,a_u-a_n,'y-'), title (' da '), grid on;

print -dwin;

pause;

plot(t_u,Om_u*r_g,'y-',t_u,Om_n_u*r_g,'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t_u,Om_u*r_g-Om_n_u*r_g,'y-'), title (' dOm '), grid on;

print -dwin;

pause;

plot(t_u,i_u*r_g,'y-',[min(t_u) max(t_u)],[i_n*r_g i_n*r_g],'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t_u,i_u*r_g-i_n*r_g,'y-'), title (' di '), grid on;

print -dwin;

pause;

plot(t_u,T_u,'y-',[min(t_u) max(t_u)],[T_n T_n], 'r-'), title (' '), grid on;

print -dwin;

pause;

plot(t_u,T_u-T_n,'y-'), title (' dT '), grid on;

print -dwin;

pause;

clear all

98



: - 150 . - 700 . - 2500 . 2. 2.1. ( , ,

 

 

 

! , , , .
. , :