Last time: Plots the trajectory of a rocket after the engines stop firing using an N-body approach.
This time:
Now, from the starting menu, the user has an option to do an orbital transfer. If this option is chosen, it asks if the user wants to either launch a rocket or input orbital elements to calculate the original location and velocity of the rocket. I will go through each in turn.
Orbital Elements:
As you can see, the program prompts for the 6 orbital elements (angular momentum found from eccentricity and semi-major axis).
It then plots the orbit and draws a line to the current location.
Rocket:
The program gives the same options to the user for launching a rocket as the rocket function. Once it is "launched" it takes the radius and velocity vector of the rocket and finds the 6 orbital elements from that. It then plots the projected orbit of the rocket, as seen below.
The launch: Falcon 9 (light), 5000 kg payload, thrust vectoring at 20 seconds for 20 seconds at 30 degrees to east for 80 degrees.
Left: Projected orbit of the rocket in accordance with the orbital elements.
Right: Close up on the perigee end. Notice the line pointing to where the rocket currently is. Also, the rocket's trajectory does land it inside of the Earth (meaning it crashes) at some points on the perigee end.
This figure shows the N-body version of an identical launch. Notice the similarities in launch location and trajectory. If you look closely at the N-body projection, you can see the lines do not line up perfectly as they do with the orbital element plot. This is because of including the masses of all other celestial bodies instead of assuming a two body system and only using Earth's mass. While this model is more accurate in the long run, the orbital element model can be used to predict short term trajectories, and can be back checked with the N-body model and the trajectory can be adjusted if it gets off course.
Here the option is given for which type of orbital transfers the user wants. The options currently are a general orbit transfer, a rendezvous, a rendezvous with the moon, or a deep space mission which will include rendezvous with other planets, solar/celestial body orbiting, and gravity assists. Depending on the choice, the program will either prompt for the target orbit's orbital elements, target satellite/spacecraft's orbital elements, or plot where the moon is.
Left: General orbit transfer: Plot of Earth, current trajectory and location, and target orbit.
Center: Rendezvous: Plot of Earth, current trajectory and location, and target orbit and satellite location.
Right: Plot of Earth, current trajectory and location, and current trajectory and location of the Moon.
This is as far as I have written. Next the user will decide at what anomaly they wish to launch, anomaly to arrive at target orbit, and the time of the transfer. The orbital transfer, rendezvous, and moon rendezvous are going to have very similar coding so I plan on finishing those before beginning the deep space function.
There are currently 27 functions (soon to be more), so needless to say my folder is beginning to become clustered. Once I finish what I am currently working on, or when I feel like it, I am going to go through and delete redundant code and re-write some functions to increase versatility.
No comments:
Post a Comment