[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Interpolation



Juan,

I do not really understand your problem. In the deck file you describe, you print one value every 24h, i.e. at time=6, 30, 54, etc. So actually the printer should not interpolate anything at 6.25, 6.5 etc. And I do not understand the reason why you use a simulation time step of 0.05 to read a file with hourly time step and output one value per day...

May be the "problem" you are talking about is due to a common misunderstanding about the type9. If you set the data reader to interpolate the data (which you do here for the third output) and if you simply print the values read by the data reader, there will be a difference. This is due to the fact that:
- If you set the data reader to interpolate the data, the type9 interpretes the values as instantaneous.
- In TRNSYS, all output variables are averaged on the time step. So at time 6 you will read the temperature at 6, but output the average temperature between 5 and 6.  

This is better explained by an example 

(NOTE: The example hereunder works in Trnsys14.2, but the attached files give the same example for any Trnsys15 user interested)


Assume you have got this input file, Test.dat

0       0
1       1
2       2
...

And this deck file, Test.dck

assign Test.lst 6
assign Test.dat 10
assign test.out 11

Simulation 0.0 10.0 1.0

Unit 1 Type 9 Std Data Reader
Parameters 10
-2      2        1.0
1       1.0      0.0
-2      1.0      0.0
10


Unit 2 Type 25 Printer
Parameters 4
1.0     0.0      10.0     11
Inputs 2
1,1     1,2
Interp  NotInt


END


The output file (Test.out) will be

TIME            Interp          NotInt   
+0.00000E+00    +0.00000E+00    +0.00000E+00
+1.00000E+00    +5.00000E-01    +1.00000E+00
+2.00000E+00    +1.50000E+00    +2.00000E+00
+3.00000E+00    +2.50000E+00    +3.00000E+00
...

The 1st column is interpolated, even though the simulation time step is the same as the data time step, because outputs are averaged on the time step.

I hope this helps you, if not do not hesitate to contact me again

Michael


PS Your trnshell version is quite old... You can find a more recent one on the SEL website. 
By the way, you could think to upgrade to Trnsys 15 one of these days...

_________________________________________________

Michael Kummert

Solar Energy Laboratory - University of Wisconsin-Madison
1500 Engineering Drive, 1303 Engr Res Bldg
Madison, WI 53706

Phone: +1 (608) 263-1589
Fax: +1(608) 262-8464
E-mail: kummert@sel.me.wisc.edu
 
SEL Web Site: http://sel.me.wisc.edu
TRNSYS Web Site: http://sel.me.wisc.edu/trnsys





-----Original Message-----
From: owner-trnsys@relay.doit.wisc.edu
[mailto:owner-trnsys@relay.doit.wisc.edu]On Behalf Of EXTERN Salazar
Juan Pablo (Praktikant; TT/EVT)
Sent: Wednesday, November 28, 2001 10:52
To: 'trnsys@relay.doit.wisc.edu'
Subject: Interpolation


Dear TRNSYS Users,
I'm experiencing a quite odd situation. For reasons that do not need to be
mentioned, I wrote a very simple Deck that has only one function. It reads
meteorogical data from a file and prints the dry bulb temperature as an
output. This occurs at a specific time every day. What I observed is that
for different hours I became the same temperature. For example: 6h, 6,25 and
6,5. The file has hourly values and they are different between 6 and 7, so
that different values should be expected.
Once I reduce the time intervall at wich printing is to occur and
investigate the temperatures between 6h and 7h TRNSYS interpolates normally.
My TRNSHELL version is 1.993 and the Deck is attached below.
I hope someone out there can help me out.
Best Regards,
Juan Salazar
*===========================================================================
===*
ASSIGN Temperature.LST 6
ASSIGN Temperature.ou1 29
*===========================================================================
===
CONST 12
JAN = 0.0
FEB = 744.0
MAR = 1416.0
APR = 2160.0
MAY = 2880.0
JUN = 3624.0
JUL = 4344.0
AUG = 5088.0
SEP = 5832.0
OCT = 6552.0
NOV = 7296.0
DEC = 8016.0
*===========================================================================
===
CONST 11
STARTMONTH = JAN
S_MONTHDAY = 1
STARTDAY = STARTMONTH/24.0+S_MONTHDAY
STARTHOUR = 6
DURATION = 8736
*===========================================================================
===
TimeStep = .05
START = (STARTDAY-1.0)*24.0+STARTHOUR
StatTime = START
EndTime = START+DURATION
PrStart = START
*===========================================================================
===
SIMULATION StatTime EndTime TimeStep
TOLERANCES 0.005 0.005
LIMITS 75 100 60
WIDTH 72
DFQ 2
*===========================================================================
===
EQUATIONS 1
T = [1,3]
ASSIGN C:\trnwin\weather\wuerzb.try 13
UNIT 1 TYPE 9 Data Reader for TRY
PARAMS 20
* Mode #of_values time_interval
-2 5 1
* Int Mul Add Int Mul Add Int Mul Add Int Mul Add Int Mul Add LU Format
* 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-1 1 0 -2 1 0 3 1 0 4 1 0 5 1 0 13 1
(6X,F7.2,F7.2,F5.1,F6.1,F3.0)
* Outputs [1,#]: # Value
* 1 Ib: Beam Radiation in kJ/(hr*m2)
* 2 Id: Diffuse Radiation in kJ/(hr*m2)
* 3 Tdb: Dry Bulb Temperature in °C
* 4 Ws: Wind Speed in km/h
* 5 RHR: Ambient Relative Humidity Ratio in %
* 19 td1: Time corresponding to values on previous line
* 20 td2: Time corresponding to values on next line
*=========================================================================
UNIT 7 TYPE 25 Printer for each time step
PARAMETERS 5
* time_intervall starttime stoptime LU# User_Units=1
24 PrStart ENDTIME 29 1
INPUTS 1
T
* input labels
T
* input units
C
*---------------------------------------------------------------------------
----
END


Attachment: Test.TPF
Description: Binary data

Attachment: Test.dat
Description: Binary data