gr-qc0702151/pio.tex
1: \documentclass[a4paper]{article}
2: \usepackage{graphicx}
3: %\usepackage[pdftex]{graphicx}
4: %\usepackage{chicago}
5: %\usepackage{geometry}
6: %\geometry{left=1.5cm,textwidth=17.5cm,top=1.5cm,textheight=24cm} %vorher 25
7: \addtolength{\textwidth}{4.0cm}
8: \addtolength{\oddsidemargin}{-1.5cm}
9: \newcommand{\be}{\begin{equation}}
10: \newcommand{\ee}{\end{equation}}
11: \newcommand{\bd}{\begin{displaymath}}
12: \newcommand{\ed}{\end{displaymath}}
13: \newcommand{\bea}{\begin{eqnarray}}
14: \newcommand{\eea}{\end{eqnarray}}
15: \newcommand{\bi}{\begin{description}}
16: \newcommand{\ei}{\end{description}}
17: \newcommand{\bq}{\begin{quote}}
18: \newcommand{\eq}{\end{quote}}
19: \def\i{\item}
20: \def\fo{\footnote}
21: \def\nn{\nonumber}
22: \def\v{\vspace{1.0cm}}
23: \def\apj{Astrophysical Journal}
24: \def\apjl{Astrophysical Journal Letters}
25: \frenchspacing
26: \sloppy
27: \begin{document}
28: \bibliographystyle{unsrt}%plain
29: 
30: \author{Alexander~Unzicker\fo{Corresponding author:alexander.unzicker et lrz.uni-muenchen.de}\  and Daniel~Schmidle\\
31:         Pestalozzi-Gymnasium  M\"unchen\\[0.6ex]}
32: %{\small{\bf e-mail:}  \fo{ask for actual email at arXiv.}}
33: \title{A Quick and Dirty Approach to Verify the Pioneer Anomaly}
34: \maketitle
35: 
36: \begin{abstract}
37: 
38: We present source code for the computer algebra system Mathematica
39: that analyzes the motion of the Pioneer spacecraft using the
40: public available ephemeris data from JPL's website. Within 15
41: minutes, the reader can verify that the Pioneer anomalous
42: acceleration $a_p$ (1) exists in the order of magnitude of $c
43: H_0$, (2) is not due to mismodeling of gravitational attraction,
44: solar pressure or spacecraft attitude maneuvers. The simple code
45: of about 100 lines may easily be extended by the reader to include
46: further tests. Due to the limitations of our approach, we do not
47: know (1) whether the unknown raw data were correctly processed to
48: generate the trajectory files (2) how the apparent mismatch of
49: ephemerides before 1990 had occurred.
50: 
51: \end{abstract}
52: 
53: \section{Introduction}
54: The Pioneer anomaly $a_p \approx -8.7 \times 10^{-10} m s^{-2}$
55: \cite{And:98, And:01} has become one of the major challenges for
56: theoretical physicists, and further efforts to investigate its
57: origin are underway \cite{Nie, Nie:04, Tur:06, Nie:07}. The
58: approximate coincidence of $a_p$ with the speed of light divided
59: by the age of the universe has raised the question if this effect
60: is new physics or a general failure of Newton's law of gravitation
61: \cite{And:01, And:06, Lam:06, Unz:07}. A couple of months ago, one
62: of us heard two astrophysicists talking about the anomaly. One of
63: them, probably tired of hearing about new trouble besides DM and
64: DE, concluded: `well, I still don't believe it...'.
65: 
66: Though the analysis of the Pioneer data was done by two independent groups
67: and published in peer-reviewed journals, it is reality that convincing
68: scientists needs time. Here we do not present any new
69: results that help to understand the anomaly, and our approach cannot compete
70: with the detailedness of the expert's analysis \cite{And:01, And:06}
71: of the non-public raw data.
72: From a point of view of general scientific
73: methodology, we find it however desirable that important results of
74: fundamental physics that require extensive
75: numerical treatment can be repeated by a broad public of non-expert scientists.
76: The preliminary analysis and the code given below is indeed intended for
77: those who like to get their own opinion in brief.
78: Furthermore, minor modifications
79: allow to test some alternative explanations the %non-expert
80: reader eventually may have in mind. A quick description for
81: getting started is found in section~\ref{sbs}. Though we cannot
82: give a detailed description of the program, some clarifying
83: comments are included in the quite self-explaining code (see
84: appendix).
85: 
86: \section{Methods}
87: 
88: \subsection{Limitations}
89: 
90: Our analysis is based on the reliability
91: of JPL's ephemeris files. As far as
92: Pioneer 10 and 11 is concerned, they contain an explicit warning:
93: 
94: \bq
95: `This trajectory is suitable for general historical purposes, but should
96:   be used cautiously for high precision or tracking data applications. This is
97:   due to potential dynamical mismatches between the Pioneer era models (DE-118,
98:   Lieske's E3 satellite theory of JUP035, SAT050, etc.) and the current modern
99:   solutions used by Horizons. For example, if the Pioneer 10 (11) solutions used
100:   here estimated planet or satellite ephemeris corrections at the time.
101:   However, the transformation from the original DE-118 planetary ephemeris
102:   coordinate system to the modern frame IS computed by Horizons. (...)
103:   The circumstances pertaining to the regeneration of the spacecraft
104:   trajectory source files are not well known.'
105: \eq
106: 
107: General remarks on the limitations of the accuracy of JPL ephemerides
108: are found in chap.~19 of the HORIZONS manual \cite{HORman}.
109: 
110: \subsection{General method}
111: 
112: We used the computer algebra system $Mathematica$ to calculate
113: spacecraft trajectories from known initial conditions and from the
114: positions of gravitating planetary bodies. The built-in-function
115: NDSolve with an explicit Runge-Kutta method was used to integrate
116: the equations of motion 
117: \be
118: \frac{d^2}{dt^2} \vec r(t) = - G \sum_i \frac{m_i (\vec r-\vec r_i)}{|\vec r-\vec r_i|^3}; 
119: \ \vec r(0)=\vec r_0; \  \frac{d}{dt}  \vec r(0)= \vec v_0,
120: \ee
121: while the sum is taken over all relevant bodies. Instead of calculating gravitational
122: forces using the gravitational constant $G$ and masses, the much
123: more accurate  Keplerian constants \cite{HORman}, p.~47, for the
124: sun and respective planets were implemented. For simplicity,
125: Mercury, Venus, Earth, Mars and the
126: asteroid belt masses were assumed to stay %leo
127: at sun's barycenter. Thus, for our approximate analysis
128: ephemerides of the outer planets and the sun were sufficient.
129: Since  the same $1/r^2$-law is obeyed, radiation pressure was
130: implemented by slightly diminishing the sun's effective mass (see code below for details)\fo{For large distances, 
131: the antenna can be assumed to be directed to the sun.}.
132: We estimated an effective surface\fo{Calculated from the diameter
133: of the antenna as given on p.~2 \cite{And:01}; The value given on p.~28 is different.} of the spacecraft of $5.9 m^2$ and an albedo of $0.7$.
134: 
135: \subsection{Data acquisition}
136: 
137: \begin{figure}[h]
138: \includegraphics[width=15cm]{scr.eps}
139: \caption{Screenshot of HORIZONS site}
140: \label{screen}
141: \end{figure}
142: 
143: All the data needed were downloaded from JPL's ephemeris site HORIZONS which contains
144: spacecraft trajectories and planetary orbits. With our code, the reader can investigate
145: any period of interest. For our analysis, we downloaded the orbits of the sun, of Jupiter, Saturn,
146: Uranus and Neptune\fo{Other bodies may easily be included; download the respective ephemeris, 
147: add the name to variable planetnames, and set the variable plmax to the desired value.}
148: and the trajectories of Pioneer 10 and 11. We chose cartesian coordinates (setting VECTORS) with the solar system
149: barycenter as origin. A time step of 1 day was sufficient for our purposes\fo{Flyby modeling
150: would require much smaller steps and quadrupole moments of planets.}, though the code
151: works with smaller steps without changes. For the numerical treatment, data were 3-D-spline
152: interpolated. Due to lack of information, we did not do any maneuver modeling.
153: 
154: \subsection{Modeling}
155: 
156: The beginning of our analysis in 1987 coincides with the analysis carried out by \cite{And:01},
157: see also \cite{Lam:06}. The last signal from Pioneer 10 was received in 2002, while the RTG of Pioneer
158: 11 became inoperable in Sept 1995. No reasonable analysis can be done after those dates;
159: we do not even know if
160: the very last signals have been included for the  generation of the trajectory files.
161: The time spans for the downloaded files can be chosen from 1985-2003 anyway, since
162: start and end can be chosen separately in $simulatespacecraft$[]. No spacecraft data
163: is available before the respective starts in 1972 and 1973. 
164: 
165: \section{Results - a preliminary analysis}
166: 
167: We compare predicted (simulated with conventional gravity) and observed (HORIZONS)
168: values for position, velocity, and acceleration (fig.~2
169: and 3). All quantities show a significant deviation.
170: 
171: \subsection{Comparison with position}
172: Here we consider the predicted $r(t)$ of our simulation with the position $r_{H}(t)$
173: in the ephemeris file\fo{While running $simulatespacecraft$[...], set option $vflag$ to $0$.}.
174: Velocities and accelerations are obtained by numerical differentiation. Though Pioneer 10 and 11
175: do not move precisely in the direction away from the solar system barycenter, for simplicity the radial
176: components only are analyzed.
177: 
178: \paragraph{An anomalous acceleration} is clearly visible for both Pioneer 10 and 11 (bottom graphs).
179: While the median
180: (minimizes absolute deviation) is $-7.60 \times 10^{-10} m s^{-2}$ and $-8.29 \times 10^{-10} m s^{-2}$
181: respectively, a quadratic fit to the acceleration data yields $-7.25 \times 10^{-10} m s^{-2}$
182: and $-7.05 \times 10^{-10} m s^{-2}$ (Pioneer 10 and 11).
183: 
184: \paragraph{The anomalous velocity} decrease is shown in the middle of fig.~(2)
185: and (3). A simple estimate $a=\frac{\Delta v}{\Delta t}$ from the velocity data
186: yields $-10.34 \times 10^{-10} m s^{-2}$ for Pioneer 10 and $-8.72 \times 10^{-10} m s^{-2}$
187: for Pioneer 11.
188: 
189: \paragraph{The deviation in radial position} is shown on top of fig.(~2)
190: and (3). In this case, the estimate $a=\frac{2 \Delta r}{(\Delta t)^2}$ yields
191: $-13.7 \times 10^{-10} m s^{-2}$ and $-9.52 \times 10^{-10} m s^{-2}$.
192: 
193: Of course, different time spans yield slightly different values, as the reader may easily
194: verify. All the above values are calculated automatically by our program.
195: 
196: %\newpage
197: 
198: %\begin{figure}[h]
199: \includegraphics[width=10cm]{allpio10.eps}
200: %\caption
201: \begin{center} Figure 2: Anomalous deviation (r), velocity (v) and acceleration (a) of Pioneer10 from 1987-2002.
202: \end{center}
203: %\label{allpio10}
204: %\end{figure}
205: 
206: %\newpage
207: 
208: %\begin{figure}[h]
209: \includegraphics[width=10cm]{allpio11.eps}
210: %\caption{Anomalous deviation (r), velocity (v) and acceleration (a) of Pioneer11 from 1987-1995.}
211: %\label{allpio11}
212: %\end{figure}
213: \begin{center} Figure 3: Anomalous deviation (r), velocity (v) and acceleration (a) of Pioneer11 from 1987-1995.
214: \end{center}
215: 
216: \subsection{Comparison with velocities}
217: The derivatives $v(r)$ of our predicted $r(t)$ from the simulation are here compared to the velocities
218: $v_{H}(t)$ from HORIZONS\fo{While running $simulatespacecraft$[..], set option $vflag$ to $1$.}.
219:  Calculating $a$ from $\Delta v$ in this case yields
220: $-13.2 \times 10^{-10} m s^{-2}$ for Pioneer 10
221: and $-4.56 \times 10^{-10} m s^{-2}$ for Pioneer 11. The anomalous acceleration functions
222: (see bottom graphs of fig.~2 and~3) do practically not change. Run $simulatespacecraft$[-1,...,1] and
223: $generateplots$[-1] to get the respective plot. %
224: % Very similar plots to  can be generated by the command $generateplots$[..].
225: 
226: 
227: \section{Discussion}
228: 
229: % puhhh pio 11 fliegt eben im moment nicht vom koordinatenursprung weg....sondern in einem satten 30°
230: %winkel...
231: %deshalb ist dot r eben was anderes als die momentane geschw.....
232: 
233: Though the deviation of the observed quantities from the predicted ones are clearly visible
234: and confirm the order of magnitude of $a_p \approx c H_0$, there are a couple of results we cannot understand yet.
235: 
236: First of all, there is a big jump in the data on January 1st,
237: 1990. Before that date, we cannot verify the known anomalous
238: acceleration at all, there seems to be an agreement with the predicted
239: trajectories. This must be due to a systematic error in
240: the ephemeris programs, i.e. a mismatch between data used then and
241: now, as mentioned above in the header of the JPL ephemeris file.
242: 
243: Further jumps in the acceleration of Pioneer 10, though of much
244: smaller amount, occurred on January 1st, 1993 and in June 1990.
245: The acceleration remains in the range of $a_p$, however. While
246: these jumps occur from a more or less constant level to another,
247: there are a couple of isolated disturbances, see bottom of
248: fig.~(2) and (3). Most likely those
249: disturbances are due to spacecraft maneuvers we did not model at
250: all. Taking the median, those disturbances are practically taken
251: out from the analysis. One should keep in mind however that even
252: the estimates from $\Delta r$ and $\Delta v$ (which were affected
253: by maneuvers) yielded $a_p$ in the correct order of magnitude.
254: Thus in no case the Pioneer anomaly can be an artifact of maneuver
255: mismodeling.
256: 
257: Looking at the acceleration plots at a high resolution we did not show here, a sinewave
258: disturbance with amplitude of about $10^{-11} m s^{-2}$ appears. The period however varies continuously
259: from about 12 days (Pioneer 11, around 1987) to 55 days (Pioneer 10, around 1997) and therefore
260: cannot be attributed to a mismodeling
261: of lunar ephemerides or a neglection %leo
262: of tidal effects
263: of the receiver station. It is clearly {\em not\/} a manifestation of the annual and diurnal signal
264: published in \cite{And:01} and must be due to some other systematic error.
265: 
266: \section{Conclusions}
267: Despite the limitations of JPL's ephemeris data, we could verify the anomalous
268: acceleration of Pioneer 10 and 11, i.e. $a_p$ cannot be due to a mismodeling of
269: gravitational attraction, maneuvers or radiation pressure. With our code, the reader
270: can easily verify or falsify further hypotheses on the origin of the anomaly. To account for
271: the effect of dust, Kuiper or asteroid belt masses, dark energy etc. it suffices to run the program
272: with different parameters or to add minor changes to the code.
273: We hope that this hands-on demonstration will develop further the interest and critical
274: acceptance of this outstanding effect.
275: 
276: 
277: \paragraph{Acknowledgement.} Though we are grateful for any comments, please 
278: understand that we cannot guarantee functionality or give further 
279: support for getting this program to run on your computer.
280: 
281: \begin{thebibliography}{10}
282: 
283: \bibitem{And:98}
284: J.~D. {Anderson}, P.~A. {Laing}, E.~L. {Lau}, A.~S. {Liu}, M.~M. {Nieto}, and
285:   S.~G. {Turyshev}.
286: \newblock {Indication, from {Pioneer 10/11, Galileo, and Ulysses} Data, of an
287:   Apparent Anomalous, Weak, Long-Range Acceleration}.
288: \newblock {\em Physical Review Letters}, 81:2858--2861, October 1998.
289: 
290: \bibitem{And:01}
291: J.~D. {Anderson}, P.~A. {Laing}, E.~L. {Lau}, A.~S. {Liu}, M.~M. {Nieto}, and
292:   S.~G. {Turyshev}.
293: \newblock {Study of the anomalous acceleration of {Pioneer} 10 and 11}.
294: \newblock {\em Physical Review D}, 65(8):082004, April 2002, arXiv: gr-qc/0104064.
295: 
296: \bibitem{Nie}
297: M.~M. Nieto and S.~G. Turyshev.
298: \newblock Finding the origin of the {Pioneer} anomaly.
299: \newblock {\em arXiv:}, {}{}gr-qc/030817, 2003.
300: 
301: \bibitem{Nie:04}
302: M.~M. Nieto and S.~G. Turyshev.
303: \newblock The {Pioneer} anomaly: The data, its meaning, and a future test.
304: \newblock {\em arXiv:}, {}{}gr-qc/0411077, 2004.
305: 
306: \bibitem{Tur:06}
307: V.G. Toth and S.~G. Turyshev.
308: \newblock The {Pioneer} anomaly: seeking an explanation in newly recovered
309:   data.
310: \newblock {\em arXiv:}, {}{}gr-qc/0603016, 2006.
311: 
312: \bibitem{Nie:07}
313: M.~M. {Nieto}.
314: \newblock {The Quest to Understand the Pioneer Anomaly}.
315: \newblock {\em ArXiv: gr-qc/0702017}, February 2007.
316: 
317: \bibitem{And:06}
318: J.D. Anderson, J.K. Campbell, and M.M. Nieto.
319: \newblock The energy transfer process in planetary flybys.
320: \newblock {\em ArXiV:}, astro-ph/0608087, 2006.
321: 
322: \bibitem{Lam:06}
323: C.~L\"ammerzahl, O.~Preuss, and H.~Dittus.
324: \newblock Is the physics within the solar system really understood~?
325: \newblock {\em ArXiV:}, gr-qc/0604052, 2006.
326: 
327: \bibitem{Unz:07}
328: A.~{Unzicker}.
329: \newblock {Why do we Still Believe in Newton's Law ? Facts, Myths and Methods
330:   in Gravitational Physics}.
331: \newblock {\em ArXiv: gr-qc/0702009}, February 2007.
332: 
333: \bibitem{HORman}
334: JPL.
335: \newblock Horizons manual.
336: \newblock ftp://ssd.jpl.nasa.gov/pub/ssd/Horizons\_doc.pdf, 2005.
337: 
338: \end{thebibliography}
339: 
340: \section{Appendix:  data preparation and source code}
341: 
342: 
343: \subsection{Step-by step procedure in 15 minutes}
344: \label{sbs}
345: \begin{enumerate}
346: \i Create your directory `pioneer' and copy all of the following files in there
347: \i Goto NASA's ephemeris site HORIZONS: {\em http://ssd.jpl.nasa.gov/horizons.cgi \/}
348: \i Change ephemeris type to VECTORS (vector table)
349: \i Set Coordinate origin to [500@0], ecliptic and mean equinox of reference epoch ICRF/J.2000.0 % yyy
350: \i Set time span from 1985-01-01 to 2003-01-01, step 1 day
351: \i Chose table settings $km, km/s$, quantities code $=2$ (two-state vector $x,y,z,vx,vy,vz$), CSV format $= YES$, object page $=NO$.
352: \i Display/Output: download/save as plain text file.
353: \i Chose target body: sun  (sol)
354: \i Generate ephemeris and save as {\em sun-85-03.txt\/}. See also screenshot fig.~\ref{screen}.
355: \i Proceed in the same manner with Jupiter, Saturn, Uranus, Neptune, Pioneer 10 and 11
356: as target bodies.
357: \i Cross-check if the file ending for the Pioneers corresponds to the last two entries of `spans' (line 2 of the code).
358: \i Chose `barycenter' where appropriate (otherwise you'll miss Jupiter's satellites) and
359:  save as  {\em neptune-85-03.txt\/} etc.
360: \i Type source from appendix or download it from {\em www.alexander-unzicker.de/pioneer.txt\/}\fo{
361: Do not paste and copy from LaTeX source code, this will create error messages.}
362: \i Change in the first line the path to your pioneer directory
363: \i Open a Mathematica *.nb file and run the following commands (see also file end of source):
364:  \bq
365:  SetDirectory["c:$\setminus \setminus$yourpioneerdirectory"]; 
366:  (* insert a $\setminus \setminus$ for any $\setminus$   in the path*) \\
367:   $<<$pioneer.txt; \\
368:   planetini[5,"-85-03"];\\
369:  simulatespacecraft[-1, 46800.5(*day start 5.1.87*), 8.75(*insert years*), 0 (*option vflag*)];
370:  genererateplots[-1];
371:  \eq
372: \i Proceed likewise with simulatespacecraft[-2, 46798.5(* 3.1.87*), 15.08,0] for Pioneer 10.
373: \end{enumerate}
374: 
375: \subsection{Source code}
376: \mbox{(*************** global settings *****************)} \\
377: \mbox{planetnames = \{"sun", (*"merkur", "venus","earth","mond","mars",*)"jupiter", "saturn","uranus",} \\
378: \mbox{"neptune","pluto","pioneer10","pioneer11"\};} \\
379: \mbox{spans=\{"-85-03","-85-03"\}; (*fileendings of spacecraft emphemerides*)} \\
380: \mbox{mjd=2400000; (** mean julianian day correction**)} \\
381: \mbox{day=3600*24; (* SI unit is seconds *)} \\
382: \mbox{(************** constants for radiation pressure modeling *******)} \\
383: \mbox{cc = 299792458;  (*speed of light*)  AU = 1.496*10\symbol{94}(11); (* astronomic unit *)} \\
384: \mbox{albedo=0.7; solarK=1367*AU\symbol{94}2/cc*(1+albedo); } \\
385: \mbox{surfaceP=\{5.9,5.9\}; (* effective surfaces for radiation pressure in m\symbol{94}2 *)} \\
386: \mbox{massP=\{258,259\};    (* spacecraft masses*)} \\
387: \mbox{(*Instead of masses, the much more accurate Kepler constants are used, see HORIZONS manual p.47 ****)} \\
388: \mbox{KKs=10\symbol{94}9\{132712440017.98698,126712767.857796, 37940626.061137281,5794549.00707,} \\
389: \mbox{6836534.0638792608,981.6008877\}; (*kepler's constants**)} \\
390: \mbox{(** all masses inside the asteroid belt (3 10\symbol{94}(21) kg ) added to sun (KKs[[1]]) **)} \\
391: \mbox{KKs[[1]]+=10\symbol{94}9*Apply[Plus, \{22032.080486417923, 324858.59882645978,398600.43289693922,} \\
392: \mbox{4902.8005821477636, 42828.314258067119, 200 (*asteroid belt estimate*)\}];} \\
393: \mbox{(** for plots: display year numbers at axes instead of days *)} \\
394: \mbox{subti=4; ti87 =Transpose[\{Table[46796.5+365.25i/subti,\{i,0,16subti\}],} \\
395: \mbox{Table[If[IntegerQ[i/subti]==True,1987+i/subti,""],\{i,0,16 subti\}]\}]; } \\
396: \mbox{ti88 =Transpose[\{Table[46796.5+365.25i/subti,\{i,0,16 subti\}],} \\
397: \mbox{Table[If[IntegerQ[i/subti/2]==True,1987+i/subti,""],\{i,0,16 subti\}]\}]; } \\
398: \mbox{SCplots=Table[\{0,0,0\}, \{i,10\}]; (* plot variable*)} \\
399: \mbox{\$DefaultFont = \{"Arial", 8\};} \\
400: \mbox{readplanet[name\_,ending\_]:=Block[\{qwe, wer\}, filename=planetnames[[name]] $<$ $>$ending $<$ $>$".txt";} \\
401: \mbox{If[FileInformation[filename]==\{\},Print["Missing ephemeris file. Stop."];Break[]];} \\
402: \mbox{IO=3; (* interpolation order of splines *)} \\
403: \mbox{qwe = Import[filename, "CSV"];} \\
404: \mbox{cut1 = Position[qwe, "\$\$SOE"][[1, 1]]; cut2 = Position[qwe, "\$\$EOE"][[1, 1]];} \\
405: \mbox{wer = Take[Drop[qwe, cut1], cut2 - cut1 - 1];} \\
406: \mbox{xyz = 1000*Transpose[Take[Transpose[wer], \{3, 5\}]]; (*** km - m  factor ***)} \\
407: \mbox{vxyz = 1000*Transpose[Take[Transpose[wer], \{6, 8\}]];} \\
408: \mbox{time = Flatten[Transpose[wer][[1]]] - mjd;} \\
409: \mbox{x1=Interpolation[Transpose[\{time,Transpose[xyz][[1]]\}],InterpolationOrder $->$ IO];} \\
410: \mbox{y1=Interpolation[Transpose[\{time,Transpose[xyz][[2]]\}],InterpolationOrder $->$ IO];} \\
411: \mbox{z1=Interpolation[Transpose[\{time,Transpose[xyz][[3]]\}],InterpolationOrder $->$ IO];} \\
412: \mbox{(** x,y,z, as function, interpolated***)} \\
413: \mbox{vx1=Interpolation[Transpose[\{time,day*Transpose[vxyz][[1]]\}],InterpolationOrder $->$ IO];} \\
414: \mbox{vy1=Interpolation[Transpose[\{time,day*Transpose[vxyz][[2]]\}],InterpolationOrder $->$ IO];} \\
415: \mbox{vz1=Interpolation[Transpose[\{time,day*Transpose[vxyz][[3]]\}],InterpolationOrder $->$ IO];} \\
416: \mbox{];} \\
417: \mbox{(* simple differentiation routine for interpolating functions of different range, step: 1 day*)} \\
418: \mbox{numdiff[tab\_,st\_(*start time in JD*),en\_(*end time in JD*)]:=Block[\{tab1p,tab1m,tab2m, tab2p\},} \\
419: \mbox{tab1p = RotateRight[tab, 1]; tab1m = RotateRight[tab, -1];} \\
420: \mbox{dtab = Flatten[\{tab[[2]]-tab[[1]],Drop[Drop[(tab1m - tab1p)/2, \{1\}], \{-1\}],tab[[-1]]-tab[[-2]]\}/day];} \\
421: \mbox{ttime = Table[i, \{i, st, en, 1\}];} \\
422: \mbox{dtabtime = Transpose[\{ttime, dtab\}];} \\
423: \mbox{dlist=Interpolation[dtabtime];dlist];} \\
424: \mbox{planetini[plmax\_,plfileending\_]:=Block[\{\},} \\
425: \mbox{(***** Reading data of all relevant planets 1 sun 2 jup, 3 sat, 4 Ura, 5 nep *********)} \\
426: \mbox{xx=yy=zz=\{\}; } \\
427: \mbox{Print["Initialize planets..."];} \\
428: \mbox{For[k=1,k $<$ =plmax,k++,readplanet[k,plfileending];AppendTo[xx,x1];AppendTo[yy,y1];AppendTo[zz,z1]]];} \\
429: \mbox{simulatespacecraft[craftflag\_,start\_,yrs\_,vflag\_(* set to 1 for comparing observed velocities*)]:=Block[\{\},} \\
430: \mbox{(********** starting values **************)} \\
431: \mbox{(** -1 for pio 11, -2, for pio 10,  anything else runs automatically*)} \\
432: \mbox{fileending=spans[[craftflag]];} \\
433: \mbox{sta=start;} \\
434: \mbox{(* radiation pressure modelled as missing solar mass *)} \\
435: \mbox{KKs[[1]]-=solarK*surfaceP[[craftflag]]/massP[[craftflag]];} \\
436: \mbox{end=Ceiling[start+yrs*365.25]+.5;} \\
437: \mbox{readplanet[craftflag, fileending]; } \\
438: \mbox{(**** starting values for simulation ***)} \\
439: \mbox{\{x0,y0,z0\}=\{x1[t],y1[t],z1[t]\} /. t$->$start; } \\
440: \mbox{\{vx0,vy0,vz0\}=\{vx1[t],vy1[t],vz1[t]\} /. t$->$start; (* new*)} \\
441: \mbox{Print["computing trajectory for ", planetnames[[craftflag]], " ... "];} \\
442: \mbox{(***** numeric integration of the equations of motion by Runge-Kutta****)} \\
443: \mbox{plmax=Length[zz];} \\
444: \mbox{loe = NDSolve[\{} \\
445: \mbox{x''[t]==Apply[Plus,Table[-day\symbol{94}2 KKs[[i]](x[t]-xx[[i]][t])/((x[t]-xx[[i]][t])\symbol{94}2+} \\
446: \mbox{(y[t]-yy[[i]][t])\symbol{94}2+(z[t]-zz[[i]][t])\symbol{94}2)\symbol{94}(3/2), \{i, 1, plmax\}]], } \\
447: \mbox{y''[t]==Apply[Plus, Table[-day\symbol{94}2 KKs[[i]](y[t]-yy[[i]][t])/((x[t]-xx[[i]][t])\symbol{94}2+} \\
448: \mbox{(y[t]-yy[[i]][t])\symbol{94}2+(z[t]-zz[[i]][t])\symbol{94}2)\symbol{94}(3/2),\{i,1, plmax\}]],} \\
449: \mbox{z''[t]==Apply[Plus,Table[-day\symbol{94}2 KKs[[i]](z[t]-zz[[i]][t])/((x[t]-xx[[i]][t])\symbol{94}2+} \\
450: \mbox{(y[t]-yy[[i]][t])\symbol{94}2+(z[t]-zz[[i]][t])\symbol{94}2)\symbol{94}(3/2), \{i, 1, plmax\}]],} \\
451: \mbox{x[start]==x0,y[start]==y0,z[start]==z0,} \\
452: \mbox{x'[start]==vx0,y'[start]==vy0, z'[start]==vz0\},} \\
453: \mbox{\{x[t], y[t],z[t]\}, \{t, start, end\},Method$->$"ExplicitRungeKutta"];} \\
454: \mbox{r[t\_] := Sqrt[loe[[1, 1, 2]]\symbol{94}2 + loe[[1, 2, 2]]\symbol{94}2 + loe[[1, 3, 2]]\symbol{94}2]; (* solution r(t) *)} \\
455: \mbox{v[t\_]:=D[r[t],t]/day;} \\
456: \mbox{a[t\_]:=D[v[t],t]/day;} \\
457: \mbox{readplanet[craftflag, fileending];  (* reading spacecraft data again*)} \\
458: \mbox{radius[t\_]:= Sqrt[x1[t]\symbol{94}2 + y1[t]\symbol{94}2 + z1[t]\symbol{94}2];      (* observed r(t) from Horizons*)} \\
459: \mbox{vradial[t\_]:= (vx1[t]*x1[t] + vy1[t]*y1[t] + vz1[t]*z1[t])/day/radius[t]; (*radial component*)} \\
460: \mbox{vobserv=Interpolation[Transpose[\{Table[i,\{i,start,end,1\}],Table[vradial[t],\{t,start,end,1\}]\}]];} \\
461: \mbox{ranom[t\_]:=radius[t]-r[t]; (* anomaly  of position **)} \\
462: \mbox{(**** vflag=1 compares to observed velocity, vflag=0, to position***)} \\
463: \mbox{If[vflag==1, vvv=numdiff[Table[r[t], \{t, start, end, 1\}], start, end];} \\
464: \mbox{  Clear[vanom];vanom[t\_]:=vobserv[t]-vvv[t],vanom=numdiff[Table[ranom[t], \{t, start, end, 1\}],start,end]];} \\
465: \mbox{aanom=numdiff[Table[vanom[t], \{t, start, end, 1\}],start,end];} \\
466: \mbox{ap=((vanom[t]/.t $->$end)-(vanom[t]/.t $->$start))/(end-start)/day;  (* ap estimate from velocities *)} \\
467: \mbox{ap2=2((ranom[t]/.t $->$end)-(ranom[t]/.t $->$start))/(end-start)\symbol{94}2/day\symbol{94}2; (* ap from position ***)} \\
468: \mbox{Print["anomalous acceleration (from v and r):  ", ap, "   ", ap2];} \\
469: \mbox{atab=Table[aanom[t], \{t, sta, end\}];} \\
470: \mbox{median=Median[atab];} \\
471: \mbox{abwei=FindMinimum[Sum[Abs[x - atab[[i]]], \{i, Length[atab]\}], \{x, 0\}][[2, 1, 2]];} \\
472: \mbox{abwei2=FindMinimum[Sqrt[Sum[Abs[x - atab[[i]]]\symbol{94}2, \{i, Length[atab]\}]], \{x, 0\}][[2, 1, 2]];} \\
473: \mbox{Print["Median, absolute, quadratic deviation minimized:  ", median, "   ", abwei, "   ", abwei2];} \\
474: \mbox{KKs[[1]]+=solarK*surfaceP[[craftflag]]/massP[[craftflag]]]; (*take out again radiation from solar mass*)} \\
475: \mbox{generateplots[body\_]:=Block[\{\},AO=sta+400;(* clean plot: axes origin shifted days in the future *)} \\
476: \mbox{tic=If[body==-1,ti87,ti88];} \\
477: \mbox{SCplots[[body,1]]=\{Plot[radius[t]-r[t],\{t, sta, end\}, Ticks$->$\{tic, Automatic\},} \\
478: \mbox{AxesOrigin$->$\{AO, 0\},AxesLabel $->$\{"", "r"\},PlotRange$->$All]]\};} \\
479: \mbox{SCplots[[body,2]]=\{Plot[vanom[t],\{t, sta, end\}, Ticks$->$\{tic, Automatic\},} \\
480: \mbox{AxesOrigin$->$\{AO, 0\},AxesLabel $->$\{"", "v"\},PlotRange$->$All]\};} \\
481: \mbox{SCplots[[body,3]]=\{Plot[aanom[t],\{t, sta, end\}, Ticks$->$\{tic, Automatic\},} \\
482: \mbox{AxesOrigin$->$\{AO, 0\},AxesLabel $->$\{"", "a"\}]\}];} \\
483: 
484: 
485: \end{document}
486: 
487: ++ftp://quasar.ipa.nw.ru/incoming/EPM2004
488: