| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
Continuous
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.
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.
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.
The Variable Time Delay and Variable Transport Delay blocks accept and output real signals of type double.
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.

Specify the mode in which the block operates.
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.
Specifies a Variable Time Delay block.
Specifies a Variable Transport Delay block.
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.
See Block-Specific Parameters for the command-line information.
Set the maximum value of the time delay input.
Default: 10
This value defines the largest time delay input that this block allows. The block clips any delay that exceeds this value.
This value cannot be negative. If the time delay becomes negative, the block clips it to zero and issues a warning message.
See Block-Specific Parameters for the command-line information.
Specify the output that the block generates until the simulation time first exceeds the time delay input.
Default: 0
The initial output of this block cannot be inf or NaN.
See Block-Specific Parameters for the command-line information.
Define the initial memory allocation for the number of input points to store.
Default: 1024
If the number of input points exceeds the initial buffer size, the block allocates additional memory.
After simulation ends, a message shows the total buffer size needed.
Because allocating memory slows down simulation, choose this value carefully if simulation speed is an issue.
For long time delays, this block might use a large amount of memory, particularly for dimensionalized input.
See Block-Specific Parameters for the command-line information.
Specify use of a fixed-size buffer to save input data from previous time steps.
Default: Off
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.
If the input data is linear, selecting this check box can save memory.
If the input data is nonlinear, do not select this check box. Doing so might yield inaccurate results.
See Block-Specific Parameters for the command-line information.
Convert this block to a direct feedthrough block.
Default: Off
Setting Select delay type to Variable time delay enables this parameter.
See Block-Specific Parameters for the command-line information.
Cause the block to output its input during linearization and trim, which sets the block mode to direct feedthrough.
Default: Off
Selecting this check box can cause a change in the ordering of states in the model when you use the functions linmod, dlinmod, or trim. To extract this new state ordering:
Compile the model using the following command, where model is the name of the Simulink model.
[sizes, x0, x_str] = model([],[],[],'lincompile');
Terminate the compilation with the following command.
model([],[],[],'term');
The output argument x_str, which is a cell array of the states in the Simulink model, contains the new state ordering. When you pass a vector of states as input to the linmod, dlinmod, or trim functions, the state vector must use this new state ordering.
See Block-Specific Parameters for the command-line information.
Set the order of the Pade approximation for linearization routines.
Default: 0
The default value is 0, which results in a unity gain with no dynamic states.
Setting the order to a positive integer n adds n states to your model, but results in a more accurate linear model of the transport delay.
See Block-Specific Parameters for the command-line information.
Specify the absolute tolerance for computing the block output.
Default: auto
You can enter auto or a numeric value.
If you enter auto, Simulink uses the absolute tolerance value in the Configuration Parameters dialog box (see Solver Pane) to compute the block output.
If you enter a numeric value, that value overrides the absolute tolerance in the Configuration Parameters dialog box.
Setting Select delay type to Variable transport delay enables this parameter.
See Block-Specific Parameters for the command-line information.
Assign a unique name to each state.
Default: ' '
If this field is blank, no name assignment occurs.
To assign a name to a single state, enter the name between quotes, for example, 'velocity'.
To assign names to multiple states, enter a comma-delimited list surrounded by braces, for example, {'a', 'b', 'c'}. Each name must be unique.
The state names apply only to the selected block.
The number of states must divide evenly among the number of state names.
You can specify fewer names than states, but you cannot specify more names than states.
For example, you can specify two names in a system with four states. The first name applies to the first two states and the second name to the last two states.
To assign state names with a variable in the MATLAB workspace, enter the variable without quotes. A variable can be a string, cell array, or structure.
Setting Select delay type to Variable transport delay enables this parameter.
See Block-Specific Parameters for the command-line information.
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 |
![]() | Unit Delay With Preview Resettable External RV | Weighted Moving Average (Obsolete) | ![]() |

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 |