Trnsys 15

Found iPad Underwater While Searching Drained River! VR180 (River Treasure) - Duration: 15:30. جلسه اول آموزش مقدماتی نرم افزار ترنسیس TRNSYS. Controller Components. The TESS Controllers Library contains numerous controllers for practically any TRNSYS simulation. Components range from a simple thermostat controller to a complex multi-stage differential controller with minimum on and off times, and from a tempering valve controller to an outside air reset controller.

About TRNSYS

TRNSYS (‘tran-sis’), commercially available since 1975, is designed to simulate the transient performance of thermal energy systems. TRNSYS relies on a modular approach to solve large systems of equations described by Fortran subroutines. Each Fortran subroutine contains a model for a system component. For example, Subroutine Type 32 contains a model of a cooling coil. Subroutine Type 56 contains a model of a multizone building. Each component has inputs and outputs. The inlet flow rates and temperatures for the air and water are inputs to the Type 32 model, while the total and latent cooling rates are among the outputs of the model. By creating an input file, the user directs TRNSYS to connect the various subroutines to form a system. The TRNSYS engine calls the system components based on the input file and iterates at each timestep until the system of equations is solved. The alternative to this method is for the researcher to write a single, monolithic program that models only the system at hand. Subsequent changes to the system configuration are more difficult with monolithic programs than they are with modular programs such as TRNSYS.

Unlike many other programs, TRNSYS allows users to completely describe and monitor all interactions between system components. For example, the user determines the connections between the output of the pump and other system components. The modularity of the program allows the user to have as many pumps, chillers, cooling coils and solar panels as necessary, in any desired configuration. Because the components are written in Fortran, a user can easily generate a TRNSYS component to model any new technology that is created. Historically, TRNSYS has been used for simulating solar thermal systems, modern renewable energy systems including PV and wind power, more general HVAC systems, and buildings.

First released in the spring of 2000, TRNSYS 15 for Windows features many improvements to the existing graphical user-interface programs as well as a host of new standard components. A major effort has also been made to allow the user to connect TRNSYS to other, existing simulation tools and to develop non-Fortran components for use with the standard library.

TRNSYS in the Windows Environment

The TRNSYS executable program has changed significantly from earlier versions of TRNSYS. The executable is an independent Windows program that controls the Windows display during the simulation. The executable calls a Dynamic Link Library (DLL) containing the actual TRNSYS Fortran source code. This combination of Windows program and DLL allows TRNSYS to take advantage of the Windows display with few modifications to the original TRNSYS source code.

During a TRNSYS simulation, up to 100 system variables can be plotted on-line (20 on each of 5 separate plots) as shown in Figure 1. The on-line plot is a powerful diagnostic tool for the simulation formulation and allows verification that the simulation is progressing as desired. The user initializes the format of the On-line Display and chooses variables to be plotted in the TRNSYS input file; the On-line Display is the component called Type 65. But even when the simulation is running, the user may pause the TRNSYS simulation, change the scale of the plot, hide one or more variables on the plot, check the precise numerical value of any of the variables, or zoom in on a portion of the display window. If an On-line Display is not desired for a simulation, TRNSYS displays a simple window indicating the progress of the simulation.



Figure 1: The TRNSYS On-line Plot Display

As it has been since its conception more than 20 years ago, the TRNSYS source code is written in Fortran. In order to modify component models in the standard TRNSYS library, a modern Fortran compiler capable of producing 32-bit Dynamic Link Libraries is required. New components can be created using any programming language as long as the compiler used can create a 32-bit DLL. No compiler is required, however, in order to use the components in the standard library. TRNSYS may still be used outside the Windows operating system (under DOS or UNIX). However, the utility programs in the TRNSYS package (PRESIM, IISiBat, TRNSHELL, etc.) and the TRNSYS executable, which handles the On-line Display, are designed for use only with Windows 95/98, Windows NT or Windows 2000. A Fortran compiler is required for using TRNSYS outside Windows.

You can also work with strings and characters to manage a complex structure. Follow the installation instructions and register the software for better work. Matlab crack getintopc. Furthermore, Matlab keygen allows you to arrange metrics to work with serial numbers. Moreover, you are not bound by some features. In fact, Matlab Crack with Keygen is the best program to work on a high-end, professional, digital account.

TRNSHELL

One of the cornerstones of the today’s use of TRNSYS is the TRNSHELL program. With TRNSYS version 13.2 and earlier, the only items distributed to TRNSYS users were the Fortran source code and the manual containing a description of each Fortran component. This left the user to provide the Fortran compiler, an editor to work with input files and view output files, a method for keeping track of all the necessary files, a plotting package for analyzing output, etc. The user also had to type in all the information contained in the input file. With TRNSYS 14.1 for DOS, several of these problems and inconveniences were addressed by including several utility programs with the TRNSYS package.

TRNSHELL brings together in one program all of the activities associated with building, running, and analyzing a TRNSYS simulation. TRNSHELL features a full-featured editor for writing and viewing TRNSYS input files, Fortran subroutines, and output files. Compiling and linking of Fortran subroutines can be executed from TRNSHELL with a single click of the mouse that executes the proper commands for your compiler. TRNSHELL can perform parametric TRNSYS simulations, varying the values of one or more system variables between runs, and store all of the results. Finally, TRNSHELL can plot data from the TRNSYS simulation output.



Figure 2: Editing the TRNSYS Input File in the TRNSHELL Environment

Parametric Simulations in TRNSHELL

Often TRNSYS users wish to explore the effects of changes in several system parameters on system performance. From the Parametrics menu of TRNSHELL, the user may select any of the TRNSYS variables assigned as constants in the TRNSYS input file and add them to a parametric table as shown in Figure 3.



Figure 3: Selecting Variables for the TRNSHELL Parametric Table

After specifying the number of parametric table runs and the values of the selected TRNSYS variables, the parametric table is run and a complete TRNSYS simulation is completed for each row (see Figure 4). Upon completion of the TRNSYS calculations, the results of the parametric table runs may be plotted and the results assessed easily.



Figure 4: The TRNSHELL Parametric Table

Plotting Simulation Results in TRNSHELL

TRNSHELL offers extensive plotting capabilities for TRNSYS simulation results. Following a simulation, plots may be generated of any variable over time or two variables as functions of one another. Complete plotting options include overlaying of plots from one or more output files, plot proportion adjustment, colors, fonts, and more. As always, any variable or parameter in the TRNSYS simulation may be written to a file with any desired frequency. These text files may then be imported into any external analysis software.



Figure 5: TRNSYS Simulation Output Results Plotted in TRNSHELL

TRNSED

TRNSYS users often share simulations with non-TRNSYS users. TRNSED makes this exchange simple. For the TRNSYS programmer, the standard TRNSYS input file is relatively easy to read and edit. However, manipulation of the file might be confusing for those not familiar with its syntax. With the addition of a few commands to the TRNSYS input file by the programmer, TRNSED eliminates unwanted details and generates a professional, customized display of selected parameters and inputs. TRNSED provides a refined interface in which selected inputs may be viewed and/or changed and simulations run. Like TRNSHELL, TRNSED offers a parametric simulation capability as well as post-simulation plotting. Detailed help, unit conversion and input checking are also included at the discretion of the TRNSED programmer. The TRNSYS license agreement allows the TRNSYS owner to freely distribute TRNSED, the small TRNSYS executable, and a TRNSED input file to others.



Figure 6: A TRNSED Input Window Allows Easy Changes to the TRNSYS Input File

IISiBat: The TRNSYS visual interface

The Center for Scientific Research in Buildings (CSTB) in Sophia Antipolis, France has developed a general front-end program, IISiBat, designed for use with any simulation program. CSTB has now adapted IISiBat specifically for use with TRNSYS. The IISiBat environment replaces most functionalities of TRNSHELL (TRNSHELL is still included with TRNSYS for backwards compatibility. It also offers a greater flexibility to develop TRNSED-based applications).

IISiBat had its origin in the perceived difficulty of creating a complete TRNSYS input file to describe the interconnection of components and other simulation parameters. Each TRNSYS component has inputs and outputs that represent the actual pipes, ducts, and control signals of their physical counterparts. The TRNSYS input file tells TRNSYS which parameters and initial values to use for each system component and how the various system components are linked together. For each component, a number of parameters (time-independent quantities), inputs (time-dependent quantities that may be outputs of other components), and initial values must be entered into the input file. For example, below is a section of an input file that indicates to TRNSYS that one of the system components is a solar collector of 6.5 m2 area that receives its solar radiation information from a weather file.

UNIT 1 TYPE 1 SOLAR COLLECTOR
PARAMETERS 10
*NS AREA CP EFF_MODE G_TST A0 A1 A2 OPT_MODE B0 B1
1 6.5 4.19 1 50 .7 15 0 1 0.1 0
INPUTS 10
*T_IN M_DOT T_AMB I_T I_H ID_H RHO INCANG SLOPE
3,1 3,2 5,5 6,6 6,4 6,5 0,0 6,9 6,10
20 200 10 0 0 0 0.2 20 45

TRNSYS input files can be difficult to interpret visually for the novice user. While comment lines can help clarify, They do not help enough. Consequently, the graphical user interface, IISiBat, was devised to simplify the authoring of input files and to provide other features that speed the TRNSYS simulation process as described below.


Using TRNSYS with IISiBat

IISiBat, which can be roughly translated from French as 'Intelligent Interface for the Simulation of Buildings,' is a general simulation environment program that has been adapted to house the TRNSYS simulation software. By its flexible nature, many powerful tools and utility programs can be controlled from the IISiBat shell. In this way, a complete simulation package can be incorporated into one environment program, from simulation engine and graphical connection programs to plotting and spreadsheet software. The IISiBat package is designed to handle all the necessary activities associated with TRNSYS. This is the combined role of TRNSHELL and PRESIM in the other Windows version of TRNSYS. These functions include editing Fortran and input files, displaying listing and output files, plotting results, offering online help, running parametric simulations, and providing shortcuts for several repetitive tasks such as Fortran compiling and linking. Similar, in theory, to PRESIM, IISiBat has an integrated pre-processing utility that allows the TRNSYS user to graphically create TRNSYS input files by connecting inputs and outputs of icons that represent TRNSYS components.



Figure 9: The IISiBat Assembly Window

Figure 9 shows the IISiBat Assembly Window used to create and work with TRNSYS simulations within the IISiBat environment. This main window contains many descriptive icons with lines connecting them. Each icon represents a different system component (eg. pump, solar collector, etc.). The user drags the necessary icons into the Assembly Window. The user creates links between the components that share information. The lines connecting the icons represent the pipes and wires that connect the physical components. While several connections are possible between two components, just one link is displayed. To view or change the input and output connections, the user clicks on the link itself to view a detailed window. A series of Tools around the border of the Assembly Panel window allow the user to place icons onto the working area, connect the icons as necessary, run the simulation, access the editor, access the spreadsheet and plotting packages, and perform many other functions.

In IISiBat, all essential TRNSYS activities are controlled directly from the Assembly Window. For example, to plot the results of a simulation run, the user clicks the Spreadsheet Tool and then clicks on the Printer Icon. The output file generated by this TRNSYS component is automatically loaded into the spreadsheet to be manipulated and plotted. Figure 10 demonstrates the spreadsheet and plotting tool.



Figure 10: IISiBat Spreadsheet and Plotting Tool

Another IISiBat feature helps the user avoid frequent reference to the TRNSYS component description manual. Figure 11 shows an example of the IISiBat Proforma containing a complete component description. The Proforma is a standard method of documenting component models into a syntactical format. The Proforma file is the model documentation standard used in IISiBat. Each TRNSYS component model has been broken down into the Proforma format which is stored in the IISiBat program. The first page of the Proforma window contains information about the history and function of the component model. The second page contains a complete description of the variables required in the model.



Figure 11: First Page of a TRNSYS Component Proforma in IISiBat

Several computer requirements exist for the effective use of IISiBat: an IBM-compatible computer running Windows 95/98, NT, 2000 or Windows XP, at least 64 MB of RAM, at least 65 MB of free disk space, and a Pentium processor.

Content

- Quick Start instructions

- Type 155 Inputs / Outputs / Parameters description

- How to add the required files to TRNSYS

Quick Start instructions

This section gives step-by-step instructions for reasonably advanced TRNSYS users who are using TRNSYS 15.3.00, Matlab 6.5 (R13) and Compaq Visual Fortran 6.6B.
Please refer to the next sections for detailed instructions and troubleshooting.
  1. Run the setup file (trnsys-matlab.exe)
  2. Select your Trnsys15 installation folder (%TrnsysRoot%) for the destination to unzip files
  3. Open your TRNSYS workspace in the compiler (%TrnsysRoot%WorkSpaceCVF66BCVF66B.dsw)
  4. Add %TRNSYSRoot%TrnLibSELSourceCodeType155.f90 to the 'Types' folder under TRNLIB Files (right click, select add, browse to the file)
  5. Add libeng.lib, libmat.lib and libmx.lib to the 'modules' folder under TRNLIB files. Those files are located in %MatlabRoot%externlibwin32digitaldf60 (%MatlabRoot% is your Matlab installation folder, e.g. C:Matlab6p5)
  6. Rebuild Trnlib (F7)
  7. Launch IISiBat and open %TRNSYSRoot%TrnLibSELExamplestrnsys-matlabtrnsys-matlab.tpf
  8. Press F8 to run the simulation. Click on 'yes' to exit the online plotter and Matlab will create a new figure

Note: To add Type 155 to a new project, select its proforma in TrnLibSELCalling Matlab

Type 155 Description

ObjectTRNSYS - Matlab link

Abstract
TRNSYS - Matlab connection
Note: to use this Type, the following Matlab libraries should be linked with trnlib.dll:
libeng.lib, libmat.lib, libmx.lib
In addition, Matlab's 'binwin32' folder must be on windows search path

Detailed description

This TRNSYS Type implements a link with Matlab
The connection uses the Matlab engine, which is launched as a separate process.
The Fortran routine communicates with the Matlab engine through a Component Object Model (COM) interface.
Type 155 can call different kinds of components which have different behaviors in TRNSYS.
The currently implemented options are:
- Standard Iterative component (called at each call of each time step)
- Real-time controller (called at the first call of each time step with the converged inputs from previous time step)
The current version of Type155 uses fixed names for the m-files that Matlab runs when a given unit is called.
- The m-file run at the first call of the first time step is: type155initialize_NNN.m
- The m-file run during other time steps is: type155simulate_NNN.m
- The m-file run at the very last call (info(8)=-1) is: type155terminate_NNN.m
NNN is parameter 6 padded with leading zeros if needed.
E.g. if par(6)=2, NNN will be 002 and the file called at the very first call of this unit will be type155initialize_002.m
ALL m-files must be in the same directory as the TRNSYS deck file OR in a directory on Matlab's search path
Note that Type155 will change the current Matlab directory to the TRNSYS deck file directory
When Type 155 calls Matlab, 3 variables are available:
t (1 x 1 array), info (1 x 18 array) and inputs (1 x nInputs array)
- t is TRNSYS simulation time
- inputs is the unit input vector (XIN in TRNSYS types)
- info holds information on the simulation and the current unit
info (1:15) is the TRNSYS INFO array (see manual for a description)
info(16) is TIME0 (simulation starting time)
info(17) is TFINAL (simulation end time)
info(18) is DELT (TRNSYS time step)
Type155 expects Matlab to create a variable called outputs (1 x nOutputs array).
Note: if necessary, Type 155 will create or pad the 'outputs' variable with -99999 to avoid memory access
violation errors
Warning: if you use ignoreEngineClose to leave Matlab running when TRNSYS exits, you will notice that the
Matlab instance will exit by itself after a certain time. You should save your session and open it in another
Matlab instance (which was not launched by TRNSYS) if you plan to work for a long time with the data

Icon
AuthorMichaël Kummert
OrganizationSolar Energy Lab, UW-Madison
EditorMKu
Creation date2003-05-28
Modification date2003-06-24
Model typeSimplified
ValidationQualitative
Assembly
Type number155
Allowed instances
KeywordsMatlab
external
link
IndiceNameDimensionUnitTypeMinMaxDefaultComment
1typeVersionDimensionless-real0+Inf0This parameter gives the version number of the Type. It will be used in future versions to ensure backwards compatibility
2nInputsDimensionless-integer12000Number of inputs sent to Matlab
3nOutputsDimensionless-integer12000Number of outputs from Matlab
4componentKindDimensionless-integer0100This parameter describes the behavior of this component. Currently, the values 0 and 10 are defined.
0: Standard Iterative component (called at each call of each time step)
10: Real-time controller (called at the first call of each time step with the converged inputs from previous time step)
5ignoreEngCloseDimensionless-boolean010If this parameter is not 0 for at least one unit of Type 155 in the simulation, the Matlab engine will not be closed when TRNSYS exits. This can be useful for further data analysis or debugging purposes. Please read the warning in 'Description'
Please note that the Matlab instance launched by TRNSYS will exit by itself after a certain time, so you should save your session and re-open it in another Matlab instance if you want to keep working on the data
6mFileIdDimensionless-integer09990The current version of Type155 uses fixed names for the m-files that Matlab runs when a given unit is called. The m-file names are:
- type155initialize_NNN at very first call
- type155terminate_NNN at very last call
- type155simulate_NNN at other calls
NNN is parameter 6, padded with leading zeroes if needed (e.g. if par 6=2) the initialisation m-file will be type155initialize_002.m
IndiceNameDimensionUnitTypeMinMaxDefaultComment
1.ninputany-real-Inf+Inf0Input sent to Matlab. The total number of inputs is set by parameter 2 (nInputs)
IndiceNameDimensionUnitTypeMinMaxDefaultComment
1.noutputany-real-Inf+Inf0Output from Matlab. The total number of outputs is set by parameter 3 (nOutputs)

How to add the required files to TRNSYS

1. General information

The following information applies to TRNSYS 15.3.00 and above and Matlab 6.5 (R13) and assumes you are using the Compaq Visual Fortran 6.6B compiler. However, you should be able to apply the method to other Matlab versions and different compilers.

In the following, the strings hereunder will refer to the folders in which these 3 programs are installed:

ProgramInstall FolderExample (default install folder)
Matlab R13%MatlabRoot%C:Maltab6p5
TRNSYS 15.3.00%TRNSYSRoot%C:Trnsys15
Compaq Visual Fortran 6.6B%CVFRoot%C:Program FilesMicrosoft Visual StudioDF98

1.1. Included files and their location

Note: if you unzip the files in the package and select your TRNSYS root folder for the destination directory, all files should be saved at the correct location. This will replace your current param.inc but the new one is fully compatible with TRNSYS 15.3.00 (see 3.1)

Type155.f90:
Type 155 source code
%TRNSYSRoot%TrnLibSELSourceCode

param.inc
:
updated include file for TRNSYS
%TRNSYSRoot%Include

Type155.tmf and type155.bmp
:
IISiBat proforma and icon for Type155
%TRNSYSRoot%IIsiBat3DataTrnLibSELCalling Matlab

trnsys-matlab.tpf, type155*.m
:
Example files
%TRNSYSRoot%TrnLibSELExamplestrnsys-matlab

type155-manual.html, trnsys-matlab-example.html:
Documentation files
%TRNSYSRoot%TrnLibSELDocumentationtrnsys-matlab

2. Computer Setup

NOTE: If the programs have been correctly installed, you should not need to do anything. This section is mainly there for reference and troubleshooting purposes.

The following folders should be added to Windows search path:
%MatlabRoot%BinWin32 ; %TRNSYSRoot%; %CVFRoot%Bin

In Windows NT/2000/XP, right click on My Computer, choose 'Properties', 'Advanced' and then 'Environment variables'. Look for Path in you user variables or in the System variables (the latter is recommended). Add all the above strings separated by semicolons(;) if they are not already present.

In Windows 95/98, you should edit the Autoexec.bat file and add the following line:
PATH=%PATH%;%MatlabRoot%BinWin32;%TrnsysRoot%;%CVFRoot%Bin
(attention, %PATH% should appear literally, while other strings should be replaced with the real installation directories, e.g. C:Matlab instead of %MatlabRoot%)

NOTE: The presence of different TEMP variables in User and System variables sometimes causes problems when using the Compaq Visual Fortran compiler. It is recommended to remove one of the TEMP definitions (e.g. the one in System Variables).

3. Add Type155 to your Trnlib DLL

3.1. If you are using CVF 6.6B

Open the Trnsys Workspace (%TRNSYSRoot%WorkSpaceCVF66BCVF66B.dsw). In the left pane, select 'Trnlib files', then the 'Types' folder. Right-click and select 'add files to folder'. Browse to the location where you have saved Type155.f90 (e.g. %TRNSYSRoot%TrnLibSELSourceCode) and select it.

NOTE: Type155 requires a new version of param.inc, which is included in the package. You should replace the existing param.inc file in %TRNSYSRoot%Include with the new version prior to compiling Type155.

3.2. If you are not using CVF 6.6B

You should modify your project to include Type155, as you would do for any non-standard Type. Instructions are available on the TRNSYS website (http://sel.me.wisc.edu/trnsys, see 'Fortran Info').

NOTE: Type155 requires a new version of param.inc, which is included in the package. You should replace the existing param.inc file in %TRNSYSRoot%Include with the new version prior to compiling Type155.

Trnsys 18 crack

4. Add the required libraries to the CVF project

4.1. If you are using CVF 6.6B

In order to use the Matlab engine library, you have to add 3 libraries: libmat.lib, libeng.lib and libmx.lib. A version of those libraries which is compatible with CVF 6.6B is included in the Matlab R13 distribution. To add them to the Trnlib Project:

Open the Trnsys Workspace (%TRNSYSRoot%WorkSpaceCVF66B.CVF66B.dsw). In the left pane, select 'Trnlib files', then the 'modules' folder. Right-click and select 'add files to folder'.

Select %MatlabRoot%externlibwin32digitaldf60libeng.lib, %MatlabRoot%externlibwin32digitaldf60libmat.lib and %MatlabRoot%externlibwin32digitaldf60libmx.lib

4.2. If you are not using CVF 6.6B

Please check the Matlab website to see if your compiler is supported. At the time of writing, only the 'Digital Fortran 5.0' and 'Digital Fortran 6.0' families were supported (CVF6.6B is the latest version in the 'Digital 6.0 family'). Use the appropriate .lib files for your compiler (all of them are included in %MatlabRoot%externlibwin32YOUR_COMPILER

If your compiler is not supported, you can still use the lib command to make the .lib files using the corresponding .def files.
Those .def files are in %MatlabRoot%externinclude. Bowmasters gameshack ws. You need to use libeng.def, libmat.def and libmx.def

5. Rebuild Trnsys

The easiest way to rebuild the entire workspace is to use the 'Build/Batch Build' command. You can then select the appropriate configuration for each one of the three projects. For example, if you want to be able to debug your application, select:

DummyLib - Win32 Debug
ExtDLL - Win32 Debug
TrnLib - Win32 Debug

Then click on 'Rebuild all'

The following files should be created:

Trnsys15DummyCVF66BDummy.lib
Trnsys15ExtDLL.dll
Trnsys15ExtDLL.lib
Trnsys15ExtDLL.exp
Trnsys15Trnlib.dll
Trnsys15Trnlib.lib
Trnsys15Trnlib.exp

6. Launch IISiBat and run the example

Open the example (trnsys-matlab.tpf, which should be in %TrnsysRoot%TrnLibSELExamplestrnsys-matlab) and press F8 to run it.
Please read trnsys-matlab-example.html for more details on that example.

To use Type155 in other projects, you should drag it from the direct access tool (the proforma will be in %TRNSYSRoot%IIsiBat3DataTrnLibSELCalling Matlab)

Comments, Questions? Please contact trnsys@engr.wisc.edu

Michaël Kummert
Solar Energy Lab, UW-Madison
2003-06-25