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

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Optimization : minimize examples

A Demonstration of the Procedure minimize

The procedure minimize returns the infimum of an expression or function over a given domain.  It is also possible to have minimize return both the infimum and the location where the infimum is either approached or achieved.

restart

The Infimum of a Function

A function f on a given domain D is said to be bounded below on D if there exists a real number β such that βfx for each x in D.  If such a β exists then it is called a lower bound of f on D.  For example, the function cosh(x) is bounded below by 0, (or any other number less than or equal to 1.)

plotcoshx,x=3..3,y=1..5

If a function f is bounded below on a domain D and if there exists an alpha which is a lower bound of f on D with the additional property that for any other lower bound gamma it follows that γα then alpha is said to be the infimum of the function f on D.  For example, the infimum of the function coshx over the real line is 1.  Another example is the function ⅇx on the real line which has an infimum of 0 but there does not exist a real number x such that ⅇx=0.

plotⅇx,x=5..2

If a function is not bounded below then the infimum is said to be .  For example, the infimum of tanx on the interval -5..5 is :

plottanx,x=5..5,y=10..10,'discont=true'

An Example of Finding the Infimum Analytically

As an example, we will prove that the infimum of coshx on the real line is 1.

cosh0=1 and therefore 1 is a lower bound.  Differentiating coshx with respect to x, we get

ⅆⅆxcoshx

sinhx

(1.1.1)

which is a function which is strictly greater than zero for 0<x and strictly less than zero for x&gt;0.

Proof Using the Mean Value Theorem

The mean value theorem states that for two values x and y where x<y, there exists some value c in the open interval (x,y) such that
            fyfx&equals;&DifferentialD;&DifferentialD;xfxx&equals;c|&DifferentialD;&DifferentialD;xfxx&equals;cyx .

In this case, if we assume y>0 this gives us that coshycosh0&equals;sinhcy for some value c in the open interval (0,y).  Therefore c>0 and thus 0<sinhc and so therefore 0<coshy1.  A similar argument gives us the same result when y<0.  Therefore the infimum of coshx is 1.

minimizecoshx&comma;x&equals;&infin;..&infin;

1

(1.1.2)

The user may wish to try this technique with a simpler function such as x2.

Specifying the Domain of a Variable

The domain of a variable can be specified in one of three ways:

The Default minimize( f(x), x )

If just the variable is listed, then it is assumed that that variable is to be minimized over the entire real line, that is, ...

minimizesinx

−1

(2.1.1)

A Range minimize( f(x), x = 0..1 )

If the variable is equated to a range, then the variable is minimized over the closed interval bounded by the given range.  The endpoints of the range must be of type realcons.

minimizesinx&comma;x&equals;0..4

sin4

(2.2.1)

This form of specifying the domain over which the function is to be minimized allows a quick substitution to give a plot of the function:

minimizex2xy&plus;2y2&plus;&ExponentialE;x&comma;x&equals;1..0&comma;y&equals;12..12

7LambertW4728+&ExponentialE;LambertW47

(2.2.2)

evalf

0.8101382722

(2.2.3)

plot3dx2xy&plus;2y2&plus;&ExponentialE;x&comma;x&equals;1..0&comma;y&equals;12..12&comma;&apos;axes&equals;framed&apos;

A Simple Relation minimize( f(x), x > 0 )

A domain can be specified by having a name related to an object of type realcons by one of the relation operators =, <, <=, > or >=.  Some examples are:

minimizecoshx&comma;x&equals;5

cosh5

(2.3.1)

minimizex2&comma;5<x

25

(2.3.2)

minimizesinx&comma;x<3

−1

(2.3.3)

minimizesignumx&comma;0<x

1

(2.3.4)

minimizesignumx&comma;0x

1

(2.3.5)

If no domains are given for any variable then it is assumed that each indeterminate of type name is being minimized over the entire real line:

minimizex2&plus;coshy&plus;3

4

(2.1)

minimizex2&plus;coshy&plus;3&comma;x&equals;&infin;..&infin;&comma;y&equals;&infin;..&infin;

4

(2.2)

minimizex2&plus;coshy&plus;3&comma;x&equals;&infin;..&infin;

3+coshy

(2.3)

plot3dx2&plus;coshy&plus;3&comma;x&equals;5..5&comma;y&equals;5..5&comma;&apos;axes&equals;framed&apos;

Option location

If the option location or location=true is given, then an expression sequence of two objects is returned, the first being the infimum and the second is a set of lists where the first operand of each list is a list of substitutions which indicates a point or set of points at or near which the infimum is either approached or achieved.  Four examples are: 

minimizex2&comma;x&equals;3..3&comma;&apos;location&apos;

0,x=0&comma;0

(3.1)

minimizecoshx&comma;x&equals;3..3&comma;&apos;location&apos;

1,x=0&comma;1

(3.2)

minimizex222&comma;x&equals;4..4&comma;&apos;location&apos;

0,x=2&comma;0&comma;x=2&comma;0

(3.3)

minimizesinx&comma;x&equals;2..12&comma;&apos;location&apos;

−1,x=3π2&comma;−1&comma;x=7π2&comma;−1

(3.4)

In some cases, minimize cannot determine the location and therefore returns FAIL as the location.

minimizesignumcoshx3&comma;x&equals;1..3&comma;&apos;location&apos;

−1,

(3.5)

The option location=false can be given to indicate explicitly that only the infimum is wanted.

If there are multiple options for the keyword location then the last is used.

minimizesinx&comma;x&equals;0..4&comma;&apos;location&apos;&comma;&apos;location&equals;false&apos;

sin4

(3.6)

minimizesinx&comma;x&equals;0..4&comma;&apos;location&equals;false&apos;&comma;&apos;location&apos;

sin4,x=4&comma;sin4

(3.7)

The location Data Structure

A location data structure (see previous section) can be used to quickly find the value of the function or the point(s) where the infimum is achieved (assuming the function is continuous and being minimized over a closed interval.)

minima&comma;points:=minimize3x24y2&comma;x&equals;4..4&comma;y&equals;2..2&comma;&apos;location&apos;

minima,points−29,x=−4&comma;y=−2&comma;−29&comma;x=−4&comma;y=2&comma;−29&comma;x=4&comma;y=−2&comma;−29&comma;x=4&comma;y=2&comma;−29

(4.1)

for i in points do &apos;x&apos;&comma;&apos;y&apos;&equals;subsi1&comma;x&comma;y&semi; od

x&comma;y=−4&comma;−2

x&comma;y=−4&comma;2

x&comma;y=4&comma;−2

x&comma;y=4&comma;2

(4.2)

 

 

Relation of the Location of the Minimum and the Infimum

If the infimum is finite then any location returned when option location is given indicates that that the infimum is either achieved at that point or approached arbitrarily closely in any open neighborhood around the point.  The location may not even be in the original interval being minimized over, but rather one of the endpoints of the interval.  If the infimum is  then the function is not bounded below on any open neighborhood of the point.

minimizepiecewisex&equals;0&comma;1&comma;x&comma;&apos;location&apos;

0&comma;x&equals;0&comma;0

(5.1)

minimizepiecewisex&equals;0&comma;1&comma;x&comma;&apos;location&apos;

1&comma;x&equals;0&comma;1

(5.2)

maximize&ExponentialE;x&comma; x&gt;0&comma;&apos;location&apos;

1&comma;x&equals;0&comma;1

(5.3)

minimizelnx&comma; x&gt;0&comma;&apos;location&apos;

&infin;&comma;x&equals;0&comma;&infin;

(5.4)

 

Return to Index for Example Worksheets