Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Variable Time Delay, Variable Transport Delay - Delay input by variable amount of time

Library

Continuous

Description

The Variable Transport Delay and Variable Time Delay appear as two blocks in the Simulink block library. However, they are the same Simulink block with different settings of a Select delay type parameter. Use this parameter to specify the mode in which the block operates.

Variable Time Delay

In this mode, the block has a data input, a time delay input, and a data output. (See How to Rotate a Block in the Simulink documentation for a description of the port order for various block orientations.) The output at the current time step equals the value of its data input at a previous time equal to the current simulation time minus a delay time specified by the time delay input.

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

When you want the output at a time that does not correspond to times of the stored input values and the solver is a continuous solver, the block interpolates linearly between points. If the time delay is smaller than the step size, the block extrapolates an output point from a previous point. For example, consider a fixed-step simulation with a step size of 1 and the current time at t = 5. If the delay is 0.5, the block needs to generate a point at t = 4.5. Because the most recent stored time value is at t = 4, the block extrapolates the input at 4.5 from the input at 4 and uses the extrapolated value as its output at t = 5.

Extrapolating forward from the previous time step can produce a less accurate result than extrapolating back 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 direct feedthrough.

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 required value.

Variable Transport Delay

In this mode, the block output at the current time step is equal to the value of its data (top, or left) input at an earlier time equal to the current time minus a transportation delay.

Simulink software finds the transportation delay, , by solving the following equation:

This equation involves an instantaneous time delay, , given by the time delay (bottom, or right) input.

For example, suppose you want to use this block to model the flow of a fluid through a pipe where the speed of the flow varies with time. In this case, the time delay input to the block would be

where L is the length of the pipe and is the speed of the fluid.

Data Type Support

The Variable Time Delay and Variable Transport Delay blocks accept and output real signals of type double.

Parameters and Dialog Box

The parameters and dialog box differ, based on the mode in which the block is operating: variable time or variable transport. Most parameters exist in both modes.

The dialog box for the Variable Time Delay block appears as follows.

The dialog box for the Variable Transport Delay block appears as follows.

Select delay type

Specify the mode in which the block operates.

Settings

Default: The Variable Time Delay block has a default value of Variable time delay. The Variable Transport Delay block has a default value of Variable transport delay.

Variable time delay

Specifies a Variable Time Delay block.

Variable transport delay

Specifies a Variable Transport Delay block.

Dependencies

Setting this parameter to Variable time delay enables the Handle zero delay parameter.

Setting this parameter to Variable transport delay enables the Absolute tolerance and State Name parameters.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Maximum delay

Set the maximum value of the time delay input.

Settings

Default: 10

Command-Line Information

See Block-Specific Parameters for the command-line information.

Initial output

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

Settings

Default: 0

The initial output of this block cannot be inf or NaN.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Initial buffer size

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

Settings

Default: 1024

Tips

Command-Line Information

See Block-Specific Parameters for the command-line information.

Use fixed buffer size

Specify use of a fixed-size buffer to save input data from previous time steps.

Settings

Default: Off

On

The block uses a fixed-size buffer.

Off

The block does not use a fixed-size buffer.

The Initial buffer size parameter specifies the buffer's size. If the buffer is full, new data replaces data already in the buffer. Simulink software uses linear extrapolation to estimate output values that are not in the buffer.

Tips

Command-Line Information

See Block-Specific Parameters for the command-line information.

Handle zero delay

Convert this block to a direct feedthrough block.

Settings

Default: Off

On

The block uses direct feedthrough.

Off

The block does not use direct feedthrough.

Dependency

Setting Select delay type to Variable time delay enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Direct feedthrough of input during linearization

Cause the block to output its input during linearization and trim, which sets the block mode to direct feedthrough.

Settings

Default: Off

On

Enables direct feedthrough of input.

Off

Disables direct feedthrough of input.

Tips

Command-Line Information

See Block-Specific Parameters for the command-line information.

Pade order (for linearization)

Set the order of the Pade approximation for linearization routines.

Settings

Default: 0

Command-Line Information

See Block-Specific Parameters for the command-line information.

Absolute tolerance

Specify the absolute tolerance for computing the block output.

Settings

Default: auto

Dependency

Setting Select delay type to Variable transport delay enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

State Name (e.g., 'position')

Assign a unique name to each state.

Settings

Default: ' '

If this field is blank, no name assignment occurs.

Tips

Dependency

Setting Select delay type to Variable transport delay enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Characteristics

Direct Feedthrough

Yes, of the time delay (second) input

Sample Time

Continuous

Scalar Expansion

Yes, of input and all parameters except Initial buffer size

Dimensionalized

Yes

Zero-Crossing Detection

No

See Also

Transport Delay

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS