## Re: Planetary Series 96

Expand Messages
• Hi Chris, Hmm, I don t seem to understand the code. But I ll do my best to understand it step by step. I want to be able to teach this to my students, because
Message 1 of 9 , Dec 1, 2012
• 0 Attachment
Hi Chris,

Hmm, I don't seem to understand the code. But I'll do my best to understand it step by step. I want to be able to teach this to my students, because I know it is the most accurate method.

Furthermore, I read that the PS96 method is based on DE402. Would it be possible to update the data based on DE405? Would this increase the accuracy even more?

Bamm

--- In skymap@yahoogroups.com, "Chris Marriott" <chris@...> wrote:
>
> Hi Bamm,
>
> The "Planetary Series 96" is a complicated one. This is the C++ code that
> SkyMap uses to compute the positions of the planets using it. All the data
> is in a separate table - that comes straight from the PS96 sample code.
>
> // Ephem96Pos
> // Find the position of a planet using the Chapront and Francou
> // "Planetary Series (1996)" theory.
> //
> // Note that this theory is only valid between 1900 and 2100 AD.
>
> void CPlanetDoc::Ephem96Pos( CObserverDoc &Observer, int nPlanet,
> double dJ, double dEcliptic[3],
> double dRect[3] )
>
> // Input arguments:
> // Observer Observation data.
> // nPlanet Planet to sum terms for.
> // dJ Julian date, TDT.
> //
> // Output arguments:
> // dEcliptic Ecliptic spherical (L,B,R) coordinates for ecliptic
> // of date.
> // dRect Equatorial rectangular (X,Y,Z) coordinates for
> J2000.0
>
> {
> int i; // loop counters
> double x;
> double dEps; // mean obliquity of the
> ecliptic
> double dSinEps, dCosEps; // trig of mean obliquity
> int nb;
> int m, iv;
> double v[3], ws[3];
> double tdeb;
> double fx;
> double wx;
> int nw;
> double f;
> double cf, sf;
> double dEcl[3];
> double dBarycentre[3]; // coordinates of barycentre
>
> SEphem96Planet &Data = Eph96Planet[nPlanet-1];
>
> // Get the "block number" within the planet's data.
>
> nb = int((dJ-Data.dJDOrigin)/Data.dPeriodLength);
>
> // Change variable.
>
> tdeb = Data.dJDOrigin + nb*Data.dPeriodLength;
> x = 2.0*(dJ-tdeb)/Data.dPeriodLength - 1;
> fx = x*Data.dPeriodLength/2.0;
>
> // Compute positions (secular terms)
>
> for (iv=0; iv<3; iv++)
> {
> v[iv] = 0.0;
> wx = 1.0;
>
> for (i=0; i<4; i++)
> {
> v[iv] += Data.Block[nb].X[iv].sec[i]*wx;
> wx *= x;
> }
> }
>
> // Compute positions (Poisson terms)
>
> wx = 1.0;
>
> for (m=0; m<3; m++)
> {
> nw = Data.nFreq[m];
>
> for (iv=0; iv<3; iv++)
> {
> ws[iv] = 0.0;
> }
>
> for (i=0; i<nw; i++)
> {
> f=Data.pFreq[m][i]*fx;
> cf=cos(f);
> sf=sin(f);
>
> for (iv=0; iv<3; iv++)
> {
> ws[iv] += Data.Block[nb].X[iv].ct[m][i]*cf +
> Data.Block[nb].X[iv].st[m][i]*sf;
> }
> }
>
> for (iv=0; iv<3; iv++)
> {
> v[iv] += ws[iv]*wx;
> }
>
> wx *= x;
> }
>
> for (i=0; i<3; i++)
> {
> v[i] /= 1.0e10;
> dRect[i] = v[i];
> }
>
> // If we've been asked to compute the position of the Earth,
> // what we've actually just found is the position of the
> // Earth-Moon barycentre. To find the heliocentric position
> // of the Earth, we need to subtract the geocentric position
> // of the barycentre.
>
> if (nPlanet==EARTH)
> {
> Ephem96GeocentricBarycentre( dJ, dBarycentre );
>
> for (i=0; i<3; i++)
> {
> dRect[i] -= dBarycentre[i];
> }
> }
>
> // Precess the coordinates from J2000 to the epoch of date.
>
> Observer.PrecessXYZ( v, dJ, PRECESSFROMEPOCH );
>
> // Find the ecliptic rectangular coordinates.
>
> dEps = Observer.MeanObliquity( dJ );
> dSinEps = sin(dEps);
> dCosEps = cos(dEps);
>
> dEcl[0] = v[0];
> dEcl[1] = v[1]*dCosEps + v[2]*dSinEps;
> dEcl[2] = -v[1]*dSinEps + v[2]*dCosEps;
>
> // Find the ecliptic spherical coordinates.
>
> dEcliptic[2] = sqrt( dEcl[0]*dEcl[0] +
> dEcl[1]*dEcl[1] +
> dEcl[2]*dEcl[2] );
>
> dEcliptic[0] = atan2( dEcl[1], dEcl[0] );
> if (dEcliptic[0]<0.0) dEcliptic[0] += TWOPI;
> dEcliptic[1] = asin( dEcl[2]/dEcliptic[2] );
> }
>
> I'm afraid I'm not really in a position to be able to explain HOW this
> works - it's essentially a C++ conversion of the sample FORTRAN code
> provided with the PS96 theory.
>
> Don't know if that's any help or not. This really isn't a planetary theory
> that's easy to use, but it is the most accurate one around, for the
> timescale 1900-2100.
>
> Chris
• I ll be honest with you, Bamm - I don t understand it either! I just did a line by line conversion of the FORTRAN sample code supplied with the files into C++,
Message 2 of 9 , Dec 2, 2012
• 0 Attachment
I'll be honest with you, Bamm - I don't understand it either! I just did a
line by line conversion of the FORTRAN sample code supplied with the files
into C++, and it worked. It's just a "black box" as far as I'm concerned.

I have no idea about how one would go about converting the data from DE402
to 405, I'm afraid. Sorry.

Chris

-----Original Message-----
From: bammgabriana
Sent: Sunday, December 02, 2012 1:52 AM
To: skymap@yahoogroups.com
Subject: [skymap] Re: Planetary Series 96

Hi Chris,

Hmm, I don't seem to understand the code. But I'll do my best to understand
it step by step. I want to be able to teach this to my students, because I
know it is the most accurate method.

Furthermore, I read that the PS96 method is based on DE402. Would it be
possible to update the data based on DE405? Would this increase the accuracy
even more?

Bamm
• Thank you Chris! You just gave me an idea. I ll tell my students that this is an algorithm for calculating planet positions and that the explanation is too
Message 3 of 9 , Dec 5, 2012
• 0 Attachment
Thank you Chris!

You just gave me an idea. I'll tell my students that this is an algorithm for calculating planet positions and that the explanation is too complicated for the course, hehe. :)

Bamm

--- In skymap@yahoogroups.com, "Chris Marriott" <chris@...> wrote:
>
> I'll be honest with you, Bamm - I don't understand it either! I just did a
> line by line conversion of the FORTRAN sample code supplied with the files
> into C++, and it worked. It's just a "black box" as far as I'm concerned.
>
> I have no idea about how one would go about converting the data from DE402
> to 405, I'm afraid. Sorry.
>
> Chris
>
>
> -----Original Message-----
> From: bammgabriana
> Sent: Sunday, December 02, 2012 1:52 AM
> To: skymap@yahoogroups.com
> Subject: [skymap] Re: Planetary Series 96
>
> Hi Chris,
>
> Hmm, I don't seem to understand the code. But I'll do my best to understand
> it step by step. I want to be able to teach this to my students, because I
> know it is the most accurate method.
>
> Furthermore, I read that the PS96 method is based on DE402. Would it be
> possible to update the data based on DE405? Would this increase the accuracy
> even more?
>
> Bamm
>
• ... and hope they don t find this group via Google :) ... [Non-text portions of this message have been removed]
Message 4 of 9 , Dec 5, 2012
• 0 Attachment
... and hope they don't find this group via Google :)

On 5 December 2012 08:55, bammgabriana <bamm@...> wrote:

> **
>
>
> Thank you Chris!
>
> You just gave me an idea. I'll tell my students that this is an algorithm
> for calculating planet positions and that the explanation is too
> complicated for the course, hehe. :)
>
>
> Bamm
>
> --- In skymap@yahoogroups.com, "Chris Marriott" <chris@...> wrote:
> >
> > I'll be honest with you, Bamm - I don't understand it either! I just did
> a
> > line by line conversion of the FORTRAN sample code supplied with the
> files
> > into C++, and it worked. It's just a "black box" as far as I'm concerned.
> >
> > I have no idea about how one would go about converting the data from
> DE402
> > to 405, I'm afraid. Sorry.
> >
> > Chris
> >
> >
> > -----Original Message-----
> > From: bammgabriana
> > Sent: Sunday, December 02, 2012 1:52 AM
> > To: skymap@yahoogroups.com
> > Subject: [skymap] Re: Planetary Series 96
> >
> > Hi Chris,
> >
> > Hmm, I don't seem to understand the code. But I'll do my best to
> understand
> > it step by step. I want to be able to teach this to my students, because
> I
> > know it is the most accurate method.
> >
> > Furthermore, I read that the PS96 method is based on DE402. Would it be
> > possible to update the data based on DE405? Would this increase the
> accuracy
> > even more?
> >
> > Bamm
> >
>
>
>

[Non-text portions of this message have been removed]
Your message has been successfully submitted and would be delivered to recipients shortly.