Skip to content

Repository files navigation

TRNRun

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.

Components

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.

Libraries

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.

Requirements

  • 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.

Python quick start

Install the package with pip:

pip install trnrun

Or with uv:

uv add trnrun

Run 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.

MATLAB quick start

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.

Demo

trnrun-demo.mp4

License

TRNRun is available under the MIT License.

About

TRNRun is a tool for running TRNSYS simulations, built to make batch runs easy to automate, monitor, and orchestrate.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages