Introduction
GRG2 is a FORTRAN program which solves nonlinear problems of the following form:
minimize or maximize gk(x)
subject to 1b(n+i)<gi(x)<ub(n+i) i = 1,2,...,m but i not equal to k (1)
1b(i)<xi<ub(i) i = 1,2,...,n.
In the above problem x is a vector of n real-valued variables. The gi are real-valued functions of x, and may be linear or nonlinear. There are m such functions, one of which is the objective and the others are equality constraints, inequality constraints, or ignored. Upper and lower bounds on the variables are optional and if present are not treated as additional constraint functions but are handled separately.
The program solves problems of this form by the Generalized Reduced Gradient (GRG) algorithm (see references 1-4 for a description and further references). The user is required to prepare a subroutine GCOMP which computes the values of g1,...,gm for any given vector x. The user also provides data specifying the upper and lower bounds as well as other parameters.
GRG2 uses first partial derivatives of each function g1 with respect to each xi variable. These are automatically computed by finite difference approximation (either forward or central differences) unless the user supplies a subroutine PARSH, which evaluates them using formulas or other methods.
GRG2 optimizes using two phases. If the initial point supplied by the user does not satisfy all gi constraints, a phase I optimization is started. The phase I objective function is the sum of the constraint violations plus, optionally, a fraction of the true objective. This optimization terminates either with a message that the problem is infeasible or with a feasible solution. Beware, if an infeasibility message is produced, the program may have become stuck at a local minimum of the phase I objective (or too large a part of the true objective was incorporated), and the problem may actually have feasible solutions. The suggested remedy, if you suspect that this is so, is to choose a different starting point (or reduce the proportion of the true objective) and try again.
Phase II begins with a feasible solution, either found by phase I or with the user provided starting point if it is feasible, and attempts to optimize the objective function provided by the user. It produces a sequence of feasible points, whose objective value never worsens (and usually improves).
There are two ways to use GRG2--through a file interface and as a subroutine. The file interface employs a sequential file consisting of fixed format 80 character records to communicate problem data, and GRG2 parameters and options to GRG2. Solution information is written to an output file or a printer. The file interface is described in sections 5 and 6. The subroutine interface permits GRG2 to be called from a user program, with all input and output (except for specification of the problem functions) passed through the argument list of subroutine GRGSUB. It is described in section 10.
GRG2 will run on any machine which has a FORTRAN compiler and sufficient memory.
2. Installing GRG2 on a Particular Machine
2.1 Machine Dependent Parameters
All computations in GRG2 are performed using double precision arithmetic, and all real variables are declared double precision.
GRG2 uses some parameters whose values depend on the computer being used. These are all set in subroutine INITLZ. When installing GRG2 on any machine, the user should check INITLZ to see that all values defined there are the correct ones for that machine. Incorrect values can cause GRG2 to malfunction.
The parameters a user needs to set in INITLZ are EPS, IWORDI, and IWORDR. EPS is the machine precision, i.e., the largest positive number, e, such that 1 + e = 1 on the machine being used. IWORDR is the number of single precision REAL variables (REAL *4 on byte oriented machines) contained in one word of the Z array (see section 2.2 for an explanation of what Z is). IWORDI is the number of INTEGER variables contained in one word of the Z array. Proper values for most machines are EPS = 1.0D-16, IWORDI =
IWORDR =2.
2.2 Program Structure and Memory Requirements
GRG2 is a modular program consisting of a number of subroutines, communicating by labelled COMMON blocks and argument lists, and a brief MAIN calling program. It can also be called as a subroutine as described in section 10. It has been written to provide the appearance of dynamic memory allocation with all arrays set up as portions of one large main array Z, so that redimensioning of arrays is never required. GRG2 contains about Fortran statements (excluding comments). The object code, with NCORE (see below) set at 7000, requires approximately bytes of core on a PC. The additional memory needed to solve a given problem depends on problem size, as explained below and in section 3.
The following is a listing of the MAIN program:
DOUBLE PRECISION Z(7000)
INTEGER IOIN,IOOUT,IODUMP
COMMON/IOUNIT/IOIN,IOOUT,IODUMP
INTEGER NCORE
DATA NCORE/7000/
IOIN = 1
IOOUT = 2
IODUMP = 3
CALL GRG(Z,NCORE)
STOP
END
NCORE is equal to the dimension of Z and only these two numbers above (i.e., the 7000's) need be changed to run in a smaller or larger amount of main memory. The various other arrays are specifically dimensioned according to the actual problem size, i.e., actual number of variables and number of functions, for best use of available memory space. A value of is large enough to accomodate 50 variables and 51 functions on a PC. Requirements for other problem sizes are discussed in section 3.
A detailed description of the various subroutines involved in the optimization process can be found in reference [2].
If the file interface is being used, GRG2 returns to the MAIN program after solving the problem(s) specified in its input data file. If the subroutine interface GRGSUB is used, all solution information is returned in GRGSUB's argument list.
2.3 Input and Output Units
As shown above, the logical input and output units for GRG2 are called IOIN and IOOUT. They are assigned the values 1 and 2 in the MAIN program, and these values may be changed if desired.
http://www.cadfamily.com/html/Article/GRG2%20User%20Guide%20in%20ISight_549_1.htm
http://www.cadfamily.com/html/Article/GRG2%20User%20Guide%20in%20ISight_549_2.htm
http://www.cadfamily.com/html/Article/GRG2%20User%20Guide%20in%20ISight_549_3.htm
http://www.cadfamily.com/html/Article/GRG2%20User%20Guide%20in%20ISight_549_4.htm
http://www.cadfamily.com/html/Article/GRG2%20User%20Guide%20in%20ISight_549_5.htm
No comments:
Post a Comment