This interplanetary trajectory with 2 flybys was calculated via a v-infinity matching scheme that calculates each leg of the trajectory by using a universal variables Lambert's problem solver and a Newton root solver (estimating a derivative via finite differences). This example is used to validate against Richard H. Battin's book called: An Introduction to the Mathematics and Methods of Astrodynamics.
The general algorithm is as follows:
1. For the first planet, pick a time of departure (Earth in this case)
2. For the second planet, pick a time of arrival (Venus in this case)
3. Use an ephemeris model (SPICE's de432s.bsp in this case) to get the ephemeris of planets 1 and 2.
4. Use the position vectors and time in between them to solve Lambert's problem for the spacecraft
5. Calculate the v infinity value of the Spacecraft arriving at planet 2
6. Use a Newton root solver to calculate the time of flight to the next planet (Mars in this case) that will result in an equal magnitude v infinity at planet 2 (Venus) arrival and departure. This is calculated via Lambert's problem and estimating the derivative via finite differences (time of flight is the independent variable, and deviation from the desired v infinity is the dependent variable)
7. Repeat steps 5 and 6 for all subsequent planets
Its difficult to explain in text without visuals, so don't worry. The next ~5 videos in the Orbital Mechanics with Python series will be covering this topic in depth and I'll be posting software in the GitHub repository for this channel ( https://github.com/alfonsogonzalez/AWP )
Links to the Space Engineering Podcast (YouTube, Spotify, Google Podcasts, SimpleCast):
• Space Engineering Podcast Full Episodes
https://open.spotify.com/show/01Gcgly...
https://space-engineering-podcast.sim...
https://podcasts.google.com/feed/aHR0...
Link to Orbital Mechanics with Python video series:
• Orbital Mechanics with Python
Link to Spacecraft Attitude Control with Python video series:
• Spacecraft Attitude Control with Python
Link a Mecánica Orbital con Python (videos en Español):
• Mecánica Orbital con Python
Link to Numerical Methods with Python video series:
• Numerical Methods with Python
#interplanetarytrajectories #flybys #vinfinity