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, , , and :
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
Minimization |
obj |
Nonlinear |
|
3 |
0 |
0 |
0 |
3 |
0 |
|
0 |
The OPTMODEL Procedure
Fletcher-Reeves |
obj |
Optimal |
-1 |
7 |
|
2.714258E-10 |
|
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. |
|
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.