The Sequential Quadratic Programming Solver |
Getting Started: SQP Solver
Consider a simple example of minimizing the following nonlinear programming problem:
Assume the starting point
. You can use the following SAS code to solve the problem:
proc optmodel;
var x {1..2};
minimize obj = (1-x[1])^2;
con cons1: x[2] - x[1]^2 = 0;
/*starting point */
x[1] = -1.2;
x[2] = 1;
solve with SQP/ printfreq = 5;
print x;
quit;
The summary of the solver output along with the optimal solution,
, is displayed in Figure 15.1.
Figure 15.1
Optimal Solution
Minimization |
obj |
Quadratic |
|
2 |
0 |
0 |
0 |
2 |
0 |
|
1 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
SQP |
obj |
Optimal |
2.652572E-12 |
26 |
|
5.7837896E-7 |
2.0208534E-6 |
0 |
The iteration log in Figure 15.2 displays information about the objective function value, the norm of the violated constraints, the norm of the gradient of the Lagrangian function, and the norm of the violated complementarity condition at each iteration.
Figure 15.2
Iteration Log
|
NOTE: The problem has 2 variables (2 free, 0 fixed). |
NOTE: The problem has 0 linear constraints (0 LE, 0 EQ, 0 GE, 0 range). |
NOTE: The problem has 1 nonlinear constraints (0 LE, 1 EQ, 0 GE, 0 range). |
NOTE: The OPTMODEL presolver removed 0 variables, 0 linear constraints, and 0 |
nonlinear constraints. |
NOTE: Using analytic derivatives for objective. |
NOTE: Using analytic derivatives for nonlinear constraints. |
NOTE: The SQP solver is called. |
Objective Optimality |
Iter Value Infeasibility Error Complementarity |
0 4.8400000 0.4400000 0.2892834 0 |
5 0.6468700 1.2864581 0.8510572 0 |
10 0.0054506 0.7825832 0.5767701 0 |
15 0.00000001935 0.0037308 0.0188459 0 |
20 1.12380194E-12 0.0000800 0.0002550 0 |
25 1.80328117E-11 0.00000264525 0.0000107 0 |
26 2.65257166E-12 0.00000057838 0.00000202085 0 |
NOTE: Converged. |
NOTE: Objective = 2.65257166E-12. |
|
|
Copyright © SAS Institute, Inc. All Rights Reserved.