The Black-Box Optimization Solver
Example 10.2 Linear Constraints and a Nonlinear Objective
The problem in this example is to minimize the six-hump camelback function (Michalewicz 1996, Appendix B). Minimize
subject to
Providing derivative-free algorithms with good estimates for lower and upper bounds often greatly improves performance because it prevents the algorithm from unnecessarily sampling in regions that you do not want to explore. For this problem, the following statements add the explicit variable bounds and
:
proc optmodel;
var x {1..2} >= -2 <= 2;
con a1: 2*x[1] + x[2] <= 2;
con a2: x[1] - x[2] >= -2;
con a3: x[1] + 2*x[2] >= -2;
min f = (4 - 2.1*x[1]^2 + x[1]^4/3)*x[1]^2 + x[1]*x[2]
+ (-4 + 4*x[2]^2)*x[2]^2;
solve with blackbox / nthreads=2;
print x;
quit;
Output 10.2.1 shows the output from running these steps.
Output 10.2.1: Linear Constraints and a Nonlinear Objective
The OPTMODEL Procedure
| Problem Summary | |
|---|---|
| Objective Sense | Minimization |
| Objective Function | f |
| Objective Type | Nonlinear |
| Number of Variables | 2 |
| Bounded Above | 0 |
| Bounded Below | 0 |
| Bounded Below and Above | 2 |
| Free | 0 |
| Fixed | 0 |
| Number of Constraints | 3 |
| Linear LE (<=) | 1 |
| Linear EQ (=) | 0 |
| Linear GE (>=) | 2 |
| Linear Range | 0 |
| Constraint Coefficients | 6 |
| Solution Summary | |
|---|---|
| Solver | Black-Box |
| Objective Function | f |
| Solution Status | Function Convergence |
| Objective Value | -1.031628453 |
| Infeasibility | 0 |
| Random Seed Used | 1 |
| Evaluations | 1591 |
| Cached Evaluations | 34 |
| Iterations | 28 |
| Presolve Time | 0.00 |
| Solution Time | 0.06 |
| [1] | x |
|---|---|
| 1 | 0.089842 |
| 2 | -0.712653 |
Last updated: June 22, 2026