Jump to main content

A Simulator for Suborbital Spacecraft

1
2
3
4
5
15 reviews

Abstract

Have you ever wished you could fly to space? Space flight is getting more accessible thanks to reusable rockets that make getting to space much cheaper. Civilian astronauts can even buy tickets for a few minutes in space! But exactly how high is "space"? How do engineers predict how high a rocket will go and figure out how to make it land safely? Find out in this project as you explore the physics of suborbital space flight. 

Summary

Areas of Science
Difficulty
Method
Time Required
Short (2-5 days)
Prerequisites

None

Material Availability

Readily available

Cost
Very Low (under $20)
Safety

No issues

Credits
Andrea Grefenstette, Science Buddies
Kenneth L. Hess, Science Buddies

Thanks to Blue Origin for providing NS-25 flight data. Read all about Ken's flight on Blue Origin's NS-25: The Thrill of a Rocket's Launch & Ascent - An Astronaut's Perspective.

Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.

Objective

Simulate the trajectory of a suborbital spaceflight and compare your simulation to data from a real flight. 

Introduction

Look up. Can you see space? Where does the sky end and space begin? While not everyone agrees, one common definition for the "edge of space" is the Kármán line, at an altitude of 100 kilometers (km) above mean sea level. The United States military uses a slightly different definition, an altitude of 80 km above mean sea level. Figure 1 shows where the Kármán line is relative to layers of the atmosphere and various spacecraft.

Layers of the atmosphere and the Karman lineImage Credit: NOAA / Public Domain
Figure 1. Altitude for different layers of the atmosphere and the Kármán line (not to scale).

Space flights that reach space (whichever definition you use) but do not complete a full orbit around the Earth are called suborbital flights. These flights typically give passengers a view of Earth and the Sun from space and a few minutes of the sensation of weightlessness, or zero-g, at the peak of the flight before returning to Earth. Some of them also have reusable rocket boosters that land safely back on Earth to be reused again and again.

How do engineers design a rocket that can reach space? They need to understand the forces acting on the rocket. Rockets burn fuel and expel exhaust gases at a very high velocity. According to Newton's third law of motion—famously stated as "for every action, there is an equal and opposite reaction"—when the exhaust is pushed out of the rocket, it pushes back on the rocket, generating thrust, or the force that propels the rocket upward. The rocket's weight—the force that results from gravity pulling on the rocket's mass—pulls it down. Air resistance, also called aerodynamic drag, also acts on the rocket. See the NASA reference in the Bibliography to learn more about the forces acting on a rocket.

According to Newton's second law of motion, the net force acting on an object, its mass, and its acceleration (the rate of change of velocity, or how much velocity changes per unit time) are all related by an equation:

Equation 1:
 

where

So, if you know the net force on an object, and you know its mass, you can calculate its acceleration. If you know an object's acceleration, you can figure out its position at a given time using two more equations. Remember that acceleration is the rate of change of velocity. Velocity, in turn, is the rate of change of distance. We can write these out as equations:

Equation 2:
Equation 3:

where

There is just one problem—as a rocket burns fuel, its mass changes! This makes "rocket science" a little more complicated than what you will usually learn in your first physics class, where you apply Newton's laws to an object with constant mass, like a ball. Do not worry though—the simulator in this project does this rocket science in a way that is very easy to follow! 

How the Program Simulates the Rocket's Flight 

The simulation models a rocket’s vertical flight by stepping through time in small chunks (like frames in an animation). At each step, it updates the rocket’s velocity and altitude based on the forces acting on it. The method used to do this is called the Euler method, which is a simple way to estimate how things change over time. Here's how the simulation works, step-by-step:

  1. Starting at time t=0, the rocket is on the ground with:
    1. Altitude = 0 meters
    2. Velocity = 0 meters/second
    3. Mass = full (dry mass + all fuel)
  2. For every time step (Δt), calculate how the rocket moves:
    1. During powered ascent (engine is on and the rocket is moving up):
      1. Calculate how much fuel is left based on the fuel burn rate.
      2. Apply thrust. While the engine is on, thrust is a constant upward force.
      3. Calculate gravity. Gravity pulls downward and gets slightly weaker as altitude increases.
      4. Calculate aerodynamic drag. Drag pushes against the rocket's direction of motion and depends on air density (which decreases with altitude) and speed.
      5. Figure out the net force. Net force = thrust (up) - drag (down) - weight (down).
      6. Compute acceleration. Acceleration = net force / current mass.
      7. Update velocity. New velocity = previous velocity + acceleration × time step.
      8. Update altitude: New altitude = previous altitude + velocity × time step.
    2. After main engine cutoff (MECO) during ascent, the engine stops burning fuel and reserves some for landing. The steps above remain the same, but the mass is now constant, and the thrust is zero. 
  3. These steps loop over and over again until the rocket reaches its maximum altitude (apogee), begins to descend (at which point drag points upward instead of down), and finally reaches the ground again (altitude ≤ 0). At this point, the loop ends, and the maximum altitude, velocity, and acceleration are recorded. 

This approach doesn't try to solve the physics equations all at once. Instead, it builds the flight path one step at a time—just like a video game updates each frame. It's not perfectly accurate, but it gives a good estimate, especially with small time steps. To explore a more mathematical description of the rocket equations, check out the Variations section of the project.

You can use the interactive module provided in the procedure to find out how changing a variable—like the mass of the rocket or how much fuel it carries—changes its maximum velocity or apogee. You can even compare your simulated rocket trajectory to data from a real rocket flight. Get ready to try rocket science out for yourself!

Terms and Concepts

Questions

Bibliography

Use these resources to learn more about the physics of rocket flight:

Materials and Equipment

Experimental Procedure

This project follows the Scientific Method. Review the steps before you begin.
Simulation
NS-25 Flight Data
Kármán Line
Altitude (m)
Time (sec)
  1. Click the "run" button in the simulation above.
    1. The animation window shows a graph with time on the x-axis and altitude in meters on the y-axis.
    2. The red line shows data for the real Blue Origin NS-25 flight crew capsule, the blue line shows a simulated trajectory, and the yellow line represents the Kármán line. The simulation assumes that the booster and crew capsule do not separate and land together without a parachute like that used by the actual crew capsule. Because the booster is more aerodynamic than the crew capsule and doesn’t use a parachute, it lands more quickly. You see this in the default simulation when the blue line reaches zero altitude in less time than the red line. See Variations below for ways to make the simulation more realistic.
    3. The text at the top of the window shows the simulated flight's apogee, maximum velocity, and maximum acceleration in both m/s2 and g's (1g = 9.81m/s2). 
  2. Now look at the code below the animation window.
    1. This code contains variables for physical parameters like the mass of the rocket's fuel, the thrust force generated by the rocket engine, and how long it takes to burn the fuel. Write down or copy the default values for the input parameters so you can refer back to them later.
    2. The code also contains a userAnimationTime variable, which controls the length of the animation in seconds. Real suborbital flights can be around 10 minutes long, so the code does not plot the flight in real time. Change this variable to speed up or slow down the animation.  
  3. See what happens if you change the value for one of the variables and re-run the simulation. Before you think about a change, think about whether the change "makes sense." The simulation will try to run no matter what you enter—it will not check whether you have entered a physically "impossible" value (like a negative number for gravity, which would make gravity point up!) or an "unrealistic" value (like a fuel mass of only 1 kilogram). For example, try increasing the value for dry_mass. This simulates a heavier vehicle, for example, one carrying more crew or cargo. How does this change the maximum altitude, velocity, and acceleration achieved by the rocket?
  4. Now try reducing the fuel mass. Note that the rocket does not use all of its fuel on ascent. It saves some fuel to slow down when landing, which is why there are separate fuel_mass_ascent and fuel_mass_landing variables. If you decrease fuel_mass_ascent, you should proportionally decrease burn_time to keep the burn_rate constant. What happens?
  5. Try increasing the thrust without changing any of the other parameters. This simulates a more powerful and efficient rocket engine that can generate more thrust with the same fuel burn rate. Again, think about what is "realistic" when you make this change. (A rocket engine that suddenly produces twice the thrust with the same amount of fuel is unlikely, but a 10% improvement might be feasible.)
  6. Now that you have played with some of the different input parameters, restore the default values that you wrote down earlier. If you cannot find them, refresh the page to reset the code.
  7. For most science projects, you should pick one independent variable (the variable you change—the input parameters) and one dependent variable (the variable you measure—the simulation results). Pick one pair of independent/dependent variables to do an experiment.
    1. Note: remember that to change the amount of fuel as your independent variable, you need to proportionally change both the fuel mass and burn time values to keep the burn rate constant.
  8. What happens to your dependent variable as you change the independent variable?
  9. How does the simulated trajectory compare to the actual NS-25 flight data as you change your input parameter(s)?
  10. There are many more things you can do with this project. Check out the Variations section for more ideas. 

Download the Suborbital Flight Mechanics Simulation Code

icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Global Goals

The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.

This project explores topics key to Industry, Innovation and Infrastructure: Build resilient infrastructure, promote sustainable industrialization and foster innovation.

Variations

  • Try using mass (both fuel and dry mass), thrust, burn time, and aerodynamic parameters for a different launch vehicle, like Mercury-Redstone 3, the first United States human spaceflight by astronaut Alan Shepard in 1961. Even though it had substantially lower thrust, Mercury-Redstone went higher than New Shepherd. Why? Try to model other suborbital rockets (often called sounding rockets).
  • Add velocity and acceleration plots to the output. Where is the maximum g-force? Is it on ascent or descent? Why?
  • How much higher will the rocket go if it doesn't need to reserve fuel for the landing burn?
  • Try using parameters for a model rocket. If you have access to a model rocket with an altimeter, collect your own trajectory data and compare it to the simulation. Note: you may need to decrease the simulation time step (default 1 second) for shorter model rocket flights.
  • While suborbital flights are not concerned with reaching escape velocity to escape Earth's orbit, you can still use your simulation to find out if a particular flight can reach escape velocity. Do research about the "rocket equation." What happens if you keep adding more and more fuel mass to your rocket (remember to increase the burn time as well)? How does the maximum velocity change? Why do orbital rockets normally have multiple stages?
  • Try changing the value of gravity. How does the amount of fuel required to reach escape velocity change for the Moon or Mars instead of Earth?
  • How does the rocket behave if there is no aerodynamic drag (dragCoefficient = 0), like on a moon or planet with no atmosphere?
  • How would you model drag on a planet with a thin atmosphere like Mars? Can you find a model for how Mars' atmospheric density varies with altitude? Is it different than the model for Earth?
  • Can you change the model to be two-dimensional and account for horizontal motion? What happens if you change the rocket's launch angle? See the equations in the Introduction and Rocket Equations of Motion section below. You will also need to apply Newton's laws of motion in the horizontal (x) direction.
  • Plot the x, y, and z velocity and acceleration data from the NS-25 Flight Data spreadsheet. The x-axis points up through the top of the crew capsule, with the y and z axes pointing out through the sides following the right-hand rule. Can you identify key events in the flight (e.g., main engine cutoff, capsule and booster separation, parachute deployment) from these graphs? How do these graphs compare if you plot the velocity and acceleration from your simulation?
  • The basic model uses a simple on/off thrust profile. The actual NS-25 flight had a more complicated thrust profile, including about seven seconds of reduced thrust (not enough for the rocket to lift off) to run diagnostics while still on the launch pad before liftoff, throttling back at the max Q period and again before main engine cutoff (MECO). The default values in the simulation allow for these periods of reduced thrust by using a value that represents an average thrust that is 90% of maximum. Can you include a more realistic thrust profile in your simulation? How does it affect the results? Note that the fuel burn rate will also change proportionally as you throttle the thrust (lower fuel burn rate is what will give you lower thrust in a real rocket).
  • The basic model treats the rocket as a single vehicle without a detachable booster and crew capsule. Can you change the model to include separation of these two components after main engine cutoff? In other words, at the moment of separation, subtract the mass of the booster from the mass of the vehicle, and then continue to track the trajectory using only the mass of the crew capsule. For re-entry, the capsule will have a very different drag coefficient after separation from the booster. Can you also model the parachutes?

Appendix: Rocket Equations of Motion

Simplified Model

For purely vertical flight in the y-direction, ignoring air resistance, the net vertical force Fy on a rocket is the thrust T minus the weight W:

Equation 4:

where Fy is the net vertical force, T is the thrust, and W is the weight (all in newtons). 

The rocket's weight is equal to its mass in kilograms times the acceleration due to gravity:

Equation 5:

where g has a value of 9.81 m/s2 at the surface of the Earth. Gravity at the Kármán line is only about 3% lower than at sea level, so we can treat g as constant.

As mentioned in the Introduction, the rocket's mass changes as it burns fuel. Assume the vehicle itself has a "dry" mass mdry, carries ascent fuel mass mfuel, ascentand reserves fuel mass mfuel, descent for landing. It burns all of the ascent fuel during the burn time with duration tburn, during which time we assume the rocket generates constant thrust T. The fuel burn rate is:

And the total mass m as a function of time is:

Equation 7:

After t > tburn, the thrust drops to zero, and the mass remains constant. This means that the rocket's flight has two phases: the initial powered flight while the engine generates thrust and the mass decreases, and a second purely ballistic phase where (ignoring air resistance) it will act like a constant-mass unpowered projectile.

Now, how do we calculate the rocket's position as a function of time using all the equations we have so far (1-7)? To more easily account for the variable mass, we can do this using the finite difference method (specifically the forward Euler method). For an index i = 0, 1, 2, 3...and a time interval Δt, the time at i is:

Equation 8:

Converting Equation 7 from continuous to discrete form, the mass at index i is:

Equation 9:
Equation 10:

and the weight at i is

Equation 11:

The net force at i is

Equation 12:

and the acceleration at i is therefore

Equation 13:

Now, applying the finite difference method to Equations 2 and 3 from the Introduction, we can first solve for the velocity at i+1:

Equation 14:

and then the vertical position y at i+1:

Equation 15:

Solving for yi+1 requires knowing the initial conditions yi and vi, but we know that the rocket starts from rest on the ground, so yi = vi = 0.

Adding Aerodynamic Drag

The aerodynamic drag force on an object acts opposite its direction of motion through a fluid and is given by the equation:

Equation 15:

where

  • FD is the drag force in newtons (N)
  • ρ is the fluid density in kilograms per cubic meter (kg/m3)
  • v is the object's velocity relative to the fluid in meters per second (m/s)
  • CD is the object's drag coefficient (dimensionless)
  • A is the object's cross-sectional area (perpendicular to the flow direction) in square meters (m2)

Including drag force FD in the equation for the net force on the rocket changes Equation 4 to:

Equation 16:

For objects moving near the surface of the Earth, air density is constant. However, atmospheric density is not constant for a rocket flight—it decreases significantly with altitude. You can look up equations that give density as a function of altitude or tables that contain the information. Similarly, for objects moving at relatively low speeds, the drag coefficient will be constant. However, drag coefficient can change dramatically with Mach number. An object's Mach number is the ratio of its velocity to the local speed of sound. Since the speed of sound depends on air density, it will also change with altitude, meaning that a rocket's drag coefficient changes with altitude as well. However, we can implement a reasonably accurate model of atmospheric drag by assuming a constant drag coefficient and using a simplified model of atmospheric density (the isothermal-barotropic model).

The code for the project includes this simplified model. Can you implement a more accurate model that accounts for variable drag coefficient and/or uses a more accurate model of atmospheric density (like the U.S. Standard Atmosphere 1976)? How does this affect the simulation results? The default values in the model have been tuned to give results that are a close match with the actual flight.  Because the drag coefficient and atmospheric model are closely intertwined, if you enhance the model to incorporate a drag coefficient that varies with velocity or improve the model of the atmosphere, you may need to also re-tune the settings from their default values.

Gravity Variation with Altitude

The following equation approximates the variation of Earth's gravity with altitude:

Equation 17:

where

  • gh is the gravitational acceleration at height h above sea level (m/s2)
  • Re is the Earth's mean radius (m)
  • g0 is the standard gravitational acceleration (9.81m/s2)

The code for this project uses this formula. How much do the simulation results change if you just use a constant value for gravity?

Runge-Kutta vs. Euler Methods

The Runge-Kutta method is another approach for calculating the rocket's trajectory that can, in some cases, give more accurate results than the Euler method. The code for this project can optionally use a fourth-order Runge-Kutta method, commonly referred to as "RK4." To enable RK4, change the line let useRK4 = false to let useRK4 = true. RK4 works like this:

  1. Start with the current velocity and altitude. 
  2. Calculate acceleration at the beginning of the time step (k1):
    1. Compute forces (thrust, weight, drag)
    2. Calculate acceleration = net force/mass
    3. Estimate how much velocity and altitude would change using this acceleration
  3. Estimate again halfway through the time step (k2):
    1. Assume the rocket moved partway using the results from k1
    2. Recalculate forces and acceleration at this new "midpoint" state
    3. Get a second estimate for velocity and altitude changes
  4. Do a third estimate, still at the midpoint (k3):
    1. Use the midpoint velocity and altitude from k2
    2. Recalculate forces, acceleration, and estimated velocity/altitude changes again
  5. Final estimate at the end of the time step (k4):
    1. Use results from k3 to predict velocity and altitude at the end
    2. Calculate forces and acceleration one last time
  6. Combine all four estimates:
    1. The simulation takes a weighted average of the four results:
      1. New velocity = initial velocity + (k1 + 2*k2 + 2*k3 +k4)/6
      2. New altitude = initial altitude + (same pattern for altitude)
    2. This can give a more accurate result than just using the beginning of the time step like the Euler method does. 

How do the simulation results change if you change the timeStep variable? Does the Runge-Kutta method truly give better results than the Euler method in this case?

Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Humans have always longed to fly and to make other things fly, both through the air and into outer space—aerospace engineers are the people that make those dreams come true. They design, build, and test vehicles like airplanes, helicopters, balloons, rockets, missiles, satellites, and spacecraft. Read more
Career Profile
Physicists have a big goal in mind—to understand the nature of the entire universe and everything in it! To reach that goal, they observe and measure natural events seen on Earth and in the universe, and then develop theories, using mathematics, to explain why those phenomena occur. Physicists take on the challenge of explaining events that happen on the grandest scale imaginable to those that happen at the level of the smallest atomic particles. Their theories are then applied to… Read more

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Finio, Ben, Andrea Grefenstette, and Kenneth L. Hess. "A Simulator for Suborbital Spacecraft." Science Buddies, 21 Apr. 2025, https://www.sciencebuddies.org/science-fair-projects/project-ideas/SpaceEx_p045/space-exploration/sub-orbital-rocket-trajectory. Accessed 13 June 2026.

APA Style

Finio, B., Grefenstette, A., & Hess, K. (2025, April 21). A Simulator for Suborbital Spacecraft. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/SpaceEx_p045/space-exploration/sub-orbital-rocket-trajectory


Last edit date: 2025-04-21
Top
Free science fair projects.