Professional Documents
Culture Documents
Program Manual
Version 2.7
InSitu Scienti c Software
c/o W. Spirkl, Kriegerstr. 23d, D 82110 Germering
November 18, 1997
Contents
1 Recent Changes 1
2 Rights and Warranty 4
3 Introduction 4
4 Software Installation 6
4.1 Computer Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5 Dynamic System Testing 7
5.1 The Algorithm of Parameter Identication . . . . . . . . . . . . . . . . . . . . . . 7
5.2 The Programs for Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.3 Skipping Subsequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3.1 Partitioning of Large Continuous Data Sequences . . . . . . . . . . . . . . 10
5.4 The Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.4.1 Choice of the Filter Constant . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5 The Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5.1 Global and Local Minima . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.5.2 Data Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.5.3 The Data Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.6 The Command File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.6.1 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.6.2 The Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.7 Output on the Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.8 The Output Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.8.1 The Short Result (DFS-) File . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.8.2 The Parameter Start Value (DFP-) File . . . . . . . . . . . . . . . . . . . . 15
5.8.3 The Result (DFR-) File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
i
5.8.4 The Log (LOG-) File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.8.5 The Residue (Rn -) Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.8.6 The Filtered Residue (Fn -) Files . . . . . . . . . . . . . . . . . . . . . . . 16
iii
List of Figures
List of Tables
iv
1 Recent Changes
Version 2.7: Error in seasonal dependence of mains temperature
corrected. Day of lowest mains water temperature is now correctly read in units of days.
Version 2.6: Seasonal dependence of mains temperature
Version 2.5: Up to 500 data sets
can be tted simultaneously.
Version 2.5: New Filter command
Version 2.5: New StartPar command
Version 2.5: New interface for external models
.
Version 2.5: Input command
included.
Version 2.5: Program DF-ListR for listing t results
included.
Version 2.5: INI les renamed to DFP.
Version 2.5: Program DF-Met
accepts Alice Springs (Australia) weather data.
Version 2.4: Demo for linear reference model
included.
Version 2.4: Program for showing the meaning of skipping
the interval inuenced by the initial system state is now general.
Version 2.4: New options /IS and /FN
for the t programs.
Version 2.4: DF-Met now
processes EC TRY data.
Version 2.4: STP Syntax
has changed. Previous syntax can still be used. New options /IS and /FN.
Version 2.4: LTP/STP corrected,
might change error specication for short and long term prediction.
Version 2.4: Corrected Algorithm to Calculate the Objective Function.
No change when not using a time variant lter. Otherwise an increased value of the objec-
tive function for a single sequence, marginal changes in the parameters for more than one
sequences.
1
2 InSitu Scienti c Software, DF 2.7
3 Introduction
Is there any special problem in testing SDHW systems in short time, say three weeks? Yes, there
is.
It is the coincidence of two facts: First, the gain of a SDHW system depends on a lot of dierent
factors, such as solar irradiance, ambient temperature, load volume and prole and cold water
temperature. Second, the `system time constant', say the time in which one store volume is
withdrawn, is about one day or more.
It follows that several parameters have to be determined to characterize the inuence of various
eects on the system under test. Furthermore, the determination of each parameter may take a
time of about several multiples of the system time constant. So we arrive at a minimum testing
time of several months.
The main idea of the programs described in this manual is to minimize experimental eort and to
compensate for it by appropiate mathematical tools, which use as much information as possible
from the test data.
A method which takes only little information is for instance the performance rating test 1] {
only one number is extracted from a three day laboratory test! The reason for needing so much
time is the requirement of stationarity { the energy in the store at the beginning and the end of
one day, for which the integral gain is determined, has to be equal.
4
3. RECENT CHANGES 5
The method implemented here, the dynamic method, uses all information at system input and
output as function of time. Furthermore, there is no stationarity requirement on the data. This
is very important, because it may take more time to get stationarity than to vary input variables
for determination of one parameter, and because it may be impossible to guarantee stationarity
(in-situ testing).
For more information about the mathematical aspects of the dynamic method we refer to 2]
and App. A.
The development of a dynamic system test procedure for SDHW systems was encouraged by
the experiences in the work of the task III of the Solar Heating & and Cooling (SHC) Programme
of the International Energy Agency (IEA) 3]. Here it was found, that stationary models should
not be applied in an outdoor test procedure. The method was developed in the frame of a Ph.D.
thesis 4] (in german language). The development was sponsored by the Bundesministerium
fur Forschung und Technologie, grant numbers 0382101C, 0328768A and 0328768B. Further
experience was gained in the DSTG working group of the IEA 5]. Research is currently underway
within the Task 14 of the IEA SHC Programme.
The method of dynamic tting is in no way restricted to SDHW systems or to the plug ow
model which is used here for SDHW systems. For this reason, additionally to the t program
for the plug ow model (DF P), a general t program (DF) is provided which allows parameter
identication using an arbitrary model, e.g. a dynamic model for solar collectors which is provided
in source code in this package.
4 Software Installation
4.1 Computer Resources
An IBM-compatible PC is required with at least 640 kByte memory, a xed disk, a CPU of type
80286 or higher and a numerical coprocessor. The operating system must be MS DOS 3.3 or
higher.
The programs are available for real mode or for protected mode operation. The latter mode is
recommended. In both modes the programs can be run in DOS winodws under MS Windows
operation.
If the optional graphical presentation of the results is used, a printer compatible to the EPSON
LQ850 24-needles printer or EPSON FX80 9-needles printer is required. Alternatively any output
device compatible with the Hewlett Packard Grac Language (HPGL) or with PostScript can
be used.
4.2 Installation
The software is installed by the following steps:
1. Select C:n.
2. Call A:Install.
3. Add the path as specied by Install to the MSDOS search path by modifying the le
AUTOEXEC.BAT.
Note, that it is possible to replace the path C:n in steps 1 and 2 simultaneously by any other
path (e.g. X:nSOLARnSDHWn), and to use any source diskette specication instead of A:.
6
5 Dynamic System Testing
5.1 The Algorithm of Parameter Identication
The t procedure used to identify the parameters is described in App. A. The method works
by the inversion of dynamic system simulation: while simulation yields the system output from
given parameters, dynamic tting yields the parameters from the measured system gain, see
Figure 5.1 and Figure 5.2.
Input Data
?
S - S -
Parameters Model System Output
F F
Figure 5.1: Dynamic system tting (F) can be interpreted as inversion of dynamic system simulation
(S).
7
8 InSitu Scienti c Software, DF 2.7
? p
Optimization
ZyZ (p t)
mod
Model
ZZ @ @@ @@
e(t) J ZZ~ +@@ @ @
J @@ r(t) - F @@ - SI @@ -
JJ :
; ;
; ;; ; ; C (p)
^ System
exp ; ; ;
under test y (t) ;; ;; ;;
Figure 5.2: The dynamic tting procedure. During the experiment, the input e is applied to the system
under test. Its measured output yexp is compared with the modeled output ymod , which depends on the
parameters p. The integral of the square (SI) of the ltered (F) deviation r gives a measure C(p) of the
goodness of the t. An optimization procedure is used to determine the value of p which yields the best
t.
/F Selects writing of t output Files, e.g. for plotting the residual (see Sect. 5.8.5).
/FN:n Use n for le names. Overwrites command FileName in the DF le.
/I Selects Interactive mode. The command le as well as the parameters and the
options can be edited.
/IS:z Use z for the initial system state. Overwrites command InitState in the DF le.
/Local The t is restricted to the next local minimum. Overwrites the NumOfLocMin set-
ting in the DF-le.
/Q A Quick run is done to check the les. Use /F /Q to generate output les only
to check the data using estimated parameter values (see Sect. 11), or
if the parameters have been determined already.
/D Derivatives are calculated, no t.
/Swap To provide a maximum amount of free memory for external models, DF swaps all
data to disk before the call (real mode only).
/Trace
:n] Traces tting with level n 0 (no trace), 1 (medium) and 2 (full).
The program can be interrupted by any key. Then, a menu allows to select one of the following
actions:
C Continues.
L Lists the current results and continues.
M The program enters interactive mode and the main menu.
S Program stops, with results.
5. DYNAMIC SYSTEM TESTING 9
5.6.1 Structure
Every line of the command le corresponds to one command statement. Every occurrence of a
symbol %n (n = 0::9) in the command le is replaced by the (n + 1) th parameter of the MSDOS
command line, the symbol %0 referring to the command le name (ignoring the extension and
the current path). For example, after calling a t program by DF P DEMO P 24, the command
FilterConst,%1 in the le DEMO P.DF is interpreted as FilterConst,24. This convention allows
the use of the same command le for dierent data, lter constants etc. Empty lines and lines
beginning with a * are ignored. Therefore, lines starting with a * can be used as comment lines
just as in data les.
The rst command should be the FileName command.
extension INI. This le may have been created in a previous run. The le can be edited
between two runs. The INI-le can be used to set the start values for the parameters. A
message is returned if the le does not exist, and arbitrary xed start values are used. The
parameters are tted and the values in the DFP-le are updated. By this procedure, the
parameters can be improved iteratively with every call of the program.
It is a good idea to rerun the t program with the start values found in a previous run. For
a good t, the parameter values should not change much, and the t should not become
better.
FixPar,x ,v
Fixes the value of the parameter x to value v . The parameter x is not varied during the
t. Example: FixPar,AC*,1.5
InitState, zinit
Sets the state vector of the system (e.g. the temperature of the store) used at the start
of simulation. The value of zinit should have no signicant inuence on the parameters
{ otherwise the skip time is not su cient. For the SDHW system model, the default is
zinit = 10 C.
The InitState command gives the possibility to nd the optimum skip time, see the demo
job SkipSDHW (SDHW systems) and Sect. 5.3.
Input,fn
Use le fn as input. May be nested. Default extension for fn is DFI.
Model,option ,On j O ]
Selects (On) or deselects (Off) the model option option . The range of feasible options
depends on the model. The options for model (P) are listed in Sect. 8.3.1. For external
models, additional options are used (see Sect. 10).
NumOfLocMin,n
Sets the number of local minima of C (p) (see Figure 5.2) investigated before the nal run.
Warning: NumOfLocMin,n with n < 2 prevents the program from escaping from local
minima! Default is NumOfLocMin,5.
Precision,p
Permits control of the number of internal time steps used for simulation. A small value of
p yields a large number of time steps, associated with good numerical accuracy and high
computation time. The default value, p = 1, was found to be adequate in all cases. However,
in cases of problems, a new run with p = 0:1 shows, whether the results were aected by
numerical errors in the solution of the dierential equations. Default is Precision,1.
Read,le ,next le,. . . ]] ,Skip=tSkip
Reads one or more data les from disk. Thereby the le specier(s) le has/have the
syntax:
le = lename
/excludenamefexcludenameg]
Each le specier may include an exclude list appended by '/'. The exclude list must not
specify a disk or a path several items are separated by ''. Wildcards are allowed e.g.
Read,nMYDATAn*.DAT/2S06*.*,Skip=7
reads all les with extension DAT available on path nMYDATA, but no les starting with 2S06.
The skip time is set to seven times the time base.
14 InSitu Scienti c Software, DF 2.7
The skip time specication is mandatory and applies to all data les read by the corre-
sponding Read command. Dierent skip times can be obtained by:
Specifying Skip=Data. For each data le, the skip time specied in the le is used
(see Sect. 5.5.2).
Using individual Read commands.
The program gives a warning for zero skip time.
StartPar,p1 =s1
,p2 =s2 ...],S
ets the start value for parameters. Only active for tting (not with /Q, /D). Overwrites the
value in the DFP-le. E.g. StartPar,uC*=5 forces the t program to start with the value 5
for parameter uC* .
TimeBase, Dt
Sets a multiplier for all abszissa (time) specications in the DF le, e.g. in the Filter and
Read command. Can be redened anytime. It may be convenient to change the default
time unit to one day by the command
TimeBase,86400
This command must not be mixed up with the nTimeStep command to be used in the
data les. The scope of TimeBase is limited to the command le, whereas nTimeStep only
aects the single data le where it is located. Default is TimeBase,1.
Table 5.1: Example for the output of the t program DF P on the screen.
\Results DF_P
* SDHW Plug Flow Model (V 2.1, Jun 1992)
frequency transform method............... Cosine
initial state value...................... 10
numerical precision...................... 1
time base................................ 3600
filter type.............................. Gaussian, tf=6, CF=1E5
Name mode tvf t_start t_skip t_end N* Size
DAT\2S040888.D3 Mean 16 0 7.8333 20.5 9.93 95..219
DAT\2S270888.D3 Mean 2.4 0 8.3333 216 24.3 85..484
DAT\2S230888.D3 Mean 3.3 0 8 72 10.5 85..223
DAT\2S130888.D3 Mean 4.2 0 7.8333 72 13.2 97..281
DAT\2S190888.D3 Mean 3.3 0 7 72 10.5 124..289
AC* uC* US CS DL RL objective
m2]
W/K/m2]
W/K]
MJ/K]
-]
K/kW]
W]
1.211 1.108E-4 10.09 0.4784 5 2.217 7.4484
0.0241 0.515 0.501 0.0157 1.13 0.191
Cross correlation matrix:
1.0000000 0.3533574 -0.0173375 -0.4104184 0.0592451 0.5971787
0.3533574 1.0000000 -0.6828999 0.0165963 0.2073083 -0.0594804
-0.0173375 -0.6828999 1.0000000 0.3635988 -0.1112233 -0.2342257
-0.4104184 0.0165963 0.3635988 1.0000000 0.0016267 -0.8762142
0.0592451 0.2073083 -0.1112233 0.0016267 1.0000000 -0.2020477
0.5971787 -0.0594804 -0.2342257 -0.8762142 -0.2020477 1.0000000
term performance prediction. The program DF-ListR lists several DFR les in dierent formats
(ASCII table, DataP data le, standard export le).
17
7 External Collector Model DS C
On path DFMODnDYNCOLL, there is an external model describing a multi-node dynamic collector
model. It is given as source code in Turbo Pascal 7.0. The implementation should help to develop
other external models. However, the model has the potential to test solar collectors and collector
loops. The parameters are shown in Table 7.1 the format of the data le is shown in Table 7.2.
The demo provides a full Monte-Carlo simulation 6] of a one-day collector test.
The model equations for a collector divided in N nodes are1 :
1
The model for uC is similar to existing models. However, there is doubt whether the wind dependence can
be modelled using v only 7]. Unfortunately more reliable models still have to be validated and are based on
additional wind measurements (e.g. the average absolute change of angle). Even the uT term seems to be often
too small to be determined reliably.
18
7. EXTERNAL COLLECTOR MODEL DS C 19
Sym- Short
bol Name Units Range Physical meaning
AC 0 AC' m2] 0 Eective collector area. For N ! 1, A0C F 0 ( ).
r r 0 Parameter in the model for the incidence angle modi-
er. r = 0 for K = 1. Activated by model option IAM.
u0 u0 Wm;2 K;1 ] 0 Eective collector loss coe cient.
cC cC kJm;2 K;1 ] > 0 Collector capacity, including both the uid as well as
the absorber, referred to ACp.
uv uv Jm;3 K;1 ] 0 Wind velocity dependence of uC . Activated by model
option WindSpeed.
uT uT Wm;2 K;2 ] 0 Temperature dependence of uC . Activated by model
option TempLoss.
Table 7.2: Format of the data record for the collector model.
symbol short name unit meaning
1 t Time s] Time. See data command nTimeStep.
2 Gt Gt Wm;2 ] Irradiance on the collector plane.
3 Gtbeam Gt beam Wm;2 ] Beam irradiance projected onto collector plane.
4 cos() Cos beam Wm;2 ] Cosine between the collector normal and the beam
irradiance.
5 Tca T ca C ] Collector ambient temperature.
6 Tin T in C ] Collector (loop) inlet temperature.
7 Tout T out C ] Collector (loop) outlet temperature.
8 C_ C dC C WK;1 ] Capacitance rate through the collector (loop).
9 v v wind m=s ] Wind velocity in collector plane.
8 SDHW System Testing
The previous chapter described the dynamic tting method without referring to a specic class of
systems. This chapter deals with the application of the so-called P model within the t program
DF P to solar domestic hot water systems (SDHW) systems.
The purpose of the programs described here is to use the data of a short term test to predict the
long term performance of the system under test for dierent conditions. For this, parameters in
a SDHW model are tted to the test data, and the model in conjunction with the values of the
parameters found are applied to the prediction conditions.
The method used here is intended to meet the following objectives:
Indoor, outdoor and in situ feasibility.
Black box test, i.e. no use is made of intrusive measurements (like e.g. inside the store).
Short term test (duration about 2. . . 3 weeks).
Low cost.
Prediction possible for any meteorological and load conditions.
Feasibility for a large class of systems.
The programs described here are designed for a fully automatic procedure running on a PC.
Figure 8.1 shows the denition of the input and output variables for SDHW systems.
T sa - -
- - P L
Paux - -
;
; PC
(G
t ca
T v ) - ;
; -
;
;
(T cw C _S) - -
8.1.2 Design
There are three important dierent cases:
Table 8.1: Format of the data record. The temperatures TS and TL are not used by DF P, but by the
pre-processors for checking the load loop data.
symbol short name unit meaning
1 t Time s] Time. See data command nTimeStep.
2 Tca T ca C] Collector ambient temperature.
3 Gt Gt e Wm;2 ] Irradiance on the collector plane, optionally including
an incidence angle modier.
4 Tsa T sa C ] Store ambient temperature.
5 Tcw T cw C ] Mains water temperature.
6 TS T S C ] Temperature before cold water mixing.
7 TL T L C ] Temperature delivered to the user. If there is no cold
water mixer, TS = TL .
8 C_ S dC S WK;1 ] Load capacitance rate through the store.
9 Pnet P net W ] Net system power. The net system power is dened
as the power delivered to the user minus the auxiliary
power. It is negative for Paux < PL .
10 Paux P aux W ] Auxiliary power (optional).
11 v v wind m=s ] Wind velocity in collector plane (optional).
12 PCP P cp W ] Collector pump power (optional).
Program SDHWPRE The program SDHWPRE automatically condenses large data les by choosing
adequate time steps. To get the data in le source pre-processed and written onto le destination ,
type
SDHWPRE source destination .
The names of the source and the destination le should not be identical.
Sym- Short
bol Name Units Range Physical meaning
AC AC* m ]
2 0 Eective collector area.
uC uC* Wm;2 K;1 ] 0 Eective collector loss coe cient. The collector loop
power - given the store temperature T relevant for
collector losses - is modelled by:
PC = AC Gt ; uC (T ; Tca)]+ :
Load outlet
6 h=1
:
:
:
:
6
* h=0
Load inlet
Figure 8.2: Draw o in the plug ow model
8. SDHW SYSTEM TESTING 25
-
Tsa TS
(Gt Tca v )
CC Paux
CW
? -6
?
Tcw C_ S
Figure 8.3: The plug ow model (P). See Table8.2 for the full list of parameters.
8.3.1 The Model Options
The following options are implemented in model (P):
Aux: Modelling of an auxiliary heater integrated in the store.
DrawoffMix: Any draw o is associated with mixing inside the store (parameter DL ).
LoadHeatExchanger: A heat exchanger decoupling the store from the load loop is modelled
by introducing a new parameter, the thermal resistance RL of the heat exchanger 12].
SolarStratification: This option can be used for systems which are capable of generat-
ing stratication by operation of the solar loop, e.g. for the so-called micro ow systems.
The degree of stratication is described by the value of the parameter SC .
WindCollector: Models the wind velocity dependence of the collector losses assuming uC
to depend linearly on v , uC (v ) = uC (0) + uv v . See footnote on Section 7.
By default, the following commands are assumed:
26 InSitu Scienti c Software, DF 2.7
Model,LoadHeatExchanger,Off
Model,WindCollector,Off
Model,Aux,On
Model,DrawoffMix,On
Model,SolarStratification,Off
8.3.2 Default
TimeBase,3600 The basic time unit is one hour.
FilterConst,6 The lter constant is six hours.
/D :dt
] Activates writing of a Detailed listing of the simulation results on a daily
basis on a le with extension DL. The optional parameter dt may control
the time resolution given in seconds (default is dt = 86400).
/FN:n The results are written on Files with prex n . Default is n=DFR-le .
/Q Suppresses the calculation of standard errors (saves computation time).
/S:n The le n is used to program the Sequencers (see below). This option
can be used more than once.
where is the azimuth angle (zero for south orientation, positive east) of the collector plane and
is the tilt angle (zero for horizontal). Both angles are specied in degrees. Default values are:
= 0 , and is set to the latitude. The source le should be in source , the input le for LTP P
is written to dest { if specied { or to a le with the same name as source but extension DFM.
For converting the measured values Gdir (normal incidence direct irradiance) and Gdi (hori-
zontal diuse irradiance) to the irradiance on collector plane Gt with tilt angle and azimuth
angle , the following algorithm is used according to Hay and Davies as reported in 18]:
1
However, during each timestep of simulation the load and auxiliary settings shall be constant. If necessary,
timesteps as given by the meteorological data are split.
2
However, for these data inconsistencies were found, (1) two (resolvable) errors for the data of Aberporth and
Copenhagen, (2) many non-resolvable problems for Carpentras, e.g. for 08.05. at 11:00.
28 InSitu Scienti c Software, DF 2.7
Gt ( ) = Gdir cos() 1 + % sin 2
2 sin() + (1 ; ) cos 2 + % sin 2 :
cos(
+ Gdi ) 2 2
(8.1)
Here, % is the albedo of the earth's surface, is the solar elevation angle, is the angle between
the collector normal and the solar beam direction, and is a measure of the quasi-direct fraction
of Gdi , which is estimated by the atmospheric transmission for direct radiation:
=h Gdir
2 (N ; 81)i ESC :
1 ; 0:0334 sin 365
(8.2)
Here, ESC is the solar constant, ESC = 1372 Wm;2, and N is the day of the year (N = 1 for rst
of January). The albedo % is set to 0:2.
To estimate the power used for the collector loop pump, the fractional collector loop opera-
tion duration is given. For instance, a value of 0:4 for a pump of 50 W indicates an average
consumption of 20 W.
3
To avoid ambiguities in the choice of a reference area, eciencies are not stated.
8. SDHW SYSTEM TESTING 29
8.5 An Example
The diskette contains data of six sequences of measurement from August 1988 to September
1988, which were provided by the Institut f#ur Thermodynamik und W#armetechnik Stuttgart
(ITW). The data were measured at a system with collectors integrated into the store and with
load heat exchanger. The system is referred to as System No 2 in 19] and as System No 1 in 2].
In 19], results from a test of the same system according to Gilliaert 20] are reported.
The full procedure of data preparation and parameter tting is executed by calling the batch
job DEMO on path DEMO.
The command le DEMOP.DF used in conjunction with the t program DF P is:
**************************************************************************
* demo command file for program DF_P, version 1.19, 01/92
*
* It is assumed, that the program DF_P is called by:
* DF_P DEMOP t n,
* where %1=<t> is the filter time constant, and
* %2=<n> is optional and used to exclude a file
**************************************************************************
* should indicate:
* System 2, demo, Model P, exclude %2
FileName,RESULTS\2SDP#%2
*
Model,Aux,Off
Model,LoadHeatExchanger,On
Model,DrawOffMix,On
*
* Exclude one file for later short term prediction
Read,DAT\2S*.D3/2S%20888.D3,Skip=7
*
* filter constants %1 hours, 0.1MJ/K
FilterConst,%1,1.0E5
8. SDHW SYSTEM TESTING 31
*
Fit
Figure 9.1: The consideration of dierent data sets yields conclusions about the prediction accuracy
y1!2. In the gure, the parameters gained from test sequence S1 are used to predict the performance
for sequence S2 . The parameters may also be gained from more than one sequence S1 .
For an experimental assessment of the method, long term performance data are generally not
available. Therefore, it is advisable to compare the system gain between model prediction and
measurement using short sequences instead of annual sequences. Figure 9.1 depicts the short
term prediction procedure.
For this purpose, the t program itself is used via a program named STP, which is called by:
STP DFR-le data-le Options ]
Here, DFR-le is the name of the DFR-le created by tting, data-le is the data le, for which
the prediction is to be made, and output-les is the prex of the les resulting from performance
prediction. A le with extension STP lists the result a le with extension R1 contains the result
as function of time (see Sect. 5.8.5).
Calling STP /? shows the available program options. Especially, the option /SKIP:tskip gives
the skip time for the data le in units as given by the TimeBase command of the DFR-le. If it is
not specied, the skip time is taken from the data le. Multiple data les can be specied these
are analyzed both, separately as well as in a summary.
32
10 Fit Program DF for External Models
The program DF P has a specic model built in. In contrary to this, the program DF.EXE allows
the use of a model in the form of an executable MSDOS program. This enables the user to
provide his/her own model not necessarily dealing with SDHW systems.
33
34 InSitu Scienti c Software, DF 2.7
options are transferred to the model program via a le named optionle containing for each
option one line, e.g. Aux,Off for the command Model,Aux,Off.
Model,Dimension,d :
Species the number of model parameters to be d . The maximum number of parameters
is 20.
Model,ExtProg,m :
Species the name of the program containing the user supplied model. The le extension
and the path of m are added according to the rules of MSDOS, so Model,ExtProg,DS P,
Model,ExtProg,DS P.EXE and Model,ExtProg,C:nDFnDS P.EXE are equivalent if the le
DS P.EXE is located at path C:nDF and there is no other le with same name in another
path which comes before C:nDF in the MSDOS search path.
Model,OutputUnits,units :
Species the physical units of the residual function.
Example : Model,OutputUnits,W.
Model,ParSpec,i ,meaning ,units :
Species the meaning and the physical units of the i 'th parameter.
Example: ParSpec,1,AC*,m2.
Model,Range,i ,min ,max :
Species the range of the i 'th parameter to be min ,max ]. Should ensure that DF uses
feasible parameter values, e.g. a nonnegative loss coe cient. Should not be used to restrict
the range to a narrow interval.
Model,TempPath,path :
Temporary parameter and residue les are written on path path .
Example: Model,TempPath,R: eects the use of disk R:. If R: is a RAM disk, the program
execution time is reduced.
It is also useful to copy the data les to a RAM disk.
However, a better way to use the extended/expanded memory is to leave all les on xed
disk and to use a le cacher. With an e cient cacher, the speed of DF together with DS P
is comparable to the speed of DF P. However, DF needs less memory since it does not keep
the data in memory.
Note, that the Read command causes DF to transfer the le name to the external model. DF
does not read the data les itself, except for analyzing the skip value.
The model has to report in le paraminfo . The format is shown for the self explaining example
of the external SDHW plug ow model DS P as used in the example:
The Param lines specify a short name, the physical units, minimum and maximum values, and a
reasonable start value. Note that the number of parameters may depend on the model options.
The options used in the example are:
LoadHeatExchanger,On
Aux,Off
The remaining Model commands are ExtProg, TempPath and all options to be transferred to
the model. Note that all model options and the model program name must be specied before
any FixPar command in the DF-le. Fit programs with internal model ignore Model,Extprog {
hence the same DF les can be used for t programs with internal and external model.
36
12 Fit Program Messages
12.1 Informative Messages
12.2 Warnings
Warnings are messages which might guide to an error in the usage of the programs.
Large time step, dt=dt , n=n Indicates, that the actual time step dt is rather large, so the
program divided it in n smaller time steps, and n was found to be rather large (> 200).
Check all timing constants (e.g. the nTimeStep command in the data les). Check whether
the capacitance rate in the data le is correct.
The warning can be ignored if it disappears with decreasing value of the objective function.
In this case the program probably started with a very low store capacity.
No files found matching name The t program was executing the nRead command and
tried to nd the le(s) name , but could not nd one. Check whether this is ok.
Zero skip time for data set n The skip time for data set n is zero.
37
38 InSitu Scienti c Software, DF 2.7
39
40 InSitu Scienti c Software, DF 2.7
@ Partial derivative with respect to x (x: scalar or vector)
@x
x]+ Yields x for x > 0, otherwise 0.
8x F (x) All x satisfy the relation F (x)
ij {] Kronecker symbol ij =1 for i = j , otherwise ij = 0
r Measurement error in r~
{] Frequency cycles per (double) interval
tskip s] Skip time (see Section 5.3)
F s] Filter time constant
AC m2 ] Collector area
AC m2 ] Eective collector area, AC = FR ( )AC . Parameter of the (P) model.
c W] Normalized objective function
C W2 s] Objective function to be minimized
CF MJK;1 ] Filter constant with regard to the load draw o
CS MJK;1 ] Thermal capacity of the store. Parameter of the (P) model.
C_ C WK;1 ] Thermal capacitance rate in the collector loop
C_ L WK;1 ] Thermal capacitance rate at the load
C_ S WK;1 ] Load side capacitance rate through the store (C_ S C_ L, C_ S = C_ L for
no thermostat mixer)
DL {] Drawo mixing coe cient. Parameter of the (P) model.
faux {] Auxiliary fraction of the store
FR {] Eective heat removal factor of the collector loop
Gt Wm;2 ] Solar irradiance in the collector plane
Gt Wm;2 ] Incidence angle corrected solar irradiance in collector plane,
Gt = GtK .
K {] Incidence angle modier
Paux W] Auxiliary power
max
Paux W] Maximum auxiliary power available
PC (T ) W] Collector loop power for given inlet temperature T
Pcp W] Collector pump power
PL W] Power delivered to the load, PL = C_ L (TL ; Tcw )
13. NOMENCLATURE 41
43
Index
test sequences
design, 21
restrictions, 21
test mode
not required, 21
time variant lter
external model, 33
TimeBase
DF command, 14
Warranty, 4
wind
dependence of collector losses, 18
dependence of collector losses, SDHW,
25
in long term performance prediction, 27
45
A The Algorithm of Dynamic Testing
A.1 Dynamic Modelling
Let y be some system variable accessible to measurement, e.g. the output power of a water
heating system. Let a model of a test system predict the value of y as a function of time by a
dierential equation for the system state z, which generally cannot be measured in detail.
dz = f p z(t) e(t)] y (t) = hp z(t) e(t)]: (A.1)
dt
Alternatively, the system may be described by a partial dierential equation:
@ z(t x) = f z(t ) p e(t)](x) y (t) = hp z(t ) e(t)] (A.2)
@t
where x represents for example the height in the store.
Here p represents a set of constant parameters and e(t) the input variables at time t, e.g.
meteorological data and the draw o mass ow. Only y (t) and e(t) are assumed accessible to
measurement. The system state z represents e.g. the temperature distribution inside the store.
In many cases it is not possible to model the system explicitly with a dierential equation, e.g.
for a complex system modelled with a simulation program. Even then the dynamic algorithm
is applicable, if a clear distinction between input variables, parameters and an output variable
can be made. Obviously, the input variables as well as the output variable must be accessible to
measurement.
1 Z 1 !
; 0 2 tm
2
r~m (p) = L r(p t) cos ( t ; t0m )
dt: (A.5)
0
m tm L m
The lter weight factors Fm are assumed to full the following relations:
X 2
8m 0 Fm
2
1 0< F m < 1: (A.7)
m
The eective number of data points for sequence Sm is:
X
Nm = Fm
2
: (A.8)
Here, a lowpass lter with gaussian shape,
! = 22L
Fm
2
= exp ; (! F )2 (A.9)
m
is used with time constant F .
The purpose of introducing a lter is to damp the inuence of transients in the residue on
the estimated values of the parameters. Such transients might be caused e.g. by inertia of the
temperature sensors or errors in the modelling of stratication. The use of a low pass lter
reects the fact that transients in the energy yield with zero mean do not inuence long term
performance.
The value of the vector p^ which minimizes C (p) is identied as the set of parameters which
models the tested system as well as possible.
As a measure of the model error, the root mean square of the ltered residue is introduced:
1
C ( p )
c(p) = P F 2 L 2 : (A.10)
m m0 m
S0 = P C (^pF)2 : (A.14)
m m
However, S0 tends to underestimate S in the case of little data, since p^ partially follows the
random uctuations of the error signal. Following the discussion of Norton 21] in Section 5.3.3,
an estimator for S which is unbiased is:
S; 0 K=
X 4
m gm gm :
S= F T (A.15)
1 ; trP H K
;1
m
m Fm
2
P
Here, tr(A) is the trace of the matrix A, tr(A) = i Aii . Hence, the nal expression is:
V = NC (^
p) H;1 :
;d
(A.17)
The covariance matrix is the appropriate measure of the uncertainty in the parameters. However,
the representation by a variance vector pi in conjunction with a correlation matrix R is used
by the t programs:
Rij = pVijp :
q
pi = Vii (A.18)
i j
This representation is equivalent to the covariance matrix. Note that the pi are standard, not
maximum errors, and do not contain systematic errors such as sensor misalignment. E.g. a wrong
calibration constant for a pyranometer inuences the value of the area parameter, but does not
show not up in the standard errors.
A. THE ALGORITHM OF DYNAMIC TESTING 49
6
E
E
E
SS E
E
E
E
WE (1)
D
D
CC
L
UL (2)
AAU
- X
Xa
e !
! a
b
b
a
a !
!
h h h
h h c
c
h ll
hz
@
@ (3)
@
@
R
l
l
Q
sh
Q
-
p
Figure A.1: Minimum search in one dimension. The iterations (1) and (2) are stopped because of arriving
at a local minimum (iteration (2) faster, since this minimum is still explored). Iteration (3) guides to the
global minimum.
The covariance matrix is used to estimate the prediction error, see Section A.4.
The analysis assumes that for the parameter set minimizing the objective function the rst derivatives
of the objective are zero. This is surely not the case if parameter values are at the rim of the feasible
range. In this case all error predictions have to be taken cum grane salis. In such a case often the data are
insu
cient { otherwise the data would bring the parameter value within the range. However, according
to experience it seems that the error speci cation can be used despite of the objections discussed.
X
Zij = Ai Aj : (A.24)
No intercorrelation is indicated by all being unity. Low values of (much smaller than unity)
correspond to badly determined directions Ai . The covariance is:
Vij = hihj
X 1A A : (A.25)
i j
The parameter error si increases due to intercorrelation by:
si 2 = Vii = X 1 A2 : (A.26)
hi h2i i
It seems to be straightforward to use the same model as used for testing, but now for the data
D, and to integrate the yield quantity Y of interest. However, there are two problems:
At rst in some cases the model must be used slightly dierent, as described in Section 8.4 for
SDHW systems.
At second, the problem of the unknown initial state arises. In testing, the begin of the data set
is skipped as described in Section 5.3. For predicting, it is assumed that the data D are repeated
cyclically. Hence the initial state is taken equal to the nal state. Technically, a certain interval
at the beginning is (although simulated using an arbitrary initial state) skipped, i.e the yield Y
is not taken into account. Then the rest of the data is simulated and nally the skipped interval
is simulated again, but now the yield Y is taken into account. This makes sure that all data D
are taken into account, with a negligible inuence of the initial state. The program LTP P for
SDHW systems uses a skip time of six days.
Y (^p + p D) Y (^p D) +
X @Y ( p D) p : (A.33)
@pi i
i
Then the standard error Y of Y is:
A. 53
h i
Y2 = Ep (Y (p D) ; Y (^p D))2 =
X (p D) @Y (p D) :
Vij @Y @p (A.34)
ij i @pj
Note that the error Y in Eq. (A.34) is only the error associated with the uncertainty of the
parameters. It may be very small (e.g. in the case of a very large data base used to determine
the parameters) in this case the error of the prediction quantity Y itself has to be added.
The derivatives are calculated numerically:
@Y (p D) Y (^p + pi ei D) ; Y (^p D) (A.35)
@pi pi
with ei being a unit vector in the direction of pi . The step sizes pi are chosen according to
Eq. (A.28) as for tting.