The pytrnsys package provides a complete framework to run and process, plot and report TRNSYS simulations. It is designed to give researchers a fast, fully automatized and easily reproducible way to execute and share TRNSYS simulations by the use of a single short configuration file. In addition, a large variety of commands is accessible to post-process simulation results in one shot.
The documentation can be found on pytrnsys.readthedocs.io.
In the following all commands should be run from the pytrnsys
directory. The command should be run in a
"Windows Command Prompt" for Windows environment. The commands should be very similar should you wish to install on
Linux.
If you want to install pytrnsys as a python package, follow the "Binary installation / User installation". If you want to develop the code, you will need git. Then you should follow the "Installation from source / Developer installation".
Open a command prompt (e.g. by hitting the Windows-key, then typing "cmd" into the search box and hitting enter). The following commands should be entered into the command prompt just opened.
Navigate to the directory which should contain the pytrnsys
directory:
cd [your-directory]
Replace [your-directory]
(including the brackets []) with your directory of choice: if your
directory is called foo
then pytrnsys
will be installed to foo\pytrnsys
.
Create a virtual environment:
py -3.12 -m venv pytrnsys
Activate it:
pytrnsys\Scripts\activate
Install the wheel
package:
pip install wheel
Install pytrnsys
and its requirements:
pip install -r https://raw.githubusercontent.com/SPF-OST/pytrnsys/v0.6.4-reqs/requirements/releases/v0.6.4/requirements.txt
You can now close the command prompt opened in the first step.
pytrnsys can now be used from a python editor of your choice within the virtual environment you created.
Several original types are delivered with pytrnsys. For those you'll manually need to copy the dll-files from:
pytrnsys\pytrnsys_data\ddcks\dlls
to the respective folder of your TRNSYS installation::
...\UserLib\ReleaseDLLs
https://github.com/SPF-OST/pytrnsys.git
All the following commands should be run from the pytrnsys
directory. The commands
specified are for a Windows environment. They are very similar for Linux.
py -3.12 -m venv venv
venv\Scripts\activate
pip install wheel
pip install -r requirements\dev.txt
Several original types are delivered with pytrnsys. For those you'll manually need to copy the dll-files from:
pytrnsys\data\ddcks\dlls
to the respective folder of your TRNSYS installation::
...\UserLib\ReleaseDLLs
And you're ready to go!
Beware that pytrnsys
can only be run from within the virtual environment you created in
step 1, i.e., whenever you open a new console window from which you want to run it you
first need to active the environment (step 2. above).
This code was not initially developed with the intention to be shared with others outside our institute SPF, but after realizing that it could help the community to have a better workflow with TRNSYS, we decided to share it.
All current developers are based at the Institute for Solar Technology (SPF) at the Eastern Switzerland University of Applied Sciences (OST) in Rapperswil.
A first version of this package was created in 2013 and since then it has evolved considerably. We would like to thank the Swiss Federal Office Of Energy (SFOE) who supported many projects related to simulations of renewable energy systems within which this code has been developed. We would also like to thank the European Union’s Horizon 2020 research and innovation programme for the funding received in TRI-HP under the Grant Agreement No. 81488. The grant allowed us to invest in, among other thing, making the code more usable for users outside SPF.