1 /*
2  *  - - - - - - - - - - - -
3  *   g a l _ b j u p v 8 7
4  *  - - - - - - - - - - - -
5  *
6  *  This routine is part of the General Astrodynamics Library
7  *
8  *  Description:
9  *
10  *  Jupiter barycentric position and velocity, with respect to the
11  *  FK5 Reference Frame.
12  *
13  *  Status:
14  *
15  *     internal support routine.
16  *
17  *  Given:
18  *
19  *     tt1                 d            TT epoch part 1 (Note 1)
20  *     tt2                 d            TT epoch part 2 (Note 1)
21  *     ref                 i            Reference frame
22  *                                        0 = dynamical equinox and ecliptic J2000.
23  *                                        1 = FK5 (VSOP87)
24  *
25  *  Returned:
26  *
27  *     pv               d[2][3]         position/velocity (AU, AU/Day)
28  *
29  *  Called:
30  *
31  *     gal_vsop87                       Compute VSOP87 position and velocity
32  *
33  *  Notes:
34  *
35  *  1) The epoch tt1+tt2 is a Julian Date, apportioned in
36  *     any convenient way between the two arguments.  For example,
37  *     JD(TDB)=2450123.7 could be expressed in any of these ways,
38  *     among others:
39  *
40  *               tt1          tt2
41  *
42  *         2450123.7          0.0       (JD method)
43  *         2451545.0      -1421.3       (J2000 method)
44  *         2400000.5      50123.2       (MJD method)
45  *         2450123.5          0.2       (date & time method)
46  *
47  *     The JD method is the most natural and convenient to use in
48  *     cases where the loss of several decimal digits of resolution
49  *     is acceptable.  The J2000 method is best matched to the way
50  *     the argument is handled internally and will deliver the
51  *     optimum resolution.  The MJD method and the date & time methods
52  *     are both good compromises between resolution and convenience.
53  *     However, the accuracy of the result is more likely to be
54  *     limited by the algorithm itself than the way the epoch has been
55  *     expressed.
56  *
57  *  2) On return, the arrays pvh and pvb contain the following:
58  *
59  *        pv[0][0]  x       }
60  *        pv[0][1]  y       } position, AU
61  *        pv[0][2]  z       }
62  *
63  *        pv[1][0]  xdot    }
64  *        pv[1][1]  ydot    } velocity, AU/day
65  *        pv[1][2]  zdot    }
66  *
67  *     The vectors are barycentric with respect to the FK5 Reference Frame.
68  *     The time unit is one day in TT
69  *
70  *  3) The routine is a soution from the planetary theory VSOP87
71  *
72  *  4) The main version of VSOP87 is similar to the previous theory VSOP82.
73  *     In the both cases the constants of integration have been determined by
74  *     fitting to the numerical integration DE200 of the Jet Propulsion Laboratory.
75  *
76  *     The differences between VSOP87 and VSOP82 mainly improve the validity time-span
77  *     for Mercury, Venus, Earth-Moon barycenter and Mars with a precision of 1" for
78  *     4000 years before and after J2000.
79  *     The same precision is ensured for Jupiter and Saturn over 2000 years and for
80  *     Uranus and Neptune over 6000 years before and after J2000.
81  *
82  *     The size of the relative precision p0 of VSOP87 solutions is given hereunder.
83  *     That means that the actual precision is close by p0*a0 au for the distances
84  *     (a0 being the semi-major axis) and close by p0 radian for the other variables.
85  *     By derivation with respect to time expressed in day (d), the precision of the
86  *     velocities is close by p0*a0 au/d for the distances and close by p0 radian/d
87  *     for the other variables.
88  *
89  *     Body          a0 (au)      p0 (10**-8)
90  *     ----          -------      -----------
91  *     Mercury        0.3871          0.6
92  *     Venus          0.7233          2.5
93  *     Earth          1.0000          2.5
94  *     Mars           1.5237         10.0
95  *     Jupiter        5.2026         35.0
96  *     Saturn         9.5547         70.0
97  *     Uranus        19.2181          8.0
98  *     Neptune       30.1096         42.0
99  *
100  *  References:
101  *
102  *     Bretagnon P., Francou G., : 1988, Astron. Astrophys., 202, 309.
103  *
104  *  This revision:
105  *
106  *     2008 June 29
107  *
108  *  Copyright (C) 2008 Paul C. L. Willmott. See notes at end.
109  *
110  *-----------------------------------------------------------------------
111  */
112 
113 #ifndef _GAL_BJUPV87_H_
114 #define _GAL_BJUPV87_H_ 1
115 
116 #undef __BEGIN_DECLS
117 #undef __END_DECLS
118 #ifdef __cplusplus
119 #define __BEGIN_DECLS extern "C" {
120 #define __END_DECLS }
121 #else
122 #define __BEGIN_DECLS /* empty */
123 #define __END_DECLS   /* empty */
124 #endif
125 
126 __BEGIN_DECLS
127 
128 void
129 gal_bjupv87
130  (
131     double tt1,
132     double tt2,
133     int ref,
134     double pv[2][3]
135  ) ;
136 
137 __END_DECLS
138 
139 #endif /* !_GAL_GAL_BJUPV87_H_ */
140 
141 /*
142  *  gal - General Astrodynamics Library
143  *  Copyright (C) 2008 Paul C. L. Willmott
144  *
145  *  This program is free software; you can redistribute it and/or modify
146  *  it under the terms of the GNU General Public License as published by
147  *  the Free Software Foundation; either version 2 of the License, or
148  *  (at your option) any later version.
149  *
150  *  This program is distributed in the hope that it will be useful,
151  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
152  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
153  *  GNU General Public License for more details.
154  *
155  *  You should have received a copy of the GNU General Public License along
156  *  with this program; if not, write to the Free Software Foundation, Inc.,
157  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
158  *
159  *  Contact:
160  *
161  *  Paul Willmott
162  *  vp9mu@amsat.org
163  */
164