GuidesRun a Simulation

Run a Simulation

Configure and execute simulations with custom parameters.

Time estimate: 15 minutes

Goal

By the end of this tutorial, you’ll be able to:

  • Configure simulation time settings
  • Modify initial conditions and parameters
  • Monitor simulation progress
  • Handle common simulation issues

Starting a Run

From any model detail page:

  1. Click Run Simulation button
  2. The run configuration panel opens
  3. Configure settings (see below)
  4. Click Start Run

Configuration Options

Time Settings

SettingDescriptionExample
DurationTotal simulation time100 seconds
Output PointsNumber of data points returned500
Start TimeWhen to begin recording0

More output points = smoother plots but larger data files. 500-1000 is usually sufficient.

Initial Conditions

Override the default starting values for any species:

# Example
prey: 100 → 150
predator: 10 → 20

Click on any species to modify its initial value.

Parameter Overrides

Modify model parameters without editing the model:

# Example
alpha: 1.0 → 1.5
beta: 0.1 → 0.08
⚠️

Invalid parameter values may cause simulation failures. Check parameter bounds in model documentation.

Monitoring Progress

After starting a run:

  1. Status indicator shows current state:

    • 🟡 Queued
    • 🔵 Running
    • 🟢 Completed
    • 🔴 Failed
  2. Progress bar shows completion percentage

  3. Estimated time remaining (for longer simulations)

Run States

StateDescriptionAction
QueuedWaiting in job queueWait
RunningSimulation executingWait
CompletedResults availableView Results
FailedError occurredCheck error message
CancelledUser cancelledStart new run

Handling Failures

Common Error: Numerical Instability

Symptoms: “Integration failed” or “NaN values”

Solutions:

  • Reduce simulation duration
  • Decrease output points
  • Check for extreme parameter values
  • Use a different integration method (if available)

Common Error: Timeout

Symptoms: “Simulation timed out”

Solutions:

  • Reduce duration or complexity
  • Break into smaller runs
  • Contact support for long-running simulations

Common Error: Invalid Parameters

Symptoms: “Parameter out of bounds”

Solutions:

  • Check parameter constraints in model documentation
  • Reset to default values
  • Use biologically reasonable values

Batch Runs

Run multiple simulations with different parameters:

  1. From model page, click Parameter Sweep
  2. Select parameter to vary
  3. Define range: min, max, steps
  4. Start batch

Results are collected and can be compared in the results viewer.

Best Practices

  1. Start simple: Run with defaults first, then modify
  2. Document changes: Note which parameters you changed
  3. Save configurations: Bookmark configurations you use frequently
  4. Compare systematically: Change one parameter at a time

Programmatic Runs

For automation, use the B-Simulant Library:

from bsim.adapters import TelluriumAdapter
 
# Load model and run simulation
adapter = TelluriumAdapter(model_path="model.sbml", parameters={"alpha": 1.5, "beta": 0.1})
adapter.setup({})
 
# Advance simulation
for t in range(0, 100, 1):
    adapter.advance_to(t)
    outputs = adapter.get_outputs()
    print(f"Time {t}: {outputs}")

The configuration varies by model standard:

  • SBML: Use TelluriumAdapter with advance_to(...) and get_outputs()
  • NeuroML: Use NeuroMLAdapter with advance_to(...) (ms)
  • ONNX: Use MLAdapter with set_inputs(...), advance_to(...), and get_outputs()

See B-Simulant Library for full documentation.

Next Steps