Calculating Comet Position at a Given Julian Date with Available Orbital Elements

I have some orbital elements for comet P/2004 R1 (McNaught) from this dataset and I would like to calculate its position around the sun (x, y, z coordinates where the sun is at the origin) at a specific Julian date. Here is the data I have:

• object: P/2004 R1 (McNaught)

epoch_tdb: 54629

tp_tdb: 2455248.548

e: 0.682526943

i_deg: 4.894555854

w_deg: 0.626837835

node_deg: 295.9854497

q_au_1: 0.986192006

q_au_2: 5.23

p_yr: 5.48

moid_au: 0.027011

a1_au_d_2: NA

a2_au_d_2: NA

a3_au_d_2: NA

dt_d: NA

ref: 20

object_name: P/2004 R1 (McNaught)

I already know how to calculate eccentric anomaly from kepler's equation. However I am struggling on calculating the mean anomaly.

Can you give me a step by step guide on the subject?

• These elements are a few years newer. ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=P%2F2004%20R1 I assume the epoch in your data is a Modified Julian Date (in JPL's Barycentric Dynamical Time). Apr 22, 2023 at 11:03
• I'm not quite sure what you're having difficulty with. All 3 of mean, eccentric, and true anomalies are 0° at the instant of perihelion passage. Apr 22, 2023 at 11:09

The "mean anomaly" is actually a measure of time expressed in terms of an angle. It is just $$360^\circ\times(t-t_{\text{periapse}})/(\text{orbital period})$$. (If you are working in degrees, you may find it convenient to work in radians.)
To find the mean anomaly, you need to know the time of periapsis This seems to be tp_tbd in your data. Also you need the orbital period. That is p_yr*365.25 (the factor of 365.25 is to convert the period to days, as the time is given as a Julian day number). And finally you need to know the time at which you want to calculate the position of the comet, again this should be as a Julian day number, your software will probably have a routine for converting a date-time to JD.
• You should reduce the value of M to the range 0 to 2pi (by repeatedly subtracting multiples of 2pi) some programming languages call this fmod. Apr 23, 2023 at 14:35