TRNRun is a tool for running TRNSYS simulations, designed to make batch runs easy to automate, monitor, and orchestrate from Python, MATLAB, or the command line.
| Component | Role |
|---|---|
| TRNRun Runner | Runs and monitors one deck, emitting JSON Lines events. |
| TRNRun Queue | Runs multiple decks with bounded concurrency and merges their events. |
| Type3830 | Reports simulation progress for monitoring and stall detection. |
| Client | Role |
|---|---|
| Python | Python interface for running concurrent simulation batches. |
| MATLAB | MATLAB interface for running concurrent simulation batches. |
Both libraries bundle the trnrun and trnrunq executables.
- Windows x64
- TRNSYS 17 or 18
- Python 3.12 or newer for the Python library
- MATLAB R2021a or newer for the MATLAB library
Progress reporting requires the optional Type3830 Progress Tracker in each deck.
Install the package with pip:
pip install trnrunOr with uv:
uv add trnrunRun a deck:
from trnrun import SimulationConfig, SimulationManager
config = SimulationConfig(watch_tmp=True)
with SimulationManager() as manager:
simulation = manager.add(r"C:\path\to\deck.dck", config)
manager.wait()See the Python documentation for concurrent batches, monitoring, and configuration.
Install the TRNRun toolbox from the MATLAB Add-On Explorer.
Run a deck:
config = trnrun.SimulationConfig(watch_tmp=true);
manager = trnrun.SimulationManager();
simulation = manager.add("C:\path\to\deck.dck", config);
manager.wait();
manager.shutdown();See the MATLAB documentation for installation, concurrent batches, and result inspection.
trnrun-demo.mp4
TRNRun is available under the MIT License.