Course contentsShow

Module 10 · Lesson 1

Simulation Fidelity

Space software is tested against simulations because the real system is out of reach. This lesson covers what gets simulated, how to choose fidelity, simulated time and how a simulator earns trust.

8 minute readUpdated November 23, 2026

Learning objectives

After this lesson you will be able to:

  • Explain why space programs depend on simulation and what a spacecraft simulator typically models
  • Choose a level of fidelity that matches the question a simulation has to answer
  • Describe how simulated time and determinism make runs repeatable, and how a simulator itself is validated

Testing against a system you cannot touch

In mainstream software, a staging environment is a copy of production that anyone on the team can deploy to. Space programs have no staging spacecraft. For most of development the flight hardware is unfinished. Once finished it is unique and too valuable to experiment on. After launch it is in orbit, reachable only through a radio link.

The foundation course introduced simulators as the answer. This module looks at how they are built and how far they can be trusted. Simulation is used for four reasons:

  • The real system is unavailable. Flight software has to be written and tested years before the hardware exists.
  • The real system cannot be risked. Nobody deliberately fails a sensor on a flight unit to see what happens.
  • The conditions cannot be created on the ground. Weightlessness, eclipse cycles and years of operation exist only in orbit.
  • The system is already flying. Changes have to be rehearsed somewhere else first.

What gets simulated

A spacecraft simulator is a set of cooperating models.

LayerWhat it models
Orbit and environmentPosition and velocity, Sun direction, eclipse, magnetic field, atmospheric density, visibility from ground stations
Spacecraft dynamicsHow attitude changes under torques from wheels, thrusters and disturbances
SubsystemsPower generation and storage, temperatures, propellant, data storage
Sensors and actuatorsWhat each sensor would report, with noise, bias, delay and failures, and what each actuator does when commanded
Ground segmentStation availability, link delays and sometimes the control system itself

The central idea is the separation between the truth model and what the software sees. The simulator knows the true attitude. The flight software sees only what the simulated star tracker reports, with its errors and delays.

A simulator resembles a test double for an external dependency, and the parallel is useful up to a point. A mock returns canned answers. A simulator closes the loop: the software's commands change the simulated physics, which changes the next sensor readings. That feedback is what makes it possible to test a controller.

Fidelity is a choice

Fidelity is how closely a model reproduces real behavior. More fidelity costs development time and run time, needs more parameters that someone has to measure, and adds more ways for the model to be wrong. The useful question is what the simulation is for.

QuestionFidelity that matters
Will next week's plan drain the battery?Energy balance, steps of seconds to a minute
Is the pointing controller stable?Detailed dynamics at the control loop rate or faster
Does the software handle a sensor dropout?Realistic sensor interfaces and fault injection; simple physics is enough
Are operators ready for launch?Realistic telemetry and command behavior

Two mistakes are common. One is building a single very detailed model and starving the rest. The other is using a simple model outside the conditions it was built for, such as a power model that assumes the arrays always face the Sun being used to assess a maneuver that turns them away. Every model should state its assumptions and its valid range. NASA's standard for models and simulations, NASA-STD-7009, asks that the credibility of results be assessed and reported to the people who make decisions with them.

Simulated time and repeatable runs

A simulation keeps its own clock. Simulated time advances only when the main loop advances it, so a week in orbit can run in seconds, a detailed model can run slower than real time, and a run can be paused at the moment of interest. This works only if the software under test takes time from an injected source and never reads the system clock, which is the same discipline as injecting a clock into a unit test.

Most spacecraft simulators use a fixed time step: every model advances by the same interval on each pass. The step has to be small compared with the fastest behavior that matters. Time is best derived from an integer step count, because adding a fractional step thousands of times accumulates rounding error.

A deterministic simulation gives identical output for identical inputs. That requires no wall-clock reads, seeded random number generators, a fixed order of model updates and no unsynchronized threads. The payoff is practical. A failure found in a nightly run can be reproduced exactly, and a change in behavior can be detected by comparing output files. When teams run thousands of cases with varied parameters, known as Monte Carlo analysis, each case is still reproducible from its recorded seed.

A practical example: can the new instrument stay on?

A small Earth observation satellite draws 70 W on average. The operations team asks whether a 25 W instrument can be left on continuously. An engineer writes a deliberately simple model to get a first answer.

// Fixed-step power simulation. Time is in whole seconds, energy in joules.
const ORBIT_PERIOD = 5700;      // s, about 95 minutes
const ECLIPSE_DURATION = 2100;  // s of each orbit spent in the Earth's shadow
const SOLAR_POWER = 120;        // W generated in sunlight
const CAPACITY = 360_000;       // J, a 100 Wh battery
const STEP = 10;                // s, fixed simulation step

class SimClock {
  private ticks = 0;
  now(): number { return this.ticks * STEP; }   // s since simulation start
  advance(): void { this.ticks += 1; }
}

// The last part of each orbit is spent in eclipse.
const inEclipse = (t: number): boolean => t % ORBIT_PERIOD >= ORBIT_PERIOD - ECLIPSE_DURATION;

// Returns the battery state of charge (0 to 1) at the end of each orbit.
function simulate(clock: SimClock, loadPower: number, orbits: number): number[] {
  let energy = 0.8 * CAPACITY;                  // J, start at 80 percent
  const socByOrbit: number[] = [];
  while (clock.now() < orbits * ORBIT_PERIOD) {
    const generated = inEclipse(clock.now()) ? 0 : SOLAR_POWER;
    energy += (generated - loadPower) * STEP;   // W x s = J
    energy = Math.min(CAPACITY, Math.max(0, energy));
    clock.advance();
    if (clock.now() % ORBIT_PERIOD === 0) socByOrbit.push(energy / CAPACITY);
  }
  return socByOrbit;
}

const format = (soc: number[]): string => soc.map((s) => s.toFixed(3)).join(' ');
console.log('70 W load:', format(simulate(new SimClock(), 70, 4)));
console.log('95 W load:', format(simulate(new SimClock(), 95, 4)));

Running it prints the state of charge at the end of each eclipse, which is the lowest point of each orbit:

70 W load: 0.592 0.592 0.592 0.592
95 W load: 0.446 0.142 0.000 0.000

At 70 W the battery refills in sunlight and settles into a repeating cycle. At 95 W it does not. The sunlit surplus is 25 W for 3,600 seconds, or 90 kJ, while each eclipse removes 95 W for 2,100 seconds, or 199.5 kJ. The battery is empty during the third orbit. The hand calculation agrees with the simulation, and that agreement is a small act of validation.

The model is honest about what it omits: charging losses, array output that varies with Sun angle, temperature and age, and heaters that switch on in eclipse. It is good enough to say that continuous operation is not possible. It is not good enough to say what duty cycle is safe. That second question needs the project's validated power model.

Validating the simulator

A simulator has bugs like any other software, and its models can be wrong even when the code is right. Trust is built from evidence, in roughly this order:

  • Analytical checks. Compare against cases with known answers, such as the period of a simple two-body orbit.
  • Unit-level test data. Fit models to measurements of real equipment, such as battery charge curves or wheel friction.
  • Spacecraft-level tests. Compare predictions with results from tests such as thermal vacuum.
  • Flight data. After launch, compare predictions with telemetry and correct the models.

The simulator is kept under configuration control with the flight software, and its known limits are recorded where its users will see them.

One weakness deserves attention. If the same engineer misreads a sensor's interface document and then writes both the flight driver and the simulated sensor, the two will agree with each other perfectly and both will be wrong. Only real hardware exposes that kind of error. The next lesson looks at how real processors and real equipment are brought into the loop.

Key takeaways

  • A simulator stands in for a system that is unfinished, too valuable to risk or already in orbit. It usually models the orbit and environment, spacecraft dynamics, subsystems, sensors and actuators, and the ground segment.
  • Fidelity is a design decision. The right level is the lowest one that answers the question reliably, and one project needs several simulators for several questions.
  • Simulated time is advanced by the simulation, not read from the wall clock. With a fixed step, seeded randomness and controlled inputs, the same run gives the same output every time.
  • A simulator is software and can be wrong. It is validated against hand calculations, test data and flight data, and its known limits are written down.

Knowledge check

Check your understanding. These questions are not graded and you can retry as often as you like.

Question 1 of 3· Select one answerOperators want to know whether a proposed week of payload activity keeps the battery above 30 percent. Which simulation is the best fit for that question?
Question 2 of 3· Select all that applyWhich practices help make a simulation run exactly repeatable? Select all that apply.
Question 3 of 3· Select one answerA thermal vacuum test shows panel temperatures 8 degrees cooler than the simulator predicted for the same conditions. What is the right response?

0 of 3 questions answered.

Glossary

Fidelity

How closely a model reproduces the behavior of the real thing, for the quantities and conditions that matter to a particular question.

Truth model

The part of a simulator that holds the actual simulated state of the spacecraft and its environment, as distinct from what the simulated sensors report.

Simulated time

The time value maintained by a simulation and advanced under its control. It can run faster or slower than wall-clock time, or be paused.

Fixed time step

A scheme in which every model in a simulation is advanced by the same constant interval on each pass through the main loop.

Deterministic simulation

A simulation that produces identical output whenever it is given identical inputs, initial conditions and random seeds.

Model validation

Gathering evidence that a model represents the real system well enough for its intended use, by comparing it with analysis, test results and flight data.

References and further reading

Finished this lesson?

Loading your progress…

Lesson version 1.0.0.