Table of Contents

Spacecraft: Ticking the Simulation

Calling a Tick

For all simulations, the simulator must be ticked every Unreal frame to execute the simulation. This is done on the Tick event of the level blueprint. To tick the simulation, the Tick Simulation function can be used.

Untitled

It is best practice to have the tick simulation function be the first function called on the event tick. All updates to the UI and components should be made after the simulation has ticked.

Untitled

The simulation tick has two parameters:

  • Step: This defines the interval between each step size in seconds. By default, \(0.1\) seconds is appropriate for accurate physics.
  • Iterations: This defines the number of times the simulation will tick every Unreal frame. Ticking \(10\) times each frame will slow down the simulation but will run the simulation faster without compromising accuracy.
Note

For certain simulations, the tick size should avoid being above 1s. For physics calculations, components such as reaction wheels will not function correctly with large step sizes as they require accuracy with small ticks. For small tick sizes, the orbit propagator will slowly gain error, while smaller tick sizes will require longer durations to reach a specified simulation time.


Executing the Simulation

The tutorial is complete. When the tutorial is played, the spacecraft should orient its solar panel towards the sun, maximizing the power gained by the spacecraft. The data will be plotted on the UI over time and the simulation will begin execution. When the spacecraft is blocked by the Earth from the sun, the solar panel will be in an eclipse and will be producing no power. This can be seen if the simulation is left on long enough (in this example, it happens after 420s).

Untitled

Note

When in darkness, it is hard to make out where the spacecraft is. By toggling L on the keyboard (using the Nominal observer), the lighting of the viewport will change outlining all components and ignoring shadows.