Beta API. See the stability policy.
Test bench outputs
This article lists what comes back when you run a test bench simulation, or one point of a sweep. It tells you where each number lives and what to call it. A sweep point uses the same layout as a single simulation, so everything here applies to both. For a run over time, see Flight outputs.
A finished run has two parts that matter here. result holds the numbers. display_labels is a map from each key to a name you can show a person. For example, thrust_n has the label Thrust (N).
Where the numbers are
result has one entry per rotor, one for the whole vehicle, one for the battery cells and one for the test bench run itself:
| Key | What it holds |
|---|---|
"1", "2", and so on | One entry per rotor, in the order you sent them. Thrust, power, the speed controller and temperatures. |
"All" | The totals for all rotors, the highest temperatures and the battery numbers. |
"Battery" | Lists with one value for each cell. It is there only when the engine reports a cell core temperature. |
"Bench" | How the run went: the outcome, the conditions, the voltage chain, the temperature to empty and the traces. |
A rotor group with count set to 4 gives four entries, "1" to "4", because the engine reads each rotor on its own.
Here is how to read a four-rotor run:
sim = client.simulations.retrieve("sim_2c5tQ...")
r = sim["result"]
labels = sim["display_labels"]
r["1"]["thrust_n"] # thrust of rotor 1, in newtons
r["All"]["total_thrust_n"] # thrust of all four rotors added up
labels["thrust_n"] # "Thrust (N)"To show every number with a proper heading, look each key up in display_labels. If a key isn't there, use the key itself:
for key, value in r["1"].items():
print(f"{labels.get(key, key)}: {value}")What each rotor reports
The keys end in the unit when there is one, such as _n for newtons, _w for watts, _v for volts and _a for amps. A key is there only when the engine gives a number for it. A rotor that stopped, or that the speed controller model doesn't support, has its names and its outcome and no numbers.
| Group | Keys |
|---|---|
| Parts | propeller and motor, the names of the parts. |
| Outcome | bench_outcome, and bench_reason when the engine gives a sentence for it. |
| Speed and force | throttle_pct, rpm, thrust_n, total_torque. |
| Power | power, shaft_power_w, mechanical_power_w, electrical_power_w, efficiency_pct, g_per_w (grams of thrust for each watt) and weight_g (motor and propeller, when both masses are known). |
| Electrical | motor_voltage_v (the voltage the speed controller applies to the motor), battery_voltage_v, current_a, bus_current_a. |
| Propeller aerodynamics | j (advance ratio), ct and cp (thrust and power coefficients), pe (the propeller efficiency), mach (the tip speed as a fraction of the speed of sound), reyn (the Reynolds number), ve (the speed of the air leaving the propeller). |
| Speed controller | esc_power_loss_w, esc_efficiency (from 0 to 1) and esc_model. |
| Temperatures | t_w_degc (winding), t_mag_degc (magnet), t_ambient_degc, p_motor_w (heat in the motor), r_th_k_per_w (thermal resistance), motor_cooling_velocity_m_s. |
irreversible_magnet_warning is true if the magnets got hot enough to lose strength for good.
Some keys appear only for a certain kind of run. For a propeller that isn't pointing straight up into the air, you also get h_force_n (the sideways force on the hub), f_vertical_n and f_horizontal_n. inflow_validity is ok or vrs_band. vrs_band marks a flight condition inside the vortex ring state band, where a propeller sinks into its own downwash. Treat the numbers with care there.
Three keys tell you how well the propeller reading went: frac_converged, compressibility_warning and frac_above_mdd. outside_propeller_model_range is true when the reading is outside the range the propeller model covers.
What the totals report
result["All"] adds up the rotors:
total_thrust_n,total_weight_gtotal_electrical_power_w,total_shaft_power_w,total_mechanical_power_wtotal_current_a,total_bus_current_atotal_g_per_w,total_efficiency_pcttotal_esc_power_loss_w,total_motor_dissipation_wmax_t_w_degcandmax_t_mag_degc, the highest winding and magnet temperaturesf_vertical_total_nandf_horizontal_total_n, when the rotors have a vertical and a horizontal force
It also has converged, which is true when every rotor has the numbers of a reading, and bench_outcome. A test bench result has no airspeed_m_s or vertical_speed_m_s, because the run holds one condition. The condition you set is in the simulation's inputs.
What the battery reports
The battery numbers are on result["All"]. Each one has a snake case key and keeps its label with capital letters and spaces, such as Total Voltage (V):
| Key | What it is |
|---|---|
total_voltage_v | The pack voltage at the reading. |
current_draw_a, power_draw_w | What the pack supplies. |
cell_voltages_v | A list with the voltage of each cell. |
charge_levels_pct | A list with the charge of each cell. |
internal_resistance_ohm | The resistance of the whole pack. |
configuration | How the cells are wired, for example 4S1P. |
remaining_capacity_mah | What is left in the pack. |
est_time_remaining_s | How long the pack lasts at this load. |
est_time_to_reserve_s | How long until it reaches its 20 percent reserve. |
bus_wire_voltage_drop_v, bus_wire_loss_w | The drop and the loss in the wire between the battery and the speed controllers. |
total_battery_dissipation_w | The heat in the cells. |
max_t_core_degc, max_t_case_degc, max_core_case_dt_degc | The highest cell temperatures, when the engine reports them. |
below_discharge_cutoff | true if the cell voltage fell under the pack's limit. |
pack_thermal_coupling_warning | true when the cell core got hotter than its limit. |
result["Battery"] holds only lists with one value for each cell: T_core, T_ambient_cell and, when the engine gives them, T_case, R_cell, P_cell, P_cell_joule and P_cell_entropic. The test bench models one cell for the whole pack, so every entry in a list repeats that cell's value.
What the run itself reports
result["Bench"] is the engine's own record of the run. Its keys use the engine's names and units: SI units, temperatures in degrees Celsius and state of charge in percent.
| Key | What it holds |
|---|---|
outcome, reason | How the run ended and the engine's sentence for it. A refusal names the input to change. |
conditions | The ambient temperature, the hold you asked for and the hold used, the reading window, and the battery's start and end. |
units | One entry for each motor, speed controller and propeller combination. Each has its reading, the smallest and largest value of each quantity over the reading window, the controller settings it ran with and its trace. |
groups | One entry for each rotor group of your request. |
system | The totals of the whole drone at the reading. |
summary | Values worked out from the reading. For each unit that includes voltage_chain, which shows where each volt of the pack went on its way to the motor. |
temperature_to_empty | The calculated temperatures from the end of the hold to an empty battery. |
energy | Where the battery's energy went, in joules. |
trace | The system's values over the run, with at most 500 rows. |
The API reference lists every field of Bench. A sweep point keeps a shorter form, and the rest is at GET /v1/sweeps/{id}/points/{index}.
Sweeps
Each point of a sweep has a rotors entry with the same layout as result, and the same display_labels:
for pt in client.sweeps.list_points("sweep_2c5tQ..."):
thrust = pt["rotors"]["1"]["thrust_n"]
print(pt["index"], pt["inputs"], thrust)A complete example
This script runs one point and one sweep. It prints each key next to its label:
"""Read a test bench result: a single simulation and a sweep share one snake_case layout.
Run it:
export THRUSTLAB_API_KEY=key_... # never hard-code the key
python examples/outputs/read_test_bench.py
A completed simulation carries two siblings:
* result - a dict keyed per rotor ("1", "2", ...) plus "All" (the totals and
the battery numbers), "Battery" (lists with one value for each
cell) and "Bench" (the engine's record of the run). Every per-rotor
and "All" key is snake_case (for example thrust_n, total_current_a).
* display_labels - {snake_key: human_string}, the label to show as a column header
(thrust_n -> "Thrust (N)").
A sweep uses the same layout for each point: a point's `rotors` has the same keys as a
simulation's `result`, and the same display_labels apply. Swap in your own component ids,
or find them by name with client.components.find(...).
"""
from thrustlab import Client
client = Client() # reads $THRUSTLAB_API_KEY from the environment
def print_group(name: str, group: dict, labels: dict) -> None:
"""Print each key -> value alongside its human display label.
Scalar keys print as `snake_key Human Label value`. Lists and nested blocks
print their size only.
"""
print(f"\n[{name}]")
for key, value in group.items():
label = labels.get(key, key) # a key with no label prints as itself
if isinstance(value, (dict, list)):
kind = "dict" if isinstance(value, dict) else "list"
print(f" {key:<28} {label:<28} <{kind}, {len(value)} entries>")
else:
print(f" {key:<28} {label:<28} {value}")
project = client.projects.create(name="sdk read-test-bench example")
# Resolve by name, or paste explicit IDs: motor_id = "comp_motor_xxx"
motor = client.components.find(name="BadAss 2826-820Kv")
prop = client.components.find(name="10.5x4.5")
battery = client.components.find(
name="Liperior 5000mAh 4S 35C 14.8V Lipo Battery With XT90 Plug"
)
# ---- single point ---------------------------------------------------------
sim = client.simulations.create(
project_id=project["id"],
battery_component_id=battery["id"],
airspeed_m_s=0.0,
density_kg_m3=1.225,
state_of_charge_pct=100,
rotor_groups=[
{
"label": "main",
# Four rotors need the Pro plan. On the Free plan, use "count": 1.
"count": 4,
"motor_component_id": motor["id"],
"propeller_component_id": prop["id"],
"throttle_pct": 70,
}
],
)
result = client.simulations.wait(sim["id"], timeout=300)
print(f"single-point status: {result['status']}")
if result["status"] == "completed":
blob = result["result"]
labels = result["display_labels"] # {snake_key: human_string}
# One entry for each rotor: "1", "2", ... (a group with count 4 gives "1" to "4").
print_group("rotor 1", blob["1"], labels)
# The totals across all rotors, and the battery numbers.
print_group("All", blob["All"], labels)
# The per-cell lists. The engine's record of the run is blob["Bench"].
print_group("Battery", blob.get("Battery", {}), labels)
print("\nbench outcome:", blob["Bench"]["outcome"])
# ---- sweep (same schema, one point per grid cell) -------------------------
sweep = client.sweeps.create(
project_id=project["id"],
battery_component_id=battery["id"],
airspeed_m_s=0.0,
density_kg_m3=1.225,
state_of_charge_pct=100,
rotor_groups=[
{
"label": "main",
# Four rotors need the Pro plan. On the Free plan, use "count": 1.
"count": 4,
"motor_component_id": motor["id"],
"propeller_component_id": prop["id"],
"throttle_pct": 70,
}
],
sweep={
"rotor_sweep_mask": [True],
"throttle": {"mode": "range", "start": 10, "stop": 100, "steps": 10},
},
)
sweep_result = client.sweeps.wait(sweep["id"], timeout=600)
print(f"\nsweep status: {sweep_result['status']}")
if sweep_result["status"] == "completed":
# Each point's `rotors` is a single-point result dict; the same snake_case
# keys (and the same display_labels vocabulary read above) apply per point.
print("\npoint | throttle in | per-rotor thrust_n | total_thrust_n")
for pt in client.sweeps.list_points(sweep["id"]):
rotor = pt["rotors"]["1"]
agg = pt["rotors"]["All"]
print(
f" {pt['index']:>2} | {pt['inputs']} | "
f"{rotor['thrust_n']:.2f} | {agg['total_thrust_n']:.2f}"
)
To run a single point or a sweep from Python, see Simulations and Sweeps.