A COMPARIS.0N OF MATHEMATICAL PROGRAMMING MODELING ...

12 downloads 19154 Views 2MB Size Report
GAMS checks to make sure the row and column names of these tables are members of the sets declared in the table name. This is known as domain checking.
Annals of Operations Research 38(1992)177-238

177

A COMPARIS.0N OF MATHEMATICAL PROGRAMMING MODELING SYSTEMS Harvey J. GREENBERG Mathematics Department, University of Colorado at Denver, P.O.Box 173364. Denver, CO 80217-3364, USA and Frederic H. MURPHY School of Business and Management, Speakman flall(006.00). Temple University,Philadelphia, PA 19122, USA

Abstract We compare three mathematical programming modeling languages, GAMS, OMNI and MathPro. T o understand the properties of these languages, we formulate four linear programs in each language. The formulations are representative of the kinds of model structures one encounters in practice. Each of the languages focuses on a different view of linear programs. GAMS approximates algebra, OMM uses the activity view and MathPro uses a block schematic. We summarize our experiences with the languages and suggest areas for further enhancement.

1.

Introduction

Prior to the development of linear programming modeling languages, LP model builders had to resort to writing matrix generators and report writers using general programming languages. Modeling languages for linear programming began to appear in the early 1960's, with the first being MAGEN [19]. New languages have appeared periodically and continue to be developed. In this paper, we examine in detail three modeling systems that represent three different approaches to model building. Our goal is to understand the important features of these systems that facilitate model building. Table I lists the modeling languages and their references. Some of the languages are experimental and are indicated by an *. These languages are undergoing development and are not commercially available. Others have been in use for years. Report writing became integrated with the first full system, MAGEN, in 1963. Shortly thereafter, GAMMA (1966) and DATAFORM (1987) were developed. By the early 1970's, these were the three primary systems (plus some others that appeared and disappeared). Although these systems have undergone internal @ J.C. Baluer AG, Scientific Publishing Company

H J . Greenberg, F.H. Murphy, Comparison of modeling systems Table 1 Modeling languages and systems for mathematical programming. AMPL CAMPS DATAMAT DATAFORM PAM GAMMA12000 CAMS GBMS* GIN* LMDO LINGO LPFORM' LPL LP-MODEL MAGIC MathPro MGG MIMI MODLER* OMNI, MAGENJPDS PLANETS PLATOFORM PM SML* UIMP ULP

Fourer, Gay and Kemighan [13] Lucas and Mitra [28] Orchard-Hays [34] Ketron Management Science [24] Welch [39] Sanders and Smith [36]; Bonner and Moore Management Science [3] Brooke, Kendrick and Meeraus [6] Jones [22,23,26] Sharda and Steiger [37] Schrage 1381 Cunningham and Schrage [9] Murphy and S tohr [32.33] Hiirlimann and Kohlas [21]; Hiirlimann (201 Ashford and Daniel [I] Day and Williams [lo] MathPro, Inc. [30] Simmons [40] Chesapeake Decision Sciences [7] Greenberg [16] Haverly Systems [8,18,19] Breitrnan and Lucas [5] Palmer et al. [35] Krishnan [25] Geoffrion [14.15] Ellison and Mitra [ l l ] Witzgall and McClain [42]

improvements (MAGEN evolved into OMNI and GAMMA into GAMMA/2000), the languages look about the same. Throughout most of the 1970's, model builders wrote matrix generator and report writer programs, using programming skills, and the programs were batch processed. At best, additions were made to the original designs, taking some advantage of interactive processing. In the late 1970's Alex Meeraus, in collaboration with Jan Bisschop, Anthony Brooke and David Kendrick, developed the first algebraic language, GAMS. Since the early 19807s,this has become a standard in academic communities and some corporations because it is accessible, powerful and relatively easy to learn.

H J . Greenberg, F.H. Murphy, Comparison of modeling system.

179

In 1983, Robert Fourer articulated a contrast between the modeler's view and the algorithm's view of a model, and he built a case for new design considerations to combine the strengths of general, high-level languages (like FORTRAN) with special-purpose languages. His own contribution, XML, is the basis for AMPL and MODLER. The recent activity leading to new modeling languages and systems stems from two basic reasons. First, early systems were written for specific computing environments and were not immediately adapted to the modern programming environments that emerged in the 1980's. Second, a new generation of modelers and managers became dissatisfied with the required programming skills, and most universities do not teach these languages, partly due to their computer dependence and partly due to their cost. One of the differences between the traditional and modem languages is that the newer languages are more declarative than imperative. The general idea is that a declarative language, which may be functional or logical, expresses what is being computed rather than how to compute it. Another characteristic is the extensive use of domains over sets. The available systems, that is, systems that are not experimental, fall into three broad categories. The first, for want of a better word, we label traditional. Here we include OMNl (and its predecessor MAGEN), DATAFORM and GAMMA. The second group uses approximations to algebraic notation: GAMS, AMPL, LINGO, LPL, MODLER and MPL. MathPro, MIMI and PAM are all block/schematic languages. We have chosen three languages, GAMS, OMNI and MathPro, to illustrate the properties of the languages in each category. GAMS uses an approximation to algebra and is popular because most modelers come from a mathematics background where algebra is a common denominator. The way in which equations are written is only an approximation to standard algebra because GAMS uses standard ASCII characters for portability. Unlike the other systems, the MPS file is hidden from the modeler's view. OMNI has many of the characteristics of a traditional programming language, but it also has many of the features of modem, nonprocedural programming languages. It is organized around producing the MPS file. That is, i t has sections to define rows, columns, right-hand sides and bounds as explicit steps. The important cognitive feature is that the statements that generate the model are organized around columns. This provides a process view of the model that many experienced modelers prefer. The data can be organized in many different ways, but the most common is to organize the tables around processes, while GAMS organizes the data around coefficients. One can consider the block schematic approach to model formulation as an extension of one of the early debugging aids in MPSs, the picture. A picture is a portion of the model defined over sets of rows and columns that is formated as a matrix with 1's and -1's printed explicitly and single letters used to denote ranges of values for the other nonzeros. This layout helps one see the patterns of nonzero blocks with the links among the blocks. That is, the block-schematic in

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

MathPro is the most visual of the three languages. Also, MathPro uses menus and screens as an integral part of building the model. We compare modeling systems along three dimensions: modeling philosophy, design concept, and implementation. The modeling philosophy is the underlying metaphor used to conceptualize the model, e.g. activity analysis, graphical or algebraic. Beyond certain basic principles of model management, communication and documentation, modeling philosophy is as much a matter of taste as a question of right and wrong. The design concept determines the potential for growth - that is, the ability to respond to changing modeling needs and computer-related technological change. In the end, the user has to deal with an implementation, and every system has quirks that one must work around. 2.

Examp!e models

We have chosen four different models to illustrate how each system captures the different kinds of structures that appear in LPs. The first is a production1 distribution model. The next two modcls use different time structures. We begin with an inventory-like structure for representing the capacity available in successive time periods. In the third problem, capacity is distinguished by the year added, so that there are no capacity balance restrictions. The fourth model is a small refinery model with multiple production stages and a complex pattern of flows for the intermediate products. We give an overview of each model in this section. We present the complete implementations of the first model in the main body of the text. For the others, we include important features in the main text, and the complete codes for GAMS and OMNI in the appendix. With MathPro, we present examples of all of the different screens but do not provide every screen for each example because of space considerations. We implemented the models in GAMS and MathPro. Since we did not have OMNI, William Golush at Haverly Systems debugged our code. The authors of the three systems have commented on an earlier draft of this paper. 2.1.

PRODUCTION DISTRIBUTION MODEL

We use this model because it is a standard model type. In this model, we have four plants distinguished by location (Northeast, Southeast, Northwest and Southwest), three products (nuts, bolts and screws), four processes (1 through 4), three inputs (raw material, labor and machine capacity) and four markets. The first three processes make nuts, bolts and screws, respectively, and the fourth makes half nuts and half bolts. The shipping cost of a product is detcrmined by starting with the per-pound cost of shipping from each plant to each market and multiplying by the weight per package. This feature tests the capabilities of the systems for matrix algebra. Not all plants produce each product, and not all markets demand each product. This tests one aspect of the logic capabilities of the systcms in handling exceptions. Ignoring

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

181

restrictions on what can be produced where, the constraint equations are as follows. We use a notation for variables and indices that brings us close to the GAMS notation.

x

PROC(I,J,P)*MAKE(P,J) I CAPACITY(I,J)

all I,J

SHIP (K,J,M) 2 DMND (K,M)

all K,M

P

J

where P = process,

I = inputs,

J = plants, K = products, M = markets, and the variable names are self-explanatory. 2.2.

AIRLINE STAFF PLANNTNG

This problem is the Feedem-Speedem Airline problem from Wagner [41, p. 661. Each month, trainees can be trained to become experienced flight attendants in the following month. Each trainee uses experienced-attendant time, reducing the availability of experienced attendants to meet demand. This leads to the following constraint for meeting demand: HOURSE*E (T)

-

HOURST*TR (T) 2 DEM (T)

where HOURSE = number of hours an experienccd attendant is available per month, HOURST = number of experienced attendant hours required per trainee in a month, E (T)

=number of experienced attendants in month T, = number of trainees in month T,

TR ( T ) DEM (T) = demand for experienced attendant hours.

A fixed percentage of the experienced attendants leave at the end of every month. We use the coefficient REMAIN to denote the fraction of experienced attendants that carry over to the next month. This leads to rhe following intcrlcmporal balance:

182

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

REMAIN*E(T - 1)

+

TR(T

-

1) - E(T)

=

E

=

0

for T22.

This is an inventory-like structure for canying capacity from one period to the next. Each of the modeling systems has a different approach to handling this structure. 2.3. MILITARY MANPOWER PLANNING

We use the Sparta problem from Wagner [41, p. 661. Here, soldiers can be enlisted for 1, 2, 3, or 4 years, and the decision is how many soldiers to enlist for each enlistment period in each year. This leads to a constraint matrix with a collection of triangles filled with 1's: Enlistments: year year year year year

1st year

1 2 3 4 5

1 1 1 1 1 1 1 1 1 1

2nd year

3rd year

4th year

1 1 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1

T o construct the constraints, we use the above coefficient pattern and require that the total troop strength be greater than or equal to demand. This structure requires more complex logic than the previous model. Beyond the previous example, it also illustrates the different approach to representing time structures in Mathpro. 2.4.

REFINERY MODEL

We adapt this model from one in the Bonner and Moore training manual for their RPMS system [4]. The refinery uses two crudes, has a distillation unit, a reformer and a catalytic cracking unit. Intermediate product streams consist of two naphthas, gasoil and residual oil, which can be blended into two grades of gasoline and one grade of fuel oil. It is a single period model with no inventories. We do not present the complete model here for space reasons. The flows of materials are given in fig. 1. r

1

butane, alkylate naphtha Crude c a t gas g a s oil

>

Cracker cycle oil

Fig. 1. Flows in the refinery model.

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

183

The reason for choosing this model is to see how the systems handle intermediate product streams that can flow in many directions, but not all streams go everywhere.

3.

GAMS

GAMS is the first of the algebraic systems and has been in use for over a decade. Consequently, it is a mature system with few surprises to trip up the model builder. One uses GAMS by preparing an ASCII file with any editor and submitting a batch job. Because GAMS works with ASCII files and is written in PASCAL, the software works on many different machines. A GAMS formulation has the following structure (see Brooke et al. [61): SETS Declarations Assignments of members data(PARAMETERS, TABLES, SCALARS) Declarations Assignments of values VARIABLES Declarations Assignments of type (Optional) Assignments of bounds and/or initial values EQUATIONS Declarations Definitions MODEL and SOLVE statements DISPLAY statements Sets are declared by giving them a name. Members are assigned by enumerating them. If there is a sequence of numbers in the member names, one enters the first and last separated by an " * ". For example, T5 *TI2 yields members T5,T6, . . . ,T12. GAMS uses the set name as an index (unlike some of the other algebraic languages). In practice, one should use short set names, because these names are used repeatedly, and long member names for documentation and readability. The rows and columns of tables range over the elements of sets that have been previously defined. GAMS checks to make sure the row and column names of these tables are members of the sets declared in the table name. This is known as domain checking. Consequently, one has to be explicit about subsets, and one cannot use a second, dummy index on a set defined with a different index as its name without declaring the second index to be an alias of the first. That is, if one is writing the expression

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

one has to have the statement ALIAS(T,TT) prior to the above expression so that T and can index over the same set. Note that to formulate a model with the above restriction on the sum, the system has to be able to recognize an order to the indices, which GAMS does. Data are entered as either scalars, parameters, or tables. There are sufficient algebraic operations to allow the model builder to construct new tables and parameters. Variables are listed with the sets over which they range. After this is done, they are typed. All variables are presumed to range over all the reals unless stated otherwise. The types are FREE, POSITIVE, BINARY and INTEGER. Bounds are specified as LO, UP or FX (fixed variable). Once the variables have been defined, one lists all of the equations by giving them a name, including the sets over which they range. One then specifies the equations using an algebra-like form. Since the character set is restricted to the ASCII characters, the full range of symbols used in standard algebra is not available and mnemonics are used instead. For example, 1 is replaccd by the keyword SUM. An important feature of the specification language is the use of logic to control which equations and variables are specified. For example, the partial sum

is written as SUM (T$(ORD(T) LT ORD (TT)) ,X (T)) where $ indicates a conditional, T is the index of summation, ORD(.) specifies the order, or position, of he index T, LT specifies the less than relation and X(T) is the variable summed. One can also apply the same logic to the definition of a domain and then use the domain in an equation as follows. Let ttl (T,TT)

=

yes$ (ORD(T) LT ORD (TT)) ,X (T))

be the domain. Then the summation becomes SUM (ttl(T,TT),X (T)) The MODEL statement allows the user to specify which of the equations defined previously are to be included in the model to be solved. This adds some capability to define a model and variant scenarios in the same file. The SOLVE statement allows the user to select the optimizer and the DISPLAY statement provides some basic table formats for the output.

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

3.1.

185

THE PRODUm MIX MODEL

The following is the product mix model specified using GAMS. This model illustrates the generic structure of a GAMS input file. It also illustrates some simple uses of the $ operator. The input file, written with any editor, is as follows. Comments on the different aspects are indicated by * in column 1 , and are interspersed within the GAMS statement. *This first line outputs a title $TITLE PRODUCTION DISTRIBUTION *The next command retains the distinction between upper and *lower case. The developers recommend using upper case for *the model and lower for comments *$OFFUPPER SETS */Is delimit the elements of a set I inputs /FW, LB,MA/ *Note the use of * to enumerate the processes P processes /Pl*P4/ *could not use NE as a region - NE a reserved word for *not equal. This will not be a problem in future versions *of GAMS J plant locations /NS, NW, SE, SW/ K products /NUTS, BOLTS, SCREWS/ M markets /MI, M2, M3, M4/; *There is a ubiquitous use of ;'s *Parameters are vectors or calculated tables PARAMETERS WEIGHT(K) weight per package of product *Set elements are l'isted with their values in the vector /NUTS 5 BOLTS 9 SCREWS 8/; TABLE

PROC(1,J,P) process inputs by plant and process

*A . separates elements of different sets when filling out *a table with more than 2 dimensions

H J . Greenberg, F.H. Murphy, Comparison of modeling systems

186

*

the + indicates a continuation of a table

TABLE OUTPUT(K,J,P) specifies the output by production process and plant NS.Pl NUTS 1 BOLTS SCREWS

NS.P2

SE.Pl NUTS 1 BOLTS SCREWS

SE.P2

TABLE

1

1

NS.P3 NS.P4 1.5 1.5 1

NW.Pl 1

SE.P3 SE.P4 SW.P2 1.5 1.5 1 1

NW.P2 NW.P3 1 1 SW.P3

PRODCST (P,J) process cost

TABLE DMND(K,M) final product demands M1 NUTS 30 BOLTS 30 SCREWS 18

M2 15 15 24

M3 19 19

M4

40

;

TABLE

CAPACITY (I,J) supply of raw materials and resource cap

TABLE

TRANSPORT(J,M) transportation cost in $ per lb

H J . Greenberg, F.H. Murphy, Comparison of modeling systems

PARAMETER TC (K, J, M )

transport

cost per

package

187

;

*A t r a n s p o r t a t i o n c o s t i s generated only when t h e product * i s produced. By summing over c o e f f i c i e n t s i n t a b l e OUTPUT * f o r a l l p r o d u c t i o n p r o c e s s e s ( P ) f o r a given product, K, *we can t e s t t o s e e i f any i s produced.

*This s e c t i o n a b o r t s matrix generation i f t h e r e a r e e r r o r s *with t h e d a t a e n t r y . S s t i t l e data validation s e t e r r O l ( j , p ) p r o c e s s c o s t nonzero but no o u t p u t p o s s i b l e e r r 0 2 ( j , p ) p r o c e s s zero but output p o s s i b l e e r r 0 3 ( j , p ) p r o c e s s output but no i n p u t s r e q u i r e d ; err01 ( j , p ) = yes$ (SUM(K, OUTPUT (J,K I P ) ) and PRODCST (J,P) eq 0) ) ; err02 ( j , p ) = yes$ ( (SUM(K, OUTPUT ( J , K , P ) ) eq 0 ) and PRODCST (J,P ) ) ; err03(j,p) = yes$(SUM(K, OUTPUT(J,K,P) and (SUM(I,PROC(J,ItP))eq 0 ) ) ; display$card ( e r r 0 l ) 'process data error ' , err01, OUTPUT, PRODCST; display$card(err02) 'process data e r r o r ' , err02, OUTPUT, PRODCST; displayScard(err03) 'process data error', err03, OUTPUT, PROC;

abort$ (card( e r r 0 l ) or card (err02) or card (err3))

'data errors - abort '

VARIABLES *A v a r i a b l e such a s Z i s always defined and s e t equal t o t h e

*objective funtion

z MAKE ( P , J) SHIP ( K , J , M )

;

POSITIVE VARIABLES

MAKE,

SHIP;

EQUATIONS COST

objective

function

I N L I M ( I ,J ) input l i m i t s PRODBAL(K, J ) m a t e r i a l balance f o r p r o d u c t s a t each p l a n t DEMAND ( K I M ) demands f o r each product i n each l o c a t i o n ;

*Note t h a t =E= i s a r e l a t i o n , not an o p e r a t o r . The $ *operator r e s t i c t s t h e generation of t r a n s p o r t a t i o n a c t i v i t i e s * t o one with nonzero t r a n s p o r t a t i o n c o s t s . Blank and 0 a r e " t r e a t e d t h e same so f a r a s t h e l o g i c i s concerned

188

HJ. Greenberg, FH. Murphy, Comparison of modeling systems

COST.. Z =E= SUM((J,P),PRODCST(P,J)*MAKE(P,J)) + SUM((K,J,M),TC(K,J,M)*SHIP(K,J,M))

;

PRODBAL (K,J) . . SUM (P,OUTPUT (K,J,P)*MAKE (P,J) ) - SUM (M$TC(KtJ,M) , SHIP (K,J,M) ) =E= 0; *We i n c l u d e a l l e q u a t i o n s

MODEL PRODPA /ALL/

i n model PRODPA

;

SOLVE PRODPA USING LP MINIMIZING Z

*

;

.L g i v e s t h e l e v e l of a v a r i a b l e o r row a n d

*the marginal

.M g i v e s

o r dual

DISPLAY MAKE.L, MAKE.M, SHIP.L, SH1P.M

;

When one uses an algebraic system, as opposed to a column- or blockoriented system, restrictions on variables have to be repeated in each row. Otherwise, one could unintentionally generate a transportation activity in a demand row with no corresponding restriction on supply. Because of the PRODBAL constraints, any extraneous SHIP activities would be 0 in the final solution and the logic restrictions just clean up the matrix in this example. GAMS has a collection of reserved words so that NE could not be used for the Northeast plant location. This problem is being taken care of by a new version of GAMS that is context sensitive. Another feature is the ubiquitous semicolon, which the modeler invariably leaves off some equation. Leaving off a semicolon can lead to some arcane diagnostic messages because the system interprets the contents between semicolons as one expression. An alternative to incorporating the control logic into the equation definitions is to restrict the domains of the sets used. For example, we could define a set jp(J,P) of process possibilities for possible outputs as follows: jp(J,P)

=

sum(K$OUTPUT(J,K,P), y e s ) ;

Doing this cleans up the equations and makes them more readable. 3.2.

AIRLINE STAFF PLANNING

This problem illustrates one of the ways logic is used to express time structures. We fix the number of experienced attendants to 60 in the first period. The model uses the following set and variables:

HJ. Greenberg. F.H. Murphy, Comparison of modeling systems

SET T t i m e /JA,FE,MR,AP,MY,JU/

;

VARIABLES E (T) e x p e r i e n c e d a t t e n d a n t s TR (T) t r a i n e e s

One denotes a single element in a set, in this case the month of January, by enclosing the name in quotes:

The following equation BAL(T) has an inventory-like structure for carrying capacity from one period to the next. Using the $ operator on the BAL row restricts the generation to rows where T is greater than JA. The ORD(.) function measures the positions of the current value for T. ORD(T) = 1 is JA. If this restriction were not in place, then a row E(JA) = 0 would be generated since GAMS does not generate terms with out-of-range index values. The resultant model would then be infeasible because E(JA) is fixed at 60. T - 1 indicates the index value immediately prior to the value of T. That is, if T = FE, then T - 1 = JA.. BAL (T) $ ( O W(T) GT 1) . .REMAIN*E(T-1) + TR (T-1) - E (T) =E= 0 ;

The important feature of this model is the way one deals with beginning and ending conditions for models with multiple time periods. In this model, the indexing is defined in such a way that the balance constraint is calculated at the beginning of each period and the balance is correctly defined for the last period without the use of any logic. If we have to make sure that the balance constraint is not defined for the last period, which happens when we index using T + 1, we specify the condition $(ORD(T) LT CARD(T)), where CARD(T) is the cardinality of set T. One can eliminate the control logic at the cost of having the balance defined in the prior period using another approach, as follows:

Since GAMS does not generate out-of-range elements, the row is not generated for T = 1. 3.3.

MILITARY MANPOWER PLANNING

This problem has a more complex logic because we have to determine the years in which recruits are available to meet demand. We use the following sets: T t i m e period /1*10/ L l e n g t h of e n l i s t m e n t /I*¶/

;

H J . Greenberg, F.H. Murphy, Comparison of modeling systems

190

We need the following alias to perform partial sums as we described above and a variable for the number of recruits: ALIAS

(T, TP)

;

VARIABLES X(T,L)

recruits

by

year and

length o f

enlistment

In the following equation, the first $ operator restricts us to using troops recruited during o r prior to period T. The second makes sure the troops are still available, that is, time of enlistment plus length of enlistment is greater than the year: YEAR(T) . . SUM ( (TP, L ) $ (ORE ( T P ) LE ORD ( T ) AND ORD ( T P ) + ORD ( L ) ) GT ORD (T))

,

X (TP, L) ) ) ) =G= REQ ( T ) ;

One could also define a restricted domain and simplify the equation as follows: s e t ttl ( T , T P , L ) ttl ( T , T P , L ) = y e s $ ( o r d ( T P ) le o r d ( T ) a n d o r d ( T P ) + o r d ( L ) gt o r d ( T ) )

...

YEAR ( T )

..

;

SUM (ttl( T , TP, L) , X ( T P , L ) ) =G= REQ ( T ) ;

The whole model can be described in one equation, although the logic is not immediately transparent. This is an example where the row orientation can make a model difficult to read. A column-oriented view is more comprehensible in this case because there tends to be less happening in each column than in each row. 3.4.

REFINERY MODEL

The reason for including this model is to test the ability of the system to deal with subsets. The refinery model contains activities representing a distillation unit, a reformer, a catalytic cracker, and the blending of intermediate products into three products: two grades of gasoline and fuel oil. The distillation unit produces four intermediate product streams, and we distinguish these product streams by the source of crude. Naphthas can go from the distillation column to a reformer or be blended into gasoline directly. Gasoil from distillation can be processed in a catalytic cracker or blended into fuel oil. The reformer can be operated in two modes, defined by severity. The different severities produce different product mixes and product outputs. The products are light and heavy reformate. They also use capacity at different rates. The catalytic converter produces cycle oil as a byproduct, which is then recycled through the converter. The products produced are light and heavy cat gas.

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

191

Since processing cycle oil returns some cycle oil, the model has the feature of a row and column defining the same material with a coefficient not equal to 1. Each gasoline blending component has two constraints on octane, controlling motor and research octane qualities. There is a viscosity constraint affecting the blending of fuel oil. We use the following set information: CR C r u d e s /MC m e d i u m crude HC h e a v y c r u d e / INTPRO i n t e r m e d i a t e p r o d u c t s /LN l i g h t n a p h t h a HN h e a v y naphtha GO gasoil RS r e s i d u a l o i l /

Using (INTPRO)in the following set definition indicates that naphthas in N are a subset of INTPRO: N(INTPR0) n a p h t h a s

/LN l i g h t n a p h t h a HN h e a v y n a p h t h a /

OCT octane

/MON m o t o r o c t a n e RON research o c t a n e /

Note that even if there is only one element, the set must be defined rather than use the element as a character string. This is because GAMS does not build up names for an MPS file, as do the traditional languages. G ( I N T P R O ) g a s o i l s /GO g a s o i l /

The following table illustrates a layout with four sites: TABLE OCTANN(GA,OCT,CR,N) REG. MON REG. RON PREM.MON PREM.RON

MC .LN 89 90 89 90

n a p h t h a o c t a n e ratings

MC. HN 82 82

MC .LN

83 83 83 83

The following table matches catalytic cracker operate activities with gasoil input. This is an example of the use of a control table that directs the logic of formulation:

192

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

TABLE GOBAL (G,CR)

The following variables are used in the equations we present here: DIST (CR) OREF/N,CR,S) OCAT (CR) BLNA (N,CR,GA) BLALKY (GA) BLFO(INTPR0,CR)

distill crude oil operate refomer operate cat cracker blend naphtha blend alkylate into prem gas blend intermediate products into fuel oil

;

The input to the equation below is naphtha from the distillation, distinguished by crude. The outputs are naphtha flows into the reformer (OREF), which has an index S for severity, and naphthas into blending (BLNA) of gasoline and fuel oil (BLFO). In the naphtha balance, the $ operators restrict the outflows of naphthas to products that use these naphthas. We control gasoline inputs by using the MON (motor octane) row in the octane table. We could not have used the set OCT in place of MON because there would have been an uncontrolled index, i.e. one that neither appears in the equation definition nor is summed. MNAP (CR,N)

..

DISTOUT (N,CR)*DIST (CR) - SUM(S,OREF(N,CR,S) ) - SUM (GAS(OCTANN(GA,'MON',CR,N) , BLNA (N,CR,GA) ) - BLFO (N,CR)$VISCOS (CR,N) =E= 0

Since the catalytic cracker uses only gasoil, the operate activity need only be indexed by CR, but the table GOBAL is necessary to make sure there is a match on the domains describing the rows. This is an example of the use of a logic table.

MG (CR,G) . . DISTOUT (G,CR)*DIST (CR) - GOBAL(G,CR)*OCAT (CR) - BLFO (G,CR)$VISCOS (CR,G) =E= 0

;

One of the remarkable features of this model is that it took about nine hours to write and debug even with a version already existing as a Lotus file. A large amount of time was spent dividing the data up into small tables defined over the same domain. This is a consequence of viewing a table as filling out a coefficient rather than representing a process. GAMS's feature of checking to make sure that all domains match reduces formulation mistakes and probably improves the targeting of errors, but at a price: domains cannot be mixed together to simplify table construction.

H J . Greenberg, F A . Murphy, Comparison of modeling systems

193

This is especially clear in that the operating characteristics of the catalytic cracker had to be split over four tables. (LPL does not require this and has a more flexible data specification.) The original attempt at formulating the model was with a single set of balance constraints defined for distillation outputs over the set INTPRO. However, GAMS does not allow the model builder to use a table defined on a subset to be in a row defined over the larger set. Fortunately, dividing this constraint made for a more readable model in the end; however, this restriction stems from treating indices and sets as the same object. Some of the specification of thc cracking unit could have becn simplified by using unions and set differences. However, whcn we tried defining new sets through the union operation, GAMS would not acccpr thcse sets as domains for tables. One can define large sets initially, construct subsets from these larger sets, and then take unions of these sets. This can, however, undercut the benefits of domain checking. GAMS does allow the model builder to use a subset of a row domain when using a table in an algebraic expression in that row. Subsets can also be used in referring to elements in a table defined over the larger set. Subsequent to building the modcl, we lcamcd how to eliminate domain chccking. One can either use an * to indicate a dimension that is not checked or not declare any dimensions at all, as follows: parameter a(i,*,l) /second index not checked*/ variable zz /*completely unchecked*/. Again, domain checking slowed down the building phase, but it facilitates debugging. So eliminating domain checking could be problematical when measured by the total amount of time to build and debug a modcl. Before concluding this section, we should emphasize the flexibility of GAMS to adapt to different modeling styles. We showed how to use control logic in both equations and domain definitions. One can also usc control tables to rcstrict generation. In the production/distribution model, wc used the cost tablcs as control tables as well as data tables. That is, we used a 0 as an indica~ionof no flow. A better practice would be to have separate control tablcs sincc onc could have a valid transportation arc with no cost. 4.

OMNI

The progenitor of OMNI, MAGEN, was the first language that integrated rcporl writing capability with matrix generation. The OMNI syntax is the same as MAGEN and has the look and feel of a programming language, unlike the newer approaches. That OMNI remains popular with modcl builders is a comment on the quality of the original design of the systcm.

194

H.J. Greenberg, F.H. Murphy, Comparison of modeling systems

Unlike GAMS, one builds an MPS file explicitly by building the row and column names as character strings. The new languages do not attempt to construct mnemonics for the row and column names, thereby burying or, in the case of MathPro, annotating the MPS input file. In OMNI one builds a character string that is used to determine a row or column in either a referenced table or the matrix. One can even build character strings to determine the table one references, which is a very useful capability. OMNI programs are written as an ASCII file and run in a batch mode. A program has the following structure: Definc classcs (sets in other systems) Define TABLES Do any algebraic operations on tables Form the rows in the rows section of the MPS file Form the vectors in the columns section of the MPS file Form the right-hand side Form ranges for ranging on the right-hand side Form bounds Each of the steps involving a "form" builds a segment of thc MPS file. An important feature of the string manipulation implementation is that the length of the names allowed for elements is at most the length of the class name. One defines short class names because one is allowed only eight characters for a row or column name in an MPS file. If one uses element names shorter than the class name, the rest of the field is filled out with blanks. This aspect allows the system to use position to extract desired symbol strings. OMNI needs a mechanism to differentiate classes from character strings when forming names. One indicates a class versus a character string by enclosing the class name in parentheses. When there are two classes as in (PL)(PR), all combinations of the set names are concatenated togcther, producing a list of names. 4.1.

PRODUCTION-DISTRIBUTION MODEL

OMNI, NUDD, NULCU *PRODUCTION DISTRIBUTION MODEL MODE, COMPILE COMPILE, NOLIT

* *

DICTIONARY CLASS IN inputs RM raw material LB labor MA material

HJ. Greenberg. F.H. Murphy, Comparison of modeling systems

* *

* *

*

195

CLASS' PR p r o c e s s e s P I , P 2 , P 3 , P4 CLASS PL p l a n t l o c a t i o n s NE, NW, SE, SW CLASS PD p r o d u c t s NU n u t s BO b o l t s SC screws CLASS MK m a r k e t s M I , M2, M 3 , M4 DATA

*Comments c a n s u r r o u n d t h e r o w s a n d c o l u m n s o f a t a b l e

*

*

TABLE WEIGHT w e i g h t p e r p a c k a g e o f p r o d u c t package P KG NU 5 nuts b o l t s BO 9 screws SC 8

*Note t h a t d i f f e r e n t s e t s a r e u s e d t o c o n s t r u c t t h e * d i f f e r e n t rows i n t h e n e x t t a b l e . T h i s i s p o s s i b l e b e c a u s e * t h e r e i s n o d o m a i n c h e c k i n g on s e t s . B e c a u s e o f n o domain * c h e c k i n g , t h e s e t names d o n o t a p p e a r i n t h e t a b l e names. *The c o l u m n names a r e c o n c a t e n a t i o n s o f t h e e l e m e n t s o f * c l a s s e s PL a n d P R .

*

*

*

TABLE PROC p r o c e s s i n p u t s b y p l a n t a n d p r o c e s s NEPl COST 2 RM 1 LB 3 MA 3 NU 1 BO SC

NEP2

NEP3

3

3

2 2 2

2.1 2 2.1

1 1

H.J. Greenberg, F.H. Murphy, Comparison of modeling systems

196

*The +R i n d i c a t e s a c o n t i n u a t i o n o f a t a b l e

*

+R

SEPl 1.9 1.1 2.8 2.7 1

COST RM LB MA NU

* *

*

SEP2 3.3 2.2 2 2.1

BO SC

SEP3 2.8 1.9 1.8 1.7

1

SEP4 4 3 3.5 2 1.5 1.5

SWP2 3.2 2 1.7 2

SWP3 2.9 2 2

2

1

1

TABLE

DMND f i n a l p r o d u c t demands

M1

M2

30 30 18

15

NU BO SC

TABLE

TABLE

1

15 25

M3 19 19

M4

49

CAPACITY s u p p l y o f r a w m a t e r i a l s and r e s o u r c e c a p

TRANSPOR t r a n s p o r t a t i o n c o s t i n $ p e r l b

*END OF DATA

*

*OMNI u s e s t h e c o n c e p t o f a l o g i c a l l y c o m p l e t e u n i t t o * b l o c k o u t a s e g m e n t o f c o d e . One c a n l e a v e o u t a n LCU * d u r i n g m o d e l g e n e r a t i o n t o v a r y t h e r e s u l t i n g m o d e l . The *LCU's a r e d e l i m i t e d b y t h e FORM SECTION a n d FORM SECTION,END *statements.

*

*

FORM

SECTION

*We f o r m a new t a b l e t o t e s t i f a p r o d u c t i s p r o d u c e d i n A *a p l a n t b y summing o v e r t h e d i f f e r e n t p r o c e s s e s .

H J . Greenberg, F.H. Murphy. Comparison of modeling systems

197

* c u r i o s i t y o f OMNI i s t h a t t h e r e f e r e n c e t o s e t s as i n d i c e s * i s t h e r e v e r s e o f n o r m a l a l g e b r a , i . e . i f I i s o u r row * a n d J o u r column, o n e w r i t e s TABLE XXX ( (J), (I))

.

* *

FORM TABLE TEST ( (PD) , (PL) ) = SUM (PR) (TABLE PROC ( (PL) (PR) , (PD) ) )

*We g e n e r a t e t r a n s p o r t a t i o n c o s t s o n l y when t h e r e i s s u p p l y * a n d demand f o r a l i n k i n s e p a r a t e t a b l e s f o r e a c h p r o d u c t

*

FORM TABLE TC (PD) ( (PL)

,(MK) )

*

*

=

transport

cost

per

package

WEIGHT (PKG, ( P D ) ) *TRANSPOR ( (MK) WHEN TEST ( (PD) , (PL) ) WHEN DMND ( (MK) , (PD)

, (PL) )

FORM SECTION,END

*The a b b r e v i a t i o n FS

for

FORM SECTION

i s FS

*

* T h i s command c o p i e s t h e n e x t t w o l i n e s i n t o t h e MPS f i l e COPY NAME PRODPA ROWS FS, END

*

*A row i s g e n e r a t e d f o r a l l combinations o f c l a s s e s i n e a c h l i n e

*OBJ i s a n o b j e c t i v e row ( t h e r e c a n be m o r e t h a n 1 i n a n *MPS f i l e ) . MAX i s a l e s s - t h a n - o r - e q u a l row a n d M I N i s a *greater-than-or-equal row. FIX i s a n e q u a l i t y c o n s t r a i n t .

*

FS FORM ROW COST = O B J INL ( P L ) ( I N ) = MAX MPRD (PL) (PD) = FIX DEM(MK) (PD) = M I N FS, END

*We c o p y COPY COLUMNS

*

the

word

'lcolumnsl'

into

the

MPS

file.

H J . Greenberg, F.H. Murphy, Comparison of modeling systems

198

*The v e c t o r names are MAKENUNE, MAKENUNW, e t c . One g e n e r a t e s * t h e c o e f f i c i e n t s f o r e a c h row w i t h a n o n z e r o . The row * m a t c h i n g r u l e s i n c l u d e t h e f o l l o w i n g : 1. t h e a c t i v i t y o r * c o e f f i c i e n t t a b l e terms i n t h e e x p r e s s i o n must c o n t a i n t h e *row s e t names, 2 . t h e sets u s e d i n t h e t a b l e r e f e r e n c e *must be o n t h e row o r column a n d 3 . a n y s e t o n t h e column * b u t n o t o n t h e row i n d e x e s m u l t i p l e a c t i v i t i e s i n t e r s e c t i n g * t h e row.

*

*

FS FORM VECTOR MAKE ( P R ) ( P L ) WHEN TABLE PROC ( ( P L ) ( P R ) ,COST) COST = TABLE PROC ( ( P L ) ( P R ) ,COST) I N L ( P L ) ( I N ) = TABLE PROC ( ( P L ) ( P R ) , ( I N ) ) MPRD ( P L ) ( P D ) = TABLE PROC ( ( P L ) ( P R ) , ( P D ) ) FORM VECTOR S ( P D ) ( P L ) (MK) WHEN TABLE COST = TABLE TC ( P D ) ( ( P L ) , (MK) ) M P R D ( P L ) ( P D ) = -1 DEM (MK) ( P D ) = 1 F S ,END

TC ( P D ) ( ( P L ) , (MK) )

*We h a v e k e p t t h e g e n e r a t i o n o f t h e body o f t h e m a t r i x as one LCU COPY

*We f o r m t h e

right-hand

side p o r t i o n

of

t h e MPS

file

RH S FS FORM VECTOR RHS I N L ( P L ) ( I N ) = TABLE CAPACITY ( ( P L ) , ( I N ) ) *The RHS n e e d n o t be s p e c i f i e d i f i t i s 0 .

*

MPRD ( P L ) ( I N ) = 0 DEM (MK) ( P D ) = DMND ( (MK) , ( P D ) ) COPY ENDATA F S , END EXECUTE, ALL

This model illustrates the important features of OMNI. It requires you to build explicitly the MPS file. Thus, the system has a well-developed ability to manipulate character strings. There also are the usual algebraic operations on matrices. The logic for dealing with exceptions is transparent and complete. One must be careful to keep set names short, so the eight character limit on row and column names is not violated when the symbols are concatenated together.

H J . Greenberg, F.H. Murphy, Comparison of modeling system

199

This can be a problem when trying to construct meaningful abbreviations in very complex models. Because of the lack of domain checking, one can construct tables that are informationally more complete in that they represent whole processes rather than just coefficients. The price one pays by not having domain checking is that it is far easier to generate identical symbol strings for different columns or rows without the system being able lo recognize the error. This is because the logic for matching is not controlled by the class names but by the class elements. 4.2.

AIRLINE STAFF PLANNING

In this model, wc explore OMNI's logic capabililics furthcr. We use the following class for months. The class namc has the same numbcr of characters as the elements. CLASS TM TIME JA,FE,MA,AP,MY,JU The rows arc BAL(TM) REQ (TM)

=

=

FIX MIN

for the balance and requirements constraints. We specify the vector for experienced attendants and we measure the balance at the end of the period. One cannot explicitly model T + 1 as in GAMS. One defines a temporary set, in this case UU, to index over the same set but different elements within the set. The $ gives the position of the elements in the set and # gives the cardinality of the sct. The / illustrates the linked class feature, where class TM is controlled by class UU. The value from TM is the one in the same position as the controlling value in UU. One can think of UU as a pointer in this situation. So that we do not generate a coefficient for the vector beyond the planning horizon, we do no1 include in our dctcrmination of UU the last element of TM when setting UU = TM + 1. FS

FORM VECTOR E (TM) COST = N,CSTE REQ (TM) = N,HOURSE BAL(TM) = -1 EXCEPT (STM.EQ.1) BAL(TM/UU) = N,REMAIN FOR $UU = $TM + 1 EXCEPT ($TM . EQ. #TM) FS ,END To define bounds, we do the following:

H J . Greenberg, F.H. Murphy, Comparison of modeling systems

FS COPY BOUNDS F S ,END FS FORM BOUNDS BOUNDROW "EJA i s t h e c h a r a c t e r s t r i n g for E x p e r i e n c e d a t t e n d a n t s i n "January. E J A , F X = N,BEGIN F S , END FS

As in GAMS, OMNI orders classes to facilitate multipcriod formulations. This problem illustrates one method of defining temporary classes. Another is the following: FORM VECTOR (PRODUCTS) FOR PRODUCTS

=

TABLE P R I C E S ( 2 , )

Here, PRODUCTS is a temporary class whose elements arc the column headings from TABLE PRICES, starting with the second character (duplicates are discarded). The ability to define sets based on table column or row names is a consequence of not checking domains. Taking column names from a table simplifies the logic of generating a model, again at the increased cost of potentially generating the same names for what should be different columns and rows. 4.3.

MILITARY MANPOWER PLANNING

We define the following classes:

*

CLASS TT TIME PERIOD 0 1 , 0 2 , 0 3 , 0 4 , 05,06,07, 08, 09, 1 0 CLASS L LENGTH OF ENLISTMENT

1, 2, 3 , 4

FORM SECTION can be used to control the order of column generation. Indices on the right of a list change most rapidly and those on the left least rapidly. Each FORM statement is completed for all index combinations before moving onto the next FORM slatement. One uses the FORM SECTION slatement to execute a collection of FORM statements for a specific value before moving on to the next.

When there are multiple conditionals, all must be satisfied. The set U U is defined to have the same elements as TT, that is, UU is defined as the 10 elements, 01

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

201

through 10, independent of TT.We place a 1 in the vector when the year of interest is greater than or equal to the year of enlistment and less than the year of enlistment plus length of service.

FORM VECTOR (TT) (L) COST = TABLE C ( (TT), (L)) YEAR(UU)

=

1 FOR #UU = #TT WHEN (SUU.GE .$TT) WHEN (SUU.LT.STT + SL)

FS,END The most interesting feature of this problcm is how the logic of formulation is more transparent with the column orientation than the row orientation. The reason is that we readily understand what happens to an enlistee; that is, each activity has a 1 in the rows when the enlistee is available. 4.4.

REFINERY MODEL

In this model, we see how OMNI deals with subsets. We first show how one can use a subclass in defining a class.

CLASS NP NAPHTHAS A SUBSET OF IP LN, HN L

CLASS IP INTERMEDIATE PRODUCTS (NP), GO, RS That is, the elements of NP are added to IP. In the following tables, we have mixed several classes together in presenting data:

* TABLE DISTIL DISTILLATION YIELDS

*

COST LN HN GO RS

MC 16

HC 15

.3

-17

.25 -2

.25 .3

.2

.25

In the next two tables, we include a class (severity) as part of the table name. We reference these tables as REF(SV). That is, as long as we construct the correct character string, we can reference any named object.

H J . Greenberg, F.H. Murphy, Comparison of modeling systems

202

* TABLE REF09 COST

LR

*

HR CAP

MCLN -3 .62 .29 1.0

REFORMER YIELDS AT 0 9 SEVERITY MCHN -3 .08 .84 1.0

HCLN .3 -5

HCHN .3

.4

1.0

.91 1.0

MCHN

HCLN .4 .5 .35 1.2

HCHN .4 .05 .78 1.2

TABLE REF11 COST LR HR CAP

MCLN .4 -6 .27 1.2

.4 .1 -75

1.2

The different ways in which one constructs tables reflects important philosophical differences. The issue is what is the logical unit for viewing data? OMNI allows the modeler to make the physical process the logical unit as in the reformer and catalytic cracker tables. GAMS and MathPro make the set the logical unit, which means that the data on physical units often are divided into several tables. The ability to have larger tables and use refinery processes as the logical units means that this model was written in substantially less time than with the other systems. We must hedge this statement since the model was built after we had already done it in both GAMS and MathPro, but the time difference was striking - 2.5 hours versus 6 hours with GAMS for first entry of the model (we do not include debugging time since we do not have an OMNI compiler). The unanswered question is whether the increased model design time is recouped in lower debugging time. Once the GAMS model was in place, debugging went quickly. With OMNI, by not having domain checking built into the error checks, there is more opportunity for mistakes to go undiscovered and for errors to be diagnosed far from the actual source. OMNI provides the model builder more control over matrix generation and less support in writing the MPS file than the other systems. The consequence is that the model builder does more programming, e.g. writing FORM SECTIONS around portions of the code and writing COPY commands. With this extra power comes the need to be a better programmer.

5.

MathPro

MathPro is the most recent model building system on the market, and it has the most novel design features of the ones presented here. All of the other systems presented were developed in a mainframe environment. MathPro is

H.J. Greenberg, F.H. Murphy, Comparison of modeling systems

20 3

designed to actively take advantage of the user-oriented PC environment with menus, function keys, etc. (LPL, CAMPS and PLANETS provide interactive editors as well.) With the other systems described so far, we have presented an ASCII file of the inputs.to the language. There is no single ASCII file in MathPro. What we present here are the screens one builds to formulate the model. Because there is no single file to examine, we describe MathPro and its screens in the context of the production-distribution problem. One begins building a model by entering a matrix schematic and working through screens that gather different kinds of information. The matrix schematic for the production-distribution problem is as follows: MATRIX COST INLIM PRODBAL DEMAND

L ;

VARIABLES X(T,L)

recruits by year and length of enlistment

z POSITIVE VARIABLE X

;

H.J. Greenberg, F.H. Murphy, Comparison of modeling systems

218

EQUATIONS COST YEAR(T) ; COST.

.

z

=E= S U M ( T , L ) , c ( T , L ) * x ( T , L ) )

;

*The f i r s t $ operator r e s t r i c t s u s t o u s i n g troops r e c r u i t e d * d u r i n g or p r i o r t o period T . T h e s e c o n d m a k e s s u r e t h e t r o o p s *are s t i l l a v a i l a b l e , t h a t i s , t i m e of e n l i s t m e n t p l u s l e n g t h *of e n l i s t m e n t a r e g r e a t e r t h a n t h e y e a r . YEAR ( T )

..

SUM ( ( T P , L) $ (ORD ( T P ) LE ORD'(T) AND ORD ( T P ) + ORD ( L ) GT ORD ( T ) ) , X(TP, L ) ) ) ) =G= REQ ( T ) ;

MODEL SPARTA /ALL/ SOLVE SPARTA USING LP MINIMIZING Z DISPLAY X.L,

X.M

;

;

A.1.3. Refinery model $ T I T L E REFINERY $OFFUPPER SETS CR c r u d e s /MC HC

medium c r u d e heavy crude/

INTPRO i n t e r m e d i a t e p r o d u c t s /LN l i g h t naphtha HN h e a v y n a p h t h a GO g a s o i l RS r e s i d u a l o i l / * U s i n g (INTPRO) i n d i c a t e s t h a t n a p h t h a s i n N a r e a s u b s e t o f *INTPRO N ( I N T P R 0 ) n a p h t h a s /LN HN

l i g h t naphtha heavy naphtha/

* N o t e t h a t e v e n i f t h e r e i s o n l y o n e e l e m e n t , t h e s e t m u s t be *definedratherthanusetheelementas a character string. This * i s b e c a u s e GAMS does n o t b u i l d u p n a m e s f o r a n MPS f i l e l i k e *the t r a d i t i o n a l matrix generators. G ( I N T P R 0 ) g a s o i l s /GO g a s o i l / R Z ( I N T P R 0 ) r e s i d s /RS r e s i d u a l o i l /

HJ. Greenberg, F.H. Murphy, Comparison of modeling system

S severity

/09 11

point 9 severity 1 point 1 severity/

RF reformate

/LR HR

light reformate heavy reformate/

CG cat gas

/LCG HCG

light cat gas heavy cat gas/

GA gasoline

/REG PREM

regular pr emiuml

OCT octane

/MON RON

motor octane research octane/

SCALARS CATCST RECYC BUTCST ALKCST DISTCAP REFCAP CATCAP FUELDEM BUTCAP ALKYCAP FODEM

219

;

catalytic cracker cost /.6/ cycle oil net input from recycle activity /.15/ cost of butane /11/ cost of alkylate /14/ distil cap /80/ reformer capacity /20/ cat cracker cap /30/ fuel oil demand /15/ butane supply /999/ alkylate supply /999/ fuel oil demand /lo/

PARAMETERS SUPPLY(CR) crude supply /MC 40 HC 60/ GASDEM (GA) gasoline demand /REG 10 PREM 30/ DISCST (CR) distillation cost /MC 16 HC 151 REFCST (S) reformer costs /09 .3 11 .4/ REFUT(S)

refomer utilization by severity /09 1. 11 1.2/

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

RECYCLE(CG) o u t p u t s f r o m r e c y c l i n g i n c a t c r a c k e r /LCG .05 HCG .05/ TABLE DISOUT (INTPRO,CR)

y i e l d s from d i s t i l l a t i o n

TABLE REFORMERS (S,RF,N,CR)

TABLEGOBAL(G,CR)

y i e l d s from reformer

matchescatalyticcrackeroperateactivities

*with g a s o i l i n p u t . T h i s i s a n example o f t h e u s e o f a c o n t r o l *table t o d i r e c t t h e logic of formulation.

*Note how w e n e e d t o k e e p t h e n e x t t w o t a b l e s s e p a r a t e b e c a u s e * t h e domain c h e c k i n g d o e s n o t a l l o w u s t o mix s e t s i n a t a b l e

TABLE CYCLE (G,CR) y i e l d s o f c y c l e o i l f r o m t h e g a s o i l i n p u t LCG HCG

MC .3 .2

HC .25 .15

TABLE CYCLE (G,CR) y i e l d s o f c y c l e o i l f r o m t h e g a s o i l i n p u t

TABLE OCTANIN(GA,OCT,CR,N) REG.MON REG.RON PREM .MON PREM . RON

MC.LN 89 90 89 90

naphtha octane r a t i n g s

MC.HN 82 82

HC.LN 83 83

83 83

H J . Greenberg, F.H. Murphy, Comparison of modeling systems

reformate o c t a n e r a t i n g s

TABLE OCTANR(GA,OCT,S,RF) REG.MON REG.RON PREM .MON PREM . RON

11.LR 89 96 90 98

11.HR 88 102 90 102

TABLE OCTANC (GA,OCT,CG) REG.MON REG.RON PREM .MON PREM .RON

LCG 78 93 83 95

TABLE OCTANG(OCT,GA) MON RON

REG 83 88

MON RON

REG

c a t gas octane

HCG 77 88 79 89 t a r g e t octane of g a s o l i n e

butane octane

PREM 101 102

TABLE OCTANA(OCT,GA) MON RON

09.HR 86 100 88 100

PREM 87 92

TABLE OCTANB (OCT,GA) REG 101 101

09.LR 87 94 88 96

o c t a n e of a l k y l a t e i n p r e m gas

PREM 100 102

TABLE VISCOS(CR,INTPRO)

v i s c o s i t y f o r f u e l o i l blending

VARIABLES

z DIST (CR) OREF (N,CR,S) OCAT ( CR) CATCYC BLBUT (GA)

d i s t i l l crude o i l o p e r a t e reformer operate c a t cracker recycle cycle o i l blend butane i n t o g a s o l i n e

H.J. Greenberg, F.H. Murphy, Comparison of modeling systems

222

BLNA (N,CR,GA) blend naphtha BLRF (RF,S,GA) blend reformate BLCAT (CG,GA) blend c a t gas BLALKY (GA) blend a l k y l a t e i n t o prem g a s BLFO (INTPRO,CR) blend i n t e r m e d i a t e p r o d u c t s i n t o f u e l o i l GASPROD (GA) g a s o l i n e production FUELOIL f u e l o i l production ; POSITIVE VARIABLES DIST, OREF, OCAT, CATCYC, BLBUT, BLNA, BLRF, BLCAT, BLALKY, BLFO, GASPROD, FUELOIL EQUATIONS COST MNAP (CR,N) MG (CR,G ) MRZ (CR,RZ) CRSUP (CR) DISCAP MREFORM ( S , RF) RF CAP MCAT (CG) MCYCLE CATCP BUTSUP ALKY SUP OCTLIM(GA,OCT) MVOL (GA) DEM (GA) MFUEL VISC DEMFUEL COST. .

Z

;

naphtha balance g a s o i l m a t e r i a l balance r e s i d m a t e r i a l balance crude supply d i s t i l l a t i o n capacity reformate balances reformer c a p a c i t y c a t gas m a t e r i a l balance m a t e r i a l balance f o r c y c l e o i l c a t cracker capacity butane supply a l k y l a t e supply blending r e s t r i c t i o n s on o c t a n e material balance on volume of gasoline inputs g a s o l i n e demand m a t e r i a l balance on f u e l o i l i n p u t s viscosityblendingconstraint f o r f u e l o i l f u e l o i l demand ;

=E= SUM (CR,DISCST (CR)*DIST (CR)) + SUM (N,CR,S), REFCST (S)*OREF (N,CR,S) ) + SUM (CR, CATCST*OCAT ( CR) ) + SUM (GA, BUTCST*BLBUT (GA)) + SUM (GAS(OCTANA( 'MON',GA)) , ALKCST*BLALKY (GA))

;

*naphtha balance *The $ o p e r a t o r r e s t r i c t s t h e outflows of naphthas t o products * t h a t use t h e s e naphthas. We c o n t r o l g a s o l i n e i n p u t s by using * t h e MON row. We could not have used t h e s e t OCT h e r e because * t h e r e would have been an u n c o n t r o l l e d index, i . e . one t h a t * n e i t h e r appears on t h e equation d e f i n i t i o n nor i s summed.

HJ. Greenberg, F.H. Murphy. Comparison of modeling systems

223

..

DISTOUT ( N , CR) *DIST ( C T ) - SUM ( S , OREF (N, CR, S ) ) - SUM (GAS (OCTANN (GA, 'MON' rCR,N) ) , BLNA (N, CR, GA) ) - BLFO (N, CR) $ V I S C O S ( C R , N ) =E= 0 ;

MNAP ( C R , N )

* g a s o i l balance *Since t h e c a t a l y t i c c r a c k e r uses o n l y g a s o i l , t h e operate * a c t i v i t y n e e d o n l y be i n d e x e d b y CR b u t t h e t a b l e GOBAL i s * n e c e s s a r y t o m a k e surethere i s m a t c h o n t h e d o m a i n s describing * t h e r o w s . T h i s i s a n e x a m p l e of t h e u s e o f a l o g i c t a b l e . MG (CR, G )

-

..

DISTOUT (G, CR) *DIST ( C R ) - GOBAL(G,CR)*OCAT(CR) BLFO (G, C R ) $ V I S C O S (CR, G ) =E= 0 ;

* r e s i d u a l o i l balance

..

MRZ ( C R , R Z ) DISTOUT ( R Z , CR) *DIST ( C R ) - BLFO (RZ, CR) $ V I S C O S (CR, R Z ) =E= 0 ; *crude supply l i m i t CRSUP ( C R )

..

D I S T ( C R ) =L= SUPPLY ( C R ) ;

" d i s t i l l a t i o n capacity l i m i t DISCAP

..

SUM (CR, D I S T ( C R ) =L= D I S T C A P ;

* m a t e r i a l balance on r e f o r m a t e s

.

MREFORM(S,RF). SUM( (N,cR), REFORMER(S,RF,N,CR)*OREF(N,CR,S)I - SUM(GA, B L R F ( R F , S , G A ) ) =E= 0 ; *reformer

capacity

RFCAP.. 'material

SUM((N,CR,S),

REFUT(S)*OREF(N,CR,S))

=L=REFCAP ;

balance o n c a t gas

MCAT ( C G )

..

SUM (CR, CRACKER (CG, C R ) *OCAT ( C R ) RECYCLE ( C G ) *CATCYC - SUM(GA, BLCAT (CG, GA) =E= 0 ;

+

* c y c l e o i l balance * T h e CATCYC a c t i v i t y r e c y c l e s c y c l e oil MCYCLE . .

SUM (CR, CYCLE ( ' GO' ,CR) *OCAT ( C R ) ) - RECYC*CATCYC =E= o ;

*cat c r a c k e r c a p a c i t y CATCP

..

SUM (CR, OCAT ( C R ) )

+

CATCYC =L= CATCAP ;

224

HJ. Greenberg, F.H. Murphy, Comparison of modeling system.

*butane supply BUTSUP.

.

SUM (GA,

BLBUT (GA) ) =L= BUTCAP ;

* a l k y l a t e supply. * T h e e f f e c t of t h i s l o g i c i s t o r e s t r i c t a l k y l a t e t o p r e m i u m

*gas b l e n d i n g .

*octane b l e n d i n g c o n s t r a i n t

..

SUM ( (N, CR) ,OCTANN (GA, OCT, CR, N ) *BLNA (N, CR, GA) ) SUM( (s,RF), OCTANR(GA,OCT,S,RF)*BLRF(RF,S,GA)) + SUM (CG, OCTANC (GA, O C T , C G ) *BLCAT ( C G , G A ) ) + OCTANB (OCT, GA) *BLBUT (GA) + OCTANA (OCT, GA) *BLALKY (GA) - OCTANG (OCT, GA) *GASPROD ( G A ) =E= o ;

OCTLIM (GA, OCT)

+

" v o l u m e t r i c balance f o r g a s o l i n e MVOL ( G A )

. . SUM ( (N, C R ) , + + +

BLNA (N,CR, GA) ) SUM((S,RF), BLRF(RF,S,GA)) SUM (CG, BLCAT (CG, GA) ) + BLBUT (GA) BLALKY (GA) - GASPROD (GA) =E= 0 ;

*demand for g a s o l i n e DEM (GA)

..

GASPROD (GA) =G= GASDEM ( G A )

;

* v o l u m e b a l a n c e f o r f u e l o i l w i t h a r e s t r i c t i o n t o i n p u t s as *defined i n t h e v i s c o s i t y t a b l e MFUEL.

.

SUM ( (INTPRO, C R ) $VISCOS ( C R , INTPRO) BLFO ( I N T P R O , C R ) ) - F U E L O I L =E= 0 ;

+

*viscosity blending restriction

*fuel o i l demand DEMFUEL..

F U E L O I L =G= FODEM

MODEL R E F I N / A L L /

;

;

SOLVE R E F I N U S I N G L P M I N I M I Z I N G Z

;

H J . Greenberg, F.H. Murphy, Comparison of modeling system

A.2.

OMNI

A .2.1. Airline staff planning

OMNI, NUDD, NULCU MODE, COMPILE COMPILE, NOLIT

*

DICTIONARY

*

T h e c l a s s name h a s t h e same n u m b e r o f c h a r a c t e r s a s t h e e l e m e n t s

CLASS TM TIME JA,FE,MA,AP,MY,JU

* DATA

*

TABLE DEMAND DEMAND REQUIREMENTS JA FE MA AP MY REQ 8000 9000 8000 10000 9000

JU 12000

*We c a n g i v e t h e LCU a r e f e r e n c e n u m b e r

*

FORM SECTION *One c a n d e f i n e s c a l a r s w i t h o u t h a v i n g t o d e f i n e a t a b l e

*

*

FORM VALUE REMAIN = .9 !FRACTIONOFEXPERIENCESATTENDANTSTHATREMAIN CSTE = 3000 !COST OF AN EXPERIENCES ATTENDANT CSTT = 2200 !COST OF A TRAINEE HOURSE = 15O!HOURS AN EXPERIENCED ATTENDANT WORKS HOURST = 100!HOURS REQUIRED TO TRAIN A TRAINEE BEGIN = 60 !NUMBER OF BEGINNING ATTENDANTS IN PERIOD 1 FORM SECTION, END

FORM SECTION COPY NAME FEEDEM SPEEDEM ROWS FS, END

*

H.J. Greenberg, F.H. Murphy, Comparison of modeling system.

* *

FS FORM ROW I D COST = OBJ BAL (TM) = FIX REQ (TM) = M I N FORM SECTION, END FORM SECTION

COPY COLUMNS FS, END

*

*We d e f i n e t h e v e c t o r f o r e x p e r i e n c e d a t t e n d a n t s . W e d e f i n e t h e * b a l a n c e a t t h e e n d o f t h e p e r i o d . One c a n n o t e x p l i c i t l y m o d e l *T + 1 a s i n GAMS. One d e f i n e s a t e m p o r a r y s e t , i n t h i s case *UU, t o i n d e x o v e r t h e same s e t b u t d i f f e r e n t e l e m e n t s . S o t h a t *we d o n o t g e n e r a t e a c o e f f i c i e n t f o r t h e v e c t o r b e y o n d t h e *planning horizon, w e do not i n c l u d e i n o u r d e t e r m i n a t i o n o f *UU t h e l a s t e l e m e n t o f TM + 1. The $ g i v e s t h e p o s i t i o n o f t h e *element i n t h e set and # g i v e s t h e c a r d i n a l i t y o f t h e set.

FS FORM VECTOR E (TM) COST = N,CSTE REQ(TM) = N, HOURSE BAL(TM) = -1 EXCEPT ($TM.EQ. 1) *The / i l l u s t r a t e s t h e l i n k e d c l a s s f e a t u r e w h e r e c l a s s TM i s * c o n t r o l l e d b y c l a s s U U . The v a l u e f r o m TT i s t h e o n e i n t h e *same p o s i t i o n a s t h e c o n t r o l l i n g v a l u e i n U U . One c a n t h i n k *of UU a s a p o i n t e r .

*

*

BAL(TM/UU) = N,REMAIN FOR $UU EXCEPT ($TM .EQ. #TM)

=

STM +

1

*We d o n o t h a v e a n y t r a i n e e s i n t h e l a s t p e r i o d

*

*

FORM VECTOR TR(TM) EXCEPT COST = CSTT REQ (TM) = -HOURST BAL(TM/UU) = 1 FOR $UU = FS, END

(STM .EQ. #TM) STM + 1

H J . Greenberg, F.H. Murphy, Comparison of modeling systems

FS COPY RHS

* *

FS, END FORM VECTOR RHS REQ (TM) = TABLE DEMAND ( (TM),REQ)

*Zero i s t h e d e f a u l t v a l u e

*

*

BAL (TM) = 0

* W e f o r m u l a t e t h e bounds s e c t i o n o f t h e MPS f i l e a £ t e r t h e RHS *and r a n g e s e c t i o n s .

FS COPY BOUNDS FS, END FS FORM BOUNDS BOUNDROW *EJA i s t h e c h a r a c t e r s t r i n g f o r E x p e r i e n c e d a t t e n d a n t s i n *January.

*

EJA,FX = N,BEGIN FS, END FS

COPY ENDATA FS, END END EXECUTE, ALL A.2.2. Military manpower planning

OMNI, NUDD, NULCU MODE, COMP ILE COMOILE, NOLIT

*

DICTIONARY CLASS TT TIME PERIOD 01,02,03,04,05,06,07,08,09,10

*

H J . Greenberg, F.H. Murphy, Comparison of modeling systems

CLASS L

*

LENGTH O F ENLISTMENT

1, 2, 3, 4

DATA TABLE I N F L

*

INF

01 02 03 04 05 06 07 08 09 10 1.0 1.05 1.12 1.71 1.80 1.90 1.97 2.10 2.22 2.38

TABLE REQ

*

REQ

P R I C E INDEX

01 5

TROOP REQUIREMENTS

02 6

*

1 50

7

04 6

05 4

06 9

07 8

08 8

09 6

10 4

COST O F S E R V I C E BY LENGTH O F ENLISTMENT

TABLE CLEN

COST

03

2 85

3 115

4 143

FORM S E C T I O N *CONSTRUCT COST TABLE FOR YEAR OF ENLISTMENT AND LENGTH OF *SERVICE

*

FORM TABLE C

*

= I N F L ( ( T T ) ,INF) *CLEN ( ( L ) ,COST) ( (TT, L ) FORM S E C T I O N , END

FORM S E C T I O N COPY NAME SPARTA ROWS F S , END FS FORM ROW COST = O B J Y E A R ( T T ) = MIN *A GREATER THAN OR EQUAL ROW

*

F S , END FS COPY COLUMNS F S , END

*

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

229

*FORM SECTION c a n be u s e d t o c o n t r o l t h e o r d e r o f c o l u m n * g e n e r a t i o n . I n d i c e s on t h e r i g h t o f a l i s t change most r a p i d l y * a n d t h o s e o n t h e l e f t l e a s t r a p i d l y . E a c h FORM s t a t e m e n t i s *completed f o r a l l i n d e x c o m b i n a t i o n s b e f o r e moving on t o t h e * n e x t FORM s t a t e m e n t . One u s e s t h e FORM SECTION s t a t e m e n t t o * e x e c u t e a c o l l e c t i o n o f FORM s t a t e m e n t s f o r a s p e c i f i c v a l u e * b e f o r e m o v i n g on t o t h e n e x t . W e h a v e i n c l u d e d i n d e x i n g i n t h e *FORM SECTION e v e n t h o u g h i s h a s n o i m p a c t o n t h e o r d e r o f *generation here.

* *

FS (TT) (L)

*With m u l t i p l e c o n d i t i o n a l s , a l l m u s t b e s a t i s f i e d . The s e t UU * i s d e f i n e d t o be t h e same as TT. W e p l a c e a 1 i n t h e v e c t o r *when t h e y e a r o f i n t e r e s t i s g r e a t e r t h a n o r e q u a l t o t h e y e a r *of e n l i s t m e n t a n d less t h a n t h e y e a r o f e n l i s t m e n t p l u s l e n g t h *of s e r v i c e . FORM VECTOR (TT) ( L ) COST = TABLE C ( (TT) , ( L ) ) *Note t h a t UU i s d e f i n e d a s t h e 1 0 e l e m e n t s , * i n d e p e n d e n t o f TT YEAR(UU)

*

=

1 FOR #UU

= #TT WHEN ($UU. GE. $TT) WHEN ( $ U U . L T .$TT + $L)

F S , END

FS COPY RH S

FS, END FORM VECTOR RHS YEAR(TT) = REQ( (TT) ,REQ) COPY ENDATA EXECUTE, ALL A.2.3. Refinery model O M N I , NUDD, NULCU MODE, COMPILE COMPILE, NOLIT

*

01 through 10,

230

H J . Greenberg, F.H. Murphy, Comparison of nodeling systems

DICTIONARY

*

* *

CLASS CR MC, HC

CRUDES

CLASS NP LN, HN

NAPHTHAS A SUBSET OF IP

*We now use c l a s s NP i n d e f i n i n g c l a s s IP

* *

CLASS IP INTERMEDIATE PRODUCTS (NP), GO, RS CLASS SV

*

* *

* *

09,

SEVERITY

11

CLASS RF LR, HR

REFORMATE

CLASS CG LC, HC

CAT GAS

CLASS GA RG, PR

GASOLINE

CLASS OCT MON, RON

OCTANE

DATA *In t h e following t a b l e s we have mixed s e v e r a l s e t s t o g e t h e r *in p r e s e n t i n g d a t a

*

TABLE DISTIL

*

COST LN HN GO RS

MC 16 .3

.25 .2 .2

DISTILLATION YIELDS

HC 15 .17 .25 .3

.25

*In t h e next two t a b l e s we include a c l a s s ( s e v e r i t y ) a s p a r t *of t h e t a b l e name. We r e f e r e n c e t h e s e t a b l e s a s REF (SV). That

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

23 1

* i s , as l o n g as w e c o n s t r u c t t h e r i g h t c h a r a c t e r s t r i n g , w e can " r e f e r e n c e a n y named o b j e c t .

*

TABLE REF09

*

COST LR HR CAP

MCLN .3 .62 -29 1.0

REFORMER YIELDS AY 0 9 SEVERITY MCHN .3 .08 -84 1.0

HCLN

HCHN

.3

.3

MCHN -4 -1 .75 1.2

HCLN .4

HCHN

.5 .35

.05 -78 1.2

-5 -4 1.0

-91 1.0

TABLE REF11 MCLN

*

COST LR HR CAP

.4 .6 .27 1.2

1.2

.4

TABLE CRACK CATALYTIC CRACKER

*

COST LC HC CYC

MC .6 .3 .2

.4

TABLE OCTRG

*

*

HC .6 .25 -15 .55

CO

.6 .05 .05 -.I5

OCTANE FOR INPUTS TO REGULAR GAS + REG GAS

MON RON

BUTANE 101 101

MCLN 89 90

MCHN 82 82

HCLN 83 83

LRll 89 96

+R MON ROM

HRll 88 102

LR09 87 94

HR09 86 100

LC 78 93

HC 77 88

GAS 80 88

TABLE OCTPR OCTANE INPUTS FORPREMIUMGASOLINE + PREMGAS

*

MON RON

ALKY 100 102

BUTANE 101 102

MCLN 89 90

HCLN 83 83

LRll 90 98

+R MON RON

LR09 88 96

HR09 88 100

LCG 83 95

HCG 79 89

GAS 84 92

HRll 90 102

H.J. Greenberg, F.H. Murphy, Comparison of modeling systems

232

* TABLE V I S C O S

V I S C O S I T Y MEASURE FOR BLENDING F U E L O I L

*Rather t h a n h a v e a l a r g e c o l l e c t i o n of scalars, w e g r o u p them * i n t o a few tables

*

TABLE CAP

*

SMC SHC DISCAP REFCAP CATCAP BUTSUP ALKSUP

C A P A C I T I E S AND S U P P L I E S CAP 40 60 80 20 30

999

999

TABLE DEM

*

GRG GP R FODEM

DEMANDS FOR F I N A L PRODUCTS

DEM 10 30 10

FORM S E C T I O N FORM VALUE

*These a r e t h e p u r c h a s e p r i c e s f o r b u t a n e a n d a l k y l a t e

*

BUTSCT ALKCST F S , END

FS COPY NAME R E F I N ROWS

*

FS,

END

=

=

11 14

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

233

FS FORM ROW I D COST = O B J *Material balances f o r d i s t i l l a t i o n outputs M (CR) ( I P ) = FIX *Crude s u p p l y CRSUP (CR) = MAX "Distillation capacity DISCAP = MAX *Reformer o u t p u t b a l a n c e s b y s e v e r i t y f o r l i g h t a n d heavy MREV(SV) (RF) = FIX *Reformer c a p a c i t y RFCAP = MAX * M a t e r i a l b a l a n c e f o r cat c r a c k e r o u t p u t MCAT (CG) = FIX *Cycle o i l b a l a n c e MCYCLE = FIX *Cat c r a c k e r c a p a c i t y CATCAP = MAX *Butane s u p p l y BUTSUP = MAX "Alkylate supply ALKSUP = MAX *Octane b l e n d i n g r e s t r i c t i o n s OCT (GA) (OCT) = M I N * M a t e r i a l b a l a n c e on g a s o l i n e volumes MVOL(GA) = FIX * G a s o l i n e demand DEM(GA) = M I N * M a t e r i a l b a l a n c e on f u e l o i l volumes MFUEL = FIX *Viscosity blending r e s t r i c t i o n VISC = F I X * F u e l o i l demand DEMFUEL = M I N FS, END

*

FS COPY COLUMNS FS, END

*

234

H J . Greenberg, F.H. Murphy, Comparison of modeling system.

*Distillation

*

FORM VECTOR D I S T ( C R ) COST = TABLE D I S T I L ( (CR) ,COST) M ( C R ) ( I P ) = TABLE D I S T I L ( ( C R ) ,I P ) ) CRSUP ( C R ) = 1 DISCAP = 1

*Reformer o p e r a t i o n

*

FORM VECTOR R ( C R ) (NA) ( S V ) COST = TABLE R E F ( S V ) ( (CR) (NA) ,COST) M ( C R ) (NA) = -1 MREF ( S V ) ( R F ) = TABLE REF ( S V ) ( (CR) (NA) ,R F ) ) REFCAP = TABLE REF ( S V ) ( ( C R ) (NA) ,CAP)

*Cat c r a c k e r o p e r a t e s f o r g a s o i l i n p u t s

*

FORM VECTOR OCAT ( C R ) COST = TABLE CRACK ( ( C R ) ,COST) M ( C R ) G O = -1 MCAT ( C G ) = TABLE CRACK ( ( C R ) , (CG) ) MCYCLE = TABLE C R A C K ( ( C R ) , C Y C ) CATCAP = 1

*Cycle o i l o p e r a t e i n c a t c r a c k e r

*

FORM VECTOR OCATCO COST = TABLE CRACK (CO, COST) MCAT(CG) = TABLE CRACK(C0, (CG) ) MCYCLE = TABLE CRACK (CO, CYC) CATCAP = 1

* T h i s f o r m s e c t i o n a c t s a s a l o o p a n d m o d i f i e s t h e o r d e r of * c o n s t r u c t i o n o f t h e b l e n d i n g a c t i v i t i e s . The a c t i v i t i e s a r e " g r o u p e d by t y p e o f g a s o l i n e . Without t h i s c o n t r o l t h r o u g h t h e *FORM S E C T I O N , t h e a c t i v i t i e s would b e g r o u p e d b y s o u r c e of *input t o blending. I n t h e past, grouping a f f e c t e d s o l u t i o n * t i m e s on l a r g e m o d e l s . B y a l t e r i n g t h e o r d e r o f g e n e r a t i o n , *one c a n g e n e r a t e d i f f e r e n t p i c t u r e s of t h e model when u s i n g * t h e MPS P I C T U R E command.

*

F S (GA)

"Butane i n p u t s t o b l e n d i n g FORM VECTOR BUT (GA) COST = BUTCST OCT (GA) ( O C T ) = TABLE OCT (GA) (BUTANE, ( O C T ) ) MVOL(GA) = 1 BUTSUP = 1

H J . Greenberg, F.H. Murphy. Comparison of modeling systems

23 5

* A l k y l a t e i n p u t s t o blending FORM VECTOR ALKY (GA) WHEN GA = P R COST = ALKCST OCTPR (OCT) = TABLE OCTPR (ALKY, (OCT) ) MVOLPR = 1 ALKYSUP = 1 *Naphtha inputs FORM VECTOR BG (GA) (CR) (NA) WHEN TABLE OCT (GA) ( (CR) (NA) ,MON) M ( C R ) (NA) = -1 OCT (GA) (OCT) = TABLE OCT (GA) ( ( C R ) (NA) , ( O C T ) ) MVOL(GA) = 1 *Reformate inputs FORM VECTOR BR (GA) ( R F ) ( S V ) WHEN TABLE OCT (GA) ( R F ) ( S V ) ,MON) MREF ( S V ) ( R F ) = -1 OCT (GA) (OCT) = TABLE OCT (GA) ( ( R F ) ( S V ) , (OCT) ) MVOL(GA) = 1 * C a t gas i n p u t s FORM VECTOR BG (GA) ( C G ) MCAT (CG) = -1 OCT (GA) (OCT) = TABLE OCT (GA) ( ( C G ) , (OCT) ) MVOL(GA) = 1 *Gasoline outputs FORM VECTOR GAS (GA) OCT (GA) (OCT) = -TABLE OCT (GA) (GAS, (OCT) ) MVOL (GA) = -1 DEM(GA) = 1 F S , END

*

* I n p u t s t o f u e l o i l b l e n d i n g . O n l y p r o d u c t s of d i s t i l l a t i o n * w i t h positive entries i n t h e v i s c o s i t y table are a l l o w e d

*

FORM VECTOR BLFO ( I P ) ( C R ) WHEN TABLE V I S C O S ( ( I P ) , ( C R ) ) M ( C R ) ( I P ) = -1 V I S C = TABLE V I S C O S ( ( I P ) , ( C R ) ) MFUEL = 1 *Fuel oil output FORM VECTOR F U E L O I L MFUEL = -1 DEFUEL = 1 F S , END

* *

FS COPY

HJ. Greenberg, F.H. Murphy, Comparison of modeling systems

236

RH S FS,

END

* T h e d e f a u l t RHS i s 0. FORM VECTOR RHS * M ( C R ) (IP) = 0

* * * * * * *

*

CRSUP ( C R ) = TABLE CAP (CAP, S ( C R ) ) D I S C A P = TABLE CAP (CAP, D I S C A P ) MREF ( S V ) ( R F ) = 0 RECAP = TABLE CAP (CAP, REFCAP) MCAT(CG) = 0 MCYCLE = 0 CATCAP = TABLE BUTSUP = TABLE ALKSUP = TABLE OCT (GA) ( O C T ) = MVOL(GA) = 0

CAP (CAP, CATCAP) CAP (CAP, BUTSUP) CAP (CAP,ALKSUP)

0

DEM (GA) = TABLE DEM (DEM, G (GA) ) MFUEL = 0 VISC = 0 DEMFUEL = TABLE DEM(DEM,FODEM) FS, END

FS COPY ENDATA F S , END EXECUTE,

ALL

References R.W. Ashford and R.C. Daniel. LP-MODEL: XPRESS-LP's model builder, IMA J. Math. Manag. 1(1986)163-176. J.J. Bisschop and A. Mecraus, On the development of a general algebraic modeling system in a strategic planning environment. mad^. Progr. Study 20(1982)1-29. Bonner and Moore Management Science, GAMMA 2000 User's Manual, Version 1.0, Houston, TX (1989). Bonner and Moore Management Science, RPMS User's Manual, Houston, TX (1977). R.L. Brei~manand J.M. Lucas, PLANETS: A modeling system for business planning, Interfaces 17(1987)94- 106. A. Brooke, D. Kendrick and A. Meeraus. CAMS, A User Guide (The Scientific Press, Redwood City, CA. 1988). Chesapeake Decision Sciences, MIMlILP User Manual, Version 2.63, New Providence, NJ (1988). Control Data Corporarion, PDSIMAGEN User Informalion Manual, Version 1. l , Haverly Systems, Denville, NJ (1974). K. Cunningham and L. Schrage, The LINGO modeling language, Technical Report, University of Chicago, Chicago, IL (1989).

H.J. Greenberg, F.H. Murphy, Comparison of modeling systems

237

[lo] R.E. Day and H.P. Williams, MAGIC: The design and use of an interactive modeling language for mathematical programming. IMA J. Math. Manag. 1(1986)53-65. [ I l l E.F.D. Ellison and G. Mitra, UIMP: User interface for mathematical programming, ACM Trans. Math. Software 8(1982)229-255. [12] R. Fourer, Modeling languages versus matrix generators for linear programming, ACM Trans. Mah. Software 9(1983)143-183. [13] R. Fourer, D.M. Gay and B.W. Kemighan, Modeling languages for mathematical programming, Manag. Sci. 36(1990)519-554. [14] A. Ceoffrion, SML: A model definition language for structured modeling. Working Paper No. 360, Western Management Science Institute. University of Califomia, Los Angeles, CA (1988; revised November 1989). [IS] A. Gcoffrion, The SML language for smctured modelmg, Working Papcr No. 378, Western Management Science Institute. University of Califomia, Los Angeles, CA (1990). [16] H.J. Greenberg. A primer for MODLER: Modeling by objectdriven linear elemental relationships. Mathematics Department, University of Colorado at Denver, Denver, CO (1990). [I71 H.J. Greenberg and F.H. Murphy. Views of mathematical programming models and their instances, Technical Report, Mathematics Department, University of Colorado at Denver, Denver, CO (1991). [18] Haverly Systems, OMNI Linear Programming System: User and Operaling Manual. Denville, NJ (1976). [19] Haverly Systems, MAGEN Reference Manual, Denville. NJ (1976). [20] T. Hiirlimann, Refuence Manualfor the LPL Modeling Languuge (Version3.1). Institute for Automation and Operations Research, University of Fribourg, CH-17700 Fribourg, Switzerland (1989). [21] T. Hiirlimann and J. Kohlas, LPL: A structured language for linear programming modeling, OR Spektrum 10(1988)55-63. [22] C.V. Jones. Applications of a graph-based modeling system (GBMS), Technical Report 88-10-02. The Wharton School, University of Pennsylvania, Philadelphia, PA (1988). [23] C.V. Jones, An introduction to graph-based modeling systems, Part I: Overview, ORSA J. Comput. 2(1990)136-151. [24] Ketron Management Science, DATAFORM User Manual, McClean, VA (1987). [25] R. Krishnan. A logic based approach to model construction, SUPA Technical Report, CarnegieMellon University, Pittsburgh, PA (1988). [26] C.V. Jones, An introduction to graph-based modeling systems, Part 11, ORSA J. Comput. (1991). [27] D.A. Kendrick and R. Krishnan, A comparison of structured modeling and GAMS, Comp. Sci. Econ. Manag. 2(1989)17-36. [28] C. Lucas and G. Mitra, CAMPS: Preliminary User Manual, Department of Mahematics and Slatistics, Brunel University, Middlesex, UK. [29] P.-C. Ma, F.H. Murphy and E.A. Stohr, A graphics interface for linear programming, Commun. ACM 32(1989)996- 1012. [30] MathPro, Inc., MathPro Usage Guide, Iruroduction and Reference, Washington. DC (1990). [31] A. Meeraus, An algebraic approach to modeling, 3rd Con5 on Economic Dynamics and Conlrol, Lyngby, Denmark (1981). [32] F.H. Murphy and E.A. Stohr, An intelligent system for formulating linear programs, Dec. Support Syst. 2(1986)39-48. [33] F.H. Murphy, E.A. Stohr and A. Asthma, Representation schemes for mathematical programming models. Working Paper, New York University (1990). (341 W. Orchard-Hays, DATAMAT User Manual, National Bureau of Economic Research, Cambridge, MA (1978). [35] K.H. Palmer, N.K. Boudwin. H.A. Patron, A.J. Rowland, J.D. Sammes and D.M. Smith, A ModelManagement Framework for Mathemafical Programming (Wiley, 1984). [36] R.L. Sanders and M.G. Smith, A description of Ronner and Moore's GAMMA system, Report No. CSH-007, Bonner and Moore Managament Science, Houston, T X (1976).

23 8

H.J. Greenberg, F.H. Murphy, Comparison of modeling systems

[37] R. Sharda and D. Steiger. Functional description of a graph-based interface for network modeling (GIN). Technical ReporL Oklahoma State University, Stillwater, OK (1989) [38] L. Schrage, Linear, Inreger and Quadralic Programming with LINDO (The Scientific Press, Redwood City. CA (1987). [39] J.S. Welch, Jr., PAM - A practitioner's approach to modeling, Manag. Sci. 33(1987)610-625. [40] R.V. Simmons, Mathematical programming modeling using MGG, IMA J. Math. Manag. l(1986) 267-276. [41] H. Wagner. Principles of Operations Research (Prenlice-Hall, Englewood Cliffs, NJ, 1975). [42] C. Witzgall and M. McClain. Problem specification for linear programs, IMA J. Math. Manag. 1(1985)177-209.