Optimization.mws

Optimization

>    restart;
with( plots ):

Warning, the name changecoords has been redefined

>   

Auxiliary Definitions

>    PrintOptProb := proc( maxmin, obj )
  local con;
  printf( " %s   %a", maxmin, obj );
  if nargs>2 then
    con := [args[3..-1]];
    printf( "\n s.t.  %a", con[1] );
    seq( printf( "\n       %a", con[j]), j=2..nops(con) );
  end if
end proc:

>    p1 := plot( [ [0,0],[3,0],[3,1],[0,1], [0,0] ], style=line, color=blue ):
p2 := seq( plot( [ [x,0],[x,1] ], style=line, color=red ), x=1..2 ):
p3 := textplot( [ seq([x-0.5,-0.1,"x"], x=1..3),
                  [3.1,0.5,"y"] ] ):
P1 := display( [p1,p2,p3], axes=none, scaling=constrained ):

>   

Lesson Overview

Optimization refers to finding the ``optimal'' solution to a problem. Optimization problems are generally classified as either constrained or unconstrained. In a constrained optimization  problem the goal is to find the largest or smallest value of a function subject to one or more constraints. For an unconstrained optimization problem, there are no restrictions on the independent variable.

The general approach to every problem is as follows:

The procedure to solve an optimization problem with a continuous objective function on a closed and bounded interval  is the procedure for finding global extrema introduced in the Global Analysis lesson: global maximum (or minimum) exists and occurs at a critical point. When the global maximum of a function is sought over an interval that is not closed and bounded , i.e., either open at at least one endpoint or unbounded, the existence of an global maximum or minimum is not guaranteed. In these situations, it will require a little more effort to provide a convincing (mathematical) argument that the solution really does solve the problem.

The first few examples are fairly standard. As your understanding of the general process improves, the examples become more complicated, often involving symbolic parameters.

>   

Example 1

Show that among all rectangles with a fixed perimeter, the square has the maximum area.

>   

Solution

The first phrase provides a constraint for this problem. Denote the perimeter by P  and let L  and W  denote the length and width of the rectangle, respectively. Then,

>    Con := 2*L+2*W=P:
Con;

2*L+2*W = P

Implicit in this problem are the geometric constraints that L  and W  are not negative:

>    Con2 := L >= 0:
Con3 := W >= 0:
Con2, Con3;

0 <= L, 0 <= W

Since area, A , is the quantity to be maximized, the objective function is

>    Obj := A = L*W:
Obj;

A = L*W

The initial formulation of this problem as an optimization problem is

>    PrintOptProb(max,Obj,Con,Con2,Con3);

 max   A = L*W

 s.t.  2*L+2*W = P

       0 <= L

       0 <= W

where s.t.  is an abbreviation for "subject to".

>   

The next step is to reformulate the problem with an objective function depending on only one variable and the constraint expressed as an appropriate interval. The perimeter constraint can be used to find an expression for either L  or W  in terms of the other variable (and the parameter P ):

>    Sub := isolate( Con, L ):
Sub;

L = 1/2*P-W

The objective function, expressed in terms of the variable W , is

>    Obj1 := eval( Obj, Sub ):
Obj1;

A = (1/2*P-W)*W

The nonnegativity of W  provides one endpoint for the interval. The nonnegativity of L  must yield the other endpoint. In fact, using the substitution identified above, the constraint for L  can be written as

>    q1 := eval( Con2, Sub ):
q1;

0 <= 1/2*P-W

or, solving for W ,

>    Con4 := isolate( q1, W ):
Con4;

W <= 1/2*P

The resulting optimization problem is

>    PrintOptProb( max, Obj1, Con3, Con4 );

 max   A = (1/2*P-W)*W

 s.t.  0 <= W

       W <= 1/2*P

Because this problem is asking for the global maximum of a continuous function on a closed and bounded interval, we know the maximum value will occur at a critical point of the objective function in the interval. The endpoints are

>    EndPt := 0, P/2:
EndPt;

0, 1/2*P

Stationary points occur when the derivative of the objective function is zero

>    dObj1 := diff( rhs(Obj1), W );
StatPtEqn := dObj1 = 0:
StatPtEqn;

dObj1 := -2*W+1/2*P

-2*W+1/2*P = 0

The one stationary point is

>    StatPt := solve( StatPtEqn, W ):
StatPt;

1/4*P

(Note that this is in the interval, in fact, it is the midpont of the interval.) And, there are no singular points

>    SingPt := NULL:

Now, evaluating the objective function at each critical point yields

>    seq( ['W'=W,Obj1], W=[EndPt,StatPt,SingPt] );

[W = 0, A = 0], [W = 1/2*P, A = 0], [W = 1/4*P, A = 1/16*P^2]

From this list it is quite clear that the maximum area, A = P^2/16 , occurs when W = P/4 , i.e., at the stationary point.

While we have found the global maximum on this interval, we are not done. It still remains to verify that the resulting rectangle is a square. This will be done by showing that L = W  for the optimal width:

>    q2 := eval( Sub, W=StatPt ):
W=StatPt;
q2;

W = 1/4*P

L = 1/4*P

Observation:

Notice that if the geometric constraints had been formulated as strict inequalities, L  > 0 and W  > 0, then the interval expressed solely in terms of W  would be the open interval: 0 < W  < P/2 . In this case the argument that the critical point is the global maximum would require consideration of appropriate one-sided limits. It is generally much easier to simply allow the degenerate geometric objects that correspond to the endpoints and work with a closed and bounded interval. Sometimes these endpoints do, in fact, yield the desired optimal configuration.

>   

Example 2

Show that among all rectangles with a fixed area, the square has the minimum perimeter.

>   

Solution

Notice the similarity - and differences - between this problem and the one in Example 1. The only changes to the wording are i) interchanging area and perimeter and ii) changing maximum to minimum. The first difference is that the constraint and objective functions are interchanged.

The first phrase provides a constraint for this problem. Denote the area by A  and let L  and W  denote the length and width of the rectangle, respectively. Then,

>    Con := A = L*W:
Con;

A = L*W

Again, the nonnegativity of L  and W  is implied:

>    Con2 := L >= 0:
Con3 := W >= 0:
Con2, Con3;

0 <= L, 0 <= W

Since perimeter, P , is the quantity to be minimized, the objective function is

>    Obj := 2*L+2*W=P:
Obj;

2*L+2*W = P

The initial formulation of this problem as an optimization problem is

>    PrintOptProb(min,Obj,Con,Con2,Con3);

 min   2*L+2*W = P

 s.t.  A = L*W

       0 <= L

       0 <= W

>   

Either L  or W  can be eliminated. As in Example 1, choose to keep W :

>    Sub := isolate( Con, L ):
Sub;

L = A/W

The objective function, expressed in terms of the variable W , is

>    Obj1 := isolate( eval( Obj, Sub ), P ):
Obj1;

P = 2*A/W+2*W

The nonnegativity of W  provides one endpoint for the interval. The nonnegativity of L  must yield the other endpoint. In fact, using the substitution identified above, the constraint for L  can be written as

>    q1 := eval( Con2, Sub ):
q1;

0 <= A/W

or, solving for W ,

>    Con4 := solve( q1, {W} ) assuming A>0:
Con4;

{0 <= W}

Oops! Maple got this wrong!! The correct solution to this inequality is

>    Con5 := W > 0:
Con5;

0 < W

>   

The resulting optimization problem is

>    PrintOptProb( min, Obj1, Con5 );

 min   P = 2*A/W+2*W

 s.t.  0 < W

Because this problem is asking for the global maximum of a continuous function on an open and unbounded interval, we have to procede with some caution. First, stationary points occur where

>    dObj1 := diff( rhs(Obj1), W ):
StatPtEqn := dObj1 = 0:
StatPtEqn;

-2*A/W^2+2 = 0

There are two solutions to this equation

>    q1 := solve( StatPtEqn, W ):
q1;

A^(1/2), -A^(1/2)

Only one of these is positive

>    StatPt := op(select( u->eval(u,A=1)>0, [q1] )):
StatPt;

A^(1/2)

The second derivative of the objective function is

>    d2Obj1 := diff( dObj1, W );

d2Obj1 := 4*A/W^3

which is positive for all W  > 0. Therefore, the objective function is concave up for all W  > 0 and the sole stationary point is the global minimizer. Thus, the rectangle with smallest area has width and length

>    W = StatPt;
eval( Sub, W=StatPt );

W = A^(1/2)

L = A^(1/2)

with perimeter

>    eval( Obj1, W=StatPt );

P = 4*A^(1/2)

In particular, observe that this is a square.

>   

Example 3

A farmer wants to set create a 1 acre (43560 sq ft) rectangular field. This field will be subdivided into three identical rectangular pens. The fence for the outer boundary of the field costs $5 per foot and the fence to create the smaller pens costs $3.50 per foot. What is the minimum cost to construct this field? (What are the dimensions of the small fields and the overall field?)

>   

Solution

The geometry of this problem is summarized in the following plot.

Each blue side is built from the $5/ft fencing and the two red sides are built uisng the less expensive fence. The total cost to build this fence is

>    Obj := C = 5*(6*x+2*y) + 3.5*(2*y):
Obj;

C = 30*x+17.0*y

The fact that the total area must be 1 acre provides the constraint

>    Con := 3*x*y = 43560:
Con;

3*x*y = 43560

The nonnegativity of x  and y  is implied:

>    Con2 := x >= 0:
Con3 := y >= 0:
Con2, Con3;

0 <= x, 0 <= y

The initial formulation of this problem as an optimization problem is

>    PrintOptProb(min,Obj,Con,Con2,Con3);

 min   C = 30*x+17.0*y

 s.t.  3*x*y = 43560

       0 <= x

       0 <= y

>   

Chosing to use y  as the independent variable, we find the substitution formula:

>    Sub := isolate( Con, x ):
Sub;

x = 14520/y

The objective function, expressed in terms of the variable y , is

>    Obj1 := isolate( eval( Obj, Sub ), C ):
Obj1;

C = 435600/y+17.0*y

The nonnegativity of y  provides one endpoint for the interval. The nonnegativity of x  must yield the other endpoint. In fact, using the substitution identified above, the constraint for x  can be written as

>    q1 := eval( Con2, Sub ):
q1;

0 <= 14520/y

or, solving for y ,

>    Con4 := solve( q1, {y} ):
Con4;

{0 <= y}

Oops! Maple got this wrong!! The correct solution to this inequality is

>    Con5 := y > 0:
Con5;

0 < y

>   

The resulting optimization problem is

>    PrintOptProb( min, Obj1, Con5 );

 min   C = 435600/y+17.0*y

 s.t.  0 < y

Once again the interval is open and unbounded. Working as in Example 2, the first derivative of the objective function is

>    dObj1 := diff( rhs(Obj1), y ):
dObj1;

-435600/y^2+17.0

First, stationary points occur where

>    StatPtEqn := dObj1 = 0:
StatPtEqn;

-435600/y^2+17.0 = 0

There are two solutions to this equation

>    q1 := solve( StatPtEqn, y ):
q1;

160.0735125, -160.0735125

Only one of these is positive

>    StatPt := op(select( u->u>0, [q1] )):
StatPt;

160.0735125

The second derivative of the objective function is

>    d2Obj1 := diff( dObj1, y );

d2Obj1 := 871200/y^3

which is positive for all y  > 0. Therefore, the objective function is concave up for all y  > 0 and the sole stationary point is the global minimizer. This fact can be seen in the plot:

>    plot( rhs(Obj1), y=0..1000, view=[DEFAULT,0..10^5],
      title="Cost to build the fence in Example 3" );

[Maple Plot]

Notice that the objective function is concave up and has a global minimum around y = 160 , as expected.

Each field will have dimensions

>    eval(Sub,y=StatPt);
y = StatPt;

x = 90.70832378

y = 160.0735125

and the entire fenced in area has dimensions

>    3*eval(Sub,y=StatPt);
y = StatPt;

3*x = 272.1249713

y = 160.0735125

The total cost to build this fence is

>    eval( Obj1,y=StatPt );

C = 5442.499425

>   

(As a check, note that the total area enclosed is 43560 square feet, or 1 acre.)

>   

Example 4

A farmer wants to set create a rectangular field with area A  (acres). This field will be subdivided into n  identical rectangular pens. The fence for the outer boundary of the field costs $ P  per foot and the fence to create the smaller pens costs $ p  per foot. What is the minimum cost to construct this field? (What are the dimensions of the small fields and the overall field?)

>   

Solution

This problem is essentially the same as Example 3, except that all dimensions and prices are provided as parameters. Each side of the outer fence is built from the $ P /ft fencing and the n-1  inner sides are built uisng the $ p /ft fence. The total cost to build this fence is

>    Obj := C = P * ( 2*n*x + 2*y ) + p * ( (n-1)*y ):
Obj;

C = P*(2*n*x+2*y)+p*(n-1)*y

The fact that the total area must be A  acres provides the constraint

>    Con := n*x*y = 43560*A:
Con;

n*x*y = 43560*A

The nonnegativity of x  and y  is implied:

>    Con2 := x >= 0:
Con3 := y >= 0:
Con2, Con3;

0 <= x, 0 <= y

The initial formulation of this problem as an optimization problem is

>    PrintOptProb(min,Obj,Con,Con2,Con3);

 min   C = P*(2*n*x+2*y)+p*(n-1)*y

 s.t.  n*x*y = 43560*A

       0 <= x

       0 <= y

>   

Chosing to use y  as the independent variable, we find the substitution formula:

>    Sub := isolate( Con, x ):
Sub;

x = 43560*A/n/y

The objective function, expressed in terms of the variable y , is

>    Obj1 := isolate( eval( Obj, Sub ), C ):
Obj1;

C = P*(87120*A/y+2*y)+p*(n-1)*y

The nonnegativity of y  provides one endpoint for the interval. The nonnegativity of x  must yield the other endpoint. In fact, using the substitution identified above, the constraint for x  can be written as

>    q1 := eval( Con2, Sub ):
q1;

0 <= 43560*A/n/y

or, solving for y ,

>    Con4 := solve( q1, {y} ) assuming A>0, n::posint:
Con4;

{0 <= y}

Oops! Maple got this wrong!! The correct solution to this inequality is

>    Con5 := y > 0:
Con5;

0 < y

>   

The resulting optimization problem is

>    PrintOptProb( min, Obj1, Con5 );

 min   C = P*(87120*A/y+2*y)+p*(n-1)*y

 s.t.  0 < y

Once again the interval is open and unbounded. Working as in Example 2, the first derivative of the objective function is

>    dObj1 := diff( rhs(Obj1), y ):
dObj1;

P*(-87120*A/y^2+2)+p*(n-1)

First, stationary points occur where

>    StatPtEqn := dObj1 = 0:
StatPtEqn;

P*(-87120*A/y^2+2)+p*(n-1) = 0

There are two solutions to this equation

>    q1 := solve( StatPtEqn, y ):
q1;

132/(2*P+p*n-p)*5^(1/2)*((2*P+p*n-p)*P*A)^(1/2), -132/(2*P+p*n-p)*5^(1/2)*((2*P+p*n-p)*P*A)^(1/2)

Only one of these is positive

>    StatPt := op(select( u->evalf(eval(u,[p=1,P=2,n=1,A=1]))>0, [q1] )):
StatPt;

132/(2*P+p*n-p)*5^(1/2)*((2*P+p*n-p)*P*A)^(1/2)

The second derivative of the objective function is

>    d2Obj1 := diff( dObj1, y );

d2Obj1 := 174240*P*A/y^3

which, because P  and A  are both positive, is positive for all y  > 0. Therefore, the objective function is concave up for all y  > 0 and the sole stationary point is the global minimizer. Because of the parameters involved in this problem, it is not possible to create a plot; but the general shape will be the same as in Example 3.

Each field will have dimensions

>    eval(Sub,y=StatPt);
y = StatPt;

x = 66*A/n*(2*P+p*n-p)*5^(1/2)/((2*P+p*n-p)*P*A)^(1/2)

y = 132/(2*P+p*n-p)*5^(1/2)*((2*P+p*n-p)*P*A)^(1/2)

and the entire fenced in area has dimensions

>    n*eval(Sub,y=StatPt);
y = StatPt;

n*x = 66*A*(2*P+p*n-p)*5^(1/2)/((2*P+p*n-p)*P*A)^(1/2)

y = 132/(2*P+p*n-p)*5^(1/2)*((2*P+p*n-p)*P*A)^(1/2)

The total cost to build this fence is

>    simplify( eval( Obj1,y=StatPt ) );

C = 264*(2*P+p*n-p)*P*A*5^(1/2)/((2*P+p*n-p)*P*A)^(1/2)

>   

Example 5

A wire of length L  (cm) is cut into two pieces. One piece is bent to form a circle and the other piece is bent to form an equilateral triangle. What are the maximum and minimum areas of the two regions?

>   

Solution

Let r  denote the radius of the circle and s  the length of the triangle's sides. Then, a circle with radius r  has perimeter

>    Pcirc := 2*Pi*r:
P[circ] = Pcirc;

P[circ] = 2*Pi*r

and area

>    Acirc := Pi*r^2:
A[circ] = Acirc;

A[circ] = Pi*r^2

Likewise, an equilateral triangle with side length s  has perimeter

>    Ptri := 3*s:
P[tri] = Ptri;

P[tri] = 3*s

and area

>    Atri := 1/2 * s * sqrt(3)/2*s:
A[tri] = Atri;

A[tri] = 1/4*s^2*3^(1/2)

The fact that the wire is of a fixed length forms one part of the constraint:

>    Con := P = Pcirc + Ptri;

Con := P = 2*Pi*r+3*s

In addition, the radius and side length cannot be negative. (If either is zero then there is only one region.)

>    Con2 := r >= 0:
Con3 := s >= 0:
Con2;
Con3;

0 <= r

0 <= s

The objective function is the total area enclosed by the two regions:

>    Obj := A = Acirc + Atri;

Obj := A = Pi*r^2+1/4*s^2*3^(1/2)

>   

The initial formulation of this problem as an optimization problem is

>    PrintOptProb(min,Obj,Con,Con2,Con3);

 min   A = Pi*r^2+1/4*s^2*3^(1/2)

 s.t.  P = 2*Pi*r+3*s

       0 <= r

       0 <= s

>   

It is probably easiest to keep r  as the variable for this problem:

>    Sub := isolate( Con, s ):
Sub;

s = 1/3*P-2/3*Pi*r

The objective function, expressed in terms of the variable r , is

>    Obj1 := isolate( eval( Obj, Sub ), A ):
Obj1;

A = Pi*r^2+1/4*(1/3*P-2/3*Pi*r)^2*3^(1/2)

The nonnegativity of r  provides one endpoint for the interval. The nonnegativity of s  must yield the other endpoint. In fact, using the substitution identified above, the constraint for s  can be written as

>    q1 := eval( Con3, Sub ):
q1;

0 <= 1/3*P-2/3*Pi*r

or, solving for r ,

>    Con4 := isolate( q1, r ):
Con4;

r <= 1/2*P/Pi

The resulting optimization problem is

>    PrintOptProb( min, Obj1, Con2, Con4 );

 min   A = Pi*r^2+1/4*(1/3*P-2/3*Pi*r)^2*3^(1/2)

 s.t.  0 <= r

       r <= 1/2*P/Pi

The continuous objective function together with the closed and bounded interval make this problem like Example 1.

There are no singular points,

>    SingPt := NULL:

endpoints are

>    EndPt := 0, P/(2*Pi);

EndPt := 0, 1/2*P/Pi

Stationary points are the solution(s) to

>    dObj1 := diff( rhs(Obj1), r ):
StatPtEqn := dObj1 = 0:
StatPtEqn;

2*Pi*r-1/3*(1/3*P-2/3*Pi*r)*3^(1/2)*Pi = 0

The unique solution to this equation is

>    StatPt := solve( StatPtEqn, r ):
StatPt;

1/2*3^(1/2)*P/(9+3^(1/2)*Pi)

To find the global maximum and minimum on this interval, compare the values of the objective function at each of the three critical points (and include the corresponding value of s ):

>    CritPt := [ EndPt, StatPt, SingPt ]:
q2 := seq( ['r'=r,simplify(Sub),simplify(Obj1)], r=CritPt );

q2 := [r = 0, s = 1/3*P, A = 1/36*P^2*3^(1/2)], [r = 1/2*P/Pi, s = 0, A = 1/4/Pi*P^2], [r = 1/2*3^(1/2)*P/(9+3^(1/2)*Pi), s = 3*P/(9+3^(1/2)*Pi), A = 3/4*P^2*(Pi+3*3^(1/2))/(9+3^(1/2)*Pi)^2]
q2 := [r = 0, s = 1/3*P, A = 1/36*P^2*3^(1/2)], [r = 1/2*P/Pi, s = 0, A = 1/4/Pi*P^2], [r = 1/2*3^(1/2)*P/(9+3^(1/2)*Pi), s = 3*P/(9+3^(1/2)*Pi), A = 3/4*P^2*(Pi+3*3^(1/2))/(9+3^(1/2)*Pi)^2]

To help identify the largest and smallest areas, convert these results to floating-point form:

>    evalf[4]( q2 );

[r = 0., s = .3333*P, A = .4811e-1*P^2], [r = .1592*P, s = 0., A = .7958e-1*P^2], [r = .5995e-1*P, s = .2078*P, A = .2999e-1*P^2]
[r = 0., s = .3333*P, A = .4811e-1*P^2], [r = .1592*P, s = 0., A = .7958e-1*P^2], [r = .5995e-1*P, s = .2078*P, A = .2999e-1*P^2]

The smallest value for A  occurs at the stationary point

>    rmin := StatPt:
r = rmin;

r = 1/2*3^(1/2)*P/(9+3^(1/2)*Pi)

 and the largest value for A  occurs at the right-hand endpoint

>    rmax := EndPt[2]:
r = rmax;

r = 1/2*P/Pi

>   

To conclude, the smallest total area for the two regions occurs with a circle of radius

>    r = rmin;

r = 1/2*3^(1/2)*P/(9+3^(1/2)*Pi)

and a triangle with side length

>    simplify(eval( Sub, r=rmin ));

s = 3*P/(9+3^(1/2)*Pi)

The total area for these two regions is

>    simplify(eval( Obj1, r=rmin ));

A = 3/4*P^2*(Pi+3*3^(1/2))/(9+3^(1/2)*Pi)^2

The maximum total area for the two regions occurs with a circle of radius

>    r = rmax;

r = 1/2*P/Pi

and a triangle with side length

>    simplify(eval( Sub, r=rmax ));

s = 0

That is, the entire length of wire is used to form the circle and there is no triangle. The total area is the area of the circle

>    simplify(eval( Obj1, r=rmax ));

A = 1/4/Pi*P^2

>   

Example 6

The illumination, L , of an object by a light source can be modeled with

  L = c*S/(d^2)  

where S  is the strength of the light source, d  is the distance from the light source to the object, and c  is a positive constant.

Suppose two light sources, with strengths S[1]  and S[2] = k*S[1] , are positioned 10 m apart. Find the location of the point that receives least illumination as a function of k . When is the minimum at the midpoint between the two light sources? For what value of k  does the point one-quarter of the way between the two lights receive the least illumination? Are there any points on the line between the lights where the minimum cannot occur?

>   

Solution

The illumination from each light is

>    L1 := c*S[1]/d[1]^2:
L[1] = L1;

L[1] = c*S[1]/d[1]^2

>    L2 := c*(k*S[1])/d[2]^2:
L[2] = L2;

L[2] = c*k*S[1]/d[2]^2

so the total illumination of an object from these two light sources is

>    Obj := L1 + L2;

Obj := c*S[1]/d[1]^2+c*k*S[1]/d[2]^2

where the distances satisfy the constraints

>    Con := d[1] + d[2] = 10:
Con2 := d[1] > 0:
Con3 := d[2] > 0:
Con;
Con2;
Con3;

d[1]+d[2] = 10

0 < d[1]

0 < d[2]

(Observe that it is not permissible to use either d[1] = 0  or d[2] = 0 .)

The initial optimization problem is

>    PrintOptProb( min, Obj, Con, Con2, Con3 );

 min   c*S[1]/d[1]^2+c*k*S[1]/d[2]^2

 s.t.  d[1]+d[2] = 10

       0 < d[1]

       0 < d[2]

The elimination of one of the distances, say d[2] , is straightforward:

>    Sub := isolate( Con, d[2] );

Sub := d[2] = 10-d[1]

The new objective function, with independent variable d[1] , is

>    Obj1 := eval( Obj, Sub );

Obj1 := c*S[1]/d[1]^2+c*k*S[1]/(10-d[1])^2

The nonnegativity constraint on d[2]  is restated as

>    Con4 := isolate(eval( Con3, Sub ),d[1]);

Con4 := d[1] < 10

(This should have been obvious!)

The new optimization problem is

>    PrintOptProb( min, Obj1, Con2, Con4 );

 min   c*S[1]/d[1]^2+c*k*S[1]/(10-d[1])^2

 s.t.  0 < d[1]

       d[1] < 10

>   

The search for stationary points in the interval produces

>    dObj1 := simplify( diff( Obj1, d[1] ) ):
StatPtEq := dObj1 = 0:
q2 := solve( StatPtEq, d[1] ):
StatPt := op(remove( has, [q2], I )):
d[1] = StatPt;

d[1] = 10/(1+k)*k^(2/3)-10*k^(1/3)/(1+k)+10/(1+k)

To attempt to classify this critical point using the Second Derivative Test, we compute the second derivative of the objective function:

>    d2Obj1 := simplify(diff( Obj1, d[1]$2 ));

d2Obj1 := 6*c*S[1]*(10000-4000*d[1]+600*d[1]^2-40*d[1]^3+d[1]^4+k*d[1]^4)/d[1]^4/(-10+d[1])^4

The result of evaluating the second derivative at the stationary point is

>    simplify( eval( d2Obj1, d[1]=StatPt ) );

-3/5000*(1+k)^5*k*(-k^2+3*k^(5/3)-6*k^(4/3)+7*k-6*k^(2/3)+3*k^(1/3)-1)*c*S[1]/(-k+k^(2/3)-k^(1/3))^4/(k^(2/3)-k^(1/3)+1)^4

It is difficult, if not impossible, to determine that this is positive for all values of the parameter k . There must be a different way.

The following limits show that the illumination becomes (positively) unbounded at each endpoint.

>    q3 := Limit( Obj1, d[1]=0, right ):
q4 := Limit( Obj1, d[1]=10, left ):
q3 = value( q3 ) assuming k>0,c>0,S[1]>0;
q4 = value( q4 ) assuming k>0,c>0,S[1]>0;

Limit(c*S[1]/d[1]^2+c*k*S[1]/(10-d[1])^2,d[1] = 0,right) = infinity

Limit(c*S[1]/d[1]^2+c*k*S[1]/(10-d[1])^2,d[1] = 10,left) = infinity

These limits combined with   i)   the continuity and differentiability of the illumination function on the open interval 0 < d[1]  < 10 and   ii)   the existence of a single stationary point on 0 < d[1]  < 10 are sufficient to conclude that the stationary point must be the global minimizer for the objective function.

>    dmin := StatPt:
d[1] = dmin;

d[1] = 10/(1+k)*k^(2/3)-10*k^(1/3)/(1+k)+10/(1+k)

To conclude, we need to respond to the specific questions.

The midpoint ( d[1] = 5 ) will be the point with minimum illumination when

>    q5 := dmin = 5:
q5;

10/(1+k)*k^(2/3)-10*k^(1/3)/(1+k)+10/(1+k) = 5

The unique solution to this is

>    q6 := solve( q5, k ):
k = q6;

k = 1

That is, the two lights have the same intensity. This makes sense by symmetry.

To move the point of minimum illumination to the one-quarter point, d[1] = 2.5 , the second light will need to be brighter. So, we expect to find k  > 1 - but how much larger? Working as above,

>    q7 := dmin = 2.5:
q8 := solve( q7, k ):
k = q8;

k = 27.

Thus, S[2] = 27*S[1] .

The final question is really asking if there are solutions to the equation

>    q9 := dmin = d;

q9 := 10/(1+k)*k^(2/3)-10*k^(1/3)/(1+k)+10/(1+k) = d

for every value of d  in 0 <= d  <= 10. For a first insight into this question, consider the graph

>    plot( dmin, k=0..10^4, view=[DEFAULT,0..10] );

[Maple Plot]

It appears clear that the location takes on all values up to 10 as k  approaches 0 (from the right). In fact,

>    Eval(d[1],k=0) = eval( dmin, k=0 );

Eval(d[1],k = 0) = 10

It is less clear that this function takes on all values down to zero. (By symmetry it seems that it should.) To see that all locations up to the position of the light are possible locations for the minimum illumination, look at the limit as k  approaches infinity:

>    q10 := Limit( dmin, k=infinity ):
q10 = value( q10 );

Limit(10/(1+k)*k^(2/3)-10*k^(1/3)/(1+k)+10/(1+k),k = infinity) = 0

Now, by the continuity of the position of minimum illumination as a function of k , the ideas behind the Intermediate Value Theorem can be applied to conclude that the minimum illumination can occur at any point between the two lights. The minimum occurs at one of the endpoints only if there is no light at that endpoint.

>   

Lesson Summary

The solution of an optimization problem typically involves three main steps:

The formulation step can frequently be the most difficult. The key here is to identify an appropriate variable (only one). If this is done correctly, then it should be possible to express the objective function in terms of this variable and to identify an interval where the maximum and/or minimum is desired.

The solution step is generally fairly straightforward. It is important to determine if the interval is closed and bounded. The cases when it is either open at at least one endpoint or unbounded require a little more effort to verify that a critical point is the desired extreme value.

>   

What's Next?

There is an essentially endless supply of problems that could be assigned at this point. The online practice and homework problems in the online homework assignment are generally quite straightforward. Attempt these first. More complicated (and interesting) problems are assigned in the textbook homework assignment.

The Mean Value Theorem lesson is the last lesson in this unit. This will be a nice conclusion to our discussion of derivatives and will provide a springboard for integration in Unit 4.

>   

>   

>