The Sequential Quadratic Programming Solver

Example 13.5: Unconstrained NLP Optimization

The SQP solver is designed mainly for constrained optimization problems, but it can be used for solving unconstrained optimization problems as well. Consider the following example:

\min& \sin x + \cos x \

Assume the starting point x^0 = 0. You can use the following SAS code to solve the problem:

    proc optmodel;
       var x init 0;   /* starting point */
       
       minimize obj =  
          sin(x) + cos(x);
       
       solve with sqp/ printfreq = 0;
       print x;
    quit;
 

The optimal solution is displayed in Output 13.5.1.

Output 13.5.1: Optimal Solution Using the SQP Solver
The OPTMODEL Procedure

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



The OPTMODEL Procedure

Solution Summary
Solver SQP
Objective Function obj
Solution Status Optimal
Objective Value -1.414213562
Iterations 4
   
Infeasibility 0
Optimality Error 8.7523537E-7
Complementarity 0

x
-2.3562



You can also solve the same function by using the NLPU solver for unconstrained NLP problems. The SAS code is as follows:

    proc optmodel;
       var x init 0;   /* starting point */
       
       minimize obj =  
          sin(x) + cos(x);
       
       solve;  /* the default solver is NLPU */
       print x;
    quit;
 


The optimal solution is displayed in Output 13.5.2.

Output 13.5.2: Optimal Solution Using the NLPU Solver
The OPTMODEL Procedure

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



The OPTMODEL Procedure

Solution Summary
Solver L-BFGS
Objective Function obj
Solution Status Optimal
Objective Value -1.414213562
Iterations 5
   
Optimality Error 1.046407E-6

x
-2.3562



The L-BFGS method is the default technique used in the NLPU solver when a nonlinear programming problem with no variable bounds is specified. See Chapter 11, "The Unconstrained Nonlinear Programming Solver," for details.

Previous Page | Next Page | Top of Page