Archive

Posts Tagged ‘graphical function’

LOOKUP Built-in Allows Reuse of Graphical Function Curves

March 10th, 2009

Karim Chichakly Modeling Tips

Sometimes it is necessary to access a data set from multiple places within a model.  For example, a manufacturer may have a non-linear curve that maps capacity required for a given product to raw material required to manufacture it.  Such a curve is shown below:

lookupgraphicalfunctioncurve

If one production line needs to know this information, a graphical function works fine.  However, if there are two production lines in the model, the second line also needs this information.  If the two lines are identical in structure, the model could be arrayed to share the curve for both lines.  If they are not, it was necessary in versions prior to 9.1 to make a copy of this curve for the second production line.  Then if, at a later time, one copy of the curve needed to be changed, the other one also needed to be changed in the same way.

Version 9.1 introduced the LOOKUP built-in.  This allows any graphical function curve to be re-used as many times as desired within the same model.  Note that a graphical function, by definition, ties a specific equation to the given curve.  Using LOOKUP, it is now possible to evaluate that same curve using several different equations in the same time step.

In this case, let’s assume the second production line has similar variables with “2” appended to their names.  Thus, there is a capacity2 and a material needed 2.  Prior to version 9.1, it was necessary for material needed 2 to be an identical copy of material needed.
Since version 9.1 allows the curve to be re-evaluated for any arbitrary
expression, material needed 2 no longer needs to be a graphical function.
Instead, it contains the equation:

material_needed_2 = LOOKUP(material_needed, capacity_2)

This equation simply evaluates the graphical function stored in material needed using capacity 2 as the x-coordinat

, , , ,

LOOKUPXY Built-in Increases Dataset Flexibility

March 3rd, 2009

Karim Chichakly Modeling Tips

Version 9.1.2 adds the ability to incorporate non-regularly sampled data easily into your models.  Many people use the graphical function for historical records of data.  The graphical function, however, assumes a fixed interval along the x-axis.  This can make it difficult to use data like the following:

Day Flow
1 12.1
3 7.6
4 15.2
6 13.5
9 23.8
12 17.3

While it is easy to determine the fixed interval to use to capture all of these points (1 day), it is more difficult to determine what data points to use for the missing intermediate 1-day values.  There are also many cases where it is very difficult to find a fixed interval that works for a given dataset.

Graphical Function Day

Graphical Function Day (click for full size)

The LOOKUPXY built-in was specifically added to address this issue.  It is unique in that it requires two separate graphical functions:  one for the x-coordinates of each pair and one for the y-coordinates of each pair.  The number of points in each graphical function should match; if they do not, extraneous points are ignored.  The data values (x-coordinates and y-coordinates) are both entered by the user as the y-values in each graphical function.  The x-values in each graphical function are ignored; only the number of points matter.  It is a good idea, though, to run the x-axis of both from one to the number of points.  That way, it is easy to verify that the values in each graphical function properly align with one another.  In addition, the x-coordinates should be in increasing order.  If they are not, however, the program will automatically readjust them when the model is first run.

Read more…

, , , ,

Setting Number of Points in a Graphical Function

February 25th, 2009

Karim Chichakly Modeling Tips

One of the questions I am sometimes asked is, “If I need a specific x-value to appear in my graphical function, how do I determine the number of points required to include that exact point?”  This arises because in a graphical function, the -axis is divided into fixed intervals; the user is only allowed to specify x-min, x-max, and the number of data points.  [If you really need a graphical function with arbitrary (x, y) points, use the LOOKUPXY() built-in function available in version 9.1.2.]

For the following discussion, the range on the x-axis will be needed:

range = x_max – x_min

In all of the examples below, x_min = 3.000 and x_max = 7.000, so the range = 7 – 3 = 4.

For integer values, here is a simple formula that always works:

# of data points = range + 1                                                                                  (1)

For example (using the range above), if the number 6 (an integer) must appear as a point on the x-axis, 4 + 1 = 5 points will be needed.  This divides the ­x-axis into the points 3.0, 4.0, 5.0, 6.0, and 7.0.

Fractional values, however, are more difficult.  In general, if you can isolate the fractional part (and this evenly divides the range), the maximum number of points needed is given by this formula:


Read more…

, , ,

Tip: Setting up imports for 2D Graphical Functions

January 29th, 2009

Sarah Davie Modeling Tips

iThink and STELLA version 9.0 introduced a powerful new feature: data import and export with Excel.  Here at isee, we were excited to hear from our customers about how much they appreciated the feature and how easy it was to use.  In fact, many customers told us that it was the major reason they upgraded to version 9.0
simple import 1

Setting up a data import from Excel is pretty straight forward:  type the name of the model variable in one cell, type the value you want to import in the cell below it, (or beside it if you are using horizontal orientation):

If you are importing a time series or graphical function, you just keep listing the data points in the cells below the variable name:

simple import 2

This kind of data formatting works well since an Excel sheet is made up of columns and rows.  But how do you format data that is harder to visualize?  Things get a little tricky when you start dealing with arrayed variables.  The most complex import is a 2 dimensional array of graphical functions.  It’s actually 3 dimensions!

I’ve put together a simple example to illustrate how to do this.

Read more…

, , ,