Delay

Description

The Delay function models the Laplace expression e-sT, where T is the length of the delay in seconds and s is the Laplace operator.  This is quite a simple function, which feeds the input into one end of an array table and as time advances, progresses to the end of the array.  After T seconds has elapsed, the original input becomes available at the output.  

 

 

Block Diagram of DELAY Function

 

If large delay times are desired where T is much greater than the calculation interval, then the array table will be large if it processes each time step.  For example, consider a calculation interval of 50 ms and a delay time of 100 ms.  To store and process the input every time step would require an array size of 2000.  Often it is not necessary to process each time step, instead the input can be sampled N times in delay time T.  If 20 such samples are considered adequate, then the array size is reduced to 20 from 2000 in this example, with a sample interval of 100 time steps or once every 5 ms.  

 

Care must be taken in modelling the delay function to ensure that minimizing storage by broadening the sample interval does not compromise the integrity of the response.  The Delay function will scale the number of allocations it requires to the STOR array according to the time delay T and number of sample intervals N.  The size of the STOR array is therefore equal to 1 + N.

 

To ensure that a good approximation to the desired delay interval is obtained, care is required in selecting the delay time interval TD.  Consider in the figure below, a desired delay time interval T1.  Due to a realistic number of samples N over the T1 interval, the effective time delay T2 becomes:

 

 

 

 

Effect of Sampling on Actual Delay

 

Therefore, if it is required to compensate for the sample effect, a modified delay time must be specified in the argument of DELAY.  If the desired time delay is T1 seconds with N samples, then the compensated time interval T2 is:

 

 

If necessary, smoothing of the stepping effect of sampling can be accomplished by filtering the DELAY output through a first order lag using function REALP2.  

 

 

Author(s):

 

 

 

Argument Descriptions

 

      REAL FUNCTION DELAY(TD,N,X)

 

 

Argument

Type

Dimension

Description

 

 

 

 

TD

REAL

1

Time delay [s]

N

INTEGER

1

Number of samples in delay T

X

REAL

1

Input function

 

Storage

This function requires the following storage allocations per call (see #STORAGE Script Directive and STORx Arrays for more details):

 

#STORAGE STOR: < N+1 >

NOTE:  There is no fixed storage array allocation size for the DELAY function but it can be determined by N + 1.

 

Address

Description

 

 

NEXC + 1

...

 

NEXC + N + 2

Storage array of inputs