Title: TRNSYSMATLAB
1Type 155 - a new TRNSYS type for coupling TRNSYS
and Matlab Example of using Matlab controllers
with TRNSYS components
W. Keilholz, M. Kummert, P. Riederer
2Origin of TRNSYS
- Originally developed for solar processes at SEL
(University of Wisconsin) - First public version was 6.0 in March 1975
- Many recent developments focus on building loads
and HVAC systems - Now a reference in multizone building and system
simulation (type 56)
3Why has TRNSYS survived ?
- General Purpose (from PV cells to cows)
- Flexible (modular)
- General Component Formulation
- Open Source Code no longer restricted to
FORTRAN - Documentation
- Model Exchange between users
- Continuous full-time SUPPORT
4Solver-Library Communication
WINDOWS FUNCTIONALITY Online plotting Simulation
control
TRNSYS.EXE
TRNLIB.DLL
SYSTEM COMPONENTS Read data files Process
radiation Component performance Some components
use Windows DDE
kernal
types
TRNSYS BRAIN Reads input file Calls
components Determines convergence
5System Definition in TRNSYS
- Set of Components
- Each component represents a physical structure
- Interconnected in order to accomplish a specified
task - Example Solar System
- Collector
- Tank
- Heat Exchanger
- Pump
- Controller
6Black Box Approach
- Requires two unique types of information
- Parameters time-independent quantities
- Inputs time-dependent quantities
- Provides desired variables as Outputs
7System Schematic
, To
.
Auxiliary Heater
m
, Tset
.
Solar Collector
, Ti
8Information Flow
Ti
To
S
Time Dependent Conditions
Solar Collector
Ta
Auxiliary Heater
Integrator
Printer
File containing integrated Qaux results
9Information Flow (2)
- INPUTS are passed to component subroutines.
- OUTPUTS are set by component subroutines.
- TRNSYS kernal directs INPUT-OUTPUT.
- User defines INPUT-OUTPUT connections
10TRNSYS Solver 0
- Successive Substitution (Solver 0 )
- Algorithm
- 1. For each unit, outputs are calculated for the
given inputs outputs are passed as inputs to
other units - 2. As long as the system doesnt converge, step 1
is repeated - Many iterations can be necessary
- The original and still most common solution
method - Best method for standard problems
- Systems which may cause problems
- Little or no capacitance (energy storage)
- Rapidly changing systems with many discrete
states
11TRNSYS Tools
- IISiBat
- graphical front-end for TRNSYS
- PREBID
- graphical tool for entering building information
- TRNSED / TRNSHELL
- tool to share simulations with non-users
- environment for building TRNSYS-based
applications - SimCad
- CAD tool for building Simulation (add-on product)
12TRNSYS tools SimCad CAD tool for building
simulation
- Object and volume oriented automatically creates
an internal data model while the user enters the
building - Able to read IFC files
- Imports DXF files and allows to convert the lines
to objects
13SimCadCAD tool for simulation with TRNSYS
14TRNSYS tools TRNSEDExample Application
15TRNSYS Components
- Subroutines
- Generic formulation
- Choose them from a black box library or
- Write them yourself
16Type 155 Calling Matlab
- Implements a link with Matlab
- Matlab is launched at every TRNSYS yimestep as a
separate process - The TYPE communicates with the Matlab engine
through a Component Object Model (COM) interface - Any Matlab command (including Simulink
simulations) can be run within a TRNSYS
simulation.
17Parameters
Type 155 Component configuration
6 parameters
M Inputs
N Outputs
18TRNSYS PROFORMA Sample simulation
19Type 155 Calling Matlab
- Freely available for all registered TRNSYS 15
users http//sel.me.wisc.edu/trnsys/ - Requires MATLAB and SIMULINK licenses
20Coupling exampleTRNSYS Simbad
- Aim
- Coupling TRNSYS Type 56 with plant / control in
Simulink - TRNSYS ? TYPE56 weather data
- SIMBAD ? Control loop
- - Temperature sensor
- - PI Controller
- - Radiator
- - Actuator
- - Valve
- - Pump
21Coupling TRNSYS SIMBADSystem layout
22Coupling example
TRNSYS TYPE56 Time step 1hour
SIMBAD Plant control Time step 10 sec
Data exchange Time step 1hour
- Surface temp.
- Conv. disturbances
Set point temperature
Mean resultant temperature of 1 hour Set point
for TRNSYS
23Coupling example TRNSYS with Simbad
24Coupling exampleExample output