Now this is not the end. It is not even the beginning of the end. But it is, perhaps, the end of the beginning.
(Sir Winston Churchill1874 - 1965)
C
HAPTERof these systems would represent a useful accomplishment. The use of second-order approximations for the analytical approach could also extend the validity of the stability considerations to QSOs with larger amplitudes.
A study of resonant orbits is also required as these represent the lowest altitude stable orbits for Phobos and are particularly interesting for approach or close observation orbits. Such study would imply the utilization of a more accurate dynamics model. In the system Mars-Phobos it is possible that in distances close to the libration points, just above the moon’s surface, chaotic regions can be found.
The study of FLI maps could be an asset to find these chaotic regions. A future study on transfer orbits between QSOs and respective optimization would also be an asset.
Any future works should look to apply their conclusions to systems of interest such as the systems Jupiter-Europa, or Saturn-Titan. These moons are known to be potential targets of future missions and the study of their orbital mechanics is an advantage for mission designers.
A
PPENDIXA Programming Code
This code was developed in the Linux OS Ubuntu and compiled with thegcccompiler (version 4.6.2) using the compilation options-g -lm -Wall -std=c99.
# i n c l u d e<s t d i o . h>
# i n c l u d e<math . h>
# i n c l u d e<t i m e . h>
# d e f i n e DIM 6
/ / S t r u c t u r e w i t h t h e o r b i t data t y p e d e f s t r u c t Trajectory {
l o n g double FLI, d_min, d_max; l o n g double x[DIM] , phi[DIM] [DIM] ;
} TRAJ;
/ / F u n c t i o n t o c o n v e r t from d i m e n s i o n a l t o p u l s a t i n g c o o r d i n a t e s
v o i d todimless (l o n g double ∗v, l o n g double a, l o n g double e, l o n g double f, l o n g double n, l o n g double mu←- ) ;
/ / F u n c t i o n t o c o n v e r t from p u l s a t i n g t o d i m e n s i o n a l c o o r d i n a t e s
v o i d todim(l o n g double ∗v, l o n g double a, l o n g double e, l o n g double f, l o n g double n, l o n g double mu) ;
/ / F u n c t i o n t h a t m u l t i p l i e s m a t r i c e s− v=v1∗v2
v o i d multm (l o n g double v[DIM] [DIM] , l o n g double v1[DIM] [DIM] , l o n g double v2[DIM] [DIM] ) ;
/ / RHS f u n c t i o n o f t h e e q u a t i o n s o f motion
v o i d motion (l o n g double ∗dx, l o n g double ∗v, l o n g double f, l o n g double mu, l o n g double e) ;
/ / RHS f u n c t i o n o f t h e v a r i a t i o n a l e q u a t i o n s
v o i d variation (l o n g double dphi[DIM] [DIM] , l o n g double phi[DIM] [DIM] , l o n g double ∗x, l o n g double f, l o n g←- double mu, l o n g double e) ;
/ / I n t e g r a t i o n f u c n t i o n w i t h Runge−K u t t a 8 method
v o i d rk8 (TRAJ ∗orbit, l o n g double f_0, l o n g double f_f, l o n g double h, l o n g double mu, l o n g double e, ←- l o n g double n, l o n g double sma) ;
/ / Main F u n c t i o n i n t main( ){
/ / V a r i a b l e s d e f i n i t i o n FILE ∗fp;
char ∗file_name=” R e s u l t s . t x t ”;
l o n g double f_0, f_f, h, pi, mu, M_ph, M_m, e, a, n, G;
i n t i, j;
TRAJ orbit, ∗ptr_orbit; clock_t start, end; double cpu_time_used;
/ / Compute S t a r t i n g Time start = clock( ) ;
/ / P o i n t e r t o o r b i t data ptr_orbit=&orbit;
/ / Constants
M_m = 6.4185∗pow( 1 0 , 2 3 ) ; / / mass o f Mars [ kg ] M_ph = 1.06∗pow( 1 0 , 1 6 ) ; / / mass o f Phobos [ kg ] mu = M_ph/ (M_m+M_ph) ; / / mass parameter e = 0 . 0 1 5 1 ; / / Phobos ’ s e c c e n t r i c i t y a = 9377.2∗pow( 1 0 , 3 ) ; / / Semi−major a x i s [m]
G = 6.67384∗pow(10 ,−11) ;
n = sqrt(G∗(M_m+M_ph) /pow(a, 3 ) ) ; / / mean motion pi = acos(−1.0) ; / / c o n s t a n t p i
/ / I n i t i a l c o n d i t i o n s orbit.x[ 0 ] = 0 ; orbit.x[ 1 ] = −100;
orbit.x[ 2 ] = 0 ; orbit.x[ 3 ] = −0.02;
orbit.x[ 4 ] = 0 ; orbit.x[ 5 ] = 0 ;
/ / I n i t i a l i z a t i o n o f o r b i t parameters
orbit.d_min = sqrt(pow(orbit.x[ 0 ] , 2 ) +pow(orbit.x[ 1 ] , 2 ) +pow(orbit.x[ 2 ] , 2 ) ) ; orbit.d_max = sqrt(pow(orbit.x[ 0 ] , 2 ) +pow(orbit.x[ 1 ] , 2 ) +pow(orbit.x[ 2 ] , 2 ) ) ; orbit.FLI= 0 ;
f o r (i= 0 ; i<DIM; i++){
f o r (j= 0 ; j<DIM; j++){
i f (i==j)
orbit.phi[i] [j] = 1 ; e l s e
orbit.phi[i] [j] = 0 ; }
}
/ / C o m p u t a t i o n a l parameters h = pi/ 8 ; / / s t e p
f_0 = 0 ; / / i n i t i a l t r u e anomaly f_f = 2∗pi∗100; / / f i n a l t r u e anomaly
/ / Opens F i l e
fp=fopen(file_name,”w”) ;
/ / FILE opening v e r i f i c a t i o n i f (fp==NULL)
printf(”\n I m p o s s i b l e t o open f i l e %s\n ”,file_name) ; e l s e
printf(”\n F i l e %s s u c c e s s f u l l y open !\n ”,file_name) ;
/ / F i r s t L i n e on F i l e
fprintf(fp,” (∗T h i s f i l e c o n t a i n s data f o r m a t e d f o r Mathematica∗)\n{”) ;
/ / I n i t i a l c o n d i t i o n s i n p u l s a t i n g c o o r d i n a t e s todimless( ptr_orbit−>x, a, e, f_0, n, mu) ;
/ / O r b i t I n t e g r a t i o n
rk8(ptr_orbit, f_0, f_f, h, mu, e, n, a) ;
/ / R e s u l t s
todim(orbit.x, a, e, f_f, n, mu) ;
fprintf(fp,”\n{%Lf , %Lf , %Lf , %Lf , %Lf , %L f}\n ”,orbit.x[ 0 ] ,orbit.x[ 1 ] ,orbit.x[ 2 ] ,orbit.x[ 3 ] ,orbit.x[ 4 ] ,←- orbit.x[ 5 ] ) ;
printf(”\nMaximum D i s t a n c e : %L f km\nMinimum D i s t a n c e : %L f km\nFLI : %L f\n ”,orbit.d_max,orbit.d_min,orbit.←- FLI) ;
/ / F i n a l i z e s f i l e fprintf(fp,”}”) ;
/ / Closes f i l e fclose(fp) ;
/ / End o f t h e program
printf(”\nEnd o f t h e program !\n ”) ;
/ / Computation o f used cpu t i m e end = clock( ) ;
cpu_time_used = ( (double) (end− start) ) / CLOCKS_PER_SEC;
printf(”\nCPU Time : %f\n ”,cpu_time_used) ;
r e t u r n 0 ;
}
/ / F u n c t i o n t o c o n v e r t from d i m e n s i o n a l t o p u l s a t i n g c o o r d i n a t e s
v o i d todimless (l o n g double ∗v, l o n g double a, l o n g double e, l o n g double f, l o n g double n, l o n g double mu←- ){
i n t i;
l o n g double aux[DIM] ;
f o r (i= 0 ; i<DIM; i++) aux[i] =v[i] ;
v[ 0 ] =aux[ 0 ]∗( 1 +e∗cos(f) ) / (a∗(1−pow(e, 2 ) ) )∗pow( 1 0 , 3 ) ; v[ 1 ] =aux[ 1 ]∗( 1 +e∗cos(f) ) / (a∗(1−pow(e, 2 ) ) )∗pow( 1 0 , 3 ) ; v[ 2 ] =aux[ 2 ]∗( 1 +e∗cos(f) ) / (a∗(1−pow(e, 2 ) ) )∗pow( 1 0 , 3 ) ;
v[ 3 ] = (aux[3]−aux[ 1 ]∗n)∗(1+e∗cos(f) ) / (a∗(1−pow(e, 2 ) )∗n)∗pow( 1 0 , 3 ) ;
v[ 4 ] = (aux[ 4 ] +aux[ 0 ]∗n)∗(1+e∗cos(f) ) / (a∗(1−pow(e, 2 ) )∗n)∗pow( 1 0 , 3 ) +mu−1;
v[ 5 ] =aux[ 5 ]∗( 1 +e∗cos(f) ) / (a∗(1−pow(e, 2 ) )∗n)∗pow( 1 0 , 3 ) ;
}
/ / F u n c t i o n t o c o n v e r t from p u l s a t i n g t o d i m e n s i o n a l c o o r d i n a t e s
v o i d todim(l o n g double ∗v, l o n g double a, l o n g double e, l o n g double f, l o n g double n, l o n g double mu){
i n t i;
l o n g double aux[DIM] ;
f o r (i= 0 ; i<DIM; i++) aux[i] =v[i] ;
v[ 0 ] = aux[ 0 ] / ( 1 +e∗cos(f) )∗(a∗(1−pow(e, 2 ) ) ) /pow( 1 0 , 3 ) ; v[ 1 ] = aux[ 1 ] / ( 1 +e∗cos(f) )∗(a∗(1−pow(e, 2 ) ) ) /pow( 1 0 , 3 ) ; v[ 2 ] = aux[ 2 ] / ( 1 +e∗cos(f) )∗(a∗(1−pow(e, 2 ) ) ) /pow( 1 0 , 3 ) ;
v[ 3 ] = (aux[ 3 ] ) / ( 1 +e∗cos(f) )∗(a∗(1−pow(e, 2 ) )∗n) /pow( 1 0 , 3 ) +aux[ 1 ]∗n; v[ 4 ] = (aux[4]−mu+1) / ( 1 +e∗cos(f) )∗(a∗(1−pow(e, 2 ) )∗n) /pow( 1 0 , 3 )−aux[ 0 ]∗n;
v[ 5 ] = aux[ 5 ] / ( 1 +e∗cos(f) )∗(a∗(1−pow(e, 2 ) )∗n) /pow( 1 0 , 3 ) ;
}
/ / F u n c t i o n t h a t m u l t i p l i e s m a t r i c e s− v=v1∗v2
v o i d multm (l o n g double v[DIM] [DIM] , l o n g double v1[DIM] [DIM] , l o n g double v2[DIM] [DIM] ){
i n t i, j, ij;
f o r (i= 0 ; i<DIM; i++){
f o r (j= 0 ; j<DIM; j++){
v[i] [j] = 0 . 0 ; }
}
f o r (i= 0 ; i<DIM; i++){
f o r (j= 0 ; j<DIM; j++){
f o r (ij= 0 ; ij<DIM; ij++){
v[i] [j] =v[i] [j] +v1[i] [ij]∗v2[ij] [j] ; }
} }
}
/ / RHS f u n c t i o n o f t h e e q u a t i o n s o f motion
v o i d motion (l o n g double ∗dx, l o n g double ∗v, l o n g double f, l o n g double mu, l o n g double e){
l o n g double r1, r2;
/ / D i s t a n c e t o t h e f i r s t p r i m a r y
r1=sqrt(pow( (v[0]−1) , 2 ) +pow(v[ 1 ] , 2 ) +pow(v[ 2 ] , 2 ) ) ;
/ / D i s t a n c e t o t h e second p r i m a r y
r2=sqrt(pow(v[ 0 ] , 2 ) +pow(v[ 1 ] , 2 ) +pow(v[ 2 ] , 2 ) ) ;
dx[ 0 ] =v[ 3 ] +v[ 1 ] ; dx[ 1 ] =v[4]−v[0]−mu+ 1 ; dx[ 2 ] =v[ 5 ] ;
dx[ 3 ] =v[4]−v[0]−mu+1+1/(1+e∗cos(f) )∗(v[ 0 ] +mu−1−(v[0]−1)∗(1−mu) /pow(r1, 3 )−v[ 0 ]∗mu/pow(r2, 3 ) ) ; dx[4]=−v[3]−v[ 1 ] + 1 / ( 1 +e∗cos(f) )∗(v[1]−v[1]∗(1−mu) /pow(r1, 3 )−v[ 1 ]∗mu/pow(r2, 3 ) ) ;
dx[ 5 ] = 1 / ( 1 +e∗cos(f) )∗(−e∗v[ 2 ]∗cos(f)−v[2]∗(1−mu) /pow(r1, 3 )−v[ 2 ]∗mu/pow(r2, 3 ) ) ;
}
/ / RHS f u n c t i o n o f t h e v a r i a t i o n a l e q u a t i o n s
v o i d variation (l o n g double dphi[DIM] [DIM] , l o n g double phi[DIM] [DIM] , l o n g double ∗x, l o n g double f, l o n g←- double mu, l o n g double e){
l o n g double r1, r2, dh[DIM] [DIM] = {{0.0}}, J[DIM] [DIM] = {{0.0}}, A[DIM] [DIM] ;
/ / D i s t a n c e t o t h e f i r s t p r i m a r y
r1=sqrt(pow( (x[0]−1) , 2 ) +pow(x[ 1 ] , 2 ) +pow(x[ 2 ] , 2 ) ) ;
/ / D i s t a n c e t o t h e second p r i m a r y
r2=sqrt(pow(x[ 0 ] , 2 ) +pow(x[ 1 ] , 2 ) +pow(x[ 2 ] , 2 ) ) ;
/ / Hessian M a t r i x o f t h e H a m i l t o n i a n
dh[ 0 ] [ 0 ] = 1−1/(1+e∗cos(f) )∗(1+(3∗pow( (x[0]−1) , 2 ) /pow(r1, 5 )−1/pow(r1, 3 ) )∗(1−mu) + ( 3∗(pow(x[ 0 ] , 2 ) /pow(←- r2, 5 )−1/pow(r2, 3 ) )∗mu) ) ;
dh[ 0 ] [ 1 ] = −1/(1+e∗cos(f) )∗( 3∗(x[0]−1)∗x[1]∗(1−mu) /pow(r1, 5 ) +3∗x[ 0 ]∗x[ 1 ]∗mu/pow(r2, 5 ) ) ; dh[ 1 ] [ 0 ] = dh[ 0 ] [ 1 ] ;
dh[ 0 ] [ 2 ] = −1/(1+e∗cos(f) )∗( 3∗(x[0]−1)∗x[2]∗(1−mu) /pow(r1, 5 ) +3∗x[ 0 ]∗x[ 2 ]∗mu/pow(r2, 5 ) ) ; dh[ 2 ] [ 0 ] = dh[ 0 ] [ 2 ] ;
dh[ 1 ] [ 1 ] = 1−1/(1+e∗cos(f) )∗(1+(3∗pow(x[ 1 ] , 2 ) /pow(r1, 5 )−1/pow(r1, 3 ) )∗(1−mu) + ( 3∗(pow(x[ 1 ] , 2 ) /pow(r2←- , 5 )−1/pow(r2, 3 ) )∗mu) ) ;
dh[ 1 ] [ 2 ] = −1/(1+e∗cos(f) )∗(3∗x[ 1 ]∗x[2]∗(1−mu) /pow(r1, 5 ) +3∗x[ 1 ]∗x[ 2 ]∗mu/pow(r2, 5 ) ) ; dh[ 2 ] [ 1 ] = dh[ 1 ] [ 2 ] ;
dh[ 2 ] [ 2 ] = 1 / ( 1 +e∗cos(f) )∗(1+(3∗pow(x[ 2 ] , 2 ) /pow(r1, 5 )−1/pow(r1, 3 ) )∗(1−mu) + ( 3∗(pow(x[ 2 ] , 2 ) /pow(r2, 5 )←-
−1/pow(r2, 3 ) )∗mu)−e∗cos(f) ) ; dh[ 0 ] [ 4 ] = −1;
dh[ 4 ] [ 0 ] = dh[ 0 ] [ 4 ] ; dh[ 1 ] [ 3 ] = 1 ; dh[ 3 ] [ 1 ] = dh[ 1 ] [ 3 ] ; dh[ 3 ] [ 3 ] = 1 ; dh[ 4 ] [ 4 ] = 1 ; dh[ 5 ] [ 5 ] = 1 ;
J[ 0 ] [ 3 ] = 1 ; J[ 1 ] [ 4 ] = 1 ; J[ 2 ] [ 5 ] = 1 ; J[ 3 ] [ 0 ] = −1;
J[ 4 ] [ 1 ] = −1;
J[ 5 ] [ 2 ] = −1;
multm(A,J,dh) ; multm(dphi,A,phi) ;
}
/ / I n t e g r a t i o n f u c n t i o n w i t h Runge−K u t t a 8 method
v o i d rk8 (TRAJ ∗orbit, l o n g double f_0, l o n g double f_f, l o n g double h, l o n g double mu, l o n g double e, ←- l o n g double n, l o n g double sma){
/ / Method c o e f f i c i e n t s
l o n g double a1[ 1 3 ] [ 1 2 ] = {{ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0}, {1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0},
{1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0}, {1 , 0 , 3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0}, {5 , 0 , −75, 75 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0}, {3 , 0 , 0 , 3 , 3 , 0 , 0 , 0 , 0 , 0 , 0 , 0},
{29443841 , 0 , 0 , 77736538 , −28693883, 23124283 , 0 , 0 , 0 , 0 , 0 , 0},
{16016141 , 0 , 0 , 61564180 , 22789713 , 545815736 , −180193667, 0 , 0 , 0 , 0 , 0},
{39632708 , 0 , 0 , −433636366, −421739975, 100302831 , 790204164 , 800635310 , 0 , 0 , 0 , 0},
{246121993 , 0 , 0 , −37695042795, −309121744, −12992083, 6005943493 , 393006217 , 123872331 , 0 , 0 ,←- 0},
{−1028468189, 0 , 0 , 8478235783 , 1311729495 , −10304129995, −48777925059, 15336726248 , ←-
−45442868181, 3065993473 , 0 , 0},
{185892177 , 0 , 0 , −3185094517, −477755414, −703635378, 5731566787 , 5232866602 , −4093664535, ←- 3962137247 , 65686358 , 0},
{403863854 , 0 , 0 , −5068492393, −411421997, 652783627 , 11173962825 , −13158990841, 3936647629 , ←-
−160528059, 248638103 , 0}};
l o n g double a2[ 1 3 ] [ 1 2 ] = {{ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0}, {18 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0},
{48 , 16 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0}, {32 , 0 , 32 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0}, {16 , 0 , 64 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0}, {80 , 0 , 0 , 16 , 20 , 0 , 0 , 0 , 0 , 0 , 0 , 0},
{614563906 , 0 , 0 , 692538347 , 1125000000 , 1800000000 , 0 , 0 , 0 , 0 , 0 , 0}, {946692911 , 0 , 0 , 158732637 , 633445777 , 2771057229 , 1043307555 , 0 , 0 , 0 , 0 , 0}, {573591083 , 0 , 0 , 683701615 , 2616292301 , 723423059 , 839813087 , 3783071287 , 0 , 0 , 0 , 0},
{1340847787 , 0 , 0 , 15268766246 , 1061227803 , 490766935 , 2108947869 , 1396673457 , 1001029789 , 0 , ←- 0 , 0},
{846180014 , 0 , 0 , 508512852 , 1432422823 , 1701304382 , 3047939560 , 1032824649 , 3398467696 , ←- 597172653 , 0 , 0},
{718116043 , 0 , 0 , 667107341 , 1098053517 , 230739211 , 1027545527 , 850066563 , 808688257 , ←- 1805957418 , 487910083 , 0},
{491063109 , 0 , 0 , 434740067 , 543043805 , 914296604 , 925320556 , 6184727034 , 1978049680 , ←- 685178525 , 1413531060 , 0}};
l o n g double c1[ 1 3 ] ={0 , 1 , 1 , 1 , 5 , 3 , 59 , 93 , 5490023248 , 13 , 1201146811 , 1 , 1};
l o n g double c2[ 1 3 ] ={0 , 18 , 12 , 8 , 16 , 8 , 400 , 200 , 9719169821 , 20 , 1299019798 , 1 , 1};
l o n g double b1[13]={14005451 , 0 , 0 , 0 , 0 , −59238493, 181606767 , 561292985 , −1041891430, ←- 760417239 , 118820643 , −528747749, 1};
l o n g double b2[13]={335480064 , 0 , 0 , 0 , 0 , 1068277825 , 758867731 , 797845732 , 1371343529 , 1151165299 ,←- 751138087 , 2220607170 , 4};
i n t i, j, l, m;
l o n g double f, dx[DIM] , dphi[DIM] [DIM] , kx[DIM] [ 1 3 ] , kphi[DIM] [DIM] [ 1 3 ] , aux_x[DIM] , aux_phi[DIM] [DIM] , ←- D1[DIM] , D0[DIM] , r, p, d, alpha[DIM] , W0[DIM] [DIM] ={{0 . 0}}, W1[DIM] [DIM] , pi, x1, x2, freq= 0 ; l o n g double dim_x[DIM] , a[ 1 3 ] [ 1 2 ] , b[ 1 3 ] , c[ 1 3 ] ;
pi = acos(−1.0) ;
x1=orbit−>x[ 0 ] ;
/ / Method c o e f f c i e n t s f o r (i= 0 ; i<13; i++){
f o r (j= 0 ; j<12; j++){
i f (a2[i] [j] ! = 0 . 0 ) a[i] [j] =a1[i] [j] /a2[i] [j] ; e l s e
a[i] [j] = 0 . 0 ;
/∗i f ( a [ i ] [ j ] ! = 0 )
f p r i n t f ( fp , ” a(%d,%d ) = %L f\n ” , i +1 , j +1 , a [ i ] [ j ] ) ;∗/
}
i f (b2[i] ! = 0 ) b[i] =b1[i] /b2[i] ; e l s e
b[i] = 0 ;
i f (c2[i] ! = 0 ) c[i] =c1[i] /c2[i] ; e l s e
c[i] = 0 ; }
r = sqrt(pow(orbit−>x[ 0 ] , 2 ) +pow(orbit−>x[ 1 ] , 2 ) +pow(orbit−>x[ 2 ] , 2 ) ) ; p = sqrt(pow(orbit−>x[ 3 ] , 2 ) +pow(orbit−>x[ 4 ] , 2 ) +pow(orbit−>x[ 5 ] , 2 ) ) ;
f o r (i= 0 ; i<3; i++){
W0[i] [i] = 1 ; D0[i] = sqrt( 1 /r) ; }
f o r (i= 3 ; i<DIM; i++){
W0[i] [i] = 1 ; D0[i] = sqrt( 1 /p) ; }
/ / I n t e g r a t i o n over t i m e
f o r (f=f_0; f< f_f−0.1∗h;f=f+h){
/ / Computation o f k ’ s f o r (i= 1 ; i<=13; i++){
f o r (l= 0 ; l<DIM;l++){ aux_x[l] = 0 ;
f o r (m= 0 ; m<DIM;m++){
aux_phi[l] [m] = 0 ; }
}
f o r (l= 0 ; l<DIM;l++){ f o r (m= 0 ; m<DIM;m++){
f o r (j= 1 ;j<=i−1 ;j++){
i f (m==0)
aux_x[l] =aux_x[l] +a[i−1][j−1]∗kx[l] [j−1];
aux_phi[l] [m] =aux_phi[l] [m] +a[i−1][j−1]∗kphi[l] [m] [j−1];
}
aux_phi[l] [m] =orbit−>phi[l] [m] +h∗aux_phi[l] [m] ; }
aux_x[l] =orbit−>x[l] +h∗aux_x[l] ; }
motion(dx, aux_x, f+c[i−1]∗h, mu, e) ;
variation( dphi, aux_phi, aux_x, f+c[i−1] , mu, e) ; f o r (l= 0 ; l<DIM;l++){
kx[l] [i−1]=dx[l] ; f o r (m= 0 ; m<DIM;m++){
kphi[l] [m] [i−1]=dphi[l] [m] ; }
} }
/ / Computation x ( n +1) f o r (l= 0 ; l<DIM;l++){
aux_x[l] = 0 ;
f o r (m= 0 ; m<DIM;m++){ aux_phi[l] [m] = 0 ; }
}
f o r (l= 0 ; l<DIM;l++){
f o r (m= 0 ; m<DIM;m++){ f o r (i= 1 ;i<=13 ;i++){
i f (m==0)
aux_x[l] =aux_x[l] +b[i−1]∗kx[l] [i−1];
aux_phi[l] [m] =aux_phi[l] [m] +b[i−1]∗kphi[l] [m] [i−1];
}
orbit−>phi[l] [m] =orbit−>phi[l] [m] +h∗aux_phi[l] [m] ; }
orbit−>x[l] =orbit−>x[l] +h∗aux_x[l] ; }
x2=orbit−>x[ 0 ] ;
i f (x1< 0 && x2> 0 ) freq++;
x1 = x2;
/ / C o n v e r t i o n t o d i m e n s i o n a l c o o r d i n a t e s f o r (i= 0 ; i<DIM; i++){
dim_x[i] =orbit−>x[i] ; }
todim(dim_x, sma, e, f+h, n, mu) ;
/ / Computation o f r a d i u s and t o t a l momentum
d = sqrt(pow(dim_x[ 0 ] , 2 ) +pow(dim_x[ 1 ] , 2 ) +pow(dim_x[ 2 ] , 2 ) ) ; / / p = s q r t ( pow ( dim x [ 3 ] , 2 ) +pow ( dim x [ 4 ] , 2 ) +pow ( dim x [ 5 ] , 2 ) ) ; r = sqrt(pow(orbit−>x[ 0 ] , 2 ) +pow(orbit−>x[ 1 ] , 2 ) +pow(orbit−>x[ 2 ] , 2 ) ) ; p = sqrt(pow(orbit−>x[ 3 ] , 2 ) +pow(orbit−>x[ 4 ] , 2 ) +pow(orbit−>x[ 5 ] , 2 ) ) ;
/ / Update maximum and minimum d i s t a n c e s i f (d> orbit−>d_max)
orbit−>d_max = d;
i f (d< orbit−>d_min) orbit−>d_min = d;
/ / S t a b i l i t y c o n d i t i o n t o c o n t i n u e i n t e g r a t i o n i f (d> 1000 | | d< 15){
orbit−>FLI = 20− (f+h) / (f_f)∗10;
r e t u r n; }
/ / Computation o f b a s i s o f d e v i a t i o n v e c t o r s multm(W1,orbit−>phi,W0) ;
/ / Computation o f D1 f o r each d e v i a t i o n v e c t o r , and c o m p u t a t i o n o f a lph a w i t h l a r g e s t D1
f o r (i= 0 ; i<DIM; i++){
D1[i] =sqrt( (pow(W1[ 0 ] [i] , 2 ) +pow(W1[ 1 ] [i] , 2 ) +pow(W1[ 2 ] [i] , 2 ) ) /r+ (pow(W1[ 3 ] [i] , 2 ) +pow(W1[ 4 ] [i] , 2 ) +pow(←- W1[ 5 ] [i] , 2 ) ) /p) ;
alpha[i] = D1[i] /D0[i] ;
D0[i] =D1[i] ;
/ / Update FLI
i f (log(alpha[i] ) > orbit−>FLI) orbit−>FLI = log(alpha[i] ) ; }
}
printf(”\n O r b i t Frequency : %L f\n ”,freq/ 1 0 0 ) ; }
Num Exp.c