Input Form: Overview - Maple Help

Forms of Input for the GlobalOptimization Package

 This help page gives a brief overview of the ways in which optimization problems can be specified in the GlobalOptimization package.  More information about each form can be found in the GlobalOptimization/AlgebraicForm, GlobalOptimization/OperatorForm, and GlobalOptimization/MatrixForm help pages.

Algebraic Form

 • Algebraic form is the most commonly used form for specifying optimization problems.  The objective function and the constraints are given as algebraic expressions, such as $\mathrm{sin}\left(x+y\right)$ or ${v}^{2}+{ⅇ}^{v}$. This form is accepted by both the GlobalOptimization[GlobalSolve] command and the GlobalOptimization[Interactive] Maplet application.
 • All computations performed by solvers in the GlobalOptimization package use floating-point Vectors and Matrices.  Problems specified in algebraic form are converted to Matrix form by the solvers. The computation performed is numeric and floating-point results are returned, even if symbols or exact data are provided.
 • For a detailed description of algebraic form, see the GlobalOptimization/AlgebraicForm help page.

Operator Form

 • Using operator form, the objective function and the constraints are provided as procedures taking one or more parameters and returning a scalar. This form of input is accepted by the GlobalOptimization[GlobalSolve] command, but not the GlobalOptimization[Interactive] Maplet application.
 • Input in operator form is converted to Matrix form by the solver.  Specifically, procedures are converted to take Vector parameters.
 • For a detailed description of operator form, see the GlobalOptimization/OperatorForm help page.

Matrix Form

 • Using Matrix form, the objective function and the constraints are specified as procedures taking Vector parameters.  Matrix form is used by the internal solvers and generally results in better performance. This form of input is accepted by the GlobalOptimization[GlobalSolve] command, but not by the GlobalOptimization[Interactive] Maplet application.
 • Matrix form input is converted to floating-point data if it is not of floating-point type.  The GlobalOptimization solvers attempt to use hardware floating-point computation when possible and appropriate.  To avoid unnecessary copying of Matrices and Vectors, create these objects with datatype=float.
 • For a detailed description of Matrix form, see the GlobalOptimization/MatrixForm help page.

Examples

 > $\mathrm{with}\left(\mathrm{GlobalOptimization}\right):$

Solve a minimization problem specified using algebraic form.  The objective function and the constraints are expressions in $x$ and $y$.

 > $\mathrm{GlobalSolve}\left({x}^{2}-y+3,\left\{{y}^{2}-xy\le 6\right\},x=0..4,y=0..4\right)$
 $\left[{0.484651860901459841}{,}\left[{x}{=}{0.263423376188894}{,}{y}{=}{2.58474001422130}\right]\right]$ (1)

Solve a minimization problem specified using operator form.  The objective function and the constraints are procedures taking two scalar input parameters.

 > GlobalSolve(proc(x,y) 5*y^2-x*y+3 end, {proc(x,y) -x-y-8 end}, -10..0, -10..0);
 $\left[{0.333333333333338366}{,}\left[\begin{array}{c}{-7.33333336274947}\\ {-0.666666637250528}\end{array}\right]\right]$ (2)

Solve a minimization problem specified using Matrix form.  The objective function is a procedure taking a two-dimensional Vector as an input parameter.

 > p:=proc(V) V[1]^2-V[2]^2 end proc:
 > nlc := proc(V,W) W[1] := V[2]^2-V[1]-5 end proc:
 > $\mathrm{bl}≔\mathrm{Vector}\left(\left[-15,-15\right],\mathrm{datatype}=\mathrm{float}\right):$
 > $\mathrm{bu}≔\mathrm{Vector}\left(\left[15,15\right],\mathrm{datatype}=\mathrm{float}\right):$
 > $\mathrm{bd}≔\left[\mathrm{bl},\mathrm{bu}\right]:$
 > $\mathrm{GlobalSolve}\left(2,p,\left[1,0\right],\mathrm{nlc},\mathrm{bd}\right)$
 $\left[{-5.24999997400607388}{,}\left[\begin{array}{c}{0.499896469271814}\\ {2.34518580372569}\end{array}\right]\right]$ (3)