Changes from Vensim 4

The following outlines changes that were made from the original release of Vensim 4. These changes were made in release 4.1 and 4.2 but were not reflected in the printed documentation.

New and Changed Functionality

Default Show Initial Causes

When you start a new model the display of initial causes will be turned off. You can turn this on by using the menu item Model>Settings menu item, clicking on the info/Sketch tab and checking show initial causes. Note that many of the diagrams in the manuals have initial causes turned on.

Line Markers

In addition to being able to display a line at 0 on graphs you can also display a line at 1 and a vertical line at Special Time. The setting of line markers is made from the Scaling tab of the Control panel.

 

SIMULATION PAUSE

If you add the variable SIMULATION_PAUSE to a model it will cause the model to take at least the specified number of seconds between save periods. This is useful if you want to slow the progress of a simulation to display graphs. For example setting:

SIMULATION_PAUSE=SAVEPER

for a model in months will cause 1 second to elapse for each simulated month. SIMULATION_PAUSE can be defined as a constant or a variable so that you can give a simulation the appearance of slowing down.

The units for SIMULATION_PAUSE do not have any effect on behavior. The pause is always read as being in seconds. If it is not a constant you should make the units match its equation.

The maximum pause is 30 seconds.

Sketch Selection

The Edit menu for Sketches has been modified to make it easier to select subsets of the visual elements. You can now Select All, Or Select:

All But Shadow - all elements not defined as shadow variables.

Aux/Const/Data - all variables that are not either Levels or Rates.

Visible Items - everything that can be seen. Normally selection from the menu includes hidden elements.

Information Arrows - all arrows that are not part of rates.

Levels - all the levels in the view.

Rates - all the rates in the view.

These selections make it easier to color or emphasize different elements of a sketch.

Maximum Number of Saved Periods

There is no longer any restriction on the number of time points that can be saved during a simulation. The Table tool is still limited to at most 8000 points but can display any subset selected from the Time Axis Control.

Memory Management and Simulation Speed

This should be transparent but a number of restrictions and inefficiencies that influence the simulation performance of large models have been removed. This is especially true for models that make extensive use of the DELAY_... functions and

models that are simulated for a great numberof SAVEPERs.

Min and Max attributes on variables for DLL

If you are using the full DLL you can now use the vensim_get_varattrib function to pass the minimum and maximum specified for a variable by passing ATTRIB_MIN (11) or ATTRIB_MAX (12) as the second argument.

Autocorrelation and Fourier Transform Notes

You can now access these transforms from the Table tool as well as the Strip Graph. The transforms have also been corrected for labeling associated with different values for SAVEPER. The maximum lag for autocorrelation is now in units of time – not the number of SAVEPERs.

Custom Tables

You can now easily create Custom Tables just as you create Custom Graphs. Just open the Custom Graph dialog and then click on the As Table... button. This will open the Custom Table Editor. The Custom Table Editor is straightforward to use. There are more details on it in Chapter 14 of the Reference Manual in the online help files.

New Functions

There have been a number of new functions added, most especially those dealing with delays and queues. The new functions are:

DELAY N(X,T,I,N) N'th order exponential delay of the input X  starting at I  and conserving X.

DELAY PROFILE(P,X,T,I,G) An arbitray delay of X  with average delay time T distributed over a profile P (a Lookup) with initial value I  initially growing at rate G.

GET DATA AT TIME(D,T) The value for the data variable D at time T  or :NA: if not available.

QUEUE AGE AVERAGE(Q,X) Average age of oldest X elements in the queue Q.

QUEUE AGE IN RANGE(Q,M,X) Number of elements in a queue between ages M and X  inclusive.

QUEUE AGE OLDEST(Q) Age of the oldest element of the queue Q.

QUEUE ATTRIB AVERAGE(Q,X) Average attribute value of the oldest X elements in the queue Q.

QUEUE ATTRIB IN RANGE(Q,M,X) The number of elements of Q with attributes between M and X inclusive.

QUEUE ATTRIB MAX(Q) Returns the maximum value of the attribute in the queue Q.

QUEUE ATTRIB MIN(Q) Returns the minimum value of the attribute in the queue Q.

QUEUE ATTRIB QUANTITY(Q,X) Number of elements in queue Q required to have a total attribute of X.

QUEUE FIFO(I,O,P,N,T) Performs numerical integration of input I  and output O  tracking age with initial age distribution profile P (a Lookup) of quantity N over time T. The attrib

QUEUE FIFO ATTRIB(I,O,A,R,P,Q,N,M,T) This variation on QUEUE FIFO adds in an incoming attribute A, a rate R at which existing attributes change, an initial distribution multiplier Q of the initial attribute M.

SMOOTH N(X,T,I,N) Returns a N'th order exponential smooth of X over time T  starting at I.

The new functions are described in detail in the online help files (see Chapter 4 of the Reference Manual).

External Constant and Data Definition Functions (DSS Only)

It is now possible to define external functions that behave like the GET XLS CONSTANT and GET XLS DATA functions to load both constants and data. This makes it more convenient to interact with customized databases. See Chapter 8 of the DSS Reference Supplement in the online help files for more details.

Live Links to Spreadsheets

The GET_123_DATA, GET_123_CONSTANTS, GET_XLS_DATA and GET_XLS_CONSTANTS functions can now take named ranges instead of cell identifiers. If you use a named range in the GET_..._DATA functions for the actual data you must also use a named range for the Time Row or column. For example suppose you have

Time

1

2

3

4

Label : TIMEROW

 

 

 

 

 

 

var[s1]

20

30

40

50

Label : VARVALS

var[s2]

15

35

23

33

 

Then you could use the function call

var[sub] := GET XLS DATA('test.xls','sheet1', 'TIMEROW','VARVALS')

and this would be the same as

var[sub] := GET XLS DATA('test.xls','sheet1',

'1','B3')

Note that named ranges must be contiguous. If you want to only use a subset of values just use a Time Row or Column that has blanks or nonnumbers for the columns or rows you want to exclude.

NOTE For some non-English versions of Excel, it is necessary to specify a different labeling letter for rows and columns. If this applies to you you can specify the alternate labeling letters in the Settings tab of the Global Options dialog (Tools>Options).

Model->Data

In the Info/Sketch tab of the Model Settings dialog has a new button labeled Model->Data that will write the names of all data the model requires into a text file. This file has one variable name (expanded with subscript elements) on each line so that it is easy to use as the first column of a spreadsheet with time running across.

Reading and Writing Changes Files

In simulation setup mode there is a new menu header Changes with two items: Read Additional Changes from File allows you to read changes for a text file. These changes are added to any onscreen changes you might have made. Write Changes to .cin File takes all onscreen changes (and any changes you have read) and writes them to a .cin file. This is similar to the functionality in the Changes Tab of the Simulation Control dialog but can be accessed directly without opening this dialog.

Moving through Equation in Equation Editor (Pro and DSS only)

For variables with multiple equations you can now use Ctrl+PgUp and Ctrl+PgDn to move between equations.

New Simulation Control Commands (DSS only)

We have added two new simulation control commands for Venapps, Command Scripts and the Vensim DLL.

SIMULATE>KALMAN|1 or 0

turns Kalman filtering on and off.

SIMULATE>INTEGTYPE|0 through 5

sets the integration type to be used. 0 is Euler Integration, 1 is Runge Kutta 4 with automatic step size adjustment, 2 is difference equation, 3 is Runge Kutta 2, 4 is Runge Kutte 2 with step size adjustment and 5 is Runge Kutta 4.

Documentation Corrections

On Page 37 of the Reference Manual (Chapter 2) the definition for the VSMOOTH macro is wrong. It should read:

:MACRO: VSMOOTH(input,SMOOTH TIME)

Vsmooth = INTEG((input - Vsmooth)/SMOOTH TIME,

  input)

~ input

~ The first order smoothed value of a variable.

|

:END OF MACRO:

In the section on Kalman filtering in Chapter 10 of the Reference Manual several small corrections have been made. Notably the control files are all names wfkal... whereas the documentation sometimes refers to wfinv... Also the original text said to fill in the Simulation Control dialog with the name kalman.prm and this is not correct. The kalman.prm file is referenced automatically. Finally, the zoomed in graph on page 255 was not really zoomed in.

On page 83 of the DSS Reference Supplement one of the paths is specified incorrectly (it is missing MSDev98). This may already have been fixed in the manual you receive. Also note that the example works only for Windows 95/98 but mdl.bat will work for both Windows 95/98 and NT.