The Unconstrained Nonlinear Programming Solver |
Suppose you want to solve the accumulated Rosenbrock function comprising 1000 variables. For ease of understanding the formulation, define to be an ordered set of indices of the decision variables and
to be an ordered set of all indices in
except the last one. In other words,
You can use the following SAS code to formulate and solve the problem by using PROC OPTMODEL:
proc optmodel; set setI = {1 .. 1000}; /* declare index sets */ set setJ = setI diff {1000}; set elementsToPrint = {1 .. 10}; var x {setI}; minimize z = sum{j in setJ} ((1 - x[j])^2 + 100*(x[j + 1] - x[j]^2)^2); solve with nlpu / printfreq = 0; print {k in elementsToPrint} x[k]; quit;
The Rosenbrock function has a unique global minimizer . The optimal solution is displayed in Output 11.2.1.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.