Engee documentation

Variable Time Delay

Delays the input signal for a variable amount of time.

blockType: VariableTimeDelay

Path in the library:

/Basic/Continuous/Variable Time Delay

Description

The Variable Time Delay unit delays the input signal for a variable amount of time.

The output data at the current time step is equal to the value of its input data at the previous time step. This step is the current simulation time minus the delay time specified by the time delay input.

τ .

variable time delay 1

During the simulation, the block stores the time and input value pairs in an internal buffer. At the beginning of the simulation, the block outputs the value of the parameter Initial output until the simulation time exceeds the input time delay value. Then, at each simulation step, the block outputs the input signal received at a point in time that corresponds to the current simulation time minus the delay time.

If you want data at time points that are between the input storage times, and the solver is a continuous solver, the block performs linear interpolation between the points. If the time delay is smaller than the step size of the solver, the block extrapolates the output point based on the previous point. For example, consider a simulation with a fixed step solver with step size 1 and current time at t = 5. If the delay is 0.5, the block should generate a point at t = 4.5, but the most recently stored time value will be at t = 4. Thus, the block extrapolates the input data at time t=4.5 from the data generated at t=4 and then uses the extrapolated data in calculating the value at time t=5.

Extrapolating forwards from a previous time step may give a less accurate result than extrapolating backwards from the current time step. However, the block cannot use the current input to calculate its output value because the input port does not have a forward pass-through connection.

If the model specifies a discrete solver, the block does not interpolate between time steps. Instead, it returns the nearest stored value that precedes the desired value.

Ports

Input

# IN_1 — input signal
scalar | vector | matrix

Details

An input signal specified as a scalar, vector or matrix.

Data types

Float64.

Complex numbers support

No

# t0 — time delay input value
scalar | vector | matrix

Details

Input time delay specified as a scalar, vector or matrix.

Data types

Float64.

Complex numbers support

No

Output

# OUT_1 — delayed output signal
scalar | vector | matrix

Details

Output signal as a scalar, vector or matrix.

Data types

Float64.

Complex numbers support

No

Parameters

Main

# Maximum delay — maximum value of the time delay input
Scalar / array of real numbers

Details

Set the maximum time delay input value. The unit limits any delay that exceeds this value. This value cannot be negative. If the time delay becomes negative, the block equates it to zero.

Default value

10

Program usage name

MaximumDelay

Tunable

Yes

Evaluatable

Yes

# Initial output — initial output value
Scalar / array of real numbers

Details

Specify the output data that the block generates until the simulation time exceeds the input time delay value.

Default value

0

Program usage name

InitialOutput

Tunable

No

Evaluatable

Yes

# Initial buffer size — initial memory allocation

Details

Determine the initial memory allocation for the number of input points to store.

If the number of input points exceeds the initial buffer size, the block allocates additional memory.

Since memory allocation slows down the simulation, choose this value carefully if simulation speed is an issue. For long delays, this block may use a large amount of memory, especially for dimensional input signals.
Default value

1024

Program usage name

MaximumPoints

Tunable

No

Evaluatable

Yes

# Use fixed buffer size — usage of a fixed size buffer
Logical

Details

Select this check box to use a fixed size buffer to save input data from previous time steps.

The parameters Initial buffer size determines the size of the buffer. If the buffer is full, new data replaces the data already in the buffer. The block uses linear extrapolation to estimate output values that are not in the buffer.

If the input data is linear, checking this box can save memory. If the input data is non-linear, do not select this check box. Doing so may result in inaccurate results.
Default value

false (switched off)

Program usage name

FixedBuffer

Tunable

No

Evaluatable

No

# Handle zero delay — option that allows you to set zero delay
Logical

Details

Define the possibility to operate the block with zero time delay.

When this checkbox is selected, the unit allows operation with zero time delay. The input signal has a direct through connection.

If this check box is not selected, the unit does not allow zero time delay operation. The input signal does not have a straight through connection.

Default value

false (switched off)

Program usage name

ZeroDelay

Tunable

No

Evaluatable

No