DELAY N(input,delay time, initial value, order) N'th order exponential delay |
Scroll Prev Top Next More |
Returns an N'th order exponential delay. If order is 1 this function is almost the same as DELAY1I and if order is 3 it is almost the same as DELAY3I. The most significant difference is that the output of the DELAY N function depends only on the values delay time had in previous Time Steps while output from the DELAY3I function depends also on the value of delay time for the current time step. If delay time is constant this difference disappears.
The DELAY N function is treated as a discrete delay function, so that its output is constant for each Time Step. If you are using Euler or Diff integration this is true of all variables. However, if you are using Runge-Kutta integration this is different from functions such as DELAY3.
The DELAY N function will conserve quantities so the integral of the output will be the same as the integral of the input except that with 0 input the total output will be initial value times delay time as evaluated by the first active computation at initial time. In addition, if TIME STEP is a variable minor discrepancies may arise between the total input and total output.
Note that for the DELAY N function to make sense delay time must be bigger than order* TIME STEP. If this is not the case Vensim will issue a warning and automatically reduce the order so that this is true. When this happens the behavior of the DELAY N function is essentially the same as the behavior of the DELAY MATERIAL function.
Restrictions: DELAY N must directly follow the equal sign and nothing else can appear on the right. It signals Vensim that the variable on the left-hand side of the equation is a Level or State variable. In the Equation Editor select Variable type Level, subtype Delay/Queue and enter DELAY N as the function.
Units: DELAY N( unit, time unit, unit, dmnl ) --> unit
Example
delayed production = DELAY N(production, delay time, production, 12)
Sample model: DELAY 1 3 N P.mdl in FunctionExamples