The Unconstrained Nonlinear Programming Solver

Example 11.2: Solving the Accumulated Rosenbrock Function

Suppose you want to solve the accumulated Rosenbrock function comprising 1000 variables. For ease of understanding the formulation, define {\cal i} to be an ordered set of indices of the decision variables and {\cal j} to be an ordered set of all indices in {\cal i} except the last one. In other words,

{\cal i} & \equiv & \{1,2, ... ,1000\} \   {\cal j} & \equiv & \{1, 2,  ... , 999 \}
The mathematical formulation of the problem is as follows:

\min  \sum_{ j \in {\cal j}} (1 - x_j)^2 + 100(x_{j+1} - x_j^2)^2

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 (1, ... , 1). The optimal solution is displayed in Output 11.2.1.

Output 11.2.1: Optimal Solution to the Accumulated Rosenbrock Function
The OPTMODEL Procedure

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



The OPTMODEL Procedure

Solution Summary
Solver L-BFGS
Objective Function z
Solution Status Optimal
Objective Value 5.140353E-11
Iterations 44
   
Optimality Error 5.2161487E-6

[1]  
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1




Previous Page | Next Page | Top of Page