| Simulink® | ![]() |
Continuous
The Variable Transport Delay and Variable Time Delay appear as two blocks in the Simulink® block library. However, they are actually the same built-in Simulink block with different settings of a Select delay type parameter. This parameter allows you to specify that the block operate in either of the following modes.
In this mode, the block has a data input a time delay input, and a data output. (See Changing the Orientation of a Block in the Simulink documentation for a description of the port order for various block orientations.) The block's 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 block's time delay input.
![]()

The block's Maximum delay parameter defines the largest value the time delay input can have. The block clips values of the delay that exceed this value. The Maximum delay must be greater than or equal to zero. If the time delay becomes negative, the block clips it to zero and issues a warning message.
During the simulation, the block stores time and input value pairs in an internal buffer. At the start of the 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 output is required at a time that does not correspond to the 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's 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 block's 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 block's parameters and dialog box differ, depending on whether it is operating in variable time or variable transport delay mode. Most parameters exist in both modes. The following sections note parameters that exist only in one mode.
The dialog box for the Variable Time Delay block appears as follows.

The delay type of the block. The Variable Time Delay block in the Simulink library has a preset value of Variable time delay. The Variable Transport Delay block has a preset value of Variable transport delay.
The maximum value of the time delay input. The value cannot be negative. The default is 10.
The output generated by the block until the simulation time first exceeds the time delay input. The default is 0. Simulink software does not allow the initial output of this block to be inf or NaN.
Initial size of the buffer used to store previous input values. The default is 1024.
Specifies use of a fixed-size buffer to save input data from previous time steps. 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 the output value if it is not in the buffer. This option can save memory if the input data is linear. If the input is not linear, this option may yield inaccurate results.
For Variable time delay mode. Turns this block into a direct feedthrough block.
Causes the block to output its input during linearization and trim. This sets the block's mode to direct feedthrough.
Enabling this check box can cause a change in the ordering of states in the model when using the functions linmod, dlinmod, or trim. To extract this new state ordering, use the following commands.
First compile the model using the following command, where model is the name of the Simulink model.
[sizes, x0, x_str] = model([],[],[],'lincompile');
Next, 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 passing a vector of states as input to the linmod, dlinmod, or trim functions, the state vector must use this new state ordering.
The order of the Pade approximation for linearization routines. 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.
The block's dialog box in Variable Transport Delay mode appears as follows.

This mode adds the following parameter.
Absolute tolerance used to solve the block's states. You can enter auto or a numeric value. If you enter auto, Simulink software determines the absolute tolerance (see Absolute tolerance). If you enter a numeric value, Simulink software uses the specified value to solve the block's states. Note that a numeric value overrides the setting for the absolute tolerance in the Configuration Parameters dialog box.
Use this to assign a unique name to each state. The state names apply only to the selected block. If left blank, no name is assigned.
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 number of states must be evenly divided by the number of state names. There can be fewer names than the number of states, but there cannot be more names than states.
For example, you can specify two names in a system with four states. Simulink software will assign the first name to the first two states and the second name to the last two.
To assign state names with a variable that has been defined in the MATLAB® workspace, enter the variable without quotes. A variable can be a string, cell, or structure.
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 | No |
![]() | Unit Delay With Preview Resettable External RV | Weighted Moving Average (Obsolete) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |