Satellite Collision Detection: A Hands-On Coding Experience
Abstract
Have you ever wondered what would happen if two satellites crashed into each other in space? While space may seem empty, Earth’s orbit is actually crowded with satellites and debris. In this project, you’ll step into the role of a space engineer, using real satellite data to model orbits, track their movement, and predict potential collisions. You’ll explore how gravity and speed affect a satellite’s movement and learn how scientists use simple math and code to prevent real-life space disasters. With interactive simulations and real-world examples, this project gives you a hands-on look at how we keep satellites - and the technology we rely on - safe in space.
Summary
None
Readily available
No issues
This publication was supported by an agreement with Cornell University, under Prime Agreement MCS2107‑23‑01 from the Department of Defense, Office of Local Defense Community Cooperation. Any opinions, findings, and conclusions or recommendations expressed in this publication are those of the author(s) and do not necessarily reflect the views of Cornell University nor those of Sponsor.

Objective
In this project, you will use real satellite tracking data and Python code to simulate orbits, calculate collision risks, and visualize satellite paths in 3D. You’ll learn how small changes in orbital parameters can prevent or cause potential satellite collisions.
Introduction
Space is vast and expansive, but Earth’s orbit is becoming increasingly crowded with satellites, space debris, and active spacecraft. Collisions in space aren't just theoretical problem—they've already happened, creating thousands of debris pieces that threaten future space missions. One of the most well-known satellite on satellite collisions occurred on February 10, 2009, when an Iridium-33 communications satellite and the inactive Russian Cosmos-2251 satellite collided over Siberia, generating a massive cloud of debris, shown in Figure 1.

The following is an animation of the 2009 collision between Iridium 33 and Cosmos 2251. The blue represents Iridium 33 and the orange is Cosmos 2251. The lines are their paths, solid dot is the satellite, and arrows are the resulting debris after the collision.
With thousands of satellites already in orbit and more launching every year, space agencies must actively monitor and predict potential collisions. Scientists use orbital mechanics, real-time tracking, and collision-avoidance algorithms to keep satellites safe. Understanding how these calculations work is essential for future engineers and space scientists to be able to contribute to and continue this work.
As mentioned above, to predict and avoid satellite collisions, we rely on orbital mechanics, which describes how objects move in space under the influence of gravity. The motion of satellites is governed by Newton’s Law of Universal Gravitation, which states that any two masses exert an attractive force on each other:
where:
- F is the gravitational force in newtons (N)
- G is the gravitational constant 6.674 x 10-11 m3kg-1s-2
- m1 and m2 are the masses of the two objects (e.g., Earth and a satellite) in kilograms (kg)
- r is the distance between their centers of mass in meters (m)
Since Earth’s gravity constantly pulls satellites inwards, they need to travel at a precise speed to stay in orbit. One that is fast enough to counteract that pull and avoid falling back to Earth. That required speed is known as orbital velocity, which at a given altitude is given by:
where:
- v is the orbital velocity in meters per second (m/s)
- M is Earth’s mass (5.972 x 1024kg),
- r is the satellite’s distance from Earth’s center (Earth’s radius + satellite altitude) in meters (m)
For example, a satellite in low Earth orbit (LEO) (~500 km altitude) must travel at around 7.8 km/s to stay in orbit.
Watch this following video to learn more about orbital mechanics:
In this project, you’ll act as a space engineer using real satellite tracking data to predict and analyze potential collisions. You’ll run simulations, adjust orbital parameters, calculate risk, and visualize satellite paths. Can you detect and prevent the next collision? Let’s find out!
Terms and Concepts
- Satellites
- Collisions
- Orbital Mechanics
- Newton’s Law of Universal Gravitation
- Orbital Velocity
- Collision Risks
Questions
- How many pieces of debris did the Iridium 33 and Cosmos 2251 produce and what are potential long term consequences of them?
- Which variables affect a satellite's orbital velocity?
- We know about low Earth orbit, but what other types of orbits are there and at what altitude are they?
Bibliography
- Kelso, T. S. (2012). Iridium 33/Cosmos 2251 Collision. CelesTrak. Retrieved April 1, 2025
- Analytical Graphics, Inc. (n.d.). STK Free Trial Options. Retrieved April 1, 2025
To learn more about TLE data:
- Wikipedia contributors. (n.d.). Orbital inclination. Wikipedia.
- Mahdi, M. C. (2015). Tigrisat orbital motionsimulation and analysis. Journal of Control Engineering and Technology JCET, 5, 1-8.
- PE0SAT. (n.d.). Two-Line Elements (TLE). Retrieved April 3, 2025
Materials and Equipment
Computer with internet access
Experimental Procedure

Setting Up the Google Colab Environment
- You will need a Google account. If you don't have one, you can create one here.
- Download the satellite_collision.ipynb file from Science Buddies. This is the code you will run for this project.
- Within your Google Drive, click on ‘MyDrive,’ then create a new folder and rename it “satellite_collision”. Inside the folder, upload the satellite_collision.ipynb file.
- Double-click on the satellite_collision.ipynb file. This should automatically open in Google Colab.
Explanation of the Physics Used in the Code
- This section explains the physical laws that govern satellite motion. The equations help explain how changes in velocity or altitude affect the simulation’s behavior.
- Code block 1a discusses Newton’s Law of Universal Gravitation and Orbital Velocity which were previously mentioned in the introduction section.
-
Kepler’s Third Law is introduced in this code block:
-
-
Altitude, measured in meters, is the value that sets how high above Earth the satellite starts. You can modify this value to simulate different orbital zones:
-
500e3→ Low Earth orbit (2,000 km) 2000e3→ Higher low Earth orbit (2,000 km)-
20000e3→ Medium Earth orbit (20,000 km) -
35786e3→ Geostationary orbit (35,786 km)
-
- Circular orbital speed (m/s) is given by the following equation:
This formula gives the ideal velocity needed for a stable circular orbit at the given altitude. -
You can multiply the circular velocity by different values to simulate non-circular orbits:
-
1.1→ 10% faster: Creates an elliptical orbit. -
1.414→ Approx. escape velocity: The satellite leaves Earth's gravitational pull. -
0.8→ Too slow: The satellite falls back to Earth.
-
Simulate and Animate a Satellite Orbit
Here we are going to run a simulation to learn more about the four main types of orbits - circular, elliptical, escape, and crash - as shown by Figure 2.

Code block 2 simulates a satellite orbiting Earth using an animation. You can change values like altitude or velocity to simulate different types of orbits (circular, elliptical, crash, or escape trajectory).
You can change altitude which defines the satellite's distance from Earth, and v0 which increases or decreases the satellite's velocity, allowing you to simulate different orbits.
In the simulation, you’ll see a red dot (the satellite) orbiting a blue circle (Earth), with its orbital path traced out in gray. Try adjusting the variables and explore how small changes in speed or position dramatically affect the satellite’s path! For example, increasing altitude creates a larger, slower orbit; increasing velocity stretches the orbit into an ellipse and then once this value hits escape velocity the satellite will break free from Earth's gravitational pull; decreasing velocity leads to a tighter ellipse or even a potential crash orbit scenario.
Simulating and Plotting Real Satellites
- Code block 3a doesn't run any code, rather its a text block containing URLs where you can access Two-Line Element (TLE) data for simulating real satellites and debris. The code linked above that you will run has satellite data in it, but you can and should replace this with satellites of your choosing. Here are the URLs that are also shown in the code file:
- Satellite TLE data:
- Space debris TLE data:
- https://celestrak.org/NORAD/elements/gp.php?GROUP=cosmos-1408-debris&FORMAT=tle
- https://celestrak.org/NORAD/elements/gp.php?GROUP=fengyun-1c-debris&FORMAT=tle
- https://celestrak.org/NORAD/elements/gp.php?GROUP=iridium-33-debris&FORMAT=tle
- https://celestrak.org/NORAD/elements/gp.php?GROUP=cosmos-2251-debris&FORMAT=tle
-
TLE is a standard data format used to describe the orbit of a satellite. Despite the name, a TLE usually comes with three lines: the first is just the name of the satellite, and the next two are lines of numbers that contain the orbital parameters. These parameters include things such as the inclination of the orbit (how tilted it is relative to Earth’s equator), the eccentricity (how stretched or circular the orbit is), and the mean motion (how many times the satellite orbits Earth in one day). Other values describe the satellite’s current position in the orbit and the exact time the data was recorded. To help visualize what these orbital parameters actually represent, take a look at Figure 3.

You can find up-to-date TLEs for all kinds of satellites, from the International Space Station to space debris, on the websites like CelesTrak linked above. So when you use a TLE in your simulation, you're not just creating a random orbit, you're tracking the actual path of a real satellite!
Code block 3c loads and visualizes the orbits of multiple real satellites in 3D using their TLE data. It works by extracting key orbital parameters from each satellite's TLE, calculating the shape and orientation of the orbit in space, and then plotting it around a 3D model of Earth.
- A few important orbital constants are defined:
mu: Earth’s gravitational constant, used to calculate orbital sizer: Earth’s radius (approximate, in km)D: Length of a sidereal day (the time it takes Earth to rotate once relative to the stars)
- The
plot_tle()function takes a dictionary of satellites and their corresponding TLEs, calculates each satellite’s orbit, and plots it in 3D. Inside the function, it loops through each satellite in the dataset. For each one, it reads the two TLE lines and begins extracting the relevant information. From the second line of the TLE, the function pulls out key orbital elements:- Eccentricity, which shows how stretched or oval the orbit is
- Inclination, the tilt of the orbit relative to Earth’s equator
- RAAN (Right Ascension of the Ascending Node), which defines the orbit’s orientation around Earth
- Argument of perigee, the point where the satellite is closest to Earth
- Mean motion, used to calculate the size of the orbit
- Using those orbital values from the TLE, the function first calculates the semi-major axis (the longest radius of the elliptical orbit) and then calculates the semi-minor axis (the shortest radius) and the linear eccentricity (the distance between the center of the orbit and the center of Earth). To orient the orbit correctly in 3D space, the function applies a series of rotations using transformation matrices. The inclination sets the tilt of the orbit relative to Earth’s equator, RAAN (Right Ascension of the Ascending Node) rotates the orbit around Earth’s axis, and the argument of perigee determines where the satellite is closest to Earth within its orbit. Together, these steps turn a flat 2D orbit into a realistic 3D path that shows how the satellite actually moves around Earth.
- The code generates 100 points around each satellite’s orbit, rotates them into the correct 3D orientation, and stores them as x, y, z coordinates. These points are then plotted to create each satellite’s orbit path, with labels showing their names. At the center of the plot, a blue wireframe sphere represents Earth. This wireframe uses polar coordinates to create a globe made of grid lines, giving a clear 3D visual without solid shading. At the end, a dictionary of real satellites and their TLEs—covering amateur radio, Earth observation, and university missions—is passed into the
plot_tle()function. The result is a full 3D visualization of multiple satellite orbits around Earth. You’ll see a labeled, blue wireframe Earth with accurately shaped and tilted orbital paths based on real-world data. It’s a powerful way to see how just two lines of TLE data can be transformed into a detailed view of how satellites move through space.
Simulating Satellite Collisions
Code Block 4 introduces the concept of satellite collisions by first simulating a hypothetical one.
- In this example, we define three different satellite orbits: one in the XY plane (a circular orbit along the equator), one in the XZ plane (a perpendicular orbit), and one in a 45° inclination tilted plane.
- Once you’ve run the code and seen how a collision plays out, you can move on to predicting real ones. Just replace the sample TLE data with two satellites of your choice using the TLE sources linked earlier, and the simulation will show whether those satellites are on a collision course.
- To work with real satellites, refer back to:
- Code Block 3b: for installing the Skyfield library, which allows you to parse and propagate real satellite orbits from TLE data.
- Code Block 3c: for an example of how to load, parse, and plot TLE data using the
tle_datadictionary.
- To work with real satellites, refer back to:
Code Block 5b is a satellite collision risk scanner that evaluates how close two real satellites — CAS-4A and CAS-4B — might get to each other.
- It does this by simulating many orbital positions for CAS-4B and estimating collision risk.
- Several key functions are used:
- calculate_satellite_positions() gets position and velocity from TLE data using sat.sgp4(),
- calculate_relative_position_velocity() subtracts the satellites’ position and velocity vectors to get their relative distance and speed which is key for assessing how close they are and how fast they’re approaching each other,
- calculate_distance() finds how far apart they are in space,
- estimate_collision_risk() uses that distance and their relative speed to calculate a risk score.
- A collision warning is triggered if the distance between the two satellites drops below 10 km. CAS-4A uses real TLE data, whereas CAS-4B is slightly modified by adjusting its Mean Anomaly, which is the angle that indicates where the satellite is along its orbit, starting from the closest point to Earth (perigee). To explore how this affects potential collision risk, the code scans CAS-4B’s Mean Anomaly across a small range (±0.1°), using 1000 small steps. For each step, a new TLE is generated, and the code calculates the positions, velocities, and distance between the satellites. It keeps track of the closest approach found during the scan. After the process, the output shows the Mean Anomaly that resulted in the closest distance, the minimum separation, and a collision risk score where 0 means no risk and 0.5 or higher signals high risk. A graph is also generated showing how the distance changes with Mean Anomaly, with a red line marking the closest point. In this simulation, the satellites come within 1.5342 km at 172.8746°, with a risk score of 0.78, indicating a high chance of collision.
-
- Note: Your results may vary depending on when you run the code, because TLE data is dynamic and reflects current satellite positions. In one example run, the satellites came within 1.5342 km with a risk score of 0.78. On your run, the minimum separation may differ — for example, 0.0119 km with a risk of 0.0044 — and that’s expected.
- This analysis highlights how small changes in orbital parameters can dramatically affect close approaches — a key insight in satellite traffic management.
- This analysis is crucial for predicting and avoiding satellite collisions because even small changes in Mean Anomaly, which controls a satellite’s position along its orbit, can significantly impact how close two objects come. By scanning this variable, we can pinpoint potential high-risk alignments and take action before a collision occurs.
Code Block 5c scans the real-time orbital positions of multiple satellites using their TLEs. It compares every possible pair and calculates potential collision risks based on their current distance and relative velocity. In the example, we used a set of 12 satellites, but you can replace these with any TLEs you find online using the URLs provided earlier.
For each satellite pair, the output includes:
- Propagation status: a numeric code showing if the position and velocity were successfully calculated (0 means success)
- Position (r): the satellite’s 3D location in space
- Velocity (v): the satellite’s 3D speed and direction
- Collision risk: a score indicating how likely the two satellites are to collide
Now it's your time to shine and think like a space engineer!
- Code Block 5d sets up a realistic collision scenario between two satellites, S-Net A and S-Net B, by slightly adjusting the Mean Anomaly in the TLE data. The code calculates each satellite’s position and velocity, then finds their distance and relative speed. A collision risk score is also calculated, where a score near 1 means a high chance of collision. If the risk is greater than zero, the simulation applies a small avoidance maneuver—by increasing S-Net A’s speed slightly—and checks whether the new trajectory successfully reduces the risk.
- In this scenario, the satellites pass within 1.21 km of each other at a relative speed of 1.32 m/s, resulting in a collision risk score of 0.0004. After applying the maneuver, the score increases slightly to 0.0033, showing that the change wasn’t effective. Now it’s your turn to take over: how would you adjust the maneuver to better avoid a collision? Try changing the direction or amount of the velocity adjustment, or experiment with modifying other orbital elements in the TLE data—such as the Mean Anomaly, Inclination, or RAAN. Even small changes can shift the satellites enough in time or space to reduce the risk of a close encounter.
Ask an Expert
Global Goals
The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.
Variations
-
Real Satellite Near-Miss: A Practical Case of Collision Prediction
On February 28, 2024, NASA’s TIMED (Thermosphere Ionosphere Mesosphere Energetics and Dynamics) spacecraft made a close pass by Russia’s Cosmos 2221 satellite, coming within just a few kilometers of each other at an altitude of around 600 km (~373 miles). Although no collision occurred, the event was closely monitored by NASA and the U.S. Department of Defense due to the potential for a high-speed impact that could have created thousands of debris fragments. TIMED, launched in 2001, is a scientific satellite studying the influence of the Sun and human activity on the upper atmosphere. Cosmos 2221, launched in 1992, is a retired Russian military satellite that is no longer operational and cannot maneuver—essentially acting as uncontrolled space debris. With neither satellite able to maneuver, the risk of collision during their close approach was significantly higher.
Code Block 6a simulates and visualizes this event using real TLE (Two-Line Element) data for both satellites.
- It converts the TLEs into SGP4 satellite models using
Satrec.twoline2rv(), then runs a simulation from 00:00 to 03:00 UTC on February 28, 2024, with 1-second resolution (10,800 steps). - Each timestamp is converted into Julian Date format using
jday(), which is required for propagation. - The result is a graph showing the changing distance between TIMED and Cosmos 2221 over time, with the X-axis representing time (UTC) and the Y-axis showing distance in kilometers.
- A red dashed line marks the moment of closest approach.
- The output reports this closest approach at 01:34:12 UTC, with a minimum separation of just 3.2748 km.
This type of analysis is critical for space situational awareness (SSA), helping scientists and space agencies detect, evaluate, and respond to high-risk conjunctions in Earth orbit.
Data Sources:
NASA Blog – TIMED Close Pass
NASA Blog – Passes Safely - It converts the TLEs into SGP4 satellite models using
- Try changing the inclination of one satellite to see how the tilt of its orbit affects the likelihood of a collision.
- What happens if you increase the number of satellites in your simulation? Does it raise the overall collision risk?
- Replace one of the satellites with space debris TLE data — how does debris influence collision prediction?
- Can you modify the orbital altitude to simulate different types of orbits, like low Earth orbit vs. geostationary?
Careers
If you like this project, you might enjoy exploring these related careers:










