Table of Contents

Spacecraft: Ticking the Simulation

Ticking the Simulation

For many scenarios, the simulator is called in the background. By default, it will tick at a rate of 1 simulated second every real-time second. No code is needed to tick the simulation.

Note

By default, the system will tick with a rate of 0.1 step-size. This will occur unless the user configures it otherwise. 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.


Configuring the Tick

When using the Scenario base class, there are options for configuring the simulation. This should be done as the first function on the Event Tick line and is called Configure Simulation.

image.png

The configure simulation function contains the following options:

  • Step: The delta-time targeted between each tick, which affects the simulation components based on the delta and fidelity. This is in seconds.
  • Speed: The ideal simulation speed to reach each second. If this number is set to 10, then this will have the simulation attempt to reach a 10x speed. In this case, it will run 100 ticks, with a 0.1 second step-size every frame.
  • Duration: The time in simulated seconds that the simulation should run for before pausing. If this time is set to 0, then the simulation will run indefinitely.

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).

image.png