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

f left-parenthesis x right-parenthesis equals left-parenthesis 4 minus 2.1 x 1 squared plus StartFraction x 1 Superscript 4 Baseline Over 3 EndFraction right-parenthesis x 1 squared plus x 1 x 2 plus left-parenthesis negative 4 plus 4 x 2 squared right-parenthesis x 2 squared

subject to

StartLayout 1st Row 1st Column 2 x 1 plus x 2 2nd Column less-than-or-equal-to 3rd Column 2 2nd Row 1st Column x 1 minus x 2 2nd Column greater-than-or-equal-to 3rd Column negative 2 3rd Row 1st Column x 1 plus 2 x 2 2nd Column greater-than-or-equal-to 3rd Column negative 2 EndLayout

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 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 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
  
Evaluations1591
Cached Evaluations34
Iterations28
Presolve Time0.00
Solution Time0.06

[1]x
10.089842
2-0.712653


Last updated: June 22, 2026