Skip to content

Running your own scenario

cleorf92 edited this page Sep 24, 2026 · 1 revision

You describe your own system in an Excel scenario file and run it with run_scenarios.

1. Start from a template

Download one of the files from Home:

  • the example scenario: easiest to learn from, because you can change a working model step by step;
  • the empty scenario template: a clean file with all sheets and settings ready.

NOTE: Both files contain Excel data validation, so many simple errors (wrong types, missing values) are caught in Excel before you run aiphoria.

Before filling in your data, read the Concepts pages (How aiphoria works, Processes, flows and stocks). The sheet-by-sheet reference starts at The scenario file.

2. Run your scenario

  1. Create a new file, for example run.py, with this code:
from aiphoria import run_scenarios

run_scenarios("path_to_settings_file.xlsx", "output_directory_name", remove_existing_output_dir=True)
  1. Replace path_to_settings_file.xlsx with the path to your scenario file and output_directory_name with the folder where the results should go.
  2. Run it:

Windows:

python run.py

Linux/macOS:

python3 run.py

3. Check the results

The results are written to the output folder you gave. aiphoria creates one sub-folder for the baseline and one for every alternative scenario in the Scenarios sheet. See Output files.

While running, aiphoria prints what it is doing and checks your data first. If something is wrong, it tells you the sheet and row. See Troubleshooting for common messages.


Next: How aiphoria works

Clone this wiki locally