The Unconstrained Nonlinear Programming Solver

Example 11.1: Solving a Highly Nonlinear Problem

Consider the following example of minimizing a nonlinear function of three variables, x, y, and z:

\displaystyle \mathop {\min}_{x,y,z} & x^2 + e^{\frac{y}{10} + 10} + \sin(y \, z)

You can use the following SAS code to formulate and solve the problem in PROC OPTMODEL:

    proc optmodel;
      var x, y, z; 
 
      minimize obj = x^2 + exp(y/10 + 10) + sin(z*y);
  
      solve with nlpu / tech = fletreev  maxiter   = 100  
                        opttol = 1e-7;
      print x y z;
 
    quit;
 

The optimal solution is displayed in Output 11.1.1.

Output 11.1.1: Optimal Solution
The OPTMODEL Procedure

Problem Summary
Objective Sense Minimization
Objective Function obj
Objective Type Nonlinear
   
Number of Variables 3
Bounded Above 0
Bounded Below 0
Bounded Below and Above 0
Free 3
Fixed 0
   
Number of Constraints 0



The OPTMODEL Procedure

Solution Summary
Solver Fletcher-Reeves
Objective Function obj
Solution Status Optimal
Objective Value -1
Iterations 7
   
Optimality Error 2.714258E-10

x y z
0 -2943.7 0.090182



The following iteration log displays information about the type of algorithm used, and the objective value, relative gradient norm, and number of function evaluations at each iteration.

Output 11.1.2: Iteration Log
NOTE: The problem has 3 variables (3 free, 0 fixed).
NOTE: The problem has 0 linear constraints (0 LE, 0 EQ, 0 GE, 0 range).
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).
NOTE: Using analytic derivatives for objective.
NOTE: The FLETCHER-REEVES CONJUGATE GRADIENT solver for unconstrained
optimization is called.
Objective Optimality Function
Iter Value Error Calls
0 22026.5 2202.64657948 1
1 3.2096359E-124 0.99999994 5
2 -0.79979862 0.60026837 16
3 -0.99009673 0.14038682 30
4 -0.99973800 0.02288966 41
5 -0.99999990 0.00045001 48
6 -1.00000000 0.00004279639 52
7 -1.00000000 2.71425843E-10 55
NOTE: Optimal.
NOTE: Objective = -1.



Previous Page | Next Page | Top of Page