The Black-Box Optimization Solver

Example 5.2 Linear Constraints and a Nonlinear Objective

(View the complete code for this example.)

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 negative 2 less-than-or-equal-to x 1 less-than-or-equal-to 2 and negative 2 less-than-or-equal-to x 2 less-than-or-equal-to 2:

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 5.2.1 shows the output from running these steps.

Output 5.2.1: Linear Constraints and a Nonlinear Objective

The OPTMODEL Procedure

Problem Summary
Objective SenseMinimization
Objective Functionf
Objective TypeNonlinear
  
Number of Variables2
Bounded Above0
Bounded Below0
Bounded Below and Above2
Free0
Fixed0
  
Number of Constraints3
Linear LE (<=)1
Linear EQ (=)0
Linear GE (>=)2
Linear Range0
  
Constraint Coefficients6

Solution Summary
SolverBlack-Box
Objective Functionf
Solution StatusFunction Convergence
Objective Value-1.031628453
  
Infeasibility0
Random Seed Used1
  
Evaluations1414
Cached Evaluations32
Iterations25
Presolve Time0.00
Solution Time0.08

[1]x
10.089843
2-0.712655


Last updated: April 14, 2021