Operator Form of Input for Optimization Package Commands - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Mathematics : Optimization : Optimization Package : General information : Input forms : Optimization/General/OperatorForm

Operator Form of Input for Optimization Package Commands


This help page describes the operator 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.


The descriptions of the various components below assume that the optimization  problem involves minimizing or maximizing a function of variables x1, x2, ..., xn.

Objective Function


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


The Optimization[LSSolve] command accepts an objective function of the form  12f1x1,x2,...,xn2+f2x1,x2,...,xn2+...+fqx1,x2,...,xn2.  In this situation, the objective function is specified as a list of procedures, each taking n floating-point parameters representing the problem variables and returning a float.  These procedures compute the least-squares  residuals f1, f2, ..., fq.



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.



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 to be between 1.0 and 2.5, and the second is constrained to be between 0.5 and 3.2.  If bounds are provided, the number of ranges must be equal to the number of problem variables.


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. For more information, see the Optimization/Options help page.

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 Optimization/Options help page.



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.





Use simple procedures as input to the NLPSolve command.

p := proc(x)
  if x <= 0 then
  end if;
end proc;

p:=procxifx<=0thenx&Hat;2&plus;1elsesinx&sol;xend ifend proc





Use operator form to solve a least-squares problem.

b1 := proc(x) x-1 end proc:

b2 := proc(x) x-7 end proc:

c1 := proc(x) -2*x-3 end proc:

c2 := proc(x) x-5 end proc:




Use operator form as input to the Maximize command.




See Also

Optimization, Optimization/InputForms, Optimization/Options, Optimization[LSSolve]

Download Help Document

Was this information helpful?

Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam