Setting Up Toggles to Put Related Expressions into One Results Header


If you are analysing an equation, you may wish to group the results of calculating several parts of this into one coefficient.

Example

Consider the following equation from ORANIG.

Equation E_x3 # Source-specific commodity demands #

(all,c,COM)(all,s,SRC)

x3(c,s)-a3(c,s) = x3_s(c) - SIGMA3(c)*[ p3(c,s)+a3(c,s) - p3_s(c) ];

You may wish to compare the sizes of the expansion terms x3_s(c) with those of the substitution terms (the part involving SIGMA3).

You can put these two terms (the expansion and substitution terms) onto a single results Header using the Toggles menu items on the popup menu on the TABmate form, as described below. [Alternatively you can do this by entering expressions into the memo on the AnalyseGE form.]

Before you carry out this example following the instructions below, have a look at the colour of the variables, especially p3, in this equation on the TABmate form. If any variable is italic and coloured grey, this indicates that the variable has been substituted out. [In some versions of ORANIG, variable p3 is substituted out.] If you see that any of these variables is substituted out, you will need to rerun TABLO, this time backsolving for the relevant variables and then rerun the simulation since, otherwise, the values of these variables are not available.

To do this on the TABmate form using the Toggles menu items, proceed as follows.

Select the expansion term x3_s(c). Then right click and select menu item Start a Group of Toggles.

Next select (with your mouse) the substitution term
SIGMA3(c)*[ p3(c,s)+a3(c,s) - p3_s(c) ]

then right click and select menu item Specify the Next Toggle.

Finally right click again and select menu item End Group of Toggles.

AnalyseGE will calculate (and put into a single results Header) the values of these two terms. The Coefficient it creates for this purpose has three arguments, one ranging over the two terms (or toggles) and the other two ranging over the All quantifiers of the equation, namely c in COM and s in SRC.

Note the order here. First Start a Group of Toggles, then one or more Specify the Next Toggle (one for each extra toggle), and finally End Group of Toggles. In particular, note that "End Group of Toggles" does not let you set up another toggle.

Each time you specify a new toggle, you are asked for the toggle name. This is used in the coefficient and formulas evaluated. In the example above, it would be natural to give the toggle name expand for the expansion term and the name subs for the substitution term.

When you select End Group of Toggles, you are asked for information about the whole group of toggles. This consists of

the Toggle Set Name (in this example we might choose "SIGMA3Set"),

the Toggle Coefficient Name (in this example we might choose "ExpSubs3"),

the Toggle Argument Position (the position of the Toggle Set in the arguments of the Toggle Coefficient - in this example we might choose this to be 1),

the Toggle Index Name (used in the declaration of the Toggle Coefficient - in this example we might choose "i1").

The statements AnalyseGE uses to do this are something like the following (which you might like to compare with those we suggest using if you enter expressions into the memo on the AnalyseGE form to do this task). [Below we have used the Toggle Set Name, Coefficient Name, Argument Position and Index Name suggested above.]

xset SIGMA3Set (expand, subs) ;

coefficient (all,i1,SIGMA3Set)(all,c,com)(all,s,src) ExpSubs3(i1,c,s) ;

formula (all,c,com)(all,s,src) ! expansion term !

ExpSubs3("expand",c,s) = x3_s(c) ;

formula (all,c,com)(all,s,src) ! substitution term !

ExpSubs3("subs",c,s) = - SIGMA3(c)*[ p3(c,s)+a3(c,s) - p3_s(c) ] ;

write ;



URL of this topic: www.copsmodels.com/webhelp/analysege/hc_tabmatetoggles.htm

Link to full GEMPACK Manual

Link to GEMPACK homepage