Defining a New Coefficient to Analyse an Equation (AnalyseGE form)


If you are analysing an equation, you may wish to group the results of calculating several parts of this into one coefficient. You can do this by entering statements into the AnalyseGE form, as the example below shows. [Alternatively you may set up a new coefficient in order to investigate some aspect of the data.]

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 do this via the following sequence of statements entered into the memo on the AnalyseGE form [Alternatively, you can do much the same using the Toggles menu items on the popup menu on the TABmate form.]

xset X3Parts (lhs, expand, subst, rhs) ;

coefficient (all,part,X3Parts)(all,c,com)(all,s,src) TempCoeff(part,c,s) ;

formula (all,c,com)(all,s,src) TempCoeff("lhs",c,s) = x3(c,s) - a3(c,s) ;

formula (all,c,com)(all,s,src) TempCoeff("expand",c,s) = x3_s(c) ;

formula (all,c,com)(all,s,src)

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

formula (all,c,com)(all,s,src)

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

write ;

The "XSET" statement defines a new set to be used. The "COEFFICIENT" statement defines the new coefficient to be used to store the results of the different calculations. The "FORMULA" statements set the values for the various parts. The "WRITE" statement causes the values of the new coefficient TempCoeff to be written to the output Header Array file.

Note that coefficients defined via "COEFICIENT" statements are only available until the next "WRITE" statement (or until a formula not beginning with "FORMULA" is inserted). [This is why we have used the uninformative name "TempCoeff".]

"FORMULA" statements are only allowed after an "COEFFICIENT" statement. These must have the coefficient defined via the previous "COEFFICIENT" statement on the left-hand side, followed by an equals sign. [Contrast "FORMULA" statements with the formulas entered into the memo on the AnalyseGE form in which the left-hand side is not included.]

After a "COEFFICIENT" statement and one or more "FORMULA" statements, you should always add a "WRITE" statement to write the value of the new coefficient to the output Header Array file. This "WRITE" statement always writes the values of the most recent coefficient defined in an "COEFFICIENT" statement to the output file.



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

Link to full GEMPACK Manual

Link to GEMPACK homepage