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

Online Help

All Products    Maple    MapleSim


Algebraic Form of Input for Optimization Package Commands

  

This help page describes the algebraic form of input for commands in the Optimization package.  For general information on all the input forms accepted by the Optimization package commands, see the Optimization/InputForms help page.  For more information about options mentioned below, see the Optimization/Options help page.

 

Objective Function

Constraints

Bounds

Initial Values

Solution

Examples

Objective Function

• 

The objective function of the optimization problem must be an algebraic expression in the problem variables, for example, exp(tan(x)) and x2+y23x+3y+3. The problem variables are the indeterminates in the objective function and, if provided, the constraints. They can also be specified using the variables option.

• 

Some commands impose additional restrictions.  For example, Optimization[QPSolve] requires the objective function to be quadratic in the problem variables.

• 

The Optimization[LSSolve] command accepts an objective function in least-squares form. This objective function is specified as a list of algebraic expressions [r1,r2,...,rq], where r1, r2, ..., rq represent the residuals to be minimized in a least-squares sense.  Thus, the objective function is 12r12+r22+...+rq2.

Constraints

• 

The constraints must be a set or list of relations.  Only relations of type `<=` and `=` are allowed.  An example is w=1&comma;2y2+z&comma;x5.

• 

Some commands impose additional restrictions.  For example, Optimization[LPSolve] requires all relations in the constraint set to be linear in the problem variables.

Bounds

• 

Specify the bounds as a sequence of arguments of the form vname=vrange, where vname is the name of a problem variable and vrange is its range, for example y=−1..2.

• 

Bounds can be included with the general constraints.  For example, adding the inequalities 1.5x and x3.2 to the constraint set is equivalent to specifying x=1.5..3.2.  Bounds are not required to be specified separately, though this usually leads to more efficient computation.

• 

The problem variables are not assumed to be non-negative by default, but the assume=nonnegative option can be used to specify this.

Initial Values

• 

Specify the initial values using the option initialpoint=p, where p is a set or list of equalities in the form varname=value. Each varname is one of the problem variables and value is the value to which it is initially set.  An example is initialpoint=x=−1.2&comma;y=5.7.

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 list containing elements of the form varname=value, where varname is a problem variable and value is its value.

Examples

withOptimization&colon;

Solve a linear program, quadratic program, and nonlinear program, all expressed in algebraic form.

LPSolve4x5y&comma;0x&comma;0y&comma;x+2y6&comma;5x+4y20

−19.&comma;x=2.66666666666667&comma;y=1.66666666666667

(1)

QPSolve2x+5y+3x2+3xy+2y2&comma;2xy

−3.53333333333333&comma;x=0.466666666666667&comma;y=−1.60000000000000

(2)

NLPSolvesinxx&comma;x=1..10

−0.217233628211222&comma;x=4.49340945753529

(3)

See Also

Optimization

Optimization/InputForms

Optimization/Options

Optimization[LPSolve]

Optimization[LSSolve]

Optimization[NLPSolve]

Optimization[QPSolve]