Please enable JavaScript to view this site.

Vensim Help

Test Inputs allow you to define alternative conditions by changing equations for a variable in the model.  The basic format for a Test Input is:

name :TEST INPUT: variable = expr

Where name is the name of a Test Input.  What appears to the right of :TEST INPUT: is exactly the same format equation you would normally use to define an auxiliary variable, and can involve only model variables.  The equation you write is also restricted in that you cannot use dynamic functions (such as SMOOTH), defining functions (such as ACTIVE INITIAL) or user defined Macros.  If you need this functionality, you can create extra model variables for use in your Test Inputs.

You can only use Test Inputs in the conditional portion of a Constraint equation.  The major reason for defining Test Inputs is to give a name to the experiment being conducted.  This can make reading the Constraint much easier.  If you do not define Test Inputs, you can define Constraints directly using the variable = expr portion of the Test Input equation.  The same restricted equation format applies if you do this.

Dynamic Test Inputs

In addition to an alternate assignment expression for a Test Input, it is often desirable to force a change in a variable after a period of time in a simulation.  For example, you might want to force production to ramp down to 0 between time 10 and 12, but before time 10 just let production be what it would have been.   This type of a change is useful both for writing complete reality Checks and for studying the response of a model to interesting Test Inputs..

To create Test Inputs with a time profile there are a series of functions that begin with RC — RC COMPARE, RC DECAY, RC GROW, RC RAMP and RC STEP (details in Functions in the Reference Guide).  These all behave in a similar manner.  For example:

TI Production to zero :TEST INPUT: 
       production = RC RAMP(production,0,2,10)

This Test Input will cause production to go to ramp from whatever it is at time 10 to zero at time 12.

The RC... functions all take two optional arguments—a start time and a duration.  If the duration is omitted, as it is above, the Test Input continues in the changed state to the end of the simulation.  If you specify a duration the Test Input will continue in the changed state for the time specified, and then the variable will revert to its normally computed value.  When it does revert the values the variable depend upon will likely be different so it most likely will not take on the value it has in a normal simulation.

If the start time (10 in the above example) is omitted, and the model contains the constant RC START TIME the changed specified will begin at this time.  If RC START TIME is not in the model the change will start at INITIAL TIME + TIME STEP.  Using RC START TIME in this manner is convenient because it allows you to globally change the time at which changes take effect and allows you to leave off additional arguments to the RC functions.  Having Test Inputs start during a simulation is helpful because it prevents startup behavior from interfering with the testing of the model and also permits you to run tests with different relative values for variables.