Table6-4a.gif (86497 bytes)

Table6-4b.gif (72626 bytes)

Table6-4c.gif (84863 bytes)

Table6-4d.gif (71454 bytes)

Table6-4e.gif (79844 bytes)

Table6-4f.gif (82342 bytes)

Table6-4g.gif (75551 bytes)

Table6-4h.gif (38585 bytes)

Program Description:

     This program uses the Broyden, Fletcher, Goldfarb and Shanno (BFGS) algorithm to minimize an unconstrained multivariable function having as many as twenty variables. The program consists of a main program, two subroutines and three functions.

     The three functions are as follows. The function FUNCT is the equation for the cost function to be minimized. The function F uses FUNCT for value of the cost function in the line search. The function FIBON uses the values of F in an open-ended Fibonacci line search. The two subroutines are SLOPE which evaluates the partial derivatives using a forward difference approximation and PRINT which prints the results of the computations.

     The input data are the number of independent variables, starting point for the search and the stopping criterion, EPS. The program will terminate when the difference between the cost function values of two successive iterations is less than or equal to EPS, the stopping criteria.

     The results are the iteration number, the values of the independent variables, and the cost function. Shown with the program are the input and output for the problem in example 6-4.

     The main program begins with an echo of the input data. Then it proceeds from iteration zero, the starting point, to use the BFGS algorithm to generate successive points until the stopping criterion is met. Initially, the Hessian matrix G is the identity matrix, and the gradient is computed using a forward difference approximation to the partial derivatives using subroutine SLOPE. The Fibonacci search function, FIBON, is used to locate the minimum along the the gradient line from xo to x1. Then the stopping criterion is checked, and the Hessian matrix G is updated. The value of the function is stored in ERROLD for future comparisons. The search direction to the next point is calculated and stored in the vector S. The value of the parameter of the line in the search direction, K, is calculated using FIBON to locate the next point. The value of the function at the new point is calculated and stored in ERR. The values of the iteration counter, the function at the new point, and the new point are printed using PRINT. The values of the gradient at the current point are computed and stored in the vector GRAD. The Hessian matrix G is updated and the program returns to repeat the calculation until the error criterion is met.

     To solve other problems, supply the equation to be minimized in the function FUNCT. It is used only by the procedure FIBON. If more than 20 variables are needed, then the CONST SIZE should be changed to the required number. No other modifications are needed. If this program is to be run in a eight bit microcomputer, the real variables must be declared double precision to prevent underflow. Otherwise a division by zero will occur.