[TRNSYS-users] Type 70

David Bradley bradley at tess-inc.com
Mon Feb 12 09:35:37 PST 2007


The documentation for Type70 is quite pathetic - and since I wrote it, I 
guess I am allowed to say so. Yes, it is possible to do what you want using 
Type70 but I am not sure that it is the best solution. You would need one 
external file (containing the value of your one parameter) for each of your 
simulations. The problem is that you would then have to switch external 
files each time you ran the simulation, which would be just as time 
consuming as changing the one parameter. What I would suggest instead is 
that you open the input file in TRNEdit and define a CONSTANT statement for 
the one parameter variable that is to change. You can then set up a 
parametric run and assign as many different values of that one CONSTANT as 
you like. The one thing to remember about parametric runs is that only the 
output files that have the same name as the input file will be reproduced 
(provided that you are not using the Type25 printer in its "append" mode). 
Make sure that if your .dck is named "inputfile.dck" that all of the output 
files have names like "inputfile.out" "inputfile.ou1" "inputfile.txt", etc.

Just for reference, here is some hopefully more useful documentation on 
Type70...

5.13.20 Type 70: Parameter replacement

Type 70 reads a specified text file and takes the values of variables found 
there and inserts them into the correct locations in the simulation. Type 
70 can be used to modify a TRNSYS input file based on the contents of a 
file, which can be left behind by any other program.

5.13.20.1 Component configuration
Type 70 is called once during the first time step. It reads a series of 
numbers out of a text file (the file is given a logical unit number) and 
then inserts those numbers into the main TRNSYS PAR array at the location 
specified by the Unit number given in Parameter 3. Type70 can be used to 
replace the parameters one or more components in a simulation. The first 
parameter of Type70 is the logical unit number assigned to the external 
file containing replacement parameter values. Simulation Studio users need 
to specify an external file name in the "external files" tab of the Type70 
proforma. Type70 then takes a two parameters for each component that is to 
have its parameter list replaced. The first of these parameters is the 
number of consecutive parameters that must be replaced in a given 
component. Type70 always starts by replacing the first parameter but it 
does not necessarily have to replace all parameters for a given component. 
Say, for example, that the user wishes to replace only the fifth parameter 
of a given component. The user would specify that 5 parameters must be 
replaced for that component. The second of the pair of parameter indicates 
which component is to have its parameters replaced by designating its UNIT 
number. Users of the Simulation Studio will need to check the component 
order tab of the "control cards" tool or press the F2 key in order to find 
out what UNIT number has been assigned to each component in the simulation.

The external text file syntax is quite simple; the file will have one line 
for each UNIT that is to have its parameters replaced. Each line simply 
contains a list of the replacement parameters. To follow on the previous 
example, say that UNIT 3 is to have its parameters replaced and that the 
parameter list in UNIT 3's proforma is:

1.0  4.0  67.0  2.0  5.0

Recall that we want to change only the value of the fifth parameter. The 
single line in the external file might be:

1.0  4.0  67.0  2.0  17.0

Which would have the result of changing UNIT 3's fifth parameter from a 
value of 5 to a value of 17.

EXAMPLE
A program is written that provides the TRNSYS user with a number of slider 
bars to set up a 24 hour repeating schedule. The program is designed to 
output a text file (NewPars.txt) containing the 24 selected values of the 
sliders. When the simulation is run (by clicking Calculate or by pressing 
F8), Type 70 looks for the text file left behind by the program, reads the 
values and inserts them into the global PARS array at the appropriate 
location. The PARS array is a TRNSYS array that contains all the values of 
all the Parameters from all the different Types in the simulation. Type 70 
is only called on the first time step; the newly modified Parameters will 
not be changed again during the course of the simulation. In the example at 
hand, the values would be inserted as Parameters for Type 14 (Forcing 
Function), which has been given UNIT number 15 in the simulation. The user 
has set the sliders so that they all have the value 1.5, and the logical 
UNIT number assigned to the slider program output file logical unit 30. The 
parameter list for Type70 would be:

Logical unit number of file containing parameter:                        30
Number of consecutive parameters to be replaced:                    24
The unit number in the deck to which the parameters belong:     15

The file NewPars.txt would have a single line:

1.5    1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5 
  1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5  1.5





At 04:54 2/12/2007, comi.daniele.poli at alice.it wrote:
>Content-class: urn:content-classes:message
>Content-Type: multipart/alternative;
>         boundary="----_=_NextPart_001_01C74E94.3D086D06"
>
>
>Hello,
>I have to simulate a list of simulation, changing the value of one 
>parameter for each simulation. Is it possible to do that automatically 
>using type 70, and how can i write the text file wich containing values of 
>parameters?
>Thanks.
>
>_______________________________________________
>TRNSYS-users mailing list
>TRNSYS-users at engr.wisc.edu
>https://www.cae.wisc.edu/mailman/listinfo/trnsys-users

****************************************************************************************
Thermal Energy System Specialists (TESS), LLC
David BRADLEY                           2916 Marketplace Drive - Suite 104
Partner                                        Madison, WI 53719
Phone: (608) 274-2577 USA
Fax: (608) 278-1475
E-mail: bradley at tess-inc.com
Web Pages:  http://www.tess-inc.com     and      http://www.trnsys.com

"Providing software solutions for today's energy engineering projects"
****************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20070212/4a656164/attachment-0005.htm>


More information about the TRNSYS-users mailing list