Input Form: Operator - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


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.

 

Objective Function

Constraints

Bounds

Initial Values

Solution

Notes

Examples

Objective Function

• 

Specify the objective function as a procedure that accepts n floating-point parameters corresponding to the problem variables and returns a float.

Constraints

• 

Specify the inequality constraints as a set or list of procedures.  A single constraint vx1,x2,...,xn0 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.

Bounds

• 

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.

Initial Values

• 

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.

Solution

• 

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.

Notes

• 

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.

Examples

withGlobalOptimization:

Solve a minimization problem using operator form.  The objective function x2y 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);

−1.,−1.65436122510606×10−241.

(1)

Solve a minimization problem with the objective function xy and constraints xy1 and y2x2.  Each constraint is specified in the same way as the objective function.

GlobalSolvex,yxy,x,yxy1,x,yy2x2,0..3,0..3

−1.41421356237922335,0.1.41421356237922

(2)

Find the global minimum of a piecewise function.

p:= proc(x)
    piecewise(x < -1, x^4-x+2, x < 1, x^3+x^2+7, x < 3, x^2+3)
end proc;

pprocxpiecewisex<&minus;1&comma;x&Hat;4x&plus;2&comma;x<1&comma;x&Hat;3&plus;x&Hat;2&plus;7&comma;x<3&comma;x&Hat;2&plus;3end proc

(3)

GlobalSolvep&comma;2..2

4.00000005349798&comma;−1.00000001069960

(4)

See Also

evalhf

GlobalOptimization

GlobalOptimization/Computation

GlobalOptimization/InputForms

GlobalOptimization/Options

GlobalOptimization[GlobalSolve]

Optimization