# Repeatable temporary experiments

> Documentation version: 3.0
> HTML: https://docs.flarelive.manifolddynamics.com/manual/control/experiments.html
> [Complete contents](https://docs.flarelive.manifolddynamics.com/contents.md) · [Agent index](https://docs.flarelive.manifolddynamics.com/llms.txt)

Use Document for the scene you want to save. Use **Experiment** for temporary preparation such as cloning robots or randomizing parameters before simulation starts.

## Example: two aircraft in one trial

Suppose Document contains one aircraft named Aircraft A:

1. Choose **Simulation > Begin experiment**.
2. Clone Aircraft A, rename the clone Aircraft B and move it to a separate starting position.
3. Change trial parameters such as mass or controller gains.
4. Initialize, run and inspect the result.
5. **Stop** returns to Experiment with both aircraft and the trial parameters ready for another run.
6. **End experiment (discard)** returns to Document with only the original Aircraft A and its original parameters.

Experiment edits stay temporary even before initialization. To run the original scene directly, initialize Document without beginning an Experiment.

## Run repeated trials with RPC

[Simulation control with RPC](https://docs.flarelive.manifolddynamics.com/manual/control/simulation.md#first-trial-initialize-and-advance) contains a complete connection-to-cleanup script. For a complex scene, build and save its FLL preparation once, then load it for later trials. Use this sequence for each parameter set:

```text
Begin experiment
    Configure the trial
    Initialize
    Apply inputs, advance and record results
    Clear Simulation
End experiment
```

For several runs of the same temporary preparation, keep Experiment active and repeat Initialize → run → Clear. Record the parameters, input sequence, actual simulated time and step size with the measurements.

## Finish or diagnose a trial

| Result | Recommended next action |
| --- | --- |
| Completed successfully | Export/read results, Clear Simulation, then End experiment when its preparation is no longer needed. |
| Initialization or step failed | Inspect Log and current state. Keep the temporary scene available while you fix the cause; Clear before changing preparation-only fields. |
| An asynchronous wait timed out | Check the original Operation and wait for its result. A timeout leaves the operation running or queued. |

For example, when you retain an asynchronous Operation named `operation`, `operation.status()` reports its phase and `operation.result(timeout=120)` continues waiting on the same request. Clear/end after that request reaches a terminal result and you have confirmed this is still your trial.

Keep one controller responsible for lifecycle and advancement. Pause automatic advancement before a scripted control loop. For reconnecting after an uncertain submission, see [tracked operations](https://docs.flarelive.manifolddynamics.com/reference/api/workspace.md#tasks-and-failures).
