The linearly constrained Betts function (Hock and Schittkowski, 1981) is defined as
The boundary constraints are
The linear constraint is
The following code calls the NLPCG subroutine to solve the optimization problem. The infeasible initial point is specified, and a portion of the output is shown in Figure 14.3.
The NLPCG subroutine performs conjugate gradient optimization. It requires only function and gradient calls. The F_BETTS module represents the Betts function, and since no module is defined to specify the gradient, first-order derivatives are computed by finite-difference approximations. For more information about the NLPCG subroutine, see the section NLPCG Call. For details about the constraint matrix, which is represented by the CON matrix in the preceding code, see the section Parameter Constraints.
Since the initial point is infeasible, the subroutine first computes a feasible starting point. Convergence is achieved after three iterations, and the optimal point is given to be with an optimal function value of . For more information about the printed output, see the section Printing the Optimization History.