Forms of Solutions - Maple Help

Solutions Returned by the Optimization Package

 This help page describes the forms of solutions returned by commands in the Optimization package.

The Default Solution

 Each Optimization command that solves an optimization problem returns, by default, a list containing the final minimum (or maximum) value and a point (the extremum).  In situations where the solution point is not unique, the command returns only one of the possible solutions.  In general, only a local extremum is obtained.  Situations in which a global extremum can be computed are described in the help pages for the individual commands.
 When the problem is in algebraic form, the solution point is a list containing elements of the form $\mathrm{varname}=\mathrm{value}$ where varname is a problem variable and value is its final value.  When the problem is in Matrix or operator form, the solution point is a Vector of numeric values.

The Solution Module

 Most of the commands in the Optimization package accept the $\mathrm{output}=\mathrm{solutionmodule}$ option.  When this option is provided, a module is returned instead of the default output described in the previous section.
 The returned module has two exports, Settings and Results. Each export is a procedure that accepts a single optional string or name argument.  When an argument is provided, the associated value is returned. For example, if the module is assigned to variable m, then the call $m:-\mathrm{Results}\left(\mathrm{objectivevalue}\right)$ returns the final numeric objective function value. When no argument is provided, then all available information is returned as a list of equations.
 The Settings procedure generally accepts any of the following names as an argument: depthlimit, evaluationlimit, feasibilitytolerance, infinitebound, initialpoint, integertolerance, iterationlimit, nodelimit, objectivetarget, or optimalitytolerance. These names correspond to the options of the same name described in the Optimization[Options] help page.  If the option is not applicable to the command used, or if the value is not available for some other reason, the Settings procedure issues an error.
 The Results procedure accepts any of the following names as an argument: evaluations, iterations, objectivevalue, or solutionpoint. The arguments objectivevalue and solutionpoint correspond to the final objective function value and the solution point that are normally returned by default.  The arguments iterations and evaluations refer to the total numbers of iterations and evaluations performed. These values are not available for all methods.

Examples

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

Solve a linear program with the Optimization[LPSolve] command.  A list containing the final objective value and a point is returned.

 > $\mathrm{LPSolve}\left(-4x-5y,\left\{0\le x,0\le y,x+2y\le 6,5x+4y\le 20\right\}\right)$
 $\left[{-19.}{,}\left[{x}{=}{2.66666666666667}{,}{y}{=}{1.66666666666667}\right]\right]$ (1)

Use the $\mathrm{output}=\mathrm{solutionmodule}$ option to obtain a module and assign this result to the variable m.

 > $m≔\mathrm{LPSolve}\left(-4x-5y,\left\{0\le x,0\le y,x+2y\le 6,5x+4y\le 20\right\},\mathrm{output}=\mathrm{solutionmodule}\right)$
 ${m}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{export}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{Results}}{,}{\mathrm{Settings}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (2)

Display the results using the Results export.

 > $m:-\mathrm{Results}\left(\right)$
 $\left[{"objectivevalue"}{=}{-19.}{,}{"solutionpoint"}{=}\left[{x}{=}{2.66666666666667}{,}{y}{=}{1.66666666666667}\right]{,}{"iterations"}{=}{2}\right]$ (3)

Assign the initial point to the variable t.

 > $t≔m:-\mathrm{Settings}\left(\mathrm{initialpoint}\right)$
 ${t}{≔}\left[{x}{=}{0.}{,}{y}{=}{0.}\right]$ (4)