You are on page 1of 58

Dynamic System Testing

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

6 Linear Static Reference Model 17


7 External Collector Model DS C 18
8 SDHW System Testing 20
8.1 Guidelines for Test Sequence Design . . . . . . . . . . . . . . . . . . . . . . . . . 21
8.1.1 Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
8.1.2 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
8.1.2.1 Laboratory Measurements . . . . . . . . . . . . . . . . . . . . . 21
8.1.2.2 Outdoor Measurement with Load Control . . . . . . . . . . . . . 21
8.1.2.3 In situ Measurement without Load Control . . . . . . . . . . . . 21
8.2 The Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
8.2.1 Necessary Conditions on the Time Resolution . . . . . . . . . . . . . . . . 22
8.2.2 Skipping for SDHW Systems . . . . . . . . . . . . . . . . . . . . . . . . . 22
8.2.3 Data Pre-processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.2.3.1 Details of the Pre-processing Programs . . . . . . . . . . . . . . 23
8.3 The SDHW System Model (P) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.3.1 The Model Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.3.2 Default . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.3.3 Usage as Store Only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.4 Long Term Performance Prediction LTP P . . . . . . . . . . . . . . . . . . . . . . 26
8.4.1 The Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8.4.1.1 Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8.4.1.2 Conversion Program DF-Met . . . . . . . . . . . . . . . . . . . . 27
8.4.2 The Sequencers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
8.4.3 The Summary (LTP-) File . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
8.4.4 The Detailed Output File . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.4.5 The Sequencer Timing File . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.5 An Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

9 Short Term Prediction 32


ii
10 Fit Program DF for External Models 33
10.1 How DF Calls an External Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
10.2 Special Commands for External Models . . . . . . . . . . . . . . . . . . . . . . . 33
10.2.1 Parameter Specication in the DF-le . . . . . . . . . . . . . . . . . . . . . 33
10.2.2 Parameter Specication by the External Model . . . . . . . . . . . . . . . 34
10.3 External SDHW Plug Flow Model DS P . . . . . . . . . . . . . . . . . . . . . . . 35
11 Checking and Debugging Measurement Errors 36
12 Fit Program Messages 37
12.1 Informative Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
12.2 Warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
12.3 Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
13 Nomenclature 39
13.1 General Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
13.2 Special Symbols for Solar Thermal Systems . . . . . . . . . . . . . . . . . . . . . 40
14 Bibliography 42
A The Algorithm of Dynamic Testing 46
A.1 Dynamic Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
A.2 Parameter Identication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
A.2.1 Covariance Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
A.2.2 Algorithm for Minimization . . . . . . . . . . . . . . . . . . . . . . . . . . 49
A.2.3 Time Variant Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
A.2.4 Analysis of Variability and Intercorrelation of Data . . . . . . . . . . . . . 50
A.3 Numerical Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
A.4 Long Term Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
A.4.1 The Yield Function Y (p D) . . . . . . . . . . . . . . . . . . . . . . . . . . 52
A.4.2 Error of the Predicted Yield Function Value . . . . . . . . . . . . . . . . . 52

iii
List of Figures

5.1 Dynamic system tting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7


5.2 The dynamic tting procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
8.1 System under test as Black Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
8.2 Draw o in the plug ow model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.3 The plug ow model (P). See Table 8.2 for the full list of parameters. . . . . . . . 25
9.1 The strategy used for evaluating the prediction accuracy . . . . . . . . . . . . . . 32
A.1 Minimum search in one dimension . . . . . . . . . . . . . . . . . . . . . . . . . . 49

List of Tables

5.1 Example for the output of the t program DF P on the screen. . . . . . . . . . . . 15


7.1 Parameters of model DS C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.2 Format of the data record for the collector model. . . . . . . . . . . . . . . . . . 19
8.1 Format of the data record. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
8.2 List of all model parameters for model (P) . . . . . . . . . . . . . . . . . . . . . . 24
8.3 Commands to program the sequencers for simulation. . . . . . . . . . . . . . . . 29

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

Version 2.4: Analysis of variability and intercorrelation


of the data in the DFR le.
Version 2.3: Superior Convergence
for data with parameters at the rim of the feasible range.
Version 2.3: One Day Solar Collector Test
now as Monte-Carlo simulation demo.
Version 2.3: Protected mode
programs now available. Provide up to 16 mega byte memory.
Version 2.3: STP runs now multiple data les
automatically, including a summary.
Version 2.2: Files renamed
The LOG le instead of the DLG le and the *.Rn les instead of the *.Fn les are used in
order to avoid name conicts. The ltered residue is written to *.Fn les.
Version 2.2: Run Time Error 207
occurring sometimes in LTP P eliminated (did not spoil results).
Version 2.2: Extended Auxiliary Sequencer
introduced.
Version 2.2: Init Command in External Models
is now transferred.
Version 2.1: Error in Filter
was found the factor 2 was neglected. This means that all lter time constants used in
former versions have to be multiplied by 1=(2 ) to get the same result.
Version 2.1: Maximum memory provided by DF
for external models by swapping data to disk.
Version 2.1: Incident Angle Modi er
is now included in the dynamic collector model DS C.
Version 2.1: LTP P
For long term prediction, LTP P now stops collector operation for store temperatures ex-
ceeding 100 C. An error was corrected causing LTP P to slightly overpredict the yield for
systems with load heat exchanger.
Version 1.19: New Transform
The complex Fourier transform is replaced by the real cosine transform. This should { by
avoiding transform wrap around eects { increase parameter accuracy, especially in the
case of little data.
Version 1.19: New covariance matrix
There is now an improved algorithm for estimating the covariance matrix. It might help
to detect the case of too little data.
1. RECENT CHANGES 3

Version 1.19: Data for Long Term Prediction


There is now a data conversion program DF-Met for long term prediction data.
Version 1.19: More Flexible Interface for External Models
Version 1.19: Revised External Collector Model DS C
2 Rights and Warranty
All rights are reserved for each program of the package by InSitu.
The programs and documentation are provided without warranty of any kind. We make no
warranties, express or implied, that the programs are free of error, or are consistent with any
particular standard of merchantability, or that they will meet your requirements for any particu-
lar application. They should not be relied on for solving a problem whose incorrect solution could
result in injury to a person or loss of property. If you do use the programs in such a manner,
it is at your own risk. The authors and distributors disclaim all liability for direct, incidental,
or consequential damages resulting from your use of the programs. Any liability of seller or
manufacturer will be limited exclusively to product replacement of diskettes with manufacturing
defects.
A copy of any publication (including any kind of reports) produced with the help of one of the
t programs would be appreciated by InSitu.

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.

5.2 The Programs for Fitting


To run a t program, you need
one of the tting programs (e.g. DF P.EXE),
a command le specifying your data and the assumptions on the system (*.DF), and
one or more data les which are referred to in the command le.
The program DF P is called by
DF P commandle  Parameters ]  Options ].

The following options can be selected:


/? Gives a short explanation of the program call.

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

B Program breaks immediately, no results.


The program can be terminated anytime by the keys Control Break. In case of an error, the
program waits user response. After setting WaitOnError=Off in the DF.CFG or COMMON.CFG, the
program quits after an error without waiting.
The t procedure is terminated:
when there were enough attempts to nd local minima (see command NumOfLocMin).
when the maximum number of function evaluations has been exceeded.

5.3 Skipping Subsequences


Generally, the system state at the beginning of a sequence is not known. At any time t during
a sequence starting at t = 0, the system state is a function of
the initial state at t = 0, and
the values of the input variables (irradiance, load etc.) during the interval 0 t].
At t = 0, only the initial state is important, but its inuence will fade out as the system state
is determined more and more by the input variables. The time when the initial state has `faded
out' enough shall be called the skip time, tskip . Now, it is not the task of the tting procedure
to guess the initial state correctly { this is impossible. The tting procedure is concerned solely
with the way the system state is inuenced by the input variables during the sequence.
Consequently, the model starts with an arbitrary initial state, which might be far from the
initial state of the system under test. However, the dierence of the system state between a
correct model and the tested system will become smaller and smaller when the inuence of
the initial state decreases. Therefore, the t program uses the information about 0 tskip ]
only for matching the correct system state at time tskip . It does not compare modeled and
measured system output during 0 tskip], since the modeled output is too badly inuenced by
the dierence in the initial system state.
The time tskip is not known a priori (it is actually dierent for dierent systems), and it
cannot be determined by the t program itself. It is the responsibility of the user to provide an
appropriate value of tskip , and it is crucial that this value is
large enough to exclude the inuence of the initial state, and
small enough to take into account the information in the test sequence.
On a SDHW test site, the system should be pre-conditioned as described in Section 8.1.2. Then
the pre-conditioning phase { the interval 0 tskip] { must be included in the data le of the
sequence, and the skip time tskip should be set to the end of the pre-conditioning phase.
Actually, the model will exactly match the purpose of a pre-conditioning phase: It will have a
well dened system state. Note that this state can dier signicantly from a uniform temperature
distribution with cold water temperature.
For the collector model and the SDHW model there is a demonstration program for the eect
of dierent initial system states. The general call is explained in Skip.DPL.
10 InSitu Scienti c Software, DF 2.7

5.3.1 Partitioning of Large Continuous Data Sequences


Large continuous data sequences, e.g. in-situ measurements on a SDHW system over one year,
often have to be partitioned in e.g. weekly sequences. This allows easy combination of dierent
parts of the sequence in the t.
As a problem, each subsequence (week) needs its own skip interval (e.g. three days). An elegant
solution is to specify the skip time (of three days) in the data and to include the corresponding
data (last three days) of the previous sequence (week). By this procedure, data are not lost by
the partitioning process.

5.4 The Filter


In many cases the low frequency output of a system is dominated by the system response to
the input and hence suited for system identication, while the high frequency components are
suppressed by the inertia of the system and/or the sensors (including the resolution of the data
acquisition) and accompanied by noise. For this reason, the t programs use a low pass lter in
order to use as far as possible the reliable part of the signal. Hence a lter constant must be
selected by the user.

5.4.1 Choice of the Filter Constant


A high value for the lter constant F suppresses too much of the useful signal and will hence
result in high parameter uncertainty. A low value can yield additional parameter errors (putting
sensor inertia into the system) and underestimation of the parameter errors (underestimating
the average spectral noise because of low high-frequency noise). The following criteria should be
fullled for F :
1. F should be not much smaller than the time resolution (response time) resulting from the
system, the sensors and the data acquisition. Hereby the resolution (inertia) of the system
is less important as long as it is taken into account by the model.
2. Simulative and/or experimental trials should proof that the chosen value of F yields
reasonable estimates for the parameter errors.
Systems with variable inertia such as SDHW systems pose a special problem. For such cases a
(time) variant lter is used, see Section A.2.3. Note that the bandwidth of the lter, and thus
the value of the normalized objective function aspdened in Eq. (A.10) increases with decreasing
lter constant F as dened in Eq. (A.19), / 1= F for white noise assumption.

5.5 The Data Files


Each data le refers to one continuous sequence of measurement. The les must have the ASCII
format. The data are read by the command Read (see Section 5.6.2). Every line of the data le
is interpreted
as a comment to be ignored, if the rst character is a '',
5. DYNAMIC SYSTEM TESTING 11

as a data command, if the rst character is a 'n', or


as a data record otherwise.

5.5.1 Global and Local Minima


The parameters sought are those yielding the globally lowest value of the objective function.
However, in non-linear models local minima aside the global minimum can occur. The t program
tries to escape the local minima as described in Section A.2.2.
However, in the case of insu cient data, many local minima at rather dierent parameter values
may occur making it di cult to nd the global minimum. The best strategy to nd the global
minimum (with high probability) is to call the t program repetitively, e.g. within a batch job
running at night1 . In any case, such a di cult case indicates that either better data are needed
or that the number of parameters has to be reduced.

5.5.2 Data Commands


The following commands may be given within a data le:
nSkip,tskip
Indicates that for this data le, the subsequence 0::tskip ] is to be skipped. The time t is
given in multiples of the actual time step in the data le set by the command nTimeStep.
The meaning of the nSkip command is explained in Section 5.3. It is usually more con-
venient to use the nSkip command in the command le instead of in the individual data
les.
nTimeStep,dt
Indicates that the time is given in multiples of dt .

5.5.3 The Data Records


Each data record { except the rst { encompasses mean values of dierent variables over a time
step from the time in the last record to the time in the current record. This implies that the
purpose of the rst record is just to give the initial time.
The length of the timesteps is not necessarily equal between the individual data records. By
contrast, it is encouraged to make use of dierent time steps for the sake of data compression,
computation speed and accuracy.
For the primary data acquisition, it is recommended to choose the length of the time steps as
small as possible, and to condense the les with a preprocessor o line (e.g. SDHWP for SDHW
systems).
Note that the number of values must be equal for each data record.
1
If the last line is %0 %1 %2 %3 %4 %5 %6 %7 %8 %9, the job repeats itself innitely.
12 InSitu Scienti c Software, DF 2.7

5.6 The Command File


The purpose of the command le is to control the execution of the t program. The command le
is well suited for documentation of the constants used. A command le must have the extension
DF.

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.

5.6.2 The Commands


FileName,name
Species the le name prex name for all output les and the DFP-le. The symbol name
may specify a disk drive and/or a path, but should not contain an extension. For every
output le a specic extension is added. For example if the command
FileName,RESULTSn%0A
appears in the command le DEMO.DF, the le name prex RESULTSnDEMOA is selected. I.e.
the DFR-le is named RESULTSnDEMOA.DFR etc.. Default is FileName,%0.
Filter,tF0=F0
,tF1=F1 ,j1=j1 j CF=CF ]
Sets the lter constant to F0 . A time variant lter to adapt the lter to a varying system
time scale. May be specied in two ways:
(1) with F1 and j , the lter time is F0 for j = 0 and F1 for j = j 1.
E.g. for solar collectors j should be the capacitance rate, and j1 the maximum (or nominal)
value. Then the lter time is F0 for no ow, and F1 for nominal ow.
(2) with CF , the lter time F is:
1 = 1 + j (5.1)
F F0 CF
Default value of is: CF = 1. For SDHW systems j should be the load capacitance rate. If
CF is set to a certain fraction (e.g. 10% or 50%) of the store capacity, the draw-o prole
during the individual draw-os is taken into account.
FilterConst,F  ,CF ]
Equivalent to Filter,tF0=F ,CF=CF .
Fit
Starts tting. Initial values of the parameters to be determined are read from a le with
5. DYNAMIC SYSTEM TESTING 13

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.

5.7 Output on the Screen


Table 5.1 shows the screen output when tting the demo data as explained in Section 8.5. It
shows:
A header specifying the name and version of the t program.
A line listing the currently best parameters and its objective function.
A short model description.
A list of important numerical constants.
A list of the data les used, specifying the name on disk, the data mode, the expansion
factor Mm =Lm by the time variant lter (Section A.2.3), the start time, the skipped time,
the end time, the eective number of data per sequence (Nm ), and the number of skipped
and total data records (Size).
The currently best parameters with their standard deviations and cross correlation matrix.

5.8 The Output Files


The following les are created by every run of a t program. Additional les with extensions Fn {
with n being an index for the individual data sequences { are reserved for graphical presentation.
5. DYNAMIC SYSTEM TESTING 15

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

5.8.1 The Short Result (DFS-) File


Lists the results from parameter identication. Note that zero variance of the parameters may
indicate
a singular covariance matrix, which might be caused by insu cient variability of the input
data.
xing of one or more parameters.

5.8.2 The Parameter Start Value (DFP-) File


The best tting parameters found are saved in a le with extension DFP. The le is used to
transfer the parameter values between two t runs. May be manipulated to explore the eect of
dierent initial guesses.

5.8.3 The Result (DFR-) File


The le with extension DFR contains the complete result of the parameter identication. It is
used to transfer information from the parameter identication to the programs for short and long
16 InSitu Scienti c Software, DF 2.7

term performance prediction. The program DF-ListR lists several DFR les in dierent formats
(ASCII table, DataP data le, standard export le).

5.8.4 The Log (LOG-) File


The le with extension LOG is used to trace the parameter values used in the t. Normally a
scratch le.

5.8.5 The Residue (Rn -) Files


Optionally, the t program produces detailed output les. These les can be used e.g. for trouble
shooting or for a short term prediction via a t program. It is possible to use these les for
graphical representation, too.
For each sequence n used, a le with extension Rn is produced containing the following columns:
Column Name Meaning
1 Time Time t
2 dMetric Derivative d=dt of the generalized time  with regard to
the time t (see Section A.2.3)
3 Measured Observed output
4 Modelled Modelled output
5 Residue Residual output, modelled minus observed

5.8.6 The Filtered Residue (Fn -) Files


Optionally, the t program lists the unltered (Residue ) and the ltered (FResidue ) residue as
a function of the metric (Metric ) on a le with extension Rn for each sequence n used. These
les show the eect of
1. adaption to 2N equidistant steps (Section A.3),
2. expansion of the Time to the Metric due to the time variant lter (Section A.2.3), if used
(otherwise Metric =Time ), and
3. the lter used.
6 Linear Static Reference Model
On path DFMODnSLIN a linear static model is implemented for which the model is:
d
X
y mod (p t) = piai(t): (6.1)
i=1
The implementation is performed with DataP. Batch job DEMO gives a complete Monte-Carlo
simulation. A Borland Pascal implementation is also provided in source code.

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 :

A0C c dTn = C_ (T ; T ) + A0C G ; u (T ; T )] (7.1)


N C dt f n;1 n N t C n ca
Gt = K  ()Gbeam
t + K diff beam
 (Gt ; Gt ) (7.2)
Z 
K diff
 = 2 2
sin() cos()K  ()d (7.3)
0
T0 = Tin (7.4)
Tout = TN (7.5)
uC = u0 + uv v + uT jTn ; Tcaj (7.6)
Here Gbeam
t the beam irradiance on collector plane and  the angle between the beam irradiance
and the collector normal. The (uniaxial) incidence angle modier K  is calculated with a model
according to 8]:
  1
r
K  () = 1 ; tan 2 : (7.7)
Note that the model does not explicitely take into account the dierence between absorber
surface temperature and uid temperature, i.e. F 0 = 1 9] is assumed, and the actual value of F 0
is absorbed in the parameter A0C .
The units DMU C.PAS and DMA Coll.PAS, and the main le DS C.PAS are specic for the collector
model. All les DMC *.PAS and DSU *.PAS are designed to be used with any external model.
Another external dynamic collector model suited for DF is implemented in 10].

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

Table 7.1: Parameters of model DS C

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) - -

Figure 8.1: System under test as Black Box


20
8. SDHW SYSTEM TESTING 21

8.1 Guidelines for Test Sequence Design


8.1.1 Restrictions
There are no principal restrictions on the test data. Therefore, a special test mode for the
measurements is not required. So the test can be designed in order to minimize testing time or
to minimize experimental eort or according to any other objective.
The only restrictions on the test sequences are:
1. The collector loop and the store may not be modied during the measurement (by contrast,
the controller of the auxiliary heater may be manipulated anytime).
2. If there is any security switch, it may not be activated during the measurement.

8.1.2 Design
There are three important dierent cases:

8.1.2.1 Laboratory Measurements


It is strongly recommended to condition the store at the beginning and the end of a test sequence,
e.g. by withdrawing three times the store volume at constant cold water temperature.
The purpose of conditioning is to
1. reconcile the system state in the real system with the system state modelled by the t
program (begin), and to
2. give information about the temperature prole at the end of the sequence to the t program.
Note that the periods of conditioning must be included in the recorded sequence data, otherwise
conditioning will yield no additional information to the t program. However, the length of the
conditioning period at the begin of the sequence is the skip time to be used in the Skip command
as described in Sect. 5.3.
There is a slight dierence in the conditioning for the begin and the end: The begin is excluded
from calculation of the objective { so it is no harm in using large draw o volumes. However,
conditioning at the end is taken into account { so in view of the available temperature sensor
accuracy there is no use in withdrawing at the end after the load temperature dierence is less
than a certain limit (e.g. 5 K).

8.1.2.2 Outdoor Measurement with Load Control


Here the same rules apply for conditioning as for laboratory measurement. It is preferable to
condition the store without or with low solar irradiance.

8.1.2.3 In situ Measurement without Load Control


The rules mentioned above should be applied as far as possible.
22 InSitu Scienti c Software, DF 2.7

8.2 The Data Files


Each record contains the numbers listed in Table 8.1. Any additional channels may be used.

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).

8.2.1 Necessary Conditions on the Time Resolution


The length of each time step of the les entering the t program should full the following
conditions:
No more than 5% of the store volume should be discharged.
The length should not be greater than half an hour or two hours for time steps with or
without signicant solar irradiance, respectively.

8.2.2 Skipping for SDHW Systems


The preferable way to choose the skip time is described in Sect. 5.3.
Alternatively, the time tskip may be estimated as the time, in which three times (1.5 times for
low draw-o mixing) the store volume is withdrawn. Examples are:
For the data on the demo diskette, a preconditioning phase of about six to seven hours
duration occurs at the beginning of each sequence. Therefore, a value of tskip = 7 hr is
used in the demo command les.
For in-situ data with 200 ` daily load volume from a 300 ` store, choose tskip = 108 hr
accepting strong draw-o mixing.
8. SDHW SYSTEM TESTING 23

8.2.3 Data Pre-processing


There are two features not provided by the t program:
Condensing { reducing the time resolution in order to get a good compromise between
accuracy and computational speed.
Checking { checking the data les for obvious errors.
It is useful to check and condense the data les once before using DF P. The program SDHWP
provides a complete check and condense procedure. It can be called using wildcards and produces
les with extension D2 (not condensed), SUM (short summary), and D3 (condensed). Example:
SDHWP DATAn*.D1
processes all data les on path DATA with extension D1. Existing les with extension D2, SUM and
D3 are overwritten. It is recommended to use the D3 les as input for tting.

8.2.3.1 Details of the Pre-processing Programs


The following programs are used by SDHWP. Normally, there is no need to call them directly.

Program SDHWFORM The function of SDHWFORM is:


To shorten the data le (remove unnecessary blanks etc.).
To normalize the data commands (e.g. to change \timestep 3600 to \TimeStep,3600).
To insert a data description header for DataP. This header is not used by the other pro-
grams.

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.

Program SDHWCHK The function of SDHWCHK is:


To check the data le for errors (e.g. for inconsistencies in the load loop).
To produce a summary le (extension SUM).

8.3 The SDHW System Model (P)


The store is modelled using a plug ow model similar to the so-called TYPE38 Algebraic Tank
Model in the simulation program TRNSYS 11]. Figure 8.2 shows the idea of the plug ow
concept.
Draw o mixing is modelled stand-by mixing is not taken into account. The physical model is
depicted in Figure 8.3. A detailed description of the model is given in 12]. The variables used
here are dened in Table 8.1, Table 8.2 shows the list of all model parameters.
24 InSitu Scienti c Software, DF 2.7

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)]+ :

uv uC*v  Jm;3 K;1 ] 0 Wind velocity dependence of uC . Activated by model


option WindCollector.
US US  WK;1 ] 0 Total store heat loss coe cient.
CS CS  MJ=K]  0:1 Total store heat capacity.
faux faux {] 2 ]0 1] Fraction of the store volume used for auxiliary heating.
Activated by model option Aux.
DL DL {] 2 0 5] Mixing constant, describing mixing eects during cold
water inlet (DL = 0 for no mixing). Activated by model
option DrawoffMix.
SC SC {] 0 Stratication parameter, SC = 0 is equivalent to a
heat exchanger immersed at the bottom. Activated by
model option SolarStratification.
RL RL KkW;1 0 Thermal resistance of the load side heat exchanger
(systems with load side heat exchanger only). A value
of RL = 0 is equivalent to no load side heat exchanger.
Activated by model option LoadHeatExchanger.

Table 8.2: List of all model parameters for model (P)

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

subsystem: collector loop subsystem: store

Eective collector area AC Cold water drawo mixing DL


Eective loss coe cient uC Overall loss coe cient US
Solar loop stratication SC Overall thermal capacity CS
Auxiliary fraction faux

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.

8.3.3 Usage as Store Only


The model can be used to model a store separately by:
1. Fix AC to an appropriate value, e.g. to the collector aperture area.
2. Fix uC to zero.
3. Enter PC =AC instead of Gt.
The option SolarStratification has to be Off. Note that by this procedure the heat resistance
of an immersed heat exchanger can not be evaluated, since only the power is used, not the
temperatures.

8.4 Long Term Performance Prediction LTP P


To the t program DF P, a corresponding program LTP P exists for long term performance pre-
diction, which has built in exactly the same model as the t program, but additionally provides:
1. Ignoring of negative values of PL (optional).
2. A thermostat mixer which reduces the load temperature TL from TS to the (xed) demand
temperature TD .
3. Collector loop operation is stopped for store temperatures exceeding 100 C.
4. An auxiliary controller which keeps the auxiliary fraction of the store above a set temper-
max .
ature Tset , using at maximum the auxiliary power Paux
The performance prediction program LTP P is called by:
LTP P DFR-le data-le  Options ]
It is assumed that the DFR-le was produced by a run of the corresponding t program DF P. The
data, which specify the climatic conditions for the prediction, are taken from le data-le . The
result is written on a le with extension LTP. The algorithm used is described in Section A.4.
Possible options are:
8. SDHW SYSTEM TESTING 27

/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.

8.4.1 The Data File


8.4.1.1 Format
The data le is in the same format as for tting, except that only the rst three channels (the time
t, the ambient temperature Tca and the solar irradiance Gt ) are needed. Additionally, the wind
velocity in collector plane must be specied as fourth channel, if model option WindCollector
is used. The other variables are synthesized via sequencers as described in Sect. 8.4.2.
Hourly values are generally su cient for long term prediction1 .

8.4.1.2 Conversion Program DF-Met


For reasons of storage request and copyright, it is not intended to distribute meteorological data
within the program package.
In order to make accessable a large class of data sets to the prediction program LTP P, the
conversion program DF-Met is provided to convert data from dierent formats into the format
required by LTP P.
Currently, the program accepts test reference years (TRY) as follows:
From the European Countries 13, 14]2 ,
TRY's from Australia 15],
TRY's in the format of the Federal Republic of Germany 16] as available from 17].
The general call is (all options are shown by DF-MET /?):
DF-Met source
dest ]
/A:]
/T: ]

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.

8.4.2 The Sequencers


A load sequencer generates the load capacitance rate C_ L as function of time (the load prole).
An auxiliary control sequencer generates the set temperature Tset and the maximum auxiliary
max as function of time (e.g. continuous or peak-o mode). A data sequencer generates
power Paux
additional input data.
The sequencers are programmed with a few special commands, see Table 8.3.
Systems with integrated auxiliary heater may fail to meet the required load temperature TD in
the case of intermittent operation or nite available power. In any case, the program displays the
minimum store outlet temperature TSmin occurring. In the case of failure (TSmin < TD ), increase
the set temperature Tset . If TSmin is signicantly above TD , decrease Tset in order to avoid
unnecessary stand by losses.

8.4.3 The Summary (LTP-) File


Some new quantities are introduced to express the result of the long term performance prediction
for an interval I . All mean values refer to the interval I 3.

Average demanded heat power  W ] PD PD = C_ L (TD ; Tcw )


Average system gain  W ] Pnet Pnet = C_ L (TL ; Tcw ) ; Paux
Fractional system gain  { ] f f = Pnet =PD
Average eective solar system area  m2 ] AS AS = Pnet =Gt

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

Table 8.3: Commands to program the sequencers for simulation.


Load sequencer
DailyLoadVol, VL Sets the daily load draw o volume to VL liters. The specic
heat capacity is assumed to be 4:19 kJ K;1`;1 .
DemandTemp,TD Sets the demand temperature to TD (default: TD = 45 C.)
DrawOff,t ,d ,f Sets a load drawo beginning at time t with duration d (t
and d in hours). This drawo's fraction of the daily drawo
is proportional to f .
MainsTemp,Tcw
,T ,N0] Sets the mains temperature to Tcw (default: Tcw = 10 C). If
the additional two parameters are given, the seasonal de-
pendence of the mains temperature is modelled as Tcw ;
T cos((N ; N0)(2  =365), where N is the day of the year.
SkipNegativeLoad,Off j On Skip negative load power (default: On)
Data sequencer
StoreAmbTemp,Tsa Sets the ambient temperature of the store to Tsa (default:
Tsa = Tca).
Auxiliary sequencer
max  ,taux taux ] Enables an auxiliary heater to keep the temperature of the
Aux,Tset,Paux i f
according tank volume above Tset . The available power is
max . Optionally, the operation time of the auxiliary heater
Paux
may be restricted to be in the interval taux
i tf ]. Example
aux
max = 10kW,
for an auxiliary controller with Tset = 60 C, Paux
and operation from 10pm to 6am:
Aux,60,1E4,22,6
Multiple use is allowed, later settings overwrite previous set-
tings. E.g.:
Aux,50,1E4
Aux,80,1E4,22,6
Aux,0,0,10,14
sets a constant set temperature of 50 C and an available
power of 10 kW. During the night, from 10pm to 6am, the set
temperature is raised to 80 C. From 10am to 2pm, auxiliary
heating is completely disabled.
WindFactor, f Sets the ratio of wind velocity on collector plane to meteo-
rological wind velocity.
30 InSitu Scienti c Software, DF 2.7

8.4.4 The Detailed Output File


The detailed output le with extension DL contains daily mean values in the format used for the
input data to the t program.

8.4.5 The Sequencer Timing File


A le with extension SQT lists the timing of the load and the auxiliary controller. This le can
be used to check the sequencer settings. It reports the load rate, the auxiliary set temperature
and the available auxiliary power as function of the time of the day. The results can be plotted
using DataP with the command le PLOT SQT.

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

Note, that %1 is a mandatory parameter, and %2 is an optional parameter.


Calling DF P DEMOP 6 xx sets the lter time constant to 6 h and excludes le 2Sxx 0888.D3 from
tting.
9 Short Term Prediction

Test data from sequence S1 Test data from sequence S2


e1 y1exp
? ?
Parameter identication e2
p^ y2exp
? ?
Model $ p^ - Gain prediction
y2mod
? ?
Modelled gain Measured gain
+ ;
? ?
Error y1!2

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.

10.1 How DF Calls an External Model


DF accepts executable les (programs) as external models. Communication between DF and the
model happens via ASCII les. A model program m is called from the program DF by:
m parle datale outputle optionle ]
Here parle contains the values of the model parameters (each value in a separate line), datale
is the name of the data le referring to a certain measured sequence, and the program is expected
to return the result in a le named outputle . The external program has to get these le names
from the MSDOS command line. The outputle must contain the columns
time , load capacitance rate , measured system output , model output .
Note that the load capacitance rate is only used for the time variant lter (see Sect. A.2.3) and
not used otherwise (then a constant value may be given). For other than SDHW systems, it has
to be replaced by an appropriate variable such as the collector capacitance rate for a collector
(eld) or the electrical current for an electrical power device (photovoltaic cell, accumulator). If
the time in the residue le is not scaled to basic units (e.g. seconds for the time ), the residue
le must contain the appropriate nTimeStep command.
The program m may by a EXE or COM le it also can refer to a BAT job in which case it is possible to
adapt the calling scheme of DF to the model (e.g. preliminary le copying or renaming, changing
the sequence of the parameters, converting the output le to a le readable by DF).
When called by DF /Swap, the amount of memory available for the external model does not
depend on the size of the data1 .

10.2 Special Commands for External Models


There are two ways to specify the parameters of an external model:

10.2.1 Parameter Speci cation in the DF- le


The following additional commands may be given in the DF-le (Dimension and ExtProg are
mandatory). If there are commands Model,. . . additional to the commands listed here, these
1
Real mode programs only.

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.

10.2.2 Parameter Speci cation by the External Model


In this variant, which is much more exible than the one mentioned above, the external model
itself reports about its parameters. For this, before tting DF calls the model m by:
m /INFO:paraminfo optionle ]
10. FIT PROGRAM DF FOR EXTERNAL MODELS 35

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:

Model,'SDHW Plug Flow Model (V 2.1, Jun 1992)'


Output,W,'net load power'
Abszissa,s,'Time'
Param,AC*,m2,0,1E10,0
Param,uC*,W/K/m2,0,100,0
Param,US,W/K,0,1E10,0
Param,CS,MJ/K,0.1,1E10,1
Param,faux,-,0.01,1,0.5
Param,DL,-,0,5,0

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.

10.3 External SDHW Plug Flow Model DS P


The SDHW plug ow model is also implemented as external model in DS P.
DS P reacts on any key by showing the current values of the parameters. However, DS P does not
read the keyboard input in order to allow DF to respond.
There are two batch jobs, DEMOE and DEMOI, to show that DF P is equivalent to DF in conjunction
with DS P. To save computation time, only one data le is used. Note that { in this case {
parameter identication is possible from a three days test!
11 Checking and Debugging
Measurement Errors
If the parameter t yields unreasonable parameter values and/or the objective is abnormally
high, this might be due to an error in measurement. In the sequel, we describe how to locate
such an error, which might be due to
improper system operation { e.g. the collector controller might have failed
systematic errors, the formula for computing the thermal power might be wrong
random errors { a temperature sensor might have failed transiently.
It might be successful to identify the erraneous sequence by omitting one of the sequences.
However, it is often very cumbersome to localize errors by interpreting t results. Generally, it
is more powerful to locate the data error, model problem or whatever the cause of trouble might
be by a prediction using reasonable parameter values { which might come from previous results
or estimation { as follows:
1. Edit the INI-le to insert the estimated values.
2. Run the t program with options /F and /Q.
3. Inspect the Rn-le(s) for abnormous deviations. These deviations point to the location of
the error in the data le. It is recommended to plot the residue as function of time.
4. Eliminate the error.
5. Repeat the procedure while necessary.

36
12 Fit Program Messages
12.1 Informative Messages

n ] Indicates simulation of the data set number n .


Best value Indicates that a parameter set was found yielding the lowest value of the objective
function since the start of this run.
Derivatives Now, the partial derivatives of the residue are calculated with regard to the
parameters.
Final search The t program takes the parameter set associated with the lowest value of the
objective function and searches the according minimum in detail.
Parameter file name not found The t program tried to read parameter values from a
previous run on le name . The le does not exist, therefore arbitrary values are used as
initial guesses.
Reading parameters from file name The t program reads initial values for the parameters
from le name .
Search local minimum, trial number n Indicates the start of the n 'th search of a local
minimum of the objective function.
Singular matrix Indicates that the second derivative matrix of the objective function is sin-
gular. May happen at the begin of the optimization or in the case of insu cient variability
of the data.
User break The t program has accepted a request to interrupt the program (eventually after
some calculations).
; > name The le name was opened for writing.

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

12.3 Error Messages


In the sequel, errors resulting from improper usage of the programs are discussed. If the program
states a so-called internal error, please send a detailed report to your distributor.
Failed to open file n for writing
Check the FileName command. Check for missing pathes.
Filter constant too small The lter constant is too small referred to the duration of the
data sets. This results in too many points used for the Fourier transform of the residue.
Remedy:
Check the timing in the data les (nTimeStep command) and in the command le
(TimeBase command).
Increase the lter constants F and/or CF appropiately.
Memory exceeded The space in memory is not su cient to keep the data.
Remedy:
Check the lter time constant. A very small value might cause this error.
Remove resident programs or programs using the shell (such as the Norton Commander).
Preprocess the data (e.g. with SDHWP).
Use DF and DS P instead of DF P.
Load resident programs into the High Memory Area using MSDOS 5.0.
Use /Swap for DF, or better:
Use DF in protected mode.
Missing Skip specification The Read command was given without a skip specication.
No data present No data le is read until the Fit command. Check the Read and NoRead
command.
No data in residue file No data are found in the residue le from the external model.
No nSkip in data Within a Read,...,Skip=Data,... command, a data le did not contain
a nSkip command.
Skip time out of range The skip time is either negative or larger than the duration of the
data set.
Remedy:
Check the skip time specication.
Check the timing in the data le.
Too many data sets Is there really need for more than 500 data sets?
Total metric is m Indicates that the sum of the durations of all data les read is less or
equal to zero. Might be caused by severe errors in the time channel of one or more data
les.
13 Nomenclature
13.1 General Symbols
Symbol Units Meaning

c Normalized objective function


C Objective function to be minimized
CF Coe cient for time variant Filter
e System input variables
Ex] Expected value of x
f Total time derivative of z as function of z(t), e(t), t
Fm {] Filter for the sequence Sm at frequency 
gm Total derivative of r~m with respect to the parameters
h Scalar function yielding y as function of z(t), e(t), t
H A matrix which approximates the second derivative (Hessian) matrix
of C
Lm Length of the m'th sequence
m {] Index numbering the measured sequences
P 2
Nm {] Eective number of data points for sequence Sm , Nm =  Fm .
p Parameter vector
r(p) Residual error function, r(p) = y mod (p) ; y exp
r~m Cosine transform of r over the Interval Im
R {] Parameter correlation matrix
s Standard deviations of the parameters
Sm Sequence number m over the time interval t0m t1m]
t Time, more general: independent variable
tm
0 Begin of the m'th sequence
V Estimated covariance matrix of the parameters p
y mod Modelled system output
y exp Measured system output
z System state vector
d Total derivative with respect to x (x: scalar or vector)
dx

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

13.2 Special Symbols for Solar Thermal Systems


Symbol Units Meaning

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

Pnet W] Net system power, Pnet = PL ; Paux


RL  K/kW ] Thermal resistance of the load side heat exchanger
SC {] Solar loop stratication parameter. Parameter of the (P) model.
t s] Time
Tca  C] Ambient temperature of the collector loop
TD  C] Temperature demanded by the user
Tcw  C] Cold water temperature
TL  C] Temperature of the water delivered to the user (TL TS )
Tset  C] Set temperature of the auxiliary heater controller
TSmin  C] Minimum outlet temperature of the store
TS  C] Outlet temperature of the store
Tsa  C] Ambient temperature of the store
uC  Wm;2 K;1 ] Specic loss coe cient of the collector
uC  Wm;2 K;1 ] Eective heat loss coe cient of the collector loop. For a collector with-
out pipes or a heat exchanger, uC = uC =( ) holds. Parameter of the
(C) and (P) model.
US  WK;1 ] Overall heat loss coe cient of the store
uv  Jm;3K;1 ] Wind velocity dependence of uC . Parameter of the (P) and (C) model.
v  ms;1 ] Wind velocity
VL `] Daily load draw o volume
( ) {] Eective transmission-absorption product
14 Bibliography
1] Solar heating { domestic water heating systems { part 1: Performance rating procedure
using indoor test methods. Draft international standard, International Organization for
Standardization, 1988.
2] W. Spirkl. Dynamic SDHW testing. J. of Solar Energy Eng., Transactions of the ASME,
112:98{101, 1990.
3] B. A. Rogers. Recommendations on test procedures for the thermal performance of solar
domestic-hot-water heating systems. Technical Report SEU-IEA-TR3, International Energy
Agency (IEA), 1989.
4] W. Spirkl. Dynamische Vermessung von Solaranlagen zur Warmwasserbereitung. Fort-
schrittsberichte der VDI-Zeitschriften, Reihe 6: Energietechnik, Nr. 241, VDI-Verlag,
D#usseldorf (W-Germany), 1990. ISBN 3-18-14 4106-6.
5] Dynamic testing of solar domestic hot water systems. Technical Report EUR 11606 EN,
International Energy Agency, 1992.
6] W. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery. Numerical Recipes, Second
Edition. Cambridge University Press, 1992.
7] G. A. Angermeier. Konvektiver w#arme#ubergang an ebenen #achen in freiluft. Fortschritts-
berichte der VDI-Zeitschriften, Reihe 19: W#armetechnik/K#altetechnik, Nr. 68, VDI-Verlag,
1993. ISBN 3-18-14 6819-3.
8] P. Ambrosetti and J. Keller. Das neue Bruttow#armeertragsmodell f#ur verglaste Son-
nenkollektoren. Technischer bericht, zweite, u#berarbeitete auage, Eidgen#ossisches Institut
f#ur Reaktorforschung (EIR), 1985. ISBN 3-85677-016-X.
9] J. A. Du e and W. A. Beckman. Solar Engineering of Thermal Processes. John Wiley &
Sons, New York, 2 edition, 1991.
10] Per Isakson. MFC DF 1.0 , An External Model to DF. Dept. of Building Services Engi-
neering, Royal Institute of Tecnology, S-100 44 Stockholm, Sweden, 1993.
11] S. A. Klein, W. A. Beckman, and P. I. Cooper. TRNSYS: A Transient System Simulation
Program, Version 13.1. Solar Energy Laboratory, Madison Wisconsin, 1990.
12] W. Spirkl and J. Muschaweck. General model for dynamic testing of solar domestic hot
water systems. Solar Energy Materials & Solar Cells, 28:93{102, 1992.
13] Cenergia energy consultants. Sct. Jacobs Vej 4, 2750 Ballerup, DK.
14] Test reference years try. Technical Report EUR 9765, Commission of the European Com-
munities, 1985.
15] G. L. Morrison and A. Litvak. Condensed solar radiation data base for australia. Technical
Report FMT/1, University of New South Wales, 1988.
42
16] K. Bl#umel, E. Hollan, M. K#ahler, and R. Peter. Entwicklung von Testreferenzjahren (TRY)
f#ur Klimaregionen der Bundesrepublik Deutschland. Forschungsbericht BMFT-FB-T 86-
051, Freie Universit#at Berlin, 1986.
17] Fachinformationszentrum Karlsruhe (FIZ), D-76344 Eggenstein-Leopoldhafen, FRG.
18] D. T. Reindl, W. A. Beckmann, and J. A. Du e. Evaluation of hourly tilted surface
radiation models. Solar Energy, 45:9{17, 1990.
19] R. K#ubler, M. Ernst, and N. Fisch. Short term test for solar domestic hot water systems
- experimental results and long-term performance prediction. In Proceedings of the ISES
Solar World Congress, Hamburg. Pergamon Press, 1988.
20] D. Gilliaert and P. Tebaldi. Development of standard test procedures for the determination
of the long term performance of solar domestic hot water systems. Technical report, Joint
Research Centre (JRC), Ispra, 1987.
21] J. P. Norton. An Introduction to Identication. Academic Press, 1986.
22] M. Vetterli and H. J. Nussbaumer. Simple t and dct algorithms. Signal Processing, 6:267{
278, 1984.
23] J. H. Wilkinson and C. Reinsch. Linear Algebra, volume II of Handbook for Automatic
Computation. Springer-Verlag, Berlin, 1971.

43
Index

auxiliary incident angle


integrated modier, 22
control sequencer, 28 InitState
fail to meet load, 28 DF command, 13
set temperature, 28 Input
DF command, 13
conditioning, 21 inverse
Copyright, 4 matrix, generalized, 52
covariance matrix irradiance, see solar irradiance, see solar ir-
singular, 15 radiance
DF-ListR program, 16 laboratory
DFP le, 15
dierentiation test design, 21
numerical, 49 Levenberg-Marquardt, 49
DL le, 30
local minima
escape from, 49
external models, 33 long term prediction, 52
data le, 27
FileName SDHW systems, 26
DF command, 12 LTP le, 28
Filter
DF command, 12 memory
lter, 10 error
choice of constant, 10 exceeded, 38
error minimum
constant too small, 38 global, local, 11
time variant, 50 Model
FilterConst DF command, 13
DF command, 12 model options
Fit model P, 25
DF command, 12
FixPar NumOfLocMin
DF command, 13 DF command, 13

global minimum, 49 outdoor


test design, 21
in-situ, 5
how to choose skip time, 22 Precision
test design, 21 DF command, 13
incidence angle pump of collector loop
modier, 40 estimate power used, 28
44
Read
DF command, 13
short term prediction, 32
singular, 52
skip, 9, 21
in data le, 14
long term prediction, 52
partitioning of large data, 10
solar irradiance, 40
low for preconditioning, 21
SQT le, 30
StartPar,p1 =s1
,p2 =s2 . . . ]
DF command, 14
stationarity
in-situ, 5
rating test, 4
time needed for, 5
swap
DF /Swap, 8

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.

A.2 Parameter Identication


For a set of measured sequences Sm = fy exp(t) e(t) j t 2 t0m t1m ]g, the observed system output
yexp (t) is compared with the model prediction y (p t). The residual error function r(p t),

r(p t) = y mod (p t) ; y exp(t) (A.3)


includes measurement uncertainties of y exp and e as well as the model error. It is measured by
the objective function C (p) which is a least-squares error function in the frequency domain:
1
XX
C (p) = Fm
2 2
r~m (p) (A.4)
m  =0
Here r~m (p) is the discrete cosine transform of r(p t) over the sequence Sm :
46
A. THE ALGORITHM OF DYNAMIC TESTING 47

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 normalization is chosen such that1:


X 2 Z t1
m
r~ m (p) = r2(p t) dt: (A.6)
 tm 0

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

A.2.1 Covariance Matrix


The statistical accuracy { i.e. the covariance matrix { of the parameters found by minimizing
C (p) is inferred from linearizing the model around p^. Then, an error ~r yields an error ^p:
X X
^p = H;1 Fm
2
~rm gm H= Fm
2
gm gm
T (A.11)
m m
1
The terms in Eq. (A.6) exist only for bandwidth limited residue.
48 InSitu Scienti c Software, DF 2.7

where gm is the derivative of r~m with regard to p.


h i
To estimate the covariance matrix V = E ^p^pT , the following relations are assumed:

E ~rm ~rm0 0 ] = mm0  0 Sm : (A.12)


Then:
 !
X 4
V=H ;1
F m Sm gm gm
T H;1: (A.13)
m
Since generally Sm is neither known nor accessible to measurement, it is assumed that Sm is
constant, Sm = S (white noise assumption). Hence, it remains to determine S . Looking at the
denition of C (p) in Eq. (A.4), S could be calculated as:

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 = P F 2 C;(^ptr) ;H;1K H;1KH;1: (A.16)


m m
For a lter with equal 2 = F 4 , the matrices H and K are equal, and the familiar
weights, Fm
P m
expression for N = m Fm
2 data points and d parameters results:

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.

A.2.2 Algorithm for Minimization


A Levenberg-Marquardt algorithm is used for minimum localization 6]. A numerical dierenti-
ation is used to evaluate the derivatives of r~(p) with regard to the parameters. To escape from
possible local minima, the minimization is restarted automatically several times from different
locations. These are taken as the currently best parameter set plus a random step which is
normally distributed with a covariance matrix equal to 25V where V is the current estimate
of the parameter covariance matrix. Figure A.1 depicts the procedure for searching the global
minimum in the one-dimensional case.
50 InSitu Scienti c Software, DF 2.7

A.2.3 Time Variant Filter


The lter used in the objective function uses a constant lter coe cient F . However, in a SDHW
system, the typical time scale is not constant at all it may vary from less than an hour (in the
case of high C_ L ) to several days (for C_ L = 0). This makes it impossible to nd a value for F ,
which retains a signicant lter eect as well as the information contained in the temperature
prole during a fast drawo.
To solve the problems due to the variations of the time scale, a time variant lter coe cient 
is introduced:
1 = 1 + C_ L (A.19)
 F CF
where CF is a constant and may be set to a certain fraction of the thermal store capacity CS . The
lter coe cient  decreases with increasing C_ L . E.g., for CF = 0:1 CS , the draw o prole will
be taken into account with a resolution of about 10% of the store volume, whereas for CF CS ,
the draw o prole will be ignored.
The technique used to realize the time variant lter is the transformation of the time t into a
generalized time , which will be called metric:
_
d = dt + F CCL dt d  0:
 = 0 : : :Mm
dt (A.20)
F
By this special choice of , during all drawos the time is expanded.
The residual function r0() for the sequence Sm is dened by:

;1 Z t()
0 d
rm(p ) = rm(p t()) dt d
= d r (p t) dt: (A.21)
t(0) m
So, the time variant lter results from the transformation t ! , r ! r0 in Eq. (A.5):
1 Z
;  0 2 Mm
  ;1  
2
r~m (p) = L
0 d
r(p t()) dt 
cos M d: (A.22)
m 0 m

A.2.4 Analysis of Variability and Intercorrelation of Data


The inverse covariance V ;1 = L (which is proportional to the Hesse matrix assuming Eq. (A.17))
is normalized to:

Zij = Lij hi hj hi = p1L : (A.23)


ii
The hi correspond to the parameter errors which would be obtained ignoring intercorrelation
they are a measure for the variability of the data with regard to the individual parameters.
The matrix Z contains the information about intercorrelation and is analyzed by eigenvector
decomposition:
A. THE ALGORITHM OF DYNAMIC TESTING 51

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

A.3 Numerical Implementation


The Cosine transform in Eq. (A.5) is performed according to 22]. It is a fast transform for
a power of two (2N ) of equidistant points. Hence before the cosine transform the data are
transformed { conserving energy { to 2N equidistant intervals. Energy conservation is achieved
by rst integrating (assuming constant values within each data interval of the original time) and
than dierentiating, as shown in Eq. (A.21). For each sequence Sm , the number N of data points
entering the Cosine transform, which is also the number of cosine coe cients, is chosen such
that FmN < 10;8 . All sums in the frequency domain are performed over 0 : : :N ; 1.
The derivatives gm are calculated by one-sided dierence quotients:

gmi = @ r~m (p)  r~m (p + pi ei ) ; r~m (p) (A.27)


@p i p i
with ei being a unit vector in the direction of pi . The step sizes pi are chosen as
 
pi =  0:02 min max(jpi j 1) pmax min :
i ; pi (A.28)
The sign is chosen in order to move away from the rim of the feasible parameter range pmin max
i pi ].
The inverse matrix H;1 { more precisely, its generalized inverse { is computed by eigenvector
decomposition. Firstly H is scaled to L:
( p
Zij = wHwij wi = 1
Hii for Hii > 10;30
otherwise (A.29)
i j
The matrix Z is represented by eigenvectors Ai and eigenvalues  (using the Jacobi diagonal-
ization algorithm 23, 6]):
X
Zij =  Ai Aj (A.30)
52 InSitu Scienti c Software, DF 2.7

The generalized inverse of L is:


(
  X 1 for  > 10;5
L ;1
=  A i Aj with  =
  (A.31)
ij 0 otherwise
Small values of  are numerically uncertain, the corresponding directions are discarded by
taking  as zero 6, Chap. 2.9]. Whenever this is done, the problem is considered as being
singular i.e. the parameters cannot be determined along the discarded directions. In any case,
the result is:

H ;1

= 1 X 
A Aj (A.32)
ij w w i
i j

A.4 Long Term Prediction


For many applications the ultimate use of the parameters p and its covariance V is the prediction
of the yield Y (p D) for certain input data D, e.g. the thermal energy delivered by a SDHW
system for standard weather data. In the following, the algorithm to calculate Y as well as its
standard deviation Y is described.

A.4.1 The Yield Function (p D) Y

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.

A.4.2 Error of the Predicted Yield Function Value


Having dened the yield function Y (p D), its standard error is estimated. The function Y (p D)
is linearized around p^:

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.

You might also like