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

Online Help

All Products    Maple    MapleSim


Overview of the Optimization Package

 

Calling Sequence

Description

Accessing Optimization Package Commands

List of Optimization Package Commands

Notes

Examples

Calling Sequence

Optimization:-command(arguments)

command(arguments)

Description

• 

The Optimization package is a collection of commands for numerically solving optimization problems, which involve finding the minimum or maximum of an objective function possibly subject to constraints.  The package takes advantage of built-in library routines provided by the Numerical Algorithms Group (NAG).

• 

The package solves linear programs (LPs), quadratic programs (QPs), nonlinear programs (NLPs), and both linear and nonlinear least-squares problems.  Both constrained and unconstrained problems are accepted.  In general, variables are assumed to be continuous, and local solutions are computed for problems that are not convex.  However, the LPSolve command does accept integer programs and the NLPSolve command provides a global search algorithm for limited situations.

• 

For an overview of the Optimization package and additional examples, see the Optimization Package Example Worksheet.

• 

You can choose the easy-to-use Minimize and Maximize commands, the Interactive Maplet, or the specialized commands for the various problem classes.

• 

Some commands support quantities with Units.  The Optimization/Units page provides more detail where and how units can be used with Optimization.

• 

Some commands allow alternatives to the default method of specifying an optimization problem.  Matrix form, described on the Optimization/MatrixForm help page, is more complex but offers greater flexibility and efficiency. The Optimization/InputForms help page summarizes all the forms of input that the solvers in  the Optimization package allow.

• 

For an overview of the Matrix input form and additional examples, see the Optimization Package Matrix Form Example Worksheet.

• 

The Optimization/Options help page summarizes common options accepted by the commands in the Optimization package.  The Optimization/Methods help page summarizes methods used by the commands for solving optimization problems.

• 

The solvers perform computations in either the hardware floating-point environment or the arbitrary-precision software floating-point environment. The Optimization/Computation help page describes the computation environment in more detail and offers suggestions on how to obtain the best performance from the solvers.

Accessing Optimization Package Commands

• 

Each command in the Optimization package can be accessed by using either the long form or the short form of the command name in the command calling sequence.

  

The long form, Optimization:-command, is always available.  The short form can be used after loading the package.

List of Optimization Package Commands

• 

The following is a list of commands available in the Optimization package.

ImportMPS

Interactive

LPSolve

LSSolve

Maximize

Minimize

NLPSolve

QPSolve

  

To display the help page for a particular Optimization command, see Getting Help with a Command in a Package.

• 

The LPSolve, LSSolve, NLPSolve, and QPSolve help pages describe the most commonly used forms of input.  Use with the more advanced Matrix form of input is described in the following pages.

LPSolveMatrixForm

LSSolveMatrixForm

NLPSolveMatrixForm

QPSolveMatrixForm

Notes

• 

To see additional information about the progress of the solver during the solution of an optimization problem, set infolevel[Optimization] to a positive integer.  More information is printed at higher infolevel settings.

Examples

withOptimization:

Use the LPSolve command to solve a linear program.  The assume=nonnegative option specifies that the problem variables x and y are non-negative.  The solution consists of the final objective function value followed by the final values for x and y.

LPSolvexy,y3x+12,y5x+2,assume=nonnegative

−1.25000000000000,x=0.187500000000000,y=1.06250000000000

(1)

Use the NLPSolve command to find a local minimum, starting from a given initial point.

NLPSolvesinxx,x=1..15,initialpoint=x=7

−0.0913252028230577,x=10.9041216489198

(2)

The Minimize command automatically selects the most appropriate solver.

Minimize2x+5y+3x2+3xy+2y2,2xy,assume=nonnegative

16.,x=2.,y=0.

(3)

Use the Matrix form of the LSSolve command to minimize the norm of gCx subject to Axb.

gVector1.2,2.0,4.0,datatype=float:

CMatrix3.0,2.0,0.15,3.5,3.8,4.0,datatype=float:

AMatrix1.0,3.0,datatype=float:

bVector0.5,datatype=float:

LSSolveg,C,A,b

0.148793339132595459,0.6726730458555980.390891015285199

(4)

Applications

Chemical Kinetics Parameter Estimation

Helical Spring

Welded Beam Design Optimization

See Also

infolevel

Optimization Example Worksheet

Optimization Matrix Form Example Worksheet

Optimization/Computation

Optimization/InputForms

Optimization/MatrixForm

Optimization/Methods

Optimization/Options