Once the spacecraft is built, the agent can run the simulation, record what happens, and read the results back. This is where an agent saves the most time: it can run a scenario, check the telemetry, change a setting, and run it again without you stepping through each run.


Setting the Epoch

The epoch is the date and time the simulation starts at. It decides where the planets, the Sun, and the ground stations are, so it matters for lighting, eclipses, and passes. simulation_epoch sets it while the simulation is reset, as a UTC date and time.

Set the epoch to 4 September 2026 at 04:00 UTC.

Turning On Recording

Studio only stores the history of a run when database recording is on. simulation_database turns recording on or off and sets the interval between samples, in seconds of simulation time. Recording must be on before the simulation starts, so it can only be changed while reset.

Turn on database recording every 10 seconds.

NOTE

Recording slows the simulation, more so at short intervals. Choose the longest interval that still shows the behavior you are interested in.


Running the Simulation

simulation_controls starts, pauses, stops, and resets the simulation, and sets its speed, duration, and step size. The duration can pause the simulation automatically when it is reached.

Run the simulation at 100 times real time for one hour of simulation time, then pause.

simulation_state reports the state, the simulation time, the requested speed, and the speed actually achieved. The achieved speed can be lower than requested on a large scenario or with recording on.

Simulation running at the speed set by the agent

While the simulation runs, the agent can read any variable, check a power bus, take screenshots, and move the viewport, but it cannot change the setup. Stop or reset the simulation to return to editing. Resetting returns every object to the state it had before the run started.


Reading Telemetry

telemetry_history reads recorded values over a window of simulation time, together with the minimum, maximum, and mean of each. Vectors are split into their x, y, and z components.

How did EventSat's battery charge fraction change over the run? Give me the lowest value and when it happened.

Live values are recorded in messages, so the agent reads them as message fields, such as Out_BatteryMsg.ChargeFraction or Out_PowerMsg.NominalPower. The agent can request a coarser resolution or a sample limit to keep long runs short.


Exporting Data

telemetry_export writes every recorded value of an object to a CSV file at a full path, and by default writes each of its output messages to a separate CSV file beside it. Existing files are kept unless the agent is asked to overwrite them.

Export EventSat's battery telemetry to C:/Data/EventSat_Battery.csv.

This is the same recorded data that can be exported from the Plotting Panel or with the Database File option in Exporting a Simulation.


Saving and Loading Simulation Files

simulation_save writes the simulation to a .json simulation file, the portable format shared with the Zendir API. It can be called at any time, including partway through a run to capture the current state. It is an export only: the Studio project is not saved, and Studio-only data such as events, constellations, and panel layouts is not included. See Using Simulation Files.

simulation_export writes the whole Studio project to a .zen file, the same as exporting from Studio. This includes events, panel layouts, notes, and the project name, description, and categories, but not recorded databases or session recordings. It counts as saving the project. Exporting partway through a run keeps the state from before the run started.

simulation_load replaces the current simulation with the contents of a simulation file, while reset. Every existing object is removed first. If the file cannot be loaded, the previous simulation is restored automatically. The open project keeps its name and is marked as having unsaved changes.

WARNING

Loading a simulation file removes everything in the current simulation. Save the project first if you want to keep the current setup.

The agent can now build a spacecraft, wire its power and software, schedule its commands, run it, and report the results. Next, learn how to have the agent start arranging the Studio workspace.