Foraging

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Chapter 5

Optimization and Newton’s method

5.1 Optimal Flying Speed


According to R McNeil Alexander (1996, Optima for Animals, Princeton U Press), the power, P ,
required to propel a flying plane at constant speed, u > 0 is
BL2
P = Au3 + ,
u
where L > 0 is lift, and A, B > 0 are positive constants. The first term is power needed to push
the aircraft through the air, whereas the second term is the power needed to push air downwards,
so that the aircraft can remain up high. (Recall that power represents energy per unit time.)
(a) Find the speed that minimizes the power P .
(b) Reformulate the problem to determine how energy per unit distance depends on the flight
speed.
(c) Compute the speed that minimizes the energy per unit distance.

Detailed Solution:
(a) To minimize the power, find critical points
dP 2 BL2
= 3Au − 2 = 0
du u
Solve algebraically for u:
BL2
u4 = .
3A
Thus 1/4
BL2

u= .
3A
Determine if this is a minimum or maximum using the second derivative test:
d2 P BL2
= 6Au + 2 >0
du2 u3
since all quantities in the expression are positive. Hence, by the second derivative test, the
solution is a local minimum.

v.2006.1 - November 26, 2006 1


Science 1 Problems (set by L. Keshet) Chapter 5

(b) Power= Energy per unit time. Hence, dividing both sides by speed leads to Energy per unit
time / distance per unit time = Energy per unit distance. Thus, the quantity of interest, that
we will call Q, is
P BL2
Q= = Au2 + 2 .
u u
(c) We now need to minimize Q, so

dQ BL2
= 2Au − 2 3 = 0.
du u
Solving for u leads to the solution:
1/4
BL2

u= .
A

To check that this, too, is a local minimum, use the sign of the second derivative.

d2 Q BL2
= 2A + 6 >0
du2 u4
Hence, the solution we found here minimizes the energy spent per unit distance.

Note: We can also reason about the solution by sketching a graph of the two functions of interest,
as shown in Figure 5.1.

5.0
Power (Energy per unit time)

Energy per unit distance

0.0
0.0 2.0

Figure 5.1: Figure for solution to problem 5.1. The optimal flight speed is higher to minimize the
energy per unit distance than to minimize the energy per unit time.

v.2006.1 - November 26, 2006 2


Science 1 Problems Chapter 5

5.2 Optimal Foraging I:


To optimize the efficiency of energy intake, it is postulated that an animal would chose a foraging
time t for which the ratio of energy intake to total time spent in searching and foraging for food
would be maximized. Suppose that F (t) is the energy gained (in calories) by foraging in a single
patch for a time duration t. Further, suppose that it takes an additional (constant) time t0 > 0
to travel back and forth to the food patch. The total time available to the animal, daylight hours
must satisfy 0 ≤ t + t0 ≤ 12. We will define the Efficiency of foraging, R(t), as the ratio

F (t)
R(t) = .
t + t0
Answer the following questions

(a) It is commonly assumed that F (0) = 0 and that F (t) is a nonnegative function. What do
these assumptions mean, and is either of them ever wrong?

(b) Show that critical points of R(t) correspond to values of t for which F 0 (t) = F (t)/(t + t0 ).

(c) Under what condition on the function F (t) is this solution an optimum? (Hint: find the
second derivative of R(t) and simplify your expression to deduce what must be true about
F 00 (t).)

(d) Now consider the function F (t) = t3 . based on part (c), what do you conclude about the
optimal foraging time? (Note: if you understand parts (b) and (c) you do not need to repeat
any calculations.)

Detailed Solution:
(a) F (0) = 0 means that no energy is gained if the animal spends no time at all in the food patch.
F (t) is nonnegative means that the energy gain is positive, i.e. that the animal does not lose
energy by spending time in the patch. If the food patch is empty (e.g. over-exploited) then
there is a possibility that searching for food will consume energy, rather than lead to a gain.
In that case, F (t) might be negative.

(b) Critical points occur when R0 (t) = 0. By the quotient rule,

F 0 (t)(t + t0 ) − F (t)(1) F 0 (t)(t + t0 ) − F (t)


R0 (t) = = = 0.
(t + t0 )2 (t + t0 )2
Thus
F 0 (t)(t + t0 )) − F (t) = 0,
so
F (t)
F 0 (t) = .
(t + t0 )
(c) We can check that this solution an optimum using the second derivative test,

[F 0 (t)(t + t0 ) − F (t)]0 (t + t0 )2 − 2(t + t0 )[F 0 (t)(t + t0 ) − F (t)]


R00 (t) =
(t + t0 )4

v.2006.1 - November 26, 2006 3


Science 1 Problems (set by L. Keshet) Chapter 5

Expanding the derivative in the numerator leads to


[F 00 (t)(t + t0 ) + F 0 (t) − F (t)0 ](t + t0 )2 − 2(t + t0 )[F 0 (t)(t + t0 ) − F (t)]
R00 (t) =
(t + t0 )4

F 00 (t)(t + t0 )3 − 2(t + t0 )[F 0 (t)(t + t0 ) − F (t)]


R00 (t) =
(t + t0 )4
At the critical point, since F 0 (t)(t + t0 ) − F (t) = 0, this expression can be simplified further
to
[F 00 (t)(t + t0 ) + F 0 (t) − F (t)0 ](t + t0 )2 [F 00 (t)(t + t0 )] F 00 (t)
R00 (t) = = = .
(t + t0 )4 (t + t0 )2 (t + t0 )
We see from the above that the sign of the second derivative of R is the same as the sign of
the second derivative of F at the critical point. (Restated, the concavity of r is the same as
the concavity of F at the critical point.)
For a local maximum of R, we need the second derivativeR00 (t) < 0, which implies (by the
above calculation) that F 00 (t) < 0. This means that the function F (t) must be concave down
at the optimal foraging time.

(d) If F (t) = t3 then F is concave up everywhere, so this contradicts the condition for a local
optimum derived in (c). Thus, the optimum would occur at an endpoint of the time interval,
i.e. at t + t0 = 12.

5.3 Optimal Foraging II:


Suppose that the energy gained by foraging for a time t is given by the function
Kt
F (t) = ,
a+t
(in calories), and let t0 be the time it takes to travel to the food patch and back. Explain the
meaning of the positive constants K, a. Find the time that maximizes the efficiency, R, (where
R is as defined in Problem 5.2). Your answer should be in terms of constants that appear in the
problem.
Once you have obtained the answer, indicate how the optimal foraging time would vary if the
travel time is longer, or if it takes more time to find food in the patch.

Detailed Solution:
The constant K represents the largest amount of energy that can be obtained from the patch. The
constant a represents the time it takes to get half the energy from the patch. (To see this, plug
t = a into F, and see that F (a) = K/2.) It is significant that the function F (t) is concave down in
this problem. (This can be verified easily by sketching the curve, or by taking the second derivative
and noting that it is negative.)
By Problem 5.2, the time at which the efficiency is maximal corresponds to the solution of the
equation
F (t)
F 0 (t) = .
(t + t0 )

v.2006.1 - November 26, 2006 4


Science 1 Problems Chapter 5

Since F (t) = Kt/(a + t), we compute the derivative

(a + t) − 1(t) a
F 0 (t) = K =K .
(a + t) 2 (a + t)2

Then the equation to solve is


a t 1
K =K
(a + t) 2 (a + t) (t + t0 )
a 1
=t
(a + t) (t + t0 )
a(t + t0 ) = t(a + t)
at + at0 = at + t2
Canceling common terms and simplifying leads to

t2 = a t0 , ⇒ t = (a t0 )1/2 .

By Problem 5.2, this is a critical point of the function R(t). Also by Problem 5.2, R(t) will be
concave down when F (t) is concave down. This reasoning establishes that we have found a value of
t that maximizes the efficiency, R(t), i.e. it guarantees that we have the right type of critical point.
Thus the optimal time is an increasing function of the travel time, t0 , and the time to extract
food from the patch, a. If either of these constants get larger (e.g. local food is depleted, or harder
to find), than the optimal foraging time also gets larger (i.e. the animal should spend more time
looking for food for maximal efficiency.)

5.4 Optimal Foraging III:


While an animal is active, it uses energy at some rate,  > 0 per unit time. We will here assume
that this rate is constant, and is the same when the animal is foraging or traveling to the food
patch. Suppose we redefine the efficiency of the animal as
Energy gain − Energy consumed
R2 (t) = .
Total time
Let the Total time = t + t0 , as before, where t0 > 0 is constant travel time to a food patch and t is
time foraging in the patch. Show that the optimal foraging time is still the same as in Problem 5.2,
despite the new formulation of efficiency.
Would this be true even if the animal consumes energy at a higher rate while foraging than
while traveling?

Detailed Solution:
The energy consumed during the active period of the individual is the rate of consumption multiplied
by the time, i.e. (t + t0 ). Therefore, the new definition of efficiency is

F (t) − (t + t0 ) F (t) (t + t0 ) F (t)


R2 (t) = = − = − .
(t + t0 ) (t + t0 ) (t + t0 ) (t + t0 )

v.2006.1 - November 26, 2006 5


Science 1 Problems (set by L. Keshet) Chapter 5

But  is a constant. This means that the new definition of efficiency is simply a constant subtracted
from the old one. Thus R20 (t) = R0 (t), as before, i.e. the derivative of this new function is the same
as the derivative of the previous efficiency function, and therefore the critical points are the same
as well.
If the animal consumes energy at a higher rate while foraging, the above cancellation will not
work, and the critical points will be different.

5.5 Optimal foraging IVa:


In some cases, it takes time for an animal to start extracting energy from a food patch, e.g. if
burrowing, or digging is required before the food is obtained. Suppose that the energy gain function
is given by
Kt2
F (t) = 2 .
a + t2
We will assume that all other conditions (i.e. constant travel time t0 , definition of efficiency
R =Energy gain / Total time spent, etc) are the same as in Problem 5.2, and that the goal is
to maximize efficiency, as before.
We will investigate this problem in a number of steps.

(a) Explain why the function F (t) selected here might represent the scenario described in this
problem. Explain the meanings of the positive constants K, a.

(b) Show that maximizing the efficiency with respect to foraging time leads to a cubic equation
for t.

(c) With K = 3 and a = 1 hrs, and t0 = 1 hrs, use the spreadsheet to find a graphical solution,
i.e. draw the graph of F (t). On the same graph, draw a straight line from the point (−t0 , 0)
with some positive slope. Adjust the slope until the line meets the curve y = F (t) at a point
of tangency. (This line is called a ”rooted tangent”. You will have to find the slope of this
tangent line by trial and error using your spreadsheet, since solving a cubic equation is not
very easy to do analytically.) Use your graph to read off the value of t, at which the tangent
line meets the curve (to two significant digits). Explain why this value of t corresponds to the
optimal solution.

See Problem 5.6 for a more accurate solution to this optimization problem using Newton’s
Method for approximating zeros of polynomials.

Detailed Solution:
(a) The function F (t) in this problem is sigmoidal, i.e. it has low values for small positive t and
then increases sharply for intermediate values of t. This means that initially the energy gain
is not proportional to time spent, it is lower. After a while, the energy gain increases with
time and later on, as energy is depleted, F (t) saturates, i.e. approaches a constant K. The
constants K, a have the same meanings and units as in Problem 5.2.

v.2006.1 - November 26, 2006 6


Science 1 Problems Chapter 5

(b) We now compute the derivative of F and find:

Kt2
F (t) = .
a2 + t2
2t(a2 + t2 ) − t2 (2t) 2ta2
F 0 (t) = K = K
(a2 + t2 )2 (a2 + t2 )

Since we are still optimizing the efficiency, R(t), the critical point still satisfies the general
equation
F (t)
F 0 (t) = .
(t + t0 )
Plugging in the derivative and the new function into this equation leads to

2ta2 Kt2 1
K =
(a + t )
2 2 2 (a + t ) (t + t0 )
2 2

2a2 t
=
(a + t )
2 2 (t + t0 )
2a2 (t + t0 ) = t(a2 + t2 )
Simplifying this leads to the cubic equation

t3 − a2 t − 2a2 t0 = 0.

In general, this type of equation is not convenient to solve analytically.

(c) The graph produced by the spreadsheet is shown in Figure 5.2. To produce this graph, the
function F (t) given in this problem was plotted on a coordinate system scaled so that the
horizontal axis shows the point t = −t0 . A straight line through this point has an equation
of the form
y = m(t + t0 )
where m is the slope. Various values of m were used until the line approximately touches the
graph. The value of m that gave the desired slope was m ≈ 0.84. From the graph it can
be seen that the tangent line meets the curve at roughly t = t∗ ≈ 1.5 hrs, which is thus the
optimal foraging time.
This graphical solution can be understood by interpreting the ratio

F (t)
F 0 (t) = .
(t + t0 )

The left hand side (LHS) is tangent line slope. The RHS can also be interpreted as a “slope”,
i.e., the ratio of height to width of a triangle with height F (t) (green line) and base (t + t0 )
(blue line segment connecting t0 and t∗ along the horizontal axis). The tangent has been so
arranged that the two slopes are the same.

v.2006.1 - November 26, 2006 7


Science 1 Problems (set by L. Keshet) Chapter 5

4.0
Optimal Foraging
<= Rooted tangent

F(t)=(K t^2)/(a^2 + t^2)

<= Point of tangency

0.0
-3.0 - t_0 t* <= Optimal foraging time 10.0

Figure 5.2: Figure for solution to problem 5.5. This is the graphical solution to the problem of
maximizing the efficiency, R(t) of foraging. t0 = 1 is the time to travel to the patch. The red curve
shows F (t), the energy gained by foraging for a time t in the patch. The optimal foraging time is
t∗ , the time at which the tangent line to the curve intersects the point (t0 , 0).

5.6 Optimal foraging IVb and Newton’s method Solution


In this question, you are asked to use Newton’s Method and the spreadsheet to find the optimal
foraging time in Problem 5.5 part (c) to 5 digits of accuracy. Assume that K = 3 and a = 1 hrs,
and t0 = 1 hrs, and use the energy gain function F (t) in Problem 5.5. If you have already done
Problem 5.5, you need not redo your derivative calculations. Simply find a solution to the cubic
equation derived in that problem.

Detailed Solution:

In Problem 5.5, we showed that the optimal foraging time satisfies the cubic equation

t3 − a2 t − 2a2 t0 = 0.

v.2006.1 - November 26, 2006 8


Science 1 Problems Chapter 5

Plugging in the values of the constants a = 1, t0 = 1, and calling the resulting polynomial P (t),
leads us to the cubic equation
P (t) = t3 − t − 2 = 0,
or restated with the variable x,
P (x) = x3 − x − 2 = 0.
We will need the derivative of this function, namely

P 0 (x) = 3x2 − 1.

For Newton’s method, we need an initial estimate x0 (We avoid using t or calling this initial
guess “t0 ” to prevent confusion with the constant travel time.) We also use the Newton Formula
recipe to generate successive values, i.e.

P (x)
x1 = x0 − .
P 0 (x)

Pick x0 = 1 for an arbitrary positive initial guess for the root. Then

x30 − x0 − 2 −2
x1 = x0 − 2
=1− = 2.
3x0 − 1 2

The successive values are best determined using the spreadsheet. We input x0 = 1 in row 0 of
some column, and implement the recipe to determine the successive values. They are x2 = 1.6364,
x3 = 1.5304, x4 = x5 = · · · = 1.5214.
Thus the optimal foraging time, to 5 significant figures is t∗ = 1.5214.

Iterate x0 f (x0 ) f 0 (x0 ) x1 = x0 − f (x0 )/f 0 (x0 )


0 1.0000 -2.0000 2.0000 2.0000
1 2.0000 4.0000 11.0000 1.6364
2 1.6364 0.7453 7.0331 1.5304
3 1.5304 0.0539 6.0263 1.5214
4 1.5214 0.0004 5.9444 1.5214

Table 5.1: Decimal value for solution to the optimal foraging time using Newton’s method, starting
from the initial guess x0 = 1.

v.2006.1 - November 26, 2006 9

You might also like