How Long it Would Take Us to Reach Alpha Centauri PART 2

Prathik S
Science For Life
Published in
5 min readApr 22, 2024

--

Photo by Andy Holmes on Unsplash

Currently, the future of space travel remains a mystery for the most part because it is very difficult to tell how long it might take along with issues regarding the fuel concerns. In my previous article, How Long it Would Take Us to Reach Alpha Centauri, I outline the wait calculation for 6 different rockets from different eras throughout history. This is like a continuation of that series so please make sure to check that article out as well! Here is the link if you are interested: https://medium.com/@prathiksasikumar20/how-long-it-would-take-us-to-reach-alpha-centauri-ff10e862853c

As the title may suggest, I will be coding a Python algorithm to carry out the wait calculation for different rockets and stars in the solar system using the formula and user input. In the case you would like to follow along, I am using the application, PyCharm and have installed Python 3 onto my computer prior.

I will not be using every single rocket from history of course, only the ones I have used in my previous article I mentioned above. Once again, I highly advise you to read that article before reading this one.

The rockets I will be looking at are the RTV-A-2, Saturn V, Minotaur C, Atlas V, Falcon Heavy, Space Launch S. These rockets have been used throughout the history of space travel and they all have different speeds and engines. The purpose of this article is to provide the reader with a clear understanding of the advancements in space travel.

By looking at the wait calculation of these rockets, we are able to see the advancement of these rockets over time while using computer science to make everyone’s life a little bit easier.

To make this algorithm, I use simple Python tools to have user input and if statements to carry out the wait calculation for any planetary object, not just Alpha Centauri like I had outlined in the last article.

Without further ado, I will begin walking you through the code:

distance = float(input("Enter the distance to your planetary object (light years): "))
RTV_A_Two = 0.00000298232 #light years per hour
Saturn_V = 0.00002311305
Minotaur_C = 0.00002538089
Atlas_V = 0.00005368193
Falcon_Heavy = 0.00003669756
Space_Launch_S = 0.00003653354

I first begin the code by asking the user to input a distance they would like to reach. In my last article, I mentioned how Alpha Centauri is 4.24 light years away. This variable essentially asks the same thing (it asks the how far they need to go).

I assign values to each of the rockets that were outlined in my previous article, these are their maximum velocities in the form of light years away. We do this so that it makes the calculation easier and the units will be same.

Rocket_Type = input("Enter your first rocket (RTV-A-Two, Saturn V, Minotaur C, Atlas V, Falcon Heavy, Space Launch S): ")

wait = 0
wait_2 = 0
Speed = 0
Speed_2 = 0
Year = 0
Year_2 = 0

This part of the code asks the user to provide a certain type of rocket, of the ones that we are using. Underneath the first line, I assign a value for each of the variables that I call further into the code. Since I call these later, their value changes, so it does not really matter what their numeric value is now.

if Rocket_Type == "RTV-A-2":
Speed = 0.00000298232
Year = 1948
Rocket_1 = RTV_A_Two
wait = float(distance / Speed)
if Rocket_Type == "Saturn V":
Speed = 0.00002311305
Year = 1963
Rocket_1 = Saturn_V
wait = float(distance/Speed)
if Rocket_Type == "Minotaur C":
Speed = 0.00002538089
Year = 2017
Rocket_1 = Minotaur_C
wait = float(distance/Speed)
if Rocket_Type == "Atlas V":
Speed = 0.00005368193
Year = 2006
Rocket_1 = Atlas_V
wait = float(distance/Speed)
if Rocket_Type == "Falcon Heavy":
Speed = 0.00003669756
Year = 2018
Rocket_1 = Falcon_Heavy
wait = float(distance/Speed)
if Rocket_Type == "Space Launch S":
Speed = 0.00003653354
Year = 2022
Rocket_1 = Space_Launch_S
wait = float(distance/Speed)

This part of the code is where we define rocket 1 based on what the user decides. We calculate the wait here by dividing the distance as defined by the user before by the speed of the rocket which is defined based on the rocket picked by the user.

Rocket_Type_2 = input("Enter your second rocket (RTV-A-Two, Saturn V, Minotaur C, Atlas V, Falcon Heavy, Space Launch S): ")

if Rocket_Type_2 == "RTV-A-2":
Speed_2 = 0.00000298232
Year_2 = 1948
Rocket_2 = Saturn_V
wait_2 = float(distance/Speed_2)
if Rocket_Type_2 == "Saturn V":
Speed_2 = 0.00002311305
Year_2 = 1963
Rocket_2 = Saturn_V
wait_2 = float(distance/Speed_2)
if Rocket_Type_2 == "Minotaur C":
Speed_2 = 0.00002538089
Year_2 = 2017
Rocket_2 = Saturn_V
wait_2 = float(distance/Speed_2)
if Rocket_Type_2 == "Atlas V":
Speed_2 = 0.00005368193
Year_2 = 2006
Rocket_2 = Saturn_V
wait_2 = float(distance/Speed_2)
if Rocket_Type_2 == "Falcon Heavy":
Speed_2 = 0.00003669756
Year_2 = 2018
Rocket_2 = Saturn_V
wait_2 = float(distance/Speed_2)
if Rocket_Type_2 == "Space Launch S":
Speed_2 = 0.00003653354
Year_2 = 2022
Rocket_2 = Saturn_V
wait_2 = float(distance/Speed_2)

The above part of the code does the same as the previous one, but is for the 2nd rocket.

wait_calculation = float(wait) - float(wait_2) + (Year - Year_2)
print("The wait calculation for " + str(Rocket_Type) + " vs " + str(Rocket_Type_2 + " is " + str(wait_calculation) + " years."))
print("For some background, if you get a negative nnumber as the result, this means that the first rocket will reach the destination that many years before the second rocket.\nIf you get a positive number, this means that the second rocket will get to the destination that many years earlier.")

Finally, this is where the magic happens. We calculate the wait calculation by subtracting both waits that were defined by each of the sets of if statements, and add it to the years of each rocket subtracted from each other. I know this sounds complicated but it will make sense if you the previous article to this one that I linked prior.

I hope this does not seem complicated, but we were successfully able to create this program, and if you would like to, you can open the Google Colaboratory link below and run the program yourselves.

https://colab.research.google.com/drive/19AXJXIZYsfDOZHSqcWlZ5hFbp292UIvg?usp=sharing

If you enjoyed this article please give a couple claps and consider following, it extremely helps and motivates me to keep going!

--

--