Please enable JavaScript to view this site.

Vensim Help

If you do not want to use the defaults you can set options in the Optimization Control dialog or directly in the Optimization Control file.  In the file these options must precede the search specification parameters and take the form :KEYWORD=value.  

As always, capitalization and spacing are ignored by Vensim.  Options must precede the parameter declarations, but otherwise order is not meaningful.   All options can be shortened to four characters.  In addition, you can include comments inside of braces {}.  If repeated or conflicting options are specified, only the last are used.

Comments can be placed in optimization control files using  the :COMMENT keyword or {}  This lets you put in remarks which are ignored by the system.  The remark will be repeated in runname.out.

If you use the Optimization Control Dialog all of the keywords will be entered automatically.  The keywords have (approximately) the same names as the fields in this dialog.  They are reported in the order they appear in the dialog.

NOTE comments are not supported by the Optimization Control dialog and will be lost if you edit a file containing comments with this dialog.

Optimizer

:OPTIMIZER = POWELL {POWELL | OFF}

The default option is POWELL, which denotes a modified Powell search.  When set to OFF, no optimization is done.  This is useful when the MULTIPLE_START option is activated.  For example, :MULTIPLE_START=GRID and :OPTIMIZER=OFF performs a grid search of increasing definition starting from the specified values.  This can be used to test the global validity of an optimum or the sensitivity of the model to the search parameters outside normal operating ranges.

Sensitivity

:SENSITIVITY=OFF { OFF | PAYOFF_VALUE{=4.0} |
                 PAYOFF_PERCENT{=10.0} |
                 PARAMETER_PERCENT{=10.0} |
                 ALL_CONSTANTS{=10.0}}

This option allows you to find out how sensitive the payoff is to changes in parameter values.  The default setting is off, which does not invoke the sensitivity calculations. Otherwise, there are four modes of use: PAYOFF_VALUE, PAYOFF_PERCENT, PARAMETER_PERCENT, and ALL_CONSTANTS. See Payoff Sensitivity for details.

Multiple Start

:MULTIPLE_START=OFF {OFF | RANDOM | RRANDOM | XPARALLEL | RPARALLEL | GRID | VECTOR | SVECTOR }

This option restarts optimization multiple times from different starting points or, if :OPTIMIZER=OFF, simulates the model for different values of the search parameters.

See Multiple Start for details.

Random Number Generation Method

:RANDOM_NUMBER=LINEAR (DEFAULT|MERSENNE|LINEAR|SUBTRACTIVE)

This option applies only if :MULTIPLE_START=RANDOM or a stochastic optimizer is used.  Beginning with Version 6.3, options are DEFAULT, MERSENNE, LINEAR and SUBTRACTIVE. The DEFAULT generator is MERSENNE. Prior to Version 6.3, the default generator was LINEAR. Older optimization control files should be updated to use the new DEFAULT or MERSENNE options. See NOISE RNG for an explanation of the options.

Random Number Seed

:SEED =1

This option is only applicable if MULTIPLE_START=RANDOM or a stochastic optimization method is used.  This is a nonnegative integer between 0 and 231 (about 2E9), needed to initialize the random number generator for the optimizer.

The default value is 1 and will be assumed if SEED is not specified.

Any other positive value will produce a distinct random sequence.

If a negative value is supplied its absolute value will be used.

If 0 is used, the seed will be nonreproducibly randomized (useful if you want to perform distinct samples on multiple computers without editing the control file for each).

Simulation and optimization use the same algorithms for generating random numbers, but represent separate invocations.  For each simulation, the random number generator is reset and regenerates the same values.

Number Restart (#Restart)

:RESTART_MAX=0

This option is applicable when MULTIPLE_START is set to RANDOM or GRID  It determines the maximum number of times the optimizer will restart.  By default RANDOM and GRID will continue until they are interrupted.  Specify a positive number to have them restart only that number of times.

Output Level

:OUTPUT_LEVEL=1 {0 | 1 | 2 | 3 | 4 | 5 | 6}

This determines the amount of information the optimizer displays as it is running.  This information will go to the screen and to the error file for the simulation.  It takes a value between 1 and 6.  Higher numbers give more information, with each higher level including all the information from the lower levels.  The specific information follows:  

0        Suppresses output.  This is useful if MULTIPLE_START is turned on.

1        The starting point and final point of the optimization are given along with their payoffs.

2        Displays any point with its payoff which is an improvement over the best payoff calculated so far.  The percent improvement is also displayed.

3        Displays the best point and payoff of every optimization, particularly useful with MWYS.

4        Displays best point and payoff of each iteration through the entire set of search vectors.

5        Displays the best point and payoff after each individual vector optimization.

6        Displays every point and payoff.

An asterisk (*) is printed in front of the parameters which have changed for the most recent simulation.

Trace

:TRACE=NO {NO{0} |YES{2}  |3|4|5|6}

NO is a synonym for 0 and YES is a synonym for 2. This is valid only if MULTIPLE_START=OFF. This allows you to trace the optimization results.  If trace is set to anything other than NO, then two files, trace.tab and trace.dat, will be created.  The file trace.tab is a tab-limited file that lists parameter values and payoffs at different iterations.  The file trace.dat lists the same information in a format that can be loaded into Vensim using Dat2vdf.  The time axis for this file is simply an index that increases by one on each simulation.  As optimization progresses, both of these files are filled in. Termination of the optimization session leaves them intact.

The value to which trace is set (2-6) determines how much information is included in the created files.  See the :OUTPUT option for a description of these different output levels.

If any point had a payoff which caused an overflow or some other numerical error, then the special value NA is entered in trace.dat. These points will be ignored when loaded into Vensim.

Maximum Iterations

:MAX_ITERATIONS=1000

This is the maximum number of times the optimizer will search through the list of parameters to avoid entering an infinite loop.  This is a control parameter for POWELL optimization.

Pass Limit

:PASS_LIMIT=2

This is the number of times the optimizer will run through an entire Powell search.  At the beginning of each search the vector set is reinitialized to ensure that none of the directions have collapsed to zero.  A value of 2 is usually good enough to deal with this and is therefore the default value.  This is a control parameter for POWELL optimization.

Fractional Tolerance

:FRACTIONAL_TOLERANCE= 0.0003

This represents the fractional tolerance for a parameter value and is used to determine when to terminate an optimization.  The search is refined until the value for each parameter is within the fractional tolerance times the search range (maximum value minus minimum value)of the parameter. If no search range is selected the fractional tolerance multiplies the larger of 1.0 and the absolute value of the parameter when the search starts. This option sets the fractional tolerance for all parameters.  You can set individual parameters separately to override this option, using the FRAC=# notation discussed in "Specifying Search Parameters" earlier in this chapter.

If you specify a fractional or absolute tolerance for an individual parameter this overrides the global fractional tolerance setting. At the beginning of the optimization absolute tolerances are computed for all search parameters and these are used to determine both the initial step size (granularity) of the search and the termination conditions. . All tolerances are adjusted by the tolerance multiplier for the initial phase of the optimization. When searching in a direction that involved multiple parameters, the tolerance is determined as the geometric mean of the tolerances in the different directions.

Optimizations work best when the tolerances for the parameters being searched over are balanced. Essentially this means that changing any parameter by its tolerance will have approximately the same impact on the payoff. If this is not the case you may get early convergence, or Vensim may perform an excessive number of simulations to converge which takes longer. If you are conducting searches over a large number of parameters it is worth it to take the time to try do this balancing.

Tolerance Multiplier

:TOLERANCE_MULTIPLIER = 21.0

The termination criteria for the search are adjusted for the early and coarse searches over the parameter space, so that these searches will terminate quickly and a more refined search can start from a good starting value.  The tolerance multiplier allows you to adjust the balance between accuracy and completion time in early searches.  On each iteration, the tolerances are multiplied by 1 + ((n - iter)/ n) * tolerance_multiplier, where n is the total number of search parameters and iter is the number of iterations through the search directions.  When iter gets bigger than n, or if no improvement is found on an iteration, the tolerance multiplier is no longer used.  This is a control parameter for POWELL optimization.

Absolute Tolerance

:ABSOLUTE_TOLERANCE =1.0

This sets the default value for an absolute tolerance.  The absolute tolerance is used in determining when to terminate a search, but it is not applied to a parameter unless the ABS modifier is given for the parameter (as discussed in the previous section) and no value is specified.  All absolute tolerances are multiplied by the :SCALE_ABSOLUTE and adjusted by the tolerance multiplier during optimization.

Scale Absolute

:SCALE_ABSOLUTE =1.0

Because of differing units of measurement, different parameters are likely to require different absolute tolerances.  Once these different absolute tolerances have been set, they can be scaled up or down using the :SCALE_ABSOLUTE value.  For example, if PARM_1 has an absolute tolerance of .3 and PARM_2 has an absolute tolerance of  .4, then setting :SCALE_ABSOLUTE=2 is the same as giving PARM_1 an absolute tolerance of .6 and PARM_2 an absolute tolerance of .8.

SCALE ABSOLUTE does not apply to fractional tolerances. Generally, if you are specifying tolerances for individual parameters you will get the best performance by specifying absolute tolerances and scaling them all for early exploration (or if using multiple start).

Vector Points

:VECTOR_POINTS=25

This option only applies if the MULTIPLE_START=VECTORor SVECTOR option is set.  This sets the number of points to search along the vector.