I Literally Sent an Algorithm to Space

Cover image for I Literally Sent an Algorithm to Space

In my last year of high school I developed an algorithm that was executed aboard the ISS - International Space Station (literally in space!). This project was part of the European Space Agency's (ESA) Astro Pi contest.

What is the Astro Pi Contest?

The Astro Pi competition is a contest where students from across Europe create scientific experiments and develop algorithms to be run on the ISS. The goal is to inspire young people to pursue careers in science, technology, engineering, and mathematics (STEM) by giving them the chance to contribute to real space missions. Learn more about the Astro Pi contest on the ESA's website by clicking here.

Our Experiment

The main objective of our experiment was to study the relativity of movement between a two-body system—specifically, the Earth and the ISS. We aimed to explore the relationship between the Earth's rotation and the ISS's translation movements to answer the following questions:

  • What is the value of the relative velocity of the ISS-Earth system?
  • Is the relative velocity constant?
  • Is Galileo's Relativity Theory relevant when studying systems with two distinct velocities?

This scientific experiment was conceived by my friend and teammate, David Afonso, who is a math genius. Like common high school students, we had no prior experience with space research or programming for space missions. How did he come up with this idea? He was inspired by the concepts of Galileo's Relativity Theory and the ISS's trajectory. He realized that the Astro Pi's unique position on the ISS could provide valuable data to test these theories. Thus, our project was born.

Method

We wrote an algorithm divided into two parts. For the main objective, the Astro Pi took photographs of the Earth at 5-second intervals and added coordinates to the EXIF fields within each image. For the secondary mission, the Astro Pi used its sensors to compare variations in humidity, pressure, and temperature against reference values. To ensure the validity of our results, we also programmed the Astro Pi to function as a human presence detector using sensors for humidity, pressure, and temperature.

Below is an image of the Earth taken by the Astro Pi aboard the ISS.

Data Analysis

The photographs were mapped on a globe using digiKam software to determine the distance between consecutive photographs. These measurements helped us approximate the relative velocity, verifying the Earth's rotation movement.

Below is an example of a pair of consecutive photographs taken by the Astro Pi.

Several approximations simplified our model:

  • We considered the ISS trajectory to be circular.
  • We assumed the Earth's rotation axis and the ISS orbit to be parallel.
  • We treated the values of Earth's rotation velocity and ISS height as constants.

These approximations, combined with short time intervals for data collection, increased the inaccuracy of our scientific results. However, they were necessary to simplify the mathematical model and make the experiment feasible.

Below you can see all the photos taken plotted on a globe.

Results

We calculated distances between all pairs of consecutive photographs, noting significant events such as deviations due to program errors. Despite some anomalies, we observed a consistent 70 km distance in every six photographs, although these values were excluded to reduce experimental error.

Key Findings

  • The average relative velocity was calculated to be 7.47 km/s.
  • This value was consistent with our expectations, though further refinement of the mathematical model could yield even more precise results.
  • The secondary mission confirmed no significant variation in sensor data, indicating no human presence near the Astro Pi, validating our primary mission data.

Our experiment was partially successful. While the limitations of our mathematical model affected the precision of our results, we successfully demonstrated the importance of considering Galileo's Relativity Theory when studying systems with two distinct velocities. The calculated relative velocity of 7.47 km/s and an experimental error of 10.42% were reasonable given our model's assumptions.

You can find the source code, data, and detailed report of our experiment on GitHub by clicking here.

Improving the Mathematical Model

If this experiment were to be repeated, we could improve our approach to increase the accuracy of our results in many different ways. Here are some steps we could take to refine the model:

Developing a New Model

Data Acquisition

Use real-time telemetry data from the ISS for accurate position and velocity measurements. Obtain high-precision timing data to accurately time-stamp each photograph.

Mathematical Formulation

Use Kepler's laws of planetary motion to describe the ISS's elliptical orbit. Apply Newton's law of universal gravitation to account for variations in gravitational pull. Include atmospheric drag equations to model the deceleration due to atmospheric resistance.

Algorithm Development

Write an algorithm that integrates these various physical factors over small time intervals to simulate the ISS’s motion accurately. Use numerical methods like Runge-Kutta for solving differential equations related to motion and forces acting on the ISS.

Validation and Testing

Compare the model's predictions with actual observational data to validate its accuracy. Perform sensitivity analysis to understand how different variables affect the results and refine the model accordingly.

Memories

For me, the best part of the projects I do is the people I meet and the memories I create. I will never forget the excitement of receiving the news that our algorithm was executed on the ISS and the joy of seeing the photographs our algorithm took of the Earth from literal space.

To be honest, for me, the best part of this project was when we had to submit the project. We were in our high school finishing the report. We were so tired and stressed because it was 23:55 and the deadline was at 00:00. The computer of the school died, so we had to put everything on a pen drive, and I ran across an entire hallway with the pen drive in my hand to reach the only other classroom open with a computer. Despite all the stress and sweat of running, we were able to submit everything by 23:59 (literally).

But then we remembered that the deadline was in UK time, and we were in Portugal. So we had one more hour to submit the project. We laughed so much that night. But the project was already submitted, and there was nothing we could do.

We didn't win or get a place on the podium, but we got something much more valuable. We got to be featured in the municipality's newspaper and got a great and funny story to tell. Below is the photo of the newspaper.

This is another project that I will never forget. I look back at this project with a smile on my face and a warm feeling in my heart. I am so grateful for the opportunity to participate in the Astro Pi contest and all the things I learned.

Final Thoughts

Participating in the Astro Pi contest was a profound experience that taught us a great deal about scientific inquiry, data analysis, and the practical application of theoretical physics. One particular thing I really enjoyed learning was multi-threading in Python. I had never used it before, and it was really cool to see how we could use it to take photos and collect data at the same time.

The opportunity to send our algorithm to space and being able to do scientific research was incredibly rewarding. I encourage anyone with a passion for science and technology to seize such opportunities—they're not only educational but also immensely inspiring.


Click here to share this article with your friends on X if you liked it.