STEM help / Calculation framework

10.3.34.7 Expression Transformation

Provides a general-purpose mechanism for modelling demand, based on up to twenty Inputs, and an arbitrary Expression which you can use to define the Output as a function of those inputs. As a straightforward example, you could use an Expression Transformation to sum the installation of several Resources in a model:

  • Create a Transformation, select Input and Transformation from the icon menu and change its type to Expression.
  • Use the Connection tool (or <Ctrl> drag-and-drop) to link Resources to the Transformation. You will be prompted to choose which Input they should define: assign them to Inputs 1 to 3 respectively.
  • Click in the formula bar for the Expression field and enter the formula: Input1 + Input 2 + Input 3.

Note: You can pick up the references to the various Inputs by clicking on the buttons for those Inputs while editing the Expression, and you can also include references to other scalar and time-series inputs – see 4.12.3 Internal references and reference mode.

The Output of the Transformation gives the sum of the Installed Capacity – the default Basis – of the three Resources.

In this example, the formula Input1 + Input 2 + Input 3 is perfectly self-explanatory; but more generally, when you have a formula where the inputs play different roles, it will be helpful to rename these Inputs, especially if you intend to copy the Transformation and re-use the Expression with different Inputs somewhere else in a model. See 9.1.1 Adding new input parameters.

As a more interesting example, consider two Services whose busy hours are not coincident. It is the overall network busy hour which will drive the demand for base station equipment. Taking the two Services as Inputs, on the Basis of Busy Hour Traffic, define an Expression which takes the maximum of the two busy hours, and adds on the corresponding contribution for the other Service. (At the business busy hour, the residential traffic is at 20% of its BH level, and at the residential busy hour, the business traffic is at 10% of its peak BH level.)

The required Expression is max (Input1 + 0.1 * Input2, Input2 + 0.2 * Input1), but the Inputs can be renamed as Bus and Res respectively, showing:

max (Res + 0.1 * Bus, Bus + 0.2 * Res).

Better still, you could use Transformation User Data to define and label the constants above, so that the formula would appear as:

max (Res + PropBusInResBH * Bus, Bus + PropResInBusBH * Res),

which – although less concise – makes its purpose much clearer.

A third example would be to model the demand for gateway equipment between two different technologies. The Output, z, is calculated from two Inputs:

where

x = first Transformation Input

y = second Transformation Input, both assumed to be non-negative.

Note that this gives a value of zero if either of x or y is zero, reflecting the fact that no gateway equipment is required in either case.

There may be occasions when you wish to use particular Expression Transformation Inputs for different purposes in different Transformations, as interpretation of the Inputs is closely bound to the sense of the Expression. In order to define separate labels for fields in individual elements, you must use the Element text box in the Rename Field dialog – see 9.1.4 Renaming fields for an individual element.

Cost allocation

For an Expression Transformation which only defines one Input, any costs arising from the used capacity of Resources used by that Transformation will be passed back directly to that Input. More generally, these costs must be allocated between the various Inputs. You can specify a set of proportions – one for each Input – which weight the allocation of costs, according to the Cost Allocation Basis input:

Fixed Proportions: costs are allocated according to the specified proportions, irrespective of the actual demand on the various Inputs.

Input Proportions: the proportions are scaled by the demand on the various Inputs, so that, for example, when the proportions are all 1, costs are allocated in direct proportion to the demand on each Input.

Note: You can allocate costs to a defined Input, even if it does not appear explicitly in the Expression. Therefore you should take care to only define the Inputs you actually require. By default, an un-referenced Input will receive a share of costs, even if you aren’t using it to calculate demand.

For example, imagine you want to allocate the cost of a CRM to services based on their revenues, although the capacity of the CRM is driven by the number of connections. In this case, the revenues of the services should be set as the inputs of an Expression transformation, and it should be ensured that only those inputs are receiving costs. An example of this is shown in the associated interactive model.

See also 10.3.4.1 Allocating costs through Transformations.

 

© Implied Logic Limited