# Determining the spacecraft position vector with respect to ICRF frame for Venus flyby

For an interplanetary mission design to Saturn, I have considered doing multiple gravity assists starting with Venus. I am using the JPL Horizons ephemeris and ESA Lambert Solver.

I have the velocity vectors of the spacecraft in the ICRF frame(obtained it from the solver) centered about the barycentre of the Solar system. I am having difficulty obtaining the position vector of the spacecraft near Venus in the ICRF frame. Is there any way to obtain the position vectors of the spacecraft using ICRF frame? The MATLAB code is:

r1vec=[-1.477068281616569E+08,2.279790503327744E+07,4.898292942424305E+03]; Earth position vector in ICRF frame
r2vec=[5.041133888931480E+07,-9.500729420957273E+07,-4.262957928339511E+06]; Venus position vector in ICRF frame
tf=112; m=0;
muC=1.32711E+11;
[V1, V2, extremal_distances]=lambert(r1vec, r2vec, tf, m, muC)


The output is:

V(near earth) =
-4.3381  -26.2828   -1.3166

V(near Venus) =
30.1512   22.1471    1.3083

extremal_distances =
1.0e+08    1.0764    1.4949


The extremal distances are the periapsis and apoapsis distances of the transfer ellipse.

• There seems to be some discussion of the same or similar software here: esa.int/gsp/ACT/projects/gtop/gtop.html as well as a potentially easier to use Python version here: github.com/esa/pagmo Also see this: asee.org/public/conferences/20/papers/7481/download
– uhoh
Dec 25, 2018 at 4:36
• @uhoh Thanks! will go through these and will post further if I have any doubts! Dec 25, 2018 at 4:45
• @uhoh the codes given in the esa website requires you to also specify pericentre radii as well as some "penalty factor" which I am not quite aware of. And the software named TRACT mentioned in the paper is not available for download as of now. Dec 26, 2018 at 23:23
• After re-reading your question a few times I think you are really asking how to use a Matlab program that doesn't have documentation sufficient for you. I don't have Matlab and so I can't try to run it. You might get an answer here but it might take a while, and you might not. In this case you may have to try to contact people who have used the software via e-mail addresses found in websites or published papers. Or, you could try a different Lambert solver. You might also consider this the right time to start using Python. You may find much more support, community and recent activity.
– uhoh
Dec 27, 2018 at 0:08
• One example might be the package described in How does the poliastro python package “Going to Mars with Python” example work? What's it really doing? I think you will have the best results if you find a software solution that has an active community of users. It's just a thought.
– uhoh
Dec 27, 2018 at 0:17

If you mean "obtaining the position vector of the spacecraft near Venus in the ICRF frame with respect to the solar system barycenter" or "obtaining the position vector of the spacecraft with respect to Venus in the ICRF frame" then you misunderstand what information/outputs the Lambert patched conic method is providing you. The Lambert solver is determining the orbit that will take you from $$\vec r_1$$ to $$\vec r_2$$ in the time of flight specified (112 days). This means that at the end of those 112 days the spacecraft is exactly where the center of Venus is (i.e., it is at $$\vec r_2$$).
To determine the position relative to Venus in the days prior to arrival (e.g. day 111 or 110) you can use something like this to get the orbital elements from the state vector output ($$\vec r_2$$ and $$\vec V_2$$) and JPL HORIZONS to determine the positions of the spacecraft and Venus on those prior days. Beware that the closer the spacecraft gets to Venus the more inaccurate the 2-body architecture becomes as the spacecraft falls into Venus' gravity well.
A more common approach is to subtract the planet's velocity (available with HORIZONS) from $$\vec V_2$$ to get the vector $$\vec v_{\infty}$$. This is a useful parameter in describing the hyperbolic orbit the spacecraft will follow as it flies by Venus. It also tells you the overarching direction from which the spacecraft will approach Venus (in the respective coordinate frame).