Additional functions

On this page we list the aditional functions that have been encountered by students working on models implemented in various other modelling languages, and how to handle them in Simile.

IMPORTANT NOTE

To use these functions, you need to add a file into your Simile installation. The file is called STEEMI.pl, and is attached to the bottom of this page. This file will change over time, as it is expanded to handle additional functions that Steemies request (typically, because you have come across a new function that is not already available).

Add the file STEEMI.pl to the directory shown below, depending on your operating system. If you want to update the set of available functions as they are added to this file, simply replace an older version with the latest version.

On Windows: Functions in My Simile Files, under Documents (Windows 7 or Vista) or My Documents (earlier Windows versions)

On Linux: Functions in .simile, in the user's home directory (you may need to do View > Show hidden files to see the .simile directory)

On Macs: Functions in Simile, in the user's home directory

This list is organised by modelling software, to make it easier to find the one you want.

If you come across a function that is not listed here,please let us know by posting a message on the discussion forum and/or adding an entry on this page, and mark it 'requested'. I will update the entry when the file has been added to STEEMI.pl

Vensim

WITH LOOKUP - done, 21 March 2012

Corresponding Simile function in STEEMI.pl: interp.

The Vensim syntax for this is illustrated by the following example:

DEFORESTATION = WITH LOOKUP (Time, ([(1850, 0) -(2300, 10)], (1850,0), (1980,2), (2100,1), (2400,1))) [GtC/Year]

So, in general, it is

y = WITH LOOKUP (x, ([(a,b) -(c,d)], (x0,y0), (x1,y1), (x2,y2), (x3,y3).... (xn,yn))) [units]

I.e. y is a function of x, with pairs of (x,y) values defining the relationship. Linear interpolation is used.

How to convert:

Ignore the [(a,b) -(c,d)] bit

Ignore the [units] bit.

The corresponding function defined in STEEMI.pl is interp(input_x_value, set_of_x_values, set_of_y_values), and its syntax is:

y = interp(x, [x0,x1,x2,x3...xn], [y0,y1,y2,y3...yn])

As usual, we don;t enter the "y =" bit (since Simile knows that we are providing an equation for y). Note that we have re-arranged to x and y values. Therefore, the original example would be entered for the variable deforestation as:

interp(Time, [1850,1980,2100,2400], [0,2,1,1])

Alternatives

You can use the Simile sketch-graph facility. Draw the influence arrow (from time to deforestation in this case), open up the equation dialogue for the target variable (deforestation), and click the Graph button to open up the sketch-graph facility. It should be pretty obvious what to do, but see the Simile Help entry if you want more information.

RAMP - done, 21 March 2012

Use the interp function (described above), with 4 coordinate pairs, defining the start of the initial horizontal bit, the start of the sloping bit, the end of the sloping bit, and the end of the final horizontal bit.

For example,

interp(x, [0,20,30,100], [2,2,5,5])

defines a ramp from (x=20, y=2) to (x=30, y=5]

STEP - done, 21 March 2012

Do as for the ramp function (above), but use the same x coordinate for the 2nd and 3rd coordinates.