Space Exploration Stack Exchange is a question and answer site for spacecraft operators, scientists, engineers, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing a piece of software which propagates the orbit of a spacecraft from an initial Earth orbit to an interplanetary orbit. My simple two-body propagation works fine in either a geocentric or heliocentric orbit. However, I cannot seem to handle the transition correctly.

Here are the steps of that transition (I can share relevant code if useful):

  1. Get ecliptic J200 position of Earth (via https://github.com/soniakeys/meeus/blob/master/planetposition/planetposition.go#L195 ) and compute the velocity of Earth (via equations in the first pages of Vallado - Fundamentals in Astrodynamics). Note that the "meeus/planetposition" library returns the ecliptic positions in L, B, R, which I convert to cartesian coordinates (via https://en.wikipedia.org/wiki/Ecliptic_coordinate_system#Rectangular_coordinates )

  2. Rotate the radius and velocity vectors of my geocentric orbit about the first axis and by the axial tilt of Earth (as per https://en.wikipedia.org/wiki/Ecliptic_coordinate_system#Converting_Cartesian_vectors )

  3. Add the spacecraft R and V vectors computed in step 2 to the radius and velocity vectors of the planet computed in step 1 (since $r_{\text{sc}_{\text{helio}}} = r_{\text{sc}_{\text{earth}}} + r_{\text{earth}_{\text{helio}}}$)

When visualizing both trajectories in Cosmographia, I can definitely tell that the computation is wrong (cf. the two screenshots below). I have been stuck on this issue for a few hours now (about twelve I'd say), so any help would be greatly appreciated.

Earth seen from the expected position (geocentric vectors) Earth seen from the incorrectly computed heliocentric position

share|improve this question
1  
This is a good place to ask, but you can also look in Astronomy SE and Math SE for potentially helpful pre-existing answers as well. – uhoh yesterday
1  
I highly recommend the use of JPL's SPICE Toolkit for coordinate frame conversions, as well as many other things, such as accessing natural body and spacecraft ephemerides. – Mark Adler yesterday
    
I know of SPICE, however, it isn't feasible for me to use it currently (I was initially hoping to use it). My software is written entirely in Go without any bindings to other languages. – ChrisR yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.