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
The objective function of the optimization problem must be an algebraic expression in the problem variables, for example, exp(tan(x)) and x2+y2−3⁢x+3⁢y+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 12⁢r12+r22+...+rq2.
The constraints must be a set or list of relations. Only relations of type `<=` and `=` are allowed. An example is w=1,2≤y2+z,x≤5.
Some commands impose additional restrictions. For example, Optimization[LPSolve] requires all relations in the constraint set to be linear in the problem variables.
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.5≤x and x≤3.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.
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,y=5.7.
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.
with⁡Optimization:
Solve a linear program, quadratic program, and nonlinear program, all expressed in algebraic form.
LPSolve⁡−4⁢x−5⁢y,0≤x,0≤y,x+2⁢y≤6,5⁢x+4⁢y≤20
−19.,x=2.66666666666667,y=1.66666666666667
QPSolve⁡2⁢x+5⁢y+3⁢x2+3⁢x⁢y+2⁢y2,2≤x−y
−3.53333333333333,x=0.466666666666667,y=−1.60000000000000
NLPSolve⁡sin⁡xx,x=1..10
−0.217233628211222,x=4.49340945753529
See Also
Optimization
Optimization/InputForms
Optimization/Options
Optimization[LPSolve]
Optimization[LSSolve]
Optimization[NLPSolve]
Optimization[QPSolve]
Download Help Document