Operator Form of Input for the GlobalOptimization Package
This help page describes the operator form of input for commands in the GlobalOptimization package. For general information on the input forms accepted by the GlobalOptimization package commands, see the GlobalOptimization/InputForms help page.
The descriptions of the various components below assume that the optimization problem involves minimizing or maximizing a function of the variables x1,x2,...,xn.
Specify the objective function as a procedure that accepts n floating-point parameters corresponding to the problem variables and returns a float.
Specify the inequality constraints as a set or list of procedures. A single constraint vx1,⁢x2,⁢...,⁢xn⁢≤⁢0 is specified as a procedure v of the same form as the objective function previously described and returning the left-hand side value of the constraint.
Specify the equality constraints also as a set or list of procedures. Each constraint wx1,⁢x2,⁢...,⁢xn⁢=⁢0 is specified as a procedure returning the left-hand side value of the constraint.
Specify bounds as a sequence of ranges. For example, the sequence −1.0..2.5,0.5..3.2 indicates that the first problem variable is constrained between −1.0 and 2.5, and the second is constrained between 0.5 and 3.2. There must be exactly one range for each problem variable and the endpoints of each range must evaluate to finite numeric values.
Because finite bounds are required, the assume=nonnegative option, available in the Optimization package, is not accepted by GlobalOptimization commands.
Specify the initial values using the option initialpoint=p, where p is a list of realcons. The list must contain one value for each problem variable. For more information on the initialpoint option, see the GlobalOptimization/Options help page.
Maple returns the solution as a list containing the final minimum (or maximum) value and a point (the computed extremum). The point is a Vector containing the values of the problem variables.
In general, the GlobalOptimization solvers attempt to evaluate procedures with the evalhf command, but this is not possible with operator form procedures. It is recommended that you do not use operator form unless ease-of-use is more important than efficiency. For more information on how to achieve efficient computation, see the GlobalOptimization/Computation help page.
Solve a minimization problem using operator form. The objective function x2−y is specified as a procedure taking two input parameters, corresponding to the problem variables, and returning a scalar.
GlobalSolve(proc(x,y) x^2-y end proc, -1..1, -1..1);
Solve a minimization problem with the objective function x−y and constraints x−y≤1 and y2−x≤2. Each constraint is specified in the same way as the objective function.
Find the global minimum of a piecewise function.
piecewise(x < -1, x^4-x+2, x < 1, x^3+x^2+7, x < 3, x^2+3)
p:=procxpiecewise⁡x<−1,x^4 − x+2,x<1,x^3+x^2+7,x<3,x^2+3end proc
Download Help Document
What kind of issue would you like to report? (Optional)