I am trying to design an Earth flyby for gravity assist in GMAT, and I know from theory that the spacecraft should pass in front of a planet with regard to its heliocentric direction of motion in order to gain delta-v. Is there a parameter or calculation that can describe that? GMAT offers an option to draw the sun vector for a given orbit view with a specific coordinate system, so I can visually see where the spacecraft is compared to the Earth's direction of motion, but I have to manually input the position that satisfies that condition for any given epoch. Instead I would like to design an optimizer that automatically picks what the position vector of the spacecraft would have to be. Is there a way I can do that?
This question has some really good answers that explain gravity assists and how they could be conceived.
If you're setting up a simulation, this report probably has everything you need, theory, procedure and its done in GMAT so in principal you could set up the same problem, for earth in your case.
My answer wasn't just "thank you" Dave Gremlin, I offered an actual solution after those two words. Repeating it here: As far as a less "official" and temporary solution goes, I created a coordinate system with the Earth as its origin, and the Sun and Earth as its axes references. "Behind" the Earth with regard to the direction of its motion around the Sun is then an inclination of 180 degrees with that coordinate system, and in front of it 0 degrees.