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

Online Help

All Products    Maple    MapleSim


GlobalOptimization

  

GlobalSolve

  

find a global solution to a nonlinear program

 

Calling Sequence

Parameters

Description

Options

Notes

Examples

Calling Sequence

GlobalSolve(obj, constr, bd, opts)

GlobalSolve(obj, bd, opts)

GlobalSolve(opfobj, ineqcon, eqcon, opfbd, opts)

GlobalSolve(opfobj, opfbd, opts)

Parameters

obj

-

algebraic; objective function

constr

-

set(relation) or list(relation); constraints

bd

-

sequence of name = range; bounds for all variables

opfobj

-

procedure; objective function

ineqcon

-

set(procedure) or list(procedure); inequality constraints

eqcon

-

set(procedure) or list(procedure); equality constraints

opfbd

-

sequence of ranges; bounds for all variables

opts

-

(optional) equation(s) of the form option = value where option is one of avgstopstepwidth, evaluationlimit, feasibilitytolerance, initialpoint, iterationlimit, localrefinement, maximize, method, numexperiments, numsigma, nugget, objectivetarget, optimalitytolerance, optsearch, populationsize, randomseed, thetamethod, theta, targetweight, timelimit, or variables; specify options for the GlobalSolve command

Description

• 

The GlobalSolve command computes a global solution to a nonlinear program (NLP) over a bounded region. An NLP involves the minimization (or maximization) of an objective function, possibly subject to inequality and equality constraints. For a more detailed explanation of the solution obtained, see the following Notes section.

• 

The global solver minimizes a merit function, incorporating a penalty term for the constraints, and provides both differential evolution and adaptive stochastic search methods. The global search phase is followed by a local search phase to refine the solution. No derivatives are required.

  

The solver is designed to search the specified region for a global solution to a non-convex optimization problem.  If the optimization problem is convex (for example, a linear program) or a local solution is acceptable, it is recommended that you use the commands for local optimization in the Optimization package. The Optimization package commands, which are more efficient, can compute global solutions to convex problems.

• 

This help page describes the use of the GlobalSolve command when the NLP is specified in algebraic or operator form. Summaries of these forms are given on the GlobalOptimization/AlgebraicForm and GlobalOptimization/OperatorForm help pages. GlobalSolve also recognizes the problem in Matrix form (see the GlobalOptimization[GlobalSolve] (MatrixForm) help page). Matrix form leads to more efficient computation, but is more complex.

• 

The first and second calling sequences use the algebraic form of input. The first parameter obj is the objective function, which must be an algebraic expression.

  

Constraints can be provided using the constr parameter. This is a set or list of relations (of type `<=` or `=`) involving the problem variables. The problem variables are the indeterminates of type name found in obj and constr. They can also be specified using the variables option.  For unconstrained problems, omit the constr parameter.

  

Bounds on the variables must be given as additional arguments, each of the form varname= varrange where varname is a variable name and varrange is its range. There must be exactly one argument for each problem variable, and the endpoints of each range must evaluate to finite numeric values.

• 

The third and fourth calling sequences use the operator form of input. The objective function opfobj must be a procedure that accepts n floating-point parameters representing the problem variables x1, x2, ..., xn and returns a float.

  

Inequality and equality constraints are provided using the ineqcon and eqcon parameters. An inequality constraint vx1,x2,,xn0 is specified by a procedure v in ineqcon that has the same form as opfobj and returns the left-hand-side value of the constraint. Similarly, an equality constraint wx1,x2,,xn=0 is specified by a procedure w in eqcon. Either ineqcon or eqcon can be an empty list or set. For unconstrained problems, omit both of these parameters.

  

Bounds on the variables must be provided. These must be a sequence of exactly n ranges corresponding in order to x1, x2, ..., xn. The endpoints of each range must evaluate to finite numeric values.

• 

Maple returns the solution as a list containing the final minimum (or maximum) value and a point (the extremum). If the input is in algebraic form, the point is a list containing elements of the form varname=value where varname is a problem variable and value is its final value. If the input is in operator form, the point is a Vector containing the values of the problem variables.

Options

  

The opts argument can contain one or more of the following options not specific to a particular solving method. The options specific to a particular solving method are described in more detail in the GlobalOptimization/Options help page.

• 

evaluationlimit = posint -- Set the maximum number of iterations performed by the Differential Evolution method. The global search phase terminates if this limit is reached.

• 

feasibilitytolerance = positive and numeric -- Set the allowed violation of constraints.

• 

initialpoint = set(equation), list(equation), or list(numeric) --  Use the provided initial point, which is a set or list of equations varname=value (for algebraic form input) or a list of exactly n values (for operator form input). This is supported by the Differential Evolution method.

• 

localrefinement = truefalse -- Perform a local optimization refinement of the solution starting from the optimal point computed by the global solver. The default is 'localrefinement'='true'.

• 

maximize or maximize = truefalse -- Maximize the objective function when m is 'true' and minimize when m is 'false'.  The option 'maximize' is equivalent to 'maximize'='true'. The default is 'maximize'='false'.

• 

method = diffevol, ego -- Set the global search algorithm: Differential Evolution (method = diffevol), or Efficient Global Optimization (method = ego).  The default is method = diffevol.

• 

objectivetarget = numeric -- Set an acceptable target value for the objective function. If the objective function achieves this value, the search terminates.

• 

timelimit = posint -- Set the maximum computation time, in seconds, for the global solver.

• 

variables = list(name) or set(name) -- Specify the problem variables when the objective function is in algebraic form.

Notes

• 

For more information on the methods used by the global solver, with suggestions for achieving best performance, see the GlobalOptimization/Computation help page.

• 

The global solver searches for the optimal solution until one of the termination criteria is met.  Then either the best available solution is returned or an error message is displayed stating that a solution could not be obtained.  The termination criteria can be set using options. Otherwise, default values for these options are applied.  In particular, the evaluationlimit option must be set to a sufficiently high value for difficult optimization problems or unexpected answers may be produced.

• 

In the case that the computation is interrupted the last solution computed may be retrieved using the GetLastSolution command.

• 

The computation is performed in floating-point. Therefore, all data provided must have type realcons and all returned solutions are floating-point, even if the problem is specified with exact values. The solver uses externally called code that works with hardware floats, but it is possible to evaluate the objective function and the constraints in Maple with higher precision. For details, see the GlobalOptimization/Computation help page.

Examples

withGlobalOptimization&colon;

Find the global solution to an unconstrained nonlinear minimization problem.

GlobalSolveexpxcosx3&comma;x=1..4

0.176954236956028&comma;x=1.81002937332731

(1)

Find the global solution to a constrained two-variable minimization problem.

GlobalSolvex3y3x+y&comma;x2+2y6&comma;x=0..5&comma;y=0..5

−24.0191790909674054&comma;x=0.0383116419453124&comma;y=2.99926610904573

(2)

Find the global solution to a constrained least-squares minimization problem.

GlobalSolvex12+y12+z12&comma;y212x7z=100&comma;x=10..10&comma;y=10..10&comma;z=10..10

60.6658882380449995&comma;x=−4.02830735637190&comma;y=6.17479203580774&comma;z=−1.93317929115185

(3)

Find the global minimum using the operator input form.

GlobalSolvexΓx&comma;1.1..1.9

0.885603194410889&comma;1.46163215294504

(4)

Initial points can be provided to find the minimum.

GlobalSolvecosxx&comma;x=11..21&comma;initialpoint=x=12

−0.0637915530395936&comma;x=15.6441283804492

(5)

Use the maximize option to maximize the objective function.

GlobalSolveaddxi2&comma;i=1..8&comma;addxi2&comma;i=1..81&comma;seqxi=1..1&comma;i=1..8&comma;maximize

1.00000000000000067&comma;x1=−0.138687931023509&comma;x2=−0.0413711220237186&comma;x3=−0.0154159434505829&comma;x4=−0.232829087709284&comma;x5=−0.333994844827890&comma;x6=0.00865198080109979&comma;x7=−0.854946138236215&comma;x8=−0.286438021614627

(6)

GlobalSolve solves real-valued optimization problems. Trying to solve a complex problem can produce an error message.

Digits20&colon;

GlobalSolvesinxlogxy&comma;x=1..2&comma;y=5..6

Error, (in GlobalOptimization:-GlobalSolve) non-numeric result encountered

However, you can apply the Re command to use the real portion of the complex-valued expressions in a complex optimization problem to define a different problem.

Digits10&colon;

GlobalSolvesinxlogxy&comma;x=1..2&comma;y=5..6

0.360686590689181019&comma;x=2.&comma;y=6.

(7)

Using Re can create distinct problems with distinct solutions. Notice the difference between the previous example and the following.

GlobalSolvesinxlogxy&comma;x=1..2&comma;y=5..6

11.3952154460165396&comma;x=1.00000002213202&comma;y=5.00000558219173

(8)

Set infolevel to 1 or higher to display details about the solution procedure.

infolevelGlobalOptimization3&colon;

GlobalSolveexpxx3&comma;x=1..0

GlobalSolve:   calling NLP solver
GlobalSolve:   calling global optimization solver
GlobalSolve:   number of problem variables   1
GlobalSolve:   number of nonlinear inequality constraints   0
GlobalSolve:   number of nonlinear equality constraints   0
GlobalSolve:   method    OptimusDEVOL
GlobalSolve:   maximum iterations   80
GlobalSolve:   population size   50
GlobalSolve:   average stopping stepwidth   .1e-3
GlobalSolve:   time limit    100
GlobalSolve:   trying evalhf mode
GlobalSolve:   performing local refinement

0.728617821489263&comma;x=−0.458962267755628

(9)

See Also

GlobalOptimization

GlobalOptimization/AlgebraicForm

GlobalOptimization/Computation

GlobalOptimization/OperatorForm

GlobalOptimization/Options

GlobalOptimization[GetLastSolution]

GlobalOptimization[GlobalSolve] (MatrixForm)

Optimization

realcons