DRc - /4 CCNCPT 4 System for Large Scale Dynamic Nonlinear Optimization USER'S MANUAL Dy Arne Drua and Alexander Meeraus Development Research Center World Bank 'Aasnington, D.C., U.S.A. Tecnnical Note :o. 1 nesearch Project 571-58 march 180 Versicn C.105/UPbATE I An Optimization Code for Large Scale Dynamic Nonlinear Optimization Problems USER'S MANUAL 1. Introduction The following manual describes the use of che optimization code CONOPT with the features that have been implemented by the beginning of November, 1979. The code is still an experimental code, and all users are encouraged to report any proolems or errors they meet. Also, users are encouraged to comment on this manual - if certain features are not explained very well or if apparently correct input decks causes error messages, and on the code itself - e.g., which additional features would be useful. The manual is organized as follows: In section 2 we give a short definition of the mathematicil problem we want to solve and we give the main assumptions on which the code is based. Section 3, 4 and 5 defines the optimization problem to the code. In section 3 we describe the MO0EL-input that-defines the structure of the problem, i.e. which variables enter in whicn -elations, and defines the constant linear part of the model. The format o" the MODEL-input is chosen as close to standard MPS-format for - ordinary L?-proolems as possible with a few additional features t.o define the time structure and the nonlinearities of the problem. Section 4 describes the SERIES-input where the numerical values of the linear but time dependent parts of tne proolem can be defined. The structure of trie nonlinearities is defined in the MODEL-input. Section 5 describes how the actual nonlinear functions are entered. The user must supply a FORTRAN subroutine called FCOMP that can compute numerical - 2 - values of tne nonlinear expressions, and the values are Passed as biack-Dox infomiation to tne optimizer. A plan for the future is to by-pass the FORTRAN subroutine ana define tne nonlinearities in a form that can be manipulated by the optimization coce. CONPT nas a control lancuage for cefining and cnanging right hand sices, councs, objective function, optimization direction, output levels, etc. instead of inventing a new control language we have, oeing satisfied users of CDC's LP-systei APEX, chosen to make a control language tnat very much follows tha lines of APEX control language with the necessary aoditions of verbs to suit the dynamic and nonlinear problems. The control language is cescribed in section 6. The output from CONOPT can be divided into different groups as reproduction of input, iteration log information, optimal or intermeaiate solutions, etc. The meaning of tnis output, especially the aobreviations in the page and table headings, is explained in section 7. Finally, in section 3 we give an example of a small optimal control problem, ana we show the four input files: MODEL, SEPIES, FCOMP, and Control. Program. At the mrment we have not implemented any revise and restart facilities. Eefore we start implementing anytning in this area we.would like to have comments from users on the types of revisions and restarts tney-would find useful. 2. The Mathematical Formulation of the Problem The type of nonlinear optimization proolem we are concerned with can without loss of generality be defined as: min or max z tL f(xt ..., xL x subject to 'gi (xII, x ,-I ... xt-L ) .rel. b , i=1, ., n ; t=1,..., T and 2 < x < t 1, ..., T - xt is a vector of continuous optimization variables in period t. The dimension of Y, is m, incependent of t. -gi is a linear or nonlinear function with continuous first derivatives. .rel. is a relation i.e. <, =, > or non binding. - a and s are vectors of lower and uoper bounds, some of which can be -- or +=. - f is an objective function with continuous first derivatives. - L is the maximum number of lags. - x t-s indicates the vector of optimization variables lagged s periods, i.e. from s periods before period t. We assume that: - the functions g and f can be expressed by the same formula. in all time periods t, especially each function depends always on the same set of variables. This assumption is certainly true for T=I, i.e. static problems. - the components of x, x-1, ..., x-L that are used in the g and f functions are all known. - the relation (<, = , >, or non binding) for a certain constraint is the same in all periods. - all variaoles enter unlagged in at least one relation. - the functions f ano g are defined for all values of x that satisfies -he Douncs. 3. St-uctural Information - The MODEL-File The structure of the problem Is entered in a iod,iled >PS-format with t :o 3 sections. nhe sections must te entered in the crcer shcwn oelow: MOEL -card RCAS - section COLUMIS - section LAGS - section (optional) RPS - section (optional) BOUNDS - section (optional) RrINGES - section (ootional) EmOAT - card The format of tr.e input cards are standard IPS-format with eacn card diviced into ; fields: 7Cl umns Content 1 2-3 Type of row or bound. 2 5-12 Name of column, right-hand side, boundset, or rangeset 3 15-22 Name of row or'column. 1 25-36 Value indicator for derivative, right-hand side, bound, or range. 51 40-47 same as field 3. 6 50-61 same as field 4. The name fields 2, 3 and 5 defined above contain 3 characters, and in the fol lowina we will always refer to names as 3 alfanumeric characters. 'iowever, in the COC-version of the code all names can have,10 characters anc the fields are extended 2 characters to the riqht, i.e. 5-14, 15-2-, and 40-49. In trne names blanks are considered as ordinary characters, i.e. "X12356 " and " X123456" are not identical. The values in field 4 and 6 dre read with a F12.5 format and they should contain a decimal point. If a cecirnal ooint coes not appear o, - assumed to De locatea :etween column 30 ano 31 or between column 5o ana :o. 3.1 'OEL-card The MODEL-carl is the first cara in the input ceck. !t is used to identify the input ceck. The forma i s: Cotumn 1-5: MODEL Fieia 3: A string of 3 al'anumeric cnaracters icentifying the input ceck. 3.2 ROWS - section The RCWS-card is the first card in the second cata section. The .ormat is: Column 1-4: ROWS After the ROWS-card eacn row or relation in one oericd of the imodel must oe cescribed oy one card with the following format: Fiela 1: The type of the row or relation with L for less than or equal (<), G for greater than or equal (>), E for equal (=), and N for non oinaing. The type character can be punched in column 2 or 3. Field 2: The name of the row, ailfanumeric characters. The objective function ex:ression must be enterea as a row-of type N. 3.3 COLUMNS - section The COLUMNS-card is the first card in the thirc cata section. The tormat is: Column 1-7: COLUMNS The COLJMNS-secticn descrioes which variables (columns) enters in wnich equations (rows) without a lag. The data is entered columnwise, and one column must be finished before the next is started. Within each column the order of the rows is unimoortant. The format of the data cards is: Field 2: The name of the column, an 3 character variable name. Must be present on all data cards. Field 3: Rowname, 8 characters. Field 4: Derivative indicator. Field 5: Rown:me or blank. Field 6: Derivative indicator if field 5 is not blank. The derivative indicator describes how the variaole (column) enters the equation (row). CONCPT recognizes 4 different types of derivatives: Derivative type 1: constant and time independent, i.e. the variable enters linearly with a constant cofficient. 2: constant but time dependent, i.e. thevariable enters linearly with a time dependent cofficient. 3: variaole derivative that only depends on lagged varianles, i.e the variable xit enters in an; expression like xit= a(xt-1, x2,...) where a(.) is any function of lagged variables. 4: variable derivative that depinds on unlagged variables, i.e. the variaole enters in a truely nonlinear fasnion. The cerivative indicators (punched in field 4 or 6 of the data card) for the four derivative types are as follows: Type 1: The value of the constant coefficient or cerivative. Type 2: 9999. Type 3: 99999. Type 4: 999999. Note: a. The special indicators 9999., 99999., and 999999. are cefault value, and it is possible to change them in the control program, see section 6. b. The CONOPT code does nct distinguish between derivatives of type 3 and 4 at the moment. c. It is always allowed to increase the type number of a cerivative. However, :ne user shculc try to use the lowest possible type numoer because the solution algoritnr takes advantage of this information. d. In static problems, i.e. problems with T=1, derivatives of type 2 and 3 aces not exist. e. The values of a type 2 derivative can be supplied in the SERIES file, see section 4. Note however, that the d,efinition of the non-linear expression that should be coded in a FORTRAN subroutine depends-on which time series have been enterea. Read section 5 carefully. 3.4 LAGS-sections If the model relations contain lags (which all dynamic models should) tne structure of the lagged part of the relations must be defined in one or more LAGS-sections. The LA6S-.ard is :ne first card in each LAGS-section. The format is: Column 1-4: LAGS Fiela 4: .ag number fCr this LAGS-section - a positive integer written with a decimal point. The LAGS-sections must be entered with increasing lag number. ,ithin each LAGS-section the cata are entered with the same format as in the COLUMNS-section with col,_-n-name, row-name anc derivative ino,cator. Each input element indicates that tne variable named by the column name enters the relation named oy the rzi name lagged the number of periods indicated by the lag numcer on the LAG3-carl. The columns must be in the same orcer as in the COLUMNS section although not all columns have to be ;resent in the LAGS-sections. 3.5 RHS-section If a right-hand side is nonzero it must be speciried in the RHS- section. he first card in this section is :he RHS-card with the following format: Column 1-3: RHS More right-hand sides can be entered. The particular right-hand side that should be used in the optimization is defined in the control program. All rignt-hand sices are entered in a format similar to the format of the COLUMNS-section, ana as in the COLUMNS-section eacn right-hand side must be finished before the next is started. The format of each caro is: - Field 2: ,ame of the right-hand side, an 8 character name. Field 3: Rowname, 8 characters. Field 4: RHS-indicator. Field 5: Rowname or blank. Field 6: RHS-indicator if field 5 is not blank. - 9 - The R-S-incicator cescribes wnether the rih:-hanc side in the row cepends cn time, in which case 9999. is enterea, or is time incependent, in whicn case the right-hand siGe value is entered. Constant zero rignt-hand sides need not oe specifiec. The 9999.-indicator is tne same as the 9999.- Indicator in the COLUMNS-section and it can be cnangez in the control program if necessary. The actual time series of the values of the rignt-hand sides are entered through the SERIES file, see section 4. *A special ri;ht-hand side named FUNCTION is reserved. This right- hand sice is usec to give the connection Detween the rOwnames and the row- indices used in the FORTRAN suoroutine that computes the ncnlinear expres- sions, see secticn 5. Field -1 and 6 of this right-hanc side must contain a positive integer, written iith a decimal point. The integer is interpreted as the rcw-inaex of the row, and it is the users responsibility that this row-incex actually corresponds to tne index usea in the FORTRAN suoroutine. The only constraints on the row-indices are that they must oe positive, less than or equal to the total number of rsws, and distinct. If a FUNCTION right-nand side is present it must supply row-indices for all non- 'inear functions. If no FUNCTION right-hand side is s_pp1iea, all the rows, ooth linear and nonlinear, will :e given inoices after tre-.r occurance in the ROWS-section. 3.6 SOUNDS-section If some of the variaDoles have bounds different from > 0, which is the default bound, these bounds must be entered in a MOUNDS-section. The first carc in this section is the 3OUNDS-card with the following format: Column 1-6: BOUNDS - 1o - More sets of bounGs can oe entered in one input deck. They are oistinguishea by a oound name. The particular bound set that should De usec in an optimization is defined in the control program. The format of the data cards is: Field 1: The bound type. There are the following possibilities: UP - upper oounc LO - lowe- oouna FR - free variable FX - fixed variable HI - < 0 PL - 0 (' -:ult) Field 2: Bouna name, an 8 character name. :'e'd 3: Column name, 8 characters. Field 4: BOUND-indicator or blank. The following rules apply to *ie order of the data cards: a. One bound set must be finished before the next bound set is 'started. b. Within each bound set the columns must appear in the same order as in the COLUMNS-section, although not all columns need to Ie mentioned. c. Only the following comoination of two bounos for one column are allowed: (LO, UP), (LO, MI), (PL, UP), and (FR, UP). The last conination is used for bounds of the type x < b where b > 0 since UP alone with a positive bound : implies o < x < b. Within a combination the order is unimportant, except with (FR, UP) where FR must be first. - 11 - The 3SYn"indicator in field 4 is only used with bound type JP, LO, ano FX. if the bound is independent of time the value is simply entered. If the bound cepends on time tne time series indicator 9999. is used. If necessary, the 9999.-indicator can be changed as mentioned in the COLUMNS- and RHS-sections. Some special oound se: names, VARIABLE and all names starting with INIT, especially INITIAL, are reserved. The VARIABLE bound se: is used to give the connection between the column names and the indices of the variables used in the FORTRAN subroutine that computes the nonlinear expres- sions, see section 5. Field 1 Fhoula be blank, and field 4 must contain a positive integer written with a decimal point. The integer is used as the index of the variaole in the FORTRAN suoroutine, and it is the users respon- sioility that the column names actually correspond to the incices useo in the FCRTRAN subroutine. The only constraints on the indices are that they must be positive, less than cr equal to the total numoer of columns, and distinct. If a VARIABLE bound set is present it must supply indices for all nonlinear variables. If no VARIABLE bound set is supplied the variables will be given indices after their occurance in the COLUMNS-section. The iNITIAL bound set is used to give the variables initial values :rat can be used as a starting point for the optimization. Field 1 can only contain the types FX, LO, and UP. if the bound type is FX the BOUND-indicator in field 4 contains the initial value. if the bound-type is LO or UP the vari- aole is initialized at its lower cr upper bound, respectively, and field 4 is not used. it is not necessary to supply any initial values and if an INITIAL bound set is present it need not contain all variables. Variables that are not initialized explicitly will be initialized as follows: - 12 - a. Fixed iariables are of course initialized at their fixed value. b. Variables witnout a bound are initialized at zero. c. Variables with one bound like UP, LO, MI, or PL are initialized at this bound. d. Variables with two Dounds like (UP, LO), (MI, LO) or (PL, UP) are initialize: at the iumerically smallest bound and in case of a tie at -:e upper (,ositive) cound. Note, that a variaDle with a positive upper bound is assumed to have lower bound 0 unless another lower cound is defined, and it will be initialized at 0. e. Lagged variaoles from periods before the planning horizon are initialized at 0. If an initia value in the INITIAL bound sets oces not satisfy the bounds in the bound set that is selected for the particular optimization, the initial value is moved to the nearest bound. It is possible to have different sets of initial values -in the inpu deck. The initial values are entered in a bound set with a name starting witn INIT using the same rules as for the INITIAL bound -t. The actual INIT;X'XX set to be used can be defined in the control program. 3.7 RANGES-section . constraint of the type lit < g (x xt , ..., t) < uJ.t can be specified in the RANGES-sect- . The value of either it or u it as well as one of the inequalities must be defined in the ROWS-section, and the value of rit = u - lit is defined in the RANGES section. If bit is the value defined fcr the row in the RHS-section the final constraint will be as f ollows: -13 - row type G: bit g, (t,x) it rt row type L: bi - r g. ... t) - bt The first card in the RANGES-section is tne RANGES-card with the following format. Column 1-6: RANGES More rance-vectors, i.e. r. - vectors, can ce -.ntered. The parti- it cular range-vector to be used in the optimization is defined in the control program. All range-vectors are entered in a format similar to the format of the COLUMNS- ana ROWS-sections, and as before each range-vector must be finished before the next is started. The exact format is: Field 2: Name of the range vector, an 8 character name. Field 3: Rowname, 8 characters. Field 4: RANGE-indicator. Field 5: Rowname or blank. Field 6: RANGE-indicator if field .5 is-nonblank. The RANGE-indicator gives the value of r in the usual way: A time independent r is entered directly while a time-cependent r is indi- cated by the 9999.-indicator with the actual time series cata entered in the SERIES section. 3.8 ENDATA-card The file with the structural information, tne MODEL-file, must always end with an ENOATA-card with the format: Column 1-6: ENDATA - 14 - 3.9 ERRORS The coce test for inconsiste.cies in the inout and prints an error message if something is wrong. in the cases wnere it is possible to recover simply by deleting the wrong data element the errors are counted as minor errors, and it will be possible to continue after a MODEL-file with minor errors. If there are more serious errors, courted as major errors, it is generally not possible to continue. However, an exception are major errors in RHS-, BOUND-, or RANGE-sets. The erroneous sat is deleted, but the job can continue as long as the deleted set is not used :o define the actual optimization problem. 4. Time Deoendent Information - The SERIES-FilE The structural description of the probiem in the MPO0EL-file is inde- pendent of the number of time periods in the optimization problem. Before the actual optimization can be initialized we will have to aefine the optimization time periods and enter data for the time series in the model. The time period information is entered in the control program, and -he time series are entered via the SERIES file. The SERIES File consists like the MCCEL-file of sections: SERIES- card, COLUMNS-section, LAGS-sections, RMS-section, SOUNDS-section, RANGES- section, and ENDATA-card. All except the SERIES and ENDATA cards are optional but if they appear their relative order must be as in the MODEL-file. In each section data can be entered for the entries a were defined by the 9999.- indicator in the MO0EL-file. 4.1 SERIES-card The SERIES-card must always be the firs- card in the time series input deck. The format is as the :IODEL-card in t.e MODEL-file. - 15 - 11.2 COLU-NS-section f a COLUMNS-section is present it must start with a COLUMNS-card as in the MCODEL-file. For each 9999.-indicccor in the columns-section a time series can be entered, but it is not required. See section 5 for a cescription of how the relations are between the FORTRAN subroutine describing tne nonlinearities and the data supplied in the time series data section. :ach time series must be defined by a header card with the following format: Column 5-12: column name, 8 characters. Column 15-22: row name, 3 characters. Column 25-36: first time period in the time series, an integer written with a decimal point. Column 37-48: last time period in the time series, an integer written with a decimal point. The time se-ies must cover the whole optimization period but it is valid to enter a time series that covers a longer period both before and/or after the optimization period. Thus, it is possible to write one SERIES file.and use it for optimizations over different time periods. T he time series itself is entered on subsequent cards using a (4F18.10) format. 7he relative order of the time series must be the same as the order of the 9999.-entries in the MPS-file. 4.3 LAGS-sections If one or more LAGS-sections are present they must all start with a LAGS-caro as in the MODEL-file. The LAGS-sections must be entered with increasing lag number. The time series in these sections are also used to 16 enter data for the 9999.-indicators, and as in the COLUMNS-section it is not required to enter time series for all 9999.-indicators, but the :ir-e cleries that are actually entered must be in the same relative order as the 9999.s in the MPS-file. Each time series must be defined by a header card with the same format as in the COLUMNS-section, and the series are then written in (4F13.10) format on subsequent cards. The definition of the time periods in connection with lagged derivatives is as follows: Let s be the lag number. The derivative of a row in period t with respect to a variable in perioo t-s is assignes to period t, i.e. to the period of the row or constraint. If the optimi- zation is performed from period ti to t2 inclusive the time series must at least contain the derivatives from perioc tI to t2 inclusive. 4.4 RHS-section If the right hand side that is going to be used in the optimiza- tion contains any 9999.-indicators, the time series must be supplied in the RHS-section of the SERIES-file. The RHS-section is started by a RHS-card iith the same format as in the MODEL-file. The right hand sides must be i:entioned in the same orcer as in the MODEL-file although not all right hand sides need..to be mentioned, and within each right hand side the time series must be supplied in tne same order as in the RHS-section of the MPS-file. If one 9999.-indicator in a right hand side is entered all time series in this right hand side must be entered. Each time series must be defined by a header card with a format similar to the header card in the COLUMNS- and LAGS-sections: Column 5-12: right hand side name, 3 characters Column 15-22: row name, 8 characters Column 25-36: first time period in tne time series, an integer written with a decimal point Column 37-4: last time period in the time series, in integer written with a decimal point The time series itself is entered in (4F18.10) format innediately following the header card. The time series must at least cover the whole optimization per-od. I.5 OUNDS-section If the bcund set or I"IT-bound set that is going to te usea in the optimization contains any 9999.-indicators the time series must oe supplied in tne EOUNDS-section of the SERIES-file. The BOUNDS-section is started by a 3CUNDCS-card witn the same format as in the MODEL-file. Tne bound sets must be mentioned in the same order as in :te MPS- file although it is not necessary to mention all bound sets. Within each bound set the time series must be entered in the same order as in the BOUNDS- section of the MPS-file. If a bound set is mentioned, all -tme series indi- cated by the 9999.-indicator in the bound set must be entered. Each time series must be aefined :y a header card with ':he followinne format: Column 5-12: Bound set name, 8 characters Column 15-22: Column name, 8 characters Column 25-36: First time period in the series, an integer written with a decimal point Column 37-48: Last time period in the series, an integer written with a decimal point The time series itself is entered in (4F18. 10) format immediately following the header card. For ordinary bound sets the time series must cover the whole planning period. For initial value bound sets the time series must at least cover the laggec values that are used in the model. Else the series can cover the whole, the first par: of or none of the optimization period. a.5 RANGES-section The rules for the ranges is similar to the rules for the bounds: if tne range set that is used in the optimization concains a 9999.-indi:azor the corresponding time series must be supplied in the RANGES-section of tne SERIES-file. The RANGES-section is started by a RANGES-card with the format described for the MODEL-fil!. Range sets must be mentioned in the same orcer as in the MODEL-file, but some of them can be left out. Within each range set the time series must be entered in the same order as in the RANGES-section of the MODEL-file. "f a range set is mentioned all time series in the set must be supplied. The header card for the time series has the format: Column 5-12: Range set name, 8 characters Column 15-22: Row name, 3 characters Column 25-36: First time period in the time series, an integer written with a decimal point Column 37-48: Last time period in the time series, an integer written with a decimal point The series itself follows the header card and is entered in (-13.10) format. - TO - ..7 ENDATA-card Like the :00EL-file the SERIES-file must always end with a card witn ENDATA punched in columns I to 6. 4.3 ERRORS The code tests for many tyoes of errors in The inout and if some- thing wrong is founc an error message is printed. In :hc cases where it is possible to recover simply by deleting the data element with the error the errors are counted as minor errors, and it will be poSsile to continue after a SERIES-file when minor errors have been read. After encountering more serious errors, counted as major errors, it is generally not possible to continue. -owever, as with the !OEL-file there is an exceotion with major errors in RHS-, BOUND-, or RANGE-sets. Again the errcneous sets are deleted and the job can continue as long as the deleted sets are not used later on. After reacing a SERIES-file with non-recoverable major errors tne MODEL-file eill still be ready so it is possible to start reading a new SERIES-file. 5. The Nonlinear Functions All nonlinearities must be supplied by the user through a subroutine called FCOMP, that can compute the numerical values of the nonlinear expres- sions and possibly also their nonzero derivatives. The first cards in the FCOMP subroutine should be: SUBROUTINE FCOMP (X,G) DIMENSION X(*), G(**) where * and ** should be replaced by the largest inex of a variable or of an expression, respectively, or simply by 1. A coroon block with the name CRUSE1 can be included as the third line in FCCMP: - 20 - COMMON/CRUSE1/NROW, NCOL, NCALL, IPROB, ITTIE, IERR ,he first five variables in CRUSE1 are input variables to FCOMP and they should never be changed. The content of the variables is as follows: NRCW - the largest index of a nonlinear function and the dimension of G. NCOL - the largest index of a nonlinear variaole and the dimension of X. CALL - the number of times FCOVP has been called including this time. If the problem is changed, e.g., because a new objective is defined, NCALL starts from 1 again. This variable can be used by the user to control input to or output from FCOMP. In the CDC- version input can be read from TAPE7 and output can be written to TAPE6 = OUTPUT. I?ROB - a cell that the user .an set in the control program. It can be used to dist-nguish different model versions tnat are all included in one FCOMP subroutine. ITIME - the number of the time period for which the nonlinear expressions should be computed. IERR - a cell through which the user can report to the optimization code that something is wrong. It is initially set to zero, and if the user sets it to a nonzero value the optimization will stop immediately. It should be mentioned, that FCOMP can call other user supplied subroutines, and it can store data in labelled commonblocks. In order to avoid duplicate common block names the user should avoid names starting with C - 21 - A row or expression is definec to be nonlinear if it contains at least one 99999.- or 999999.-entry in either the COLUMNS- or one of the LAGS-sections of the MODEL-file, and a column or variable is defined to be nonlinear if the MODEL-file contains at least one 99999.- or 999999.-entry in the column in the COLUMNS- or one of the LAGS-sections. All 9999.-entries in the COLUMNS- or LAGS-sections that are not replaced by actual time series during input of the SERIES-file should be treated in the FCOMP-subroutine and in the following definitions as if the entries had been 99999.-entries, i.e. the variable is assumed to enter nonlinearly in the expression. The subroutine FCOMP is only concerned with the nonlinear parts of the expressions. The nonlinear part of the expression in a certain row is the part of the tctal expression that depends on all the variables that enters nonlinearly in the row. I.e. if x. enters as 3 * x. + x2 both 3 * x. 2 i1 1 I and x. are part of tie nonlinear expression, and if a derivative is supplied it must be coded as 3 + 2 * x 1. If x. also enters lagged but linearly, the lagged xi-part is not a part of the nonlinear expression. The values of the current nonlinear variables are supplied to FCOMP through the vector X(*) that is the first argument of FCOMP. X(ICOL) contains the value of the variable (column) that was definea to have no ICOL in the bound set named VARIABLE. X will only be defined for values of ,COL mentioned in the VARIABLE bound set. If no VARIABLE bound set was supplied X(ICOL) will contain the value of the ICOLth column in the COLUMNS-section of the MODEL-file. Lagged values of the nonlinear variables are supplied to FCOMP through the systems function XLAG (ICOL,:LAG). ICOL is the column number as defined above and ILAG is the number of lags. ILAG must be positive. - 22 - The values of the nonlinear expressions are returned through the vector S(*) that is the second argument of FCOMP. The nonlinear expressions are referenced through row numbers. Expression no. IROW corresponds to the row that was defined to have no. IROW in the right hand side named FUNCTION. If no FUNCTION right hand side was supplied, expression IROW corresponos to the TROW'th row in the ROWS-section of the IMPS-file. It is possible also to supply partial derivatives of the nonlinear expressions to the optimization code. However, the description must wait for a later version of the manual. - 23 - Taole 1: Differences between standard MPS-format and CONOPT-for-at Item MPS (e.c. APEX or MPSX) CONOPT-fornat 1. Names Leading blanks are ignored, he wnole 8-character string enedded olanks are sometimes is used as the name. Blanks allowed. are not recognized. 2. Linear combinat.on rows Sometimes accetec. Not allowea. 3. iarkers Acceptaole. "lot allowed. 4. Ti,ie series indicator Not aoplicabie. 9999.- or an alternative indicator is recognized. 5. Nonconstant coefficients Not aoplicacle. 99999.- ano 999999.- or alternative inaicators are recogni zed. 6. = IC' -N rhs Not aoplicao)e. Optional. 7. VARIABLE' bna Not applicaole. ODtioal. 8. INITIAL brd Not applicable. Optional. Can ae located anywhere in the 3OUNGS- section. 9. INITXXXX ond Not aoplicabte. Optional. 10. RANGES Range valuEs can De negative. Range values must be Ranges cai :e aoplied to equal- positive. Ranges can ities. only be applied to inequalities. 11. Coefficient values If :here is no decimal point Standard FORTRAN Fl2.0 one is assumed in the first format is used. I.e. blank position after the number. if there is no cecimal E-fornat is sometimes accepted. point one is assumed after the first 6 posi- tions in the field. E-format with rig ht justified exponent is accepted. - 24 - c. The --ntrol Language The control language used for CONOPT is very similar to the control languz,e used in APEX-III, especially in the way the flcw of control is managed. Therefore, users that are familiar with APEX can look at Table 2 and proceed to sectici 6.5. 6.1 General Format of Control Statements All control cards are divided into 7 fields that are used as follows: Field 1 in column 1 to 10 is either blank or contains a label for the control card. All labels must be unique. Field 2 in column 11 to 20 is used for the verb that describes the instr-ction to be performed. Field 3 to 7 in column 20 to 30, 31 to 40 etc. up to 61 to 70 are used for parameter 1 through parameter 5. If more parameters are needed they are written on thE following card with both label and verb fields blank. The position of the label, verb, and parameters within the 10-character fields is unimportant and blank parameter fields are .ignored.. 6.2 Flow.of Control Most input/output and computational instructions returns on exit a positive integer parameter, LBRANCH, that gives a summary of the result of- the operations. The values returned in LBRANCH are described with the different verbs in Section 6.5. Based on the value of LBRANCH it is possible to jump to different parts of the control program by inserting a BRANCH-verb immediately after the verb that created the LBRANCH value. ine parameters of the BRANCH verb are "abels, and if the value of L3RANCH is i, control is transferred to the control statement with the - 25 - label in parameter i. After the j.'m.p the value of LBRANCH is reset to 1. 'f not all parameter fields are defined by the user the last label will be copied to the rest of the parameter fields such that all large LBRANCH values will give the same jum.i. To jump to the next card it is possible to give tne next card a label and use thie label as a BRANCh parameter. However, an asrerisk (*) in tne parameter field of the BRANCi card is equivalent to this const ruct i on. The second imoortant cntrol verb is EXIT. It is -imply u2d to finish the execution of the control program. The next veros are useful for writing sub-routines ind for loop construction Etc. The first-time user will hardly need them and he can skip to Section 6.3. ?EFCRM is a vert very similar to BRANCH. it transfers control to one of the labels used as parameters on the PERFORM card depending on the value of L3RANCH. The difference is the association with the verb NEXT. When a PERFORM verb is executed and the label is not * the address of the instruction following the PERFORM statement is placed in a stack. When the verb NEXT, that has no parameters, is executea, control is transferred to the instruction in the top of the stack and this instruction is deleted from the stack. PERFORM acts as a call of a subroutine and NEXT is the correspone- ing return jump. The maximum nesting of PERFORM verbs is 10. Conditional branches based on the values of certain CR-cells (see Section 6.4) instead of on the outcome of computational procedures can be set up using the TEST-verb. The first parameter must be the name of a cell, either integer or real , and the second parameter is either the name of a cell or a numerical value. TEST sets the value of LBRANCH to I if the value - 26 - of the call in carameter I is less than parareter 2, L3RANCH is set to 2 if the two values are equal, and it is set to 3 if parameter I is greater than :arameter 2. 7ased on the value of LBRANCH the verbs BRANCH or PERFORM can transfer control to different instructions. 6.3 Default Branches and Default Procedures If the user does not enter a BRANCX-card irnediately after the instruc:ion that created the L3RANCH value, the system will in most cases insert a d=fault BRANCH-card. The labels on tne default BRANCH-cards are cescribed together with the LBRANCH values in Section 6.5. -ne cef:ult BRANCH-cards will in many cases transfer control away from the %ext instructGion if a major or minor error was found or if the opti-izatin for some reason did not give the optimal solution. If the user wants to continue incePendent of the LBRANCH value or with other jumps than the default he must enter an explicit BRANCH verb, e.g. with an asterisk for continue in some of the Paraneter fields. The default branches can have the following labels: MAJERR, MINERR, PROBOUT, and *. Corresponding to'each of these labels there is a deFault rrocecure that is inserted in the control program unless the user defines tne label by writing it on one of his own control cards. The default procedures are currently as follows: Label Verb Par =eter fields MAJER? MESSAGE MAJOR ERRCP - TERMINATION EXIT MI iNER MESSAGE MINOR ERROR - TERM1INATION EXIT PROCUT MESSAGE ON OPTIMAL EXIT 0UTPUT SAVE EXIT - 27 - 3.4 Communication Region Cells and Associated Verbs The detailed operations of the input procedures and the compu- tational procedures can be determined through a number of communication region cells, CR-cells. The names and description of the most important ones can be found in table 2. Almost all cells have default values that are also shown in :he table, and except for some 'ames, e.g. KNSOBJ objective function name) the ootimization can work with only default values. Some of the cells can be changed through two verbs, SET and STEP, that have two parameters. The first parameter is the name of a CR-cell, and the second parameter can either be the name of a cell or a numerical constant. The SET instruction simply replaces the content of the cell in parameter 1 with tne value or the content of the cell in parameter 2. The STEP instruction increases the content of the cell in parameter 1 with the value or the content of the cell in parameter 2. 6.5 !nout/Output and Comoutational Verbs 6.5.1 MODEL The MCCEL-verb is an input verb that asks the system to read the MODEL-file. The verb has one parameter, an alfanumeric string in parameter field 1. The string can be blank. After the MODEL-verb is called the corresponding file is rewound and read until the proper MODEL card is found. If the parameter of the MODEL-verb is blank tne first MODEL-card is selected from the file, and if a non-blank parazieter was supplied the first MODEL card with this name in field 2 (column 15-24) is selected. After the MODEL-card is selected the ROWS, COLUMNS etc. are read until an ENDATA card or until end of file. The L3?.ANCH-values returned by MODEL are: 1 - Successful completion. 2 - 'Major error were found. 3 - Minor errors were found. - 28 - Taule Z. CGlirunication Region Cells :1awe Type meset Uefault Description KNNGU 0 - The name on the MCDEL-card of the selected MODEL-file. Yes &lank The name of tne selectea bound set. AN')lk A Yes MINIMIZE Uirection of optimization (NIN, MINIMIZE, MAX, or MAXIMIZE). KhLR A bc - The name on the SERIES-card of the selected SERIES-file. foijiT A Yes IINITIAL The name of the selected initial bound set. Abboo A Yes ElanK The name of the selected objective function. KiOKhh A Yes blank The name of the selected right hand side. nalh A Yes olank The name of tie selecteo range set. LrLKml i Yes 10 The upper cound on the number of minor error messages from each input section. LFENk2 I Yes It The upper Dound on the number of major error messages frcoa each input section. LiTTEn I Yes 100,CUG The upper Dound on the number of iterations in UPTIMIZE. LiMPS I Yes 0 The upper boLnd on the number of input recoras from each input section of the MODEL-file that are reproduced on the output. LFTSU I Yes 0 As LFHPS for the SERIES-file. LJFLTM I Yes 1 The function ade for the FCOMP subroutine, see Section 5. LufkU I Yes 1 The value of the first period in the opti- mization. Lagged values are prior to this period. L TO I Yes 1 The value cf tne last period in the opti- mi zati on. LJTAB I Yes U Base pericu usec in encodiny the period-code on the FCRTRAN-reaaaole output file. abJAC1 R Yes 9999 Value to inoicate time series elements in the MOUEL-file. RVJAC2 a Tes 99999 Value tc inoicate nonlinear Jacoci eleasents only oepenoiig on laggeo variables. aboa3 R Yes 599559 Value to incicate 6eneral non-linear Jacobi elements. Eplaanation to taule 2: Type: A - Alianuieric, I - lnteer, K - kcdl. Re4et: Yes - tne cell can Le cnan eu in a $ET or STEP instruction. ko - tne cell cannot t)e changed cirectly Dy the user. - 29 - and the default BRANCH-card that is inserted irmediately after the MODEL verb if the user does not supply his own BRANCH card is: BRANCH MAJERR MINERR 6.5.2 SERIES The SERIES-verb is very similar to the MODEL-verb, the only differ- ence being that it reads the SERIES file. The file is again rewound before reading and the verb has one parameter that has the same function as the parameter of the MODEL-verb. Notice that the two CR-cells LJFROM and LJTO should be set before calling SERIES if the default values are not wanted. Also, if a new opti- mization should be performed with the same model but with a different planning period, SERIES must be called again after the change in LJFROM and/or LJTO. The LBRANCH values and the def. ult BRANCH-card are the same as for MODEL. 6.5.3 OPTIMIZE The OPTIMIZE-verb takes care of the optimization including the search for a first feasible solution and the proper setting up of the problem. The verb has no parameters. For the setup some of the CR-cells are needed. First of all the names KNSOBJ, KNSRHS, KNSBND, KNSRNG, KNSINT, and KNSDIR. If no objective name, KNSOBJ, is supplied only a feasible solution will be searched. The default blank names for KNSRHS, KNSBND, and KNSRNG correspond to an all - 30 - zero right hand side, a bound set of greater than or equal to zero bounds on all variables, and a range set without any ranges. The default initial value bound set, KNSINT, is INITIAL, and the default optimization direction, KNSDIR, is MINIMIZE. The number of iterations performed including both iterations in the search for a feasible solution and in the optimization is limited by the CR- cell LFITER with a default value of 100,000. LFITER can be reset in a SET or a STEP Instruction. The LBRANCH values returned by OPTIMIZE are: 1. Optimal solution. 2. Major error. 3. No feasible solution can be found. 4. Iteration count greater than or equal to LFITER. 5. Convergence too slow. 6. No change in objertive even though the reduced gradient is greater than the tolerance. 7. Time limit reached. 8. A feasible solution is found but no objective was supplied. 9. There is not sufficient core to continue. And the default BRANCH-card that is inserted unless the user writes his own is BRANCH * MAJERR PROBOUT If the LBRANCH-value was 4, i.e. if the solution process was stopped prematurely, calling the OPTIMIZE verb again will continue the optimization exactly as if there had been no interrupt. Notice that the iteration count - 31 - continues so LFITER should be reset before OPTIMIZE is called again. Other CR-cells that have to do with output can also be reset between the two OPTIMIZE verbs, and the OUTPUT verb (see 6.5.4.) can be called without destroying the status of the solution. Calling OPTIMIZE again after one of the other L3RANCH values causes a major error. If some of the problem-defining cells such as the name cells KNSOBJ, KNSRHS etc. are changed then the problem will be set up again at the next call to OPTIMIZE, and the solution process is started from the beginning again. If the time horizon is changed through a -esetting of LJFROM or LJTO the user must call SERIES again before OPTIAIZE. 6.5.4 OUTPUT The OUTPUT verb produces an MPS-like listing of the current solu- tion. A detailed description is found in section 7.5. In addition, a spe- cial FORTRAN-readable solution file in APEX-ill compatible format for further processing in report-generators (TABGEN) can be requested. The following options are available: OUTPUT FULL full MPS-like cutput FULL/SPEC full MPS-like iutput and special file SPECIAL special file only blank full MPS-like output Further details on the special FORTRAN-readable file ire Quen in Appendi> If output is called before a feasible solutio.. nas been found only the feasible periods and the current period are printed. - 32 - The MESSAGE vero is used to print a string on :he solution output. ine orternt of the 5 parai.eter fielas is simply printed as a 50 character striny at the i.;oment the MESSAGE verb is executed. The purpose of the SAVE verb is to save the current solution at a file with the necessary inforiation to make a r!start. The actual pro- cecure anc corresponaing restart procedure are not imiplemented yet. 0.$.7 kI TE The IkT'E vero writes a part of the current solution on the local fle IkT. nITE can have one paraineter with the three possible values MODEL, :E.mIES, anc TSP. If no parameter is specifieo, SERIES is assumed. WRITE c-n uni., oe callea after an OPTIMIZE verb has been executed. 'ARITE vCiEL writes a moGified MOLEL file. Only the currently selectea risnt hano sice, boune set, initial bound set, and range set will be included in tne hUuEL file, ano iii the initial bouna set all variables will be present as type FX witn a 9999.- incication. AKITE SERIES writes a -mocifieo SERIES file. Again, only the currently ,electeo ri,ht hano siGe, bound set, initial bound set, and range set will be incluceG, ano in the initial 0cun set all variables will be representea by fll tire series. The LJFRM and LJTO cells should not be changed between the execution of GPTIHIZE ano WRITE SERIES. The length of the time series on file mT will correspond to the optimiization perico including the necessary lagyeu variaoles. - 33 - RITE TP produces a file with the current solution values that can ue entereG Girectly into TSP. (InRITE MODEL ana WRITE TSP have not been imple- m,nteG yet.) The output from the WRITE or WRITE SERIES verb can be used for re- starts. Nutice, rowever, that all variaoles are present as time series in une initial bouna set. If they are not referenced by 9999.- indicators in the N0OuEL file a rinor error will result ano the initial values will not oe usCC. Also, right hand sides, oounG sets, initial bound sets, ano range sets tnat v.ere not selectea in the previous optimization will not be part of the new bEIES file, so if tney are referenced by 9999.s in the MODEL file a minor error will result. Tne coming WRITE MOCEL verb will create a MODEL file that can be useo Girectl1. 7. Groiriary Out:1uat Apart froi the FOkTRAN cuipilers listing of the FCCMP suorcutine the orainary output froi. CONOPT can oe aiviaea into 5 groups, each of which are GoescriDe in the followin6: 7.1 Control Protrain Listing The first p.art of tie output is a listing of the control ,program that is useo to control the order of the computaticns and the setting of 0lfferent cells. The control program contains both the control carcs aefinea Dy the user ana default branch cards after the computational pro- ceoures if a oranch caru was not suppliec by the user. Also default action Tor ininor ara najor errors is aded if it is not Gefinec by the user. All carcs are assigneo a number in the control program listing, and this number will be useo in later references. - 34 - The control caras usea with the example in Section 8 are shown in Fi6. 3, anG the correspcncing control prograia listing is shown in Fig. 4. 7.Z 'xecution Information Tne execution of tne control program can be followed closely on the cu:,ut. Each tie a line is executec the number of the line, the vero of tne line ana tne parameters are printed. In case of a BRANCH-verb -re value of tne oranci parameter LBRANCh is also printea. 7.3 uutLut from -OUEL ana SERIES The cefault output fra, the input verbs MODEL and SERIES is a listing of tne section cards (MODEL, ROWS, COLUMNS, etc.) with the card numb,Ler, error tessages for any errors found within a default limit of 10 wincr errLrh ano 10 major errors for each input section, and a summary of tne nuinoer cf errors in eacn section. The limit on the number of error inessa.,es is storea in LFERR1 ana LFERR2 for minor ana major errors respectivel1, and they can be changed by the SET-verb. it is possiole also to get a listing of the ordinary input cards. Tne user cell LF'PS with cefault value 0 gives an upper bound on the nuintr of recoros listeG froii each section of the MODEL-file, ano the user cell LFTSU has the same purpose for the SERIES-file. Notice, the listing of Lne input is not an exact reprocuction of the input cards but a listing of th- Gata as they are interpreted Dy the input routines. 7.4 Uutput froi, OPTIMIZE The output from OPTIiIZE will be explained through an example. The iteraticn output fro OPTIMIZE corresponding to the example in section 8 is - 35 - shown in Fig. 5 and 6. Fig. 5 shows the first phase of the optimization where we search for a feasible solution. The search is done period by period, and the numbers in the output listing have the following meaning (the explanation is a little technical and the user without interest in the methodology can jump to Section 7.5): PERIOD: The number of the period in wnich we search for a feasible solution. All earlier periods are already feasible, or they are not part of the optimization. PHASE: The search uses three different algorithms with decreasing speed but with increasing reliability: 1: - We use a Newton-type algorithm within the current time period, keeping lagged variables fixed. The basic variaoles are if possible chosen away from the bounds, and if there is more freedom left, a nearly triangular basis is chosen. 2: - If Newton is not successful, which mainly will be the ?,e if there are not enough variables away from bounds to choose as basic variables, a gradient and conjugate gradient search is tried, again keeping lagged variables fixed. 3: - If both the Newton and the gradient search fails, the lagged variables will also have to be chanqed. This is done in phase 3. We iterate in an optimization problem with the sun of squared infeasibilities in the first infeasible period as the objective and with the equations in the earlier feasible periods as constraints, essentially using a reduced gradient algorithm. -36- U,PThI' L STEPL.NGTH: This is the steplenSth, either in the Niwton-direction kpnase 1) or in tne graoient or reduced rraoient cirection ( hase 2 or 3), tnat was Tounu to 6ive the smallest suin of squared infeasibilities. Ir. the Newton alsorithin an initial steplength of 1 is tried. In the gracient searcn tne initial rate 6f cnan e of the vector of infeasibilities is com- juteo ano oasec on tnis an initial steplength is estimatea. N*AXL STEPLEiGTh: Tne largest steplength that woula keep all variables witnin the uouas. In Newton the r.axinal steplength is never assumec to be larger tnan 1. 5UM UF SQUARED INFEASIILITIES: Tne sun. of the squared residials or infeasi- :jilities in tne first infeasiole period after tne iteration has been finished The lines witncut an iteration numoer simply print the initial value of the sui, of squarec resil.LaS refore any searc is perfornea. ohLLS UF -CurP: This nuiicer counts the total number of calls of the user- sLuroutine F'.UMP Lurink tne iteraticn incluaing tne calls *see to corpute the nonlinear partldl cerivatives of tne constraints. CHANGE OLUMNS: This nurber is only printeG in pnase 2 and 3. In phase 2 it counts the nurner of variables that are"not restrictea by a bound in the initial point of the search, or in otner words the number of variables uetdeen Douncs during the search. In phase 3 it is the number of super- oasics in the earlier feasiole perioas plus the number of unconstrainea variaoles in the first infeasiole period. COJ. GrkU. A logical variaole that is true if a conjugate search is used. Tnis is the case if the changing variables are the same as in the last iteration. - 37 - 0n Fly. u is shown the oroinary iteration output curing tne -ptimization, also for the exam,ple in Section 8. The output is civicec into 6 categories for the inversion, the superbasis, the one dimensional search, the reduced graciient, tne tolerances, ano the oojective function. The explanation of rie nuiicers is: tNVERSiU'i: S-: Tne nu.ber of oasis changes from last iter!tion -cuted as the number of new nonasic variables. zPj: Tne numoer of spike columns usec to represent the inverse oasis matrix for cll time periods. SPE: Tne nuruer of nonzero elements in tne spike columns. PbP: Tne nurcer of pivots between periocs, i.e. the number cf times it was not possiole to cr ose a basic variable for a row from the time period of the row. LFC: The number of calls of FCCMP used to cmpute the nonlinear derivatives of tne constraints. SUPEkbAS IS: LS: Tne nui.,oer of superoasic variables usec d.ring the iteration. BS: Tne nui,ber of the variaules entering the superbasis in the iteration if anY. ** incicates that aore than one variable were acceG to the super- Dasis curing tne iteration. -Ab: Tne number of the variables leaving the superbasis curing the iteration if any. The nurber of the variaole here anG in + S8 corresponos to the nu6.uer usea in the solution output. - 38 - UiLINEkSI0NP-L SLAkCh: STP: The nunber of oifferent steplenytns that were tried in tre onecilinen- sional search. LFC: Tne nua.Ler of calls of FCCMP used during the onedimensional search in the Newton suoroutine to check for feasibility and to return to the reasiole surface. L-U?T: The final steplenSth in the search. Values in the order of nanituce of 1 indicates a well-scaled and well-behaved problem. rAX: k loiycal variaole tnat is true (T) the onedimensionai searcn was actively constrained oy a ocuno on one of the oasic cr superoasic variales. uK: : loyical varlaole tnat is false (F) if something goes wrong in the oneoimensional searcn, especially if there are problems with tne convergence of tne Newton alsorith.. L-K-GRA: Gives the 1enS:A (Euclician norm) of the part of the reduced racient rnat corresponds to the supereasic variables including any super- Dasics accea curing the iteration. L- X:. The lengtn of the change vector for the super-basics, also including arj suPerUaSICS aGG curing the iteration. CF/DL: The initial rate of change of the oDjective function along the search Girectiun. H-CUNb: m lower irouna on the condition number of the estimated hesssian of tne recoLce oujective function com,putec as the square of the ratio of the largest to smallest ciayonal element in the Cholesky factorization of the hessian esti.;atE. LarSe numcers can inaicatec that the proolen is badly - 39 - OuELT: In the ;iewtcn iterat-ons, where we restore feasibi ity after some variables have oeen changea, tne error in the oujective due to errors in the constraints is coputea as the scalar prcauct of toe resicuals ana the La,rarne .uItipliers. Wuring the onecimersinal search this est,imate of the error is requirea to -e iess tnan the numDer shown. In the line printed when tne opti;,tal soLution is reachea the number in this column is the actu21 estimate of the error. LunWTx.: The ocuno usea in the Newton iterations on the sum of squared in- teasioilities in one time perioo. ULCTIVE FUiTION: The value of the ooactive at the end of the iteration. 7.5 UL.tput from .UTPUT For a sample ot the output of the solution produced by the verb UUTIUT, see Fi. 7 ina 8 that again refer to the example in Section 8. Tne cutput is diviceo into two parts, one Gescribing the informa- tin tnat has to Go with the constraints, ano one that describes the variaoles. The first infor,ation printea on the tcp of each page is the status cf the solution. There are five cifferent pcssioilities: GPTIIML: The length of the super%asic part of the reduced gradient is less than the tolerance, or the numtar of superbasic variables is zero with no canciGate to enter the superbasis. tiJERIt-LIATE kCGPTIMAL: A feasible solution has been found ano we are in the pror2ss of improving this solution. - 40 - FINL ,oNUPTIrNL: % feasiole solution has :een found. The iterations have ueen stoppeo, either because the convergence is too slcw or because it was not possiole to find a better solution even though the reauceG gracient was greatEr than the tolerance. I F ik3 L: No fedsiole sclution can be Iouna because a local minimum in tne sum of squarea resicuals was founc. The output will only show tne in:-ial T&asible periods ano the first perioc with infeasicilities. INTE~aml.h uFEiasiLE: NG feasible solution ras been found yet, but the search can cectinue. Again only the initial feasible periods and the first perico witn .,feasibilities is orinted. The secona piece of information is the value of the objective funcion. f :ne status of the solution shows an infeasible solution the value ;rinc2 is :ne sur of squared infeasioiiities in the infeasible period, anu if a feasiDle solution has been founa the value printed is the value of tne ojective cefi-eo uy the user. Tne next line ives the names- frcmn the MOEL ana SERIES cards and the naj.es of the selectea cojective function, rignt hard siae, bounc set, range set, ano tne cirection of the optiiinzaticn. Tht rest of tne page in the CONSTPAIIT section (Fig. 7) is very sili,ilar to orGinary LP-output with an extra column inoicating the tirme perio(o. A few cc,,..ents a probsDly needed: 1. The constraints are cefinec as SL< g.( .) < BU twhere the lower anc upper right hani siaes can L= equal (type EQ), one can ue - or + infinity (type LE or GE), Loth can have - 41 - aosolu.a value infinity (type FR) or they can both De finite but Gifferent ktype RG). The value of g is printea in the KOW ,CTIVITY coluior. and the values of BL ano BU.t in the RhS LOWER ano RHS UPPER columns respectively. . The value in tne :L,CK column is the value u,, definea by g1iX ) + u = 3.t, where B is the right hand side value. t ...t t t 3. Tie value in tne MARGINAL coliin shows the partial cerivative of tne optiial objective function value with respect to Bit, keeping in i.ino tnat cL ano/or BUit moves with Bi if they are not iLitit infinity. 4. iotice tnat t.e value of the objective function in the feasible case is computeG as minus tne sum of the slacks in the objective rows. Therefore, the marginals of the free nonbinding objective rows are always one. 5. Nhen a feasible solution has not yet Deen found the MARGINAL column snows the partial cerivatives of the sum of squared infeasibilities. when tne search is in phase 1 or 2, see-section 7.4, only unlagged variaules anG equations are considered ana the marginals are rot cefinea (LiNDEF) for laQced constraints. The first lines in tne VARIABLES section (see Fig. 8) are the same as in the LGNST'RkINTS section. The rest of the page is again very similar to LP-output with tne aGGitional PERIOD column. The cifferences frcm LP are: 1. The -NbEk printEG in the first column is the numbe- I the variaole usec internally, and it is also the number that is usea in the iteration log to cescribe variaoles entering ana - 42 - leaving the superbasis. The number sometimes jumps between time periocs. The missing numoers correspcnd to slack variables that ire reportea in the CONSTRAINTS section. 2. The STATUS of the variaoles can assume more value than in LP. Apart from LOwER, UPPER, and BASIC we have LAGGED variables, i.e. variaoles from Defore the optimization period that are neeoeu in one or more constraints, and SUPER(-basic) variables, i.e. nonosic variaoles not at a bound. In the search for a feasiule solution there are two more values of the status: CUN)TANT, that is usea for lagged variables not changea in the phase 1 ana 2 procedures for finding a feasible solution, ana ACTIVE, that is used for variables changed in the last gradient search. A last status, UNDEF, is used for all variables just after a feasiole solutiuA has been found and before the opti- mization is started. 3. The G8J. GRADIENT is simply the sum of the derivatives of all the oujective rows lagged properly relative to each other. Variawles frcm outsice the optimization period have an uncefined on,ective yracient (UNDEF). Before a feasible solution has been found the nLmoer printed is the derivative of the sum of squared inTeasl01lities in the infeasible period with respect to the variaole of the line. If we are in phase 1 or 2 of the search for a feasiole solution where laggeo variables are kept constant (status CN&TANT) the objective gradient is undefinea. - 43 - 4. The RED. GRADIENT column gives the reduced gradient. It corre- s,onOs to tie reduced costs in LP ana it can be interpreted in tne sauie way. The sign is chosen such that the reduced gradient value of a variable at a bound corresponds to the partial derivative uf tne opti.al ou-ective function value witn respect to the variable, taKing into account that the constraints should be satisfied, except possiDly tne bounos on this variable. The sign is independent of tne optimization direction. 5. Before a feasible solution is found the RED. GRADIENT values are a little different. In the infeasible period the constraints are not useG ana the reduceG 'racient is equal to the objective gradient. In the earlier feasiule perioGs the reduced gradient is either nut defined, as in phase 1 and 2, or it is the reduced gradient of the sun, of squared infeasiDilities in the infeasible period. 7.6 Testoutput Most of the subroutines in the system contain write statements for testoutput ano the testoutput can ue controled to cover single. subroutines or small groups of suoroutines at different levels of detail. Testuutput is controllea oy corrmunication cells with names starting witn LO. The naies ano the documentation of these cells can ue found in the internal cocumentation of the system in subroutine INITLZ,. All output lines should be more or less self-explanatory as long as the naming conventions mentioned in INITLZ - remeberrbred. The listing of the internal Gocumentation can be inace by a li .le program that follows the system. But oe careful. The occumentation uses over 120 pages. - 44 - Throuyh the use of iteration interrupts, resetting of cells and re- start of the optiwization it is fairly easy to limit the testoutput to certain iterations. o. An Exanple The follCow1ing rOGel is a small n,ocel Gescrioing the pricing problem of the GPEC countries if tiey want to maximize discounted profits from their oil reserves. The n,oael is taken from R.S. Pindyck, "Gain to Producers frcm tne Lartelization of Exnaustiole Resources" in Review of Economics ana starietics, vol. to, p. 238-251. Only the equations of the mocel and the necessary data will De given. For further explantation, see the original paper. Variaoles: Tf, - the total demana for oil on the world market in year t in billion oarrels (ob). Jt - the supply froin non-OPEC countries in year t (bb). CS - the cuiulative supply from non-OPEC countries to year t inclusive (bb). Kt - tne amount of oil supplied by OPEC countries in year t (bb). - the reserves of oil in the OPEC countries in the beginning of year t (bo). P - the price char6eG by OPEC countries in year t. This price is supposed to set the world market price. In 1975-dollars/barrel. The aoove names without subscript t will be used as variable or column names in the riODEL-file. - 45 - Data: In 1974 we hao the followinj values for the variab'es: Tu = 18.0, S = b.5, LS = 0.0, 0 = 11.5, and R = 500.0. Equations: Tne names written before the explanation of the equations are the names used as row or equation names in the MODEL-file. TDEQ: Dejand equation of the world marked: TUt = 0.dlTDt 1-0.13 P + 1.0 + 2.3 (1.015)t-1975 C - Tu + U.87TD - 0.13 P = - 1.0-2.3 (1.015)t1975 tLQ: +upply Function for non-OPEC countries: .t 0.?5%- + (O.1P, + 1.1) (1.02) o -CS - t + 0.75 St-1 + (C.1Pt+ 1.1) (1.02) t = 0 LLEQ: kccounting identity tor cumulative supply from non-OPEC countries: t = UC-1 +t or - CSt + CSt-1 + St = 0 ULQ: harket oalance equation: u= T - S or - D, + T - S =0 t t t t t t .EQ: kccountin iuentity for the OPEC reserves: t t-1 - Ut or - Rt + Rt-1 -t = 0 PRUFIT: Cojective function term for year t U (P - 150/k ) (1.05)1974-t - 46 - The MUDEL-input file is shown in Fig. 1. Notice the follcwing: a. The nonlinearities, P ano CS in SEQ and D, P, and R in PROFIT, are all inoicatea uy the 999999.-indicator. All other expressions are linear with time incependent coefficients, ano the coefficients are enterea as in orcinary LP. v. There are 4 laygeo term. They are all declared in the LAGS- section where also the lagnumber of 1 is declarea. c. There are nonlinearities in the SEQ and PROFIT expressions. There- fore, they are oeclared in the FUNCTION right hand side as having inGex 2 and 4 in FCOMP, respectively. c~. TUEQ is tne only equation with a nonzero right hand side. Since the right hand sice is time dependent it is declared with the 9999.- inoicatcor. e. The variaoles CS, D, R, ana P enter nonlinearly somewiere and they are ueclared in the VARIABLE bound set as having indices 1, 6, 4, ano 2 in FLOMP, respectively. Notice that the names appear in the saie oroer as in the column section. f. The CS, K, ana P variaoles enter in nonlinear functions that have singularities in zero. They are therefore given positive lower bounos to avoia nurierical aifficulties. All other variables will by cefault have a lower bouno of zero. s. In orcer to test the influence of initial values two aiifferent bound sets with initial values are declarea. In the control program, we can choose the particular set of inital values. - 47 - n1. In tne IITtA bouna set soie of the variables are GeclareG to be initializea at tne same value in all time perioas. In i,iany cases tne user has sore apriori knowledge of tne order of magnitude of the raocel variables and passing this information can increase the speed ana nunterical stability significantly. Tne SLAIES input file is shown in Fiy. 2. Notice the following: a. A very long time series has been entered in the RHS-section. In the control programri we will ceclare the actual optimization perioo ano the relevant part of the series will be extracted. The aovantage of the long series '* that it can be used for wany runs with cifferent time horizon. v. In the IlTIAL oouno set the time series are entered with only one eleient, the laggeo initial value. This is the minimum amount of information. c. in tne INITA uouna set the time series for CS is simply made up to fit the constant initial S-values. The series for the reserve R is chosen as a geometric series with the quotient known froi 1974 to 75. These initial values make economic sense, ana they can increase the speed significantly- o iotice that the time series are supplied in the same orcer. as the 9999's in the MOCEL-file. The simplest set of control cards that can run the example is shovn in Fig. 3, and the total control program with all oefault branches and cefault lauels interestea is shown in Fig. 4. The iteration output from the exa.ple is shown in Fig. 5 arc 6, ano the print of the optimal solution is snoywn in Fig. 7 anG S. Fig 3 to 8 have all been discussea in Section 7. - 48 - Table 3. Summary of CONOPT - Verbs Vero Parameters Descriotion BRANCH L1 '2 'n jumps to ILBRANCH and sets LBRANCH = 1 CRPRINT cI c2 ... c5 displays current value of one or more CR cells EXIT none terminates CONOPT MESSAGE prints NEXT none returns to verb following the latest PERFORM call PERFORM z L . return-jump to LBRANC and sets 2 n LBRANCH - 1 SET c1 p2 sets c1 to p2 STEP c p2 increments: cI - 2 TEST p1 p2 sets LBRANCH - 1 p1 < p2 2 p p2 3 pl > 2 TIME none prints current resource use MODEL blank/name reads first/name model and sets LBRANCH -1 successful 2 major error 3 minor error OPTIMIZE ncne sets LBRANCH - 1 optimal 2 major error 3 infeasible 4 iteration interrupt 5 convergence too slow 6 no change in objective 7 time limit 8 feasible solution only 9 insufficient core OUTPUT blank generates MPS-like output and/or FORTRAN- FULL readable file FULL/SPEC SPECIAL SERIES blank/name reads first/name series and sets LBRANCH = 1 successful 2 major error 3 minor error WRITE blank generates new series or model file SER IES MOCEL TS? * c. CR cell. p1 = CR cell cr constant. L. . label. - 49 - Table 4. CONOPT-Verbs and their Default BRANCH Labels Vero Default Labels LBRANCH Set BkANCH not applicable 1 CRPkINT not applicaole no EXIT not applicaole no NEb)aGk not applicable no MUGEL * MAJERR NINERR yes EXT not applicaDle no OUTPUT not applicable no UPTIMIZE * MAJERR PROBOUT yes PERFOkei not applicable 1 SERIES * MAJERR MINERR yes SET not applicaole no STEP not applicaole no TEST * yes TIME not applicable no WRITE * MA%JERR MINERR yes Figures Figure 1: Listing of Model File Figure la: FCOMP Subroutine Figure 2: Listing of Series File Figure 3: Control Program Figure 4: Expanded Control Program Figure 5: Iteration Log - Search for a Feasible Solution Figure 6: Zteration Log - Search for Optimal Solution Figure 7: Output of Constraints Section Figure 8: Output of Variables Section 7igure 1: Listing of Model File MOOEL OWEC ROWS E TDEQ 4 PPOFIT E SEQ E CSEQ E DEQ E REQ COLUMNSoE TO TDEQ .t, DEQ S CSEQ +1,0000 nEQ -1,0 CS SEQ 9999990 CSEQ REQ 0 D PRnFIT 999. R PROFIT 99qQQQ. p pQrFIT 9qqqQ. p 3EG QqqQQQ, p TDEQ -0,13 LAGS 1. TO TDEQ 0,87 3 SEI 0,75 CS CSEG 1. R REQ 1,0 RMS FUNCTION PROFIT FUNCTION SEQ 2, RIGHT TOEG ;qq>. BOUNOS LO 8ND CS 0,01 LO BNO R 0,01 LO SNO P 0.01 FX INIJIAL To 9999. FX INITIAL s qqqq, FX INITIAL CS qqq. FX INITIAL 0 qqqq, FX INITIAL R qqqQ· VARIABLE CS 1, VARIABLE D 6, VARIABLE R 4, VARIABLE P 2. FX INITA TO 18,0 FX INITA 3 6,5 FX INITA CS 9999.0 FX INITA 0 11,5 FX INITA R QQQQ.0 FX !NITA 14,0 ENDATý Fi3-a la: FCO1-P Subrout,ne C C EXAMPLE NO I . TwE wCOPOLY CASE OF THE rPEC PROBLEM. C SURnUTINE FCOp(%,Gl REAL G(4),X(b) COmm)ON/CRUSE1/N;GQ*,COL, NCALL,!PROB, I TIME, IERR C C THE NONLINE4R PART OF TwE SUPPLY FUNCTION FUR THE NON-OPEC CUNTRIES, C C C THE ORJECTIVE FUNCTI', C RETURN E #4 Figure 2: Li?ting of Series File ýEQIE3Tsn14TE%T TiH DEq 1975: 20335. *3,3flC00 -3.33as00 •3.361518 -3,Gosco -3.ua1136 -3,77753 U51 C20 -3,552ti3 -3,5QO33 -3,D24747 -3.bb,Q?44 -,709283 -3.la Q22 -3,791t71 *3,833038 -,37553å 3,0kAkh7 -3.,4b217 -a,ooAA3 -a,o'1q87 -a,no77h7 -4.1L;4233 -a,lQ13'7 -4,2302o7 o4,?A7A56 -4,33717Q -a,3A72-- -4,380a0 -4,QaQ%11 .4 5ai5s -a,55083, 4 ,ZQCI1 .4,7037a -4.,759,ab -0.81592 -a,872927 -4,931121 -4,98.596 .5,04q83b -5,110584 -5,1722Q2 -5 23826 -5,2983a8 -5.362e24 -5,428?b6 -5,%u4eQO -5,562110 -5,630Sc2 -5,700m00 -5k770500 -5,802058 -5,91a688 .S,qRRQGQ e -,063235 -6,13Q183 ! t127I o,2q4515 t.373Q33 o.aza5a2 - :o360 INITIAL 7 1q74. 'Q70. 1.8, IwITTAL s 1974. 1974. IN171Au CS 194 197a, 0, INITtÅL 0 1q7a, IQ7a, 11.5 INITIAL q 1974, 1q7G, 500. INITA CS 1 2035, 0; 7, 10; 21. 28, 35, 2, , 56, b3, 7, 77. sat 91,' 98, ICS, 112. 11 , 126, 133, 100, 1a7, 154, 161, 168, 175, 1A2, 189, 196, 203, 210. 217, 22a, 231, 238, 2.5, 252, 259, 26é, 273, 280, 287, 29G, 301, 308. li5, 322, 329, 336, 343, 350, 357, 364, 371, 37%, 385, 392, 394, 406, a13, a20, a27. INI' 1974 203%, 100, o88, L77, 4oo, 5,k Qu4, U35, a25, 415, job, 3Qk, 387, 378, 3b9, 36i, 353, 345, 337, 329, 321, 31a, 307, 300, 23, 286, 279, 273, 267, 261, 255, 2aq, 2r3, 2371 232, 227, 221, 216, 211, 207, 202, 197, 193, 188, 18a. 180, 175, 171, le7, 16a, to, 156, 153. 1aq, ia, 1a2, 136, 133, 130, 12a, ENDATA FigUre 3: Contrl Program ,4ODEL SET LJE98 oT SET -jTJ JQTQ SEPTES SET (NSRwS QIGHT SET QrjanUT -ESSAGE ICN QPTI-AL EXIT (DEFAULT 20 nU'PUT (EF AULT 21 SAVE (OFAULT 22 EXIT (DEFAULT 0 EPROq(S) rw CONTROL pqOr.'RAM (SIZE= 12a1, Figure 5: Iteration Log - Search for a Feasible Solution SEARCH FO A FEASIiLE SOLUTION I7ERA- OPTIAL MAXT4AL SUM OV SnUARED CALLS CHANGE CONJ. TION PERIOD PHASE STEPLENGTH STEPLENGTH INFEASIBILITIES OF FCOwP CULUMNS GPAD, 1975 2,5o38Saa7E*+05 1 1 1q75 1 ol 0. 2.5o3851ia7E*05 2 1975 2 p.021E-o1 1.1863r+07 a,807297833E*04 1 7 F 3 1q75 ! 1,0OOOE+00 1.0000E+00 2,888Q158u3E-08 5 I975 2,01701i175E*02 2 a 17b I 1,0N0OE-OA 1.0000F+00 2,17 bUQ97 -08 5 !'77 1,a7b13a8b6E0oo 2 5 lq77 1,0000E00 1.OOoOE000 1,50167'8E.-13 5 1978 1,11l776oa2Eoo 2 6 0978 1 1,0000E.o0 1.oooE+oo b,1a2u89a3E-i 5 197Q 8,627761sb7L-01 7 7 f7Q ! .3n00E*oo 1.0000r+o 2,u25oo81E.jE ** FEASBL SLUTIC4, VA._UE nF iiJECTIVF = t,3896j4ba4E+oi Figure 6: Iteration Log - Search for Optimtal Solution ITE A. (NVFWSIVN StIPERHA91S nNEIMENSIUNAL SEANCH NEIUCED GPADIENT IULtRåNLS OHJEC1IVt TION RICH SPC SPE PBp CFC rS. 3 5m 1 -Sa STP CFC L-OPT HAX OK L-N-GRA L-DX DF/OL H-COND ljIJi CT, CONSTR, fur.CT10(4 8 5 5 5 ?o 5 oh* 10 om 1.12Eo00 F T 2.851*0a 2.85E+01 8.11E*02 1.Ef00 1,4t-05 6.01-06 4,ncIO17587EI02 9 0 s 15 0 >0 5 2 18 3.29E*00 F T 2.27Ef00 2.27t*00 5,141400 1,+00 5,1t-03 b,0-O0 4,1-bblbb17L*2 10 0 5 15 0 20 5 2 17 3.72E*00 F T 4,0IL.01 4,08E.01 1.62[-01 3,F00 &,b-04 6,0E-06 4,7y9634134t*u2 11 0 5 15 o 20 5 3 25 2,92E+00 F T 4.251.02 4,67E«02 1,89E-03 3,f+00 1.9E-ob ö,0-06 4,7'96ö106U(2 12 0 5 15 0 20 5 2 12 1,52E*00 F T 3.04-02 4,82E-02 1,21[-03 3,E*00 1.2E-06 6,O-b0 4,749b70M541*02 13 0 5 15 0 20 5 3 26 3.92E+00 F T 1.59E.03 1.67C-03 2,60k-06 3,f#00 2.6E-09 6.0t-06 4.79b709005t*02 10 0 5 15 0 >0 5 1 6 1,00E*00 F T 6.66[-04 1.53E-03 8.87E-07 1,1*00 2,3F-09 6,OE-06 4,149b709101+02 15 0 5 15 0 20 5 2 10 1.00E*00 F T 8,07E-05 291IE-04 1,481-08 2,100 2,3E.09 6,0.E-06 4.7u9b7091002 16 0 5 15 0 20 5 7.04EC07 2,30E-06 1,47t-12 2,1#00 4,7E-10 6,0E.06 m,749ö70910t*02 * OPTIMAL SOLUTION. THL LENGTH OF THE REDUCEO GRADIENT 13 LESS THAN THE TOLERANCE, *** LINE 12 8RANCH WITH LORANCH a i ** LINE 13 OUTPJJT Figure 7: Output tof Cotnutraintti Seetløn C 0 N S T Ný A I N T 5 SOLUTION STATUSI OPIlmAL VALUE Uk OBJICTIVt «74,96709 M00LalPrC SEWIr3ZTSOINitST OBJOPRØFIT RHScRIGHT BNDaONO RNGu oIRzp4AXIHIif NUMBER NAME PFNID TYPI STATUS RON ACTIVITY SLACK RHS LOWER RHS uPPtw MARGI1AL i infl 1975 to BINDING -3,30000 , .3,30000 -31,30000 .47,20544 2 PROFIT 1975 FR SLACK 120,57020 -120.57020 -INF #INk -1.00000 obJ I 5t0 1975 EG BINOING i i 0 4 CSF0 1975 r0 BINDING , % Otn 1975 EG BINDING -..101071 b Rin l975 r0 BINnING .?0380 7 10i li 197b tfu BINDING 1140339>0 .3:33450 040,45171 å PkUVlI 1976 F9 SLAri8 95 92026 I95,92026 -NF ,1Ný .1,00000 flUJ q Sin 1916 10 KINDING 3405.% 10 cSriå 1976 Fø INDING ti ntn 1976 EG bINDING. I i 12 Rt0 1976 EG BINDING, -.02809 lI 1lFo 1977 EG BINDING -3.36952 .3,3h952 :.3,952 så44Id5 14 PNFIT 1977 FR SLACK 88,58376 ø88.18376 -INi ØINF -1.00000 (di> IS Stn 1977 F0 BIiDING 28.60929 16 CSlr 1977 r0 I1INDING .,4966b 17 Oto l977 t0 AINØI NG j.•0Q?2l I8 Rio 1977 ko HINDING -,0191% I9 TOFo 197b [u HINDING -3 5 40506 .1:40506 .?7,15207 20 PROFIT 1978 FR SLACK 88,85264 -88,85264 -INF *INd -1,00000 0lbJ 21 Stil 1978 to BINDING ?4'6652å 2? cSfa 1978 fø BINDING -,1450 21 Din [978 EG BINDING 5 24 Rio 1978 F0 BINOING -.01112 25 IDF0 1979 E0 BINDING -3.4i4114 .3,44114 3.44114 .1704644 26 PunFIT [979 FN SLACK 81,04024 -81,04024 -INF *Nk -_1.00000 Ob 27 Stn 1979 E0 RINDING >10.90642 2f CSFQ 1979 et BINDING -.14202 29 nto 1979 E0 BINDING .17,04844 3o RIO 1979 E0 BINDING -.00439 Figure 8: 0utp>ut of VarIables Section V Å R l A 8 L E 3 SOLUTION STATUSI OPTImAL VALUE OF OBJLCTIVL ' 474,967n9 MODELOPEC SRIESZTSDINTfST OøJvpROFjT Rl5zRIGHT ONDcNNO RNGr DINgMAXIMIZ NUMBER NAME PFRInD TYPE 3TATøS VAR ACTIVITY OBJ, GRAOIENT BNO LolR BND UPPER RED, GRADIENI ...... . . . . - - .- - - - - - - - - - - - - - - - - - - - - - - TO 1974 rx LAGGED 18,00000 UNDEU 16.00000 18,00000 INDtF 3 1974 fX LAGGfO 6.50000 UNDLF 6,50000 6,50000 UNOEF CS l974 FX LAGGFO , UNDEF e UNOD R 1974 Fx LAGGED 500.00000 UNDEF 500,00000 500,00000 uNDLF l TO 1975 PL RAS!C 17,24902 , ,t4F 2 3 1975 PL BASIC 7,24214 , ti* 3 CS 1975 PL FiASIC 7,24214 , *01000 *INF 4 0 1975 PL BASIC 10,00688 12,0Ma73 , *iNk 5 9 1975 PL BASIC 489,99312 00992 ,01000 #INk å p 1975 PL SoPrR 13,16118 9,53016 ,01000 *1N -2,4th296EL07 8 TO 1976 PL BASIC 16,76574 ,Ø*1Nk 9 3 197! PL RASIC 7,64809 ,Ø*JNk 10 CS 1976 PL BASIC 14,89023 , .01000 +lF 11 0 1976 PL BAsIC 9,11765 10,52028 ,+IN 12 R 1976 PL BASIC 480,87547 .00894 ,01000 *+Nt 13 P 1976 Pi StiPfR 12,1850 8.26998 ,01000 *INF 5,1s5303L-07 15 TO 1977 PL RASIC l6,28250 , + 1y i1 3 1977 PL BASIC 7,97365 , ,IN* 17 CS 1977 pi. fAsIC 22,8638d , ,01000 #INF I5 r '977 o BASIC 8.30885 10.66138 , .INk 19 q 1977 PL RASIC 472.56662 *00804 :01000 #INk 20 P 1977 PL SuPER 12,87090 7,17750 ,01000 *INt 1,2011;-J.07 22 TO 1978 PL RASIC t5.52091 ,INF 2.1 1978 Pt BASIC 8,43031 *INt 24 CS 1978 pL BAS!C 31,29419 . ,01000 *NF 25 0 1978 PL RASIC 7.09060 12,53104 *INt 26 R 1978 PL BASIC 465,47602 ,00o7 ,01000 *IN- 27 P 197d PL SiiPER 15,76864 5,83346 ,01000 +1Ný 1,813529L.07 24 TO 1979 PL BASIC 14,04444 . +6N0 30 S 1979 PL BASIC 9,29211 , ,INF 31 C 1979 PL HAsIC 40,58632 ,01000 *INF 32 0 1979 PL RASIC 4,75231 17,052h3 , *INF 33 R 1979 PL BASIC 460,72371 .00439 ,01000 eINF 14 P 1979 PL SUPER R2,30683 3,72356 ,01000 #INF 3,525235E-07 LINE 14 (X.t1*, :200 CP SECS InTAL TIME FIEt.h LfNGIN a 49472 Cm woRDS (1405008) woRK LENGTH a 829 CM WNRoS APPENDIX Soecial Output File The use of the FULL/SPEC as SPECIAL option with the OUTPUT verb causes the current solution to be written onto a FORTRAN-readable file. The default file name TAPE12 can be changed via the SOL=tfn parameter on the CONOPT call card. If more than one solution is written to the same file, each solution is separated by an end-of-file mark; no file positioning takes place either before or after writing. The CONOPT variable and equation names have to be augmented by a period-code in order to be compatible with standard LP naming conventions. CONOPT uses character positions 9 and 10 (counted from the left) to encode a 2-character base 32 period-code. The characters and their order are A,3,... ,Z,0,1,...,5. The following encoding scheme is usea by default: period code base 0 AA 1 AB 31 A5 32 BA -0 55 -1 54 The code for the base period can be changed with the LJTAB cell (default zero). For example, setting LJTAB to 1975 will associate the code AA with 1975, AB with 1976 and so on. In any event, CONOPT prints a message to indicate the exact encoding scheme used in generating the special file. -2- The format of this file follows the APEX-1i specifications, see Appendix B of the APEX-111 reference manual. The code for the basis status had to be extended to account for super-basic status. Bits 11-10 of the special word (word 7) includes the following types: 00 nonbasic 01 nonbasic at upper bound 10 basic 11 super basic Exampl e: The following example illustrates the use of the special file in connection with TASGEN. The control cards are: OPT. REWIND,TAPE12. TABGEN. 7/8/9 7/8/9 7/8/9 (Matri x> 7/8/9 7/8/9 6/7/8/9 - 3 - Trie expandea control program was: NU4BER ,LABEL., *vERR.,, ,P4RAM1, ,PARAM2, ,PARAM3, ,PARAM14, ,PARAM5, i >4ODEL 2 RRANCW4 MAJEP9 41INERR 3 SET LJFPO1m 1Q75 ( SET LJTn IQ7Q 5 sERIES i RRANCH m MAJERR MINERR 7 SET