Section 12.1 Introduction to Optimization
¶When we know how to find extreme values of a function, we can use those techniques to answer physical questions involving optimization. Optimization problems involve at least two related physical quantities. One quantity is a control variable, a physical attribute of the system that one can adjust. The other quantity depends on the control variable and measures an aspect of the system that we wish to improve.
In this section, we consider some examples of optimization. The primary challenge for such problems is in clearly defining the system, identifying the control variable and the quantity to optimize. We then apply the calculus techniques for finding extreme values.
Subsection 12.1.1 Objective Functions
Optimization is the application of finding extreme values to either maximize or minimize some quantity of interest. We usually have a physical incentive for this optimization, such as minimizing energy consumption, maximizing evolutionary fitness, minimizing costs of materials, or maximizing profit. The quantity of interest will depend on some independent variable that we have the ability to control or adjust. We call the mapping from the control variable to the physical quantity being optimized the objective function.
Frequently, identifying the appropriate objective function is the more challenging aspect of an optimization problem. Once the function is identified, the task is reduced to identifying local extreme values and behavior at end points. Sometimes the objective function depends on multiple independent variables that are related through some constraint. The constraint typically determines an equation which can be used to rewrite the objective functions as having only have a single independent variable. In addition, we need to determine a meaningful physical domain for the function.
We begin with several examples of creating objective functions for optimization problems. The actual analysis will follow later. Several simple examples come from geometry where we need to construct a shape that has some feature (like a given perimeter, area or volume) and we wish to make some other feature as large as possible. We use these examples not because they are practical but because they illustrate the principles of optimization effectively.
Example 12.1.1.
Suppose we want to create a rectangle that has an area of \(500 \; cm^2\text{.}\) Three sides will have one type of trim while the fourth side will have trim that is twice as expensive. What should be the dimensions of the rectange to minimize the cost of the trim?
Start by identifying the variables.
- \(h\) is the horizontal width of the rectangle
- \(v\) is the vertical length of the rectangle
- \(C\) is the cost of the trim around the rectangle
Once we have identified our variables, we need to find a formula for the cost because that is what we want to minimize. We will assume that the more expensive side is one of the horizontal lengths. Let \(p\) be the unit cost (per cm) of the less expensive trim so that \(2p\) is the unit cost of the more expensive trim. The total cost of the trim is given by
Our objective function \((h,v) \mapsto C\) involves two independent variables. This means we need an additional constraint. Reviewing the problem, we recall that the total area needs to be \(500 \; cm^2\text{.}\) The area is computed by \(A=h \cdot v = 500\) so that we can treat \(v\) as another dependent variable,
Substituting this formula into our objective function, we can rewrite it involving only a single independent variable \(h\text{:}\)
Because \(p\) is a constant multiple in this formula, the location of the minimum will not depend on \(p\text{.}\)
Finally, we need to consider the physical domain for the objective function. The natural domain for the map \(h \mapsto C\) is \(h \ne 0\text{.}\) However, negative values for \(h\) don't make physical sense. The physical domain for this problem will be \(h \in (0,\infty)\text{.}\) That is, the optimization problem will be answered by finding the global minimum of \(C\) on the interval \((0,\infty)\text{.}\)
A graph of this relation is shown below using \(p=1\text{.}\) The minimum value occurs somewhere near \(h=20\) with a cost \(C\) close to \(100p\text{.}\) We need to use calculus to find the exact value.
Example 12.1.2.
Suppose you have a flexible pipe of length 10 meters that you will bend to make three sides of a rectangle. How long should you make these sides so that the rectangle has as large an area as possible?
We start by identifying the variables. It is often helpful to draw a figure. A sample diagram is shown in Figure 12.1.3. We label the two opposite vertical sides by the variable \(h\) (height) and the horizontal side by the variable \(w\) (width).
We want to make the area as large as possible. This makes the area of the rectangle \(A\) the dependent variable. The area of a rectangle is the height times the width, so our objective function is defined by
We need to write this as a function of one independent variable.
The constraint for our independent variables \(h\) and \(w\) is that the total length of pipe used is 10 meters. The pipe is used for two edges of length \(h\) and one edge of length \(w\text{.}\) As an equation, the constraint becomes
If we solve this equation for \(w\text{,}\) we find
which we can substitute into the objective function,
The last step is to identify the physical domain for the objective function. A physical measurement of length must be non-negative, so \(h \ge 0\text{.}\) What is the largest value of \(h\) that is possible? We need \(w \ge 0\) which requires \(10-2h \ge 0\text{.}\) This implies \(h \le 5\text{.}\) The physical domain is therefore \(h \in [0,5]\text{.}\) Even though the shape would be an empty rectangle (no area), all of the variables are still defined when \(h=0\) or \(h=5\text{.}\) We include the end points since closed intervals are easier to analyze.
A graph of the objective function is shown in Figure 12.1.4. We can see that the area will be maximized at the vertex of this parabola. Calculus will give us an efficient method to find this point.
A biological example follows. A fundamental hypothesis of biology is that evolution drives organisms to maximize their fitness, which corresponds to the number of surviving offspring. There is often a trade-off between the number of offspring and the probability that the offspring survive. Let \(f\) (fecundity) represent the number of offspring an organism produces and let \(s\) (survival) represent the probability that an offspring will survive. The then fitness is given by \(F=f \cdot s\text{,}\) the average number of offspring that survive.
Example 12.1.5.
Suppose that the survival probability is related to fecundity so that it decreases linearly. If each organism has ten offspring, the survival probability is \(s=0.95\text{.}\) If each organism has forty offspring, the survival probability drops to \(s=0.8\text{.}\) How many offspring should the organism have to maximize fitness?
First, identify the variables. The objective function is the fitness \(F\) which depends on both \(f\) (fecundity) and \(s\) (survival probability) through
This objective function has two independent variables, \((f,s) \mapsto F\text{.}\)
We need to reduce the number of independent variables to a single variable by realizing that \(f\) and \(s\) will satisfy a linear relation. Because the original question asks for how many offspring should be produced, we will choose \(f\) to be the independent variable. The line passes through points \((f,s)=(10,0.95)\) and \((f,s)=(40,0.8)\text{.}\) We can compute the slope
Using the point-slope equation of a line, we find
Using substitution in the objective function gives
To find the physical domain, we require \(f \ge 0\) and \(s \ge 0\text{.}\) The second requirement becomes \(-0.005f+1 \ge 0\text{,}\) which means that \(f \le 200\text{.}\) The physical domain is therefore \(f \in [0,200]\text{.}\) A graph shows that the maximum should occur at the vertex of a parabola.
Subsection 12.1.2 Analysis for Optimization
Now that we have illustrated how to find the objective function for several examples, let us work through the analysis to solve the optimization problems. Two of our examples had objective functions that were quadratic polynomials. We start with those examples.
Example 12.1.7.
The bent pipe example resulted in an objective function
and a physical domain \(h \in [0,5]\text{.}\) Complete the optimization and find the dimensions that will maximize the area of the resulting rectangle.
To find the global extreme of the function \(A(h) = 10h-2h^2\text{,}\) we begin by computing the derivative,
To perform sign analysis of \(A'(h)\text{,}\) we first find the root \(A'(h)=0\text{:}\)
Our test intervals are \([0,\frac{5}{2})\) and \((\frac{5}{2},5]\text{.}\) Testing the sign at \(h=1\) and \(h=4\) as sample points, we find
The results of our sign analysis are summarized on the following number line.
Our sign analysis of \(A'(h)\) implies that \(A\) has a maximum value at \(h=\frac{5}{2}\text{.}\) Because \(A\) is increasing on \([0,\frac{5}{2}]\) and decreasing on \([]\frac{5}{2},5]\text{,}\) we see that this is a global maximum on the domain. The resulting dimensions of the rectangle are \(h=\frac{5}{2}=2.5\) meters and \(w = 10-2h = 10 - 2(2.5)=5\) meters. The area of the rectangle will be \(A=12.5\) square meters.
Example 12.1.8.
The fitness example resulted in an objective function
and a physical domain \(f \in [0,200]\text{.}\) Complete the optimization to find the number of offspring that will maximize the fitness.
To find the global maximum of \(F(f)\text{,}\) we first compute the derivative,
The root \(F'(f)=0\) occurs at \(f=100\text{.}\) Our sign analysis uses test intervals \([0,100)\) and \((100,200]\text{.}\) We compute the sign of \(F'(f)\) at sample points \(f=0\) and \(f=200\text{:}\)
The results of our sign analysis are summarized on the following number line.
The First Derivative Test allows us to conclude that \(F\) has a local maximum value at \(f=100\text{.}\) Because \(F\) is increasing on \([0,100]\) and decreasing on \([100,200]\text{,}\) this must also be a global maximum. The fitness will be maximized when each individual reproduces with 100 offspring.
For our third example, the objective function is not a polynomial. Because we have not yet established a rule for the derivative in this case, we will use technology to find it.
Example 12.1.9.
The cost to put trim on our rectangle was found to be the objective function
with a physical domain \(h \in (0,\infty)\text{.}\)
The SageMath computer algebra system allows us to compute derivatives automatically.
We now know
Like \(C(h)\text{,}\) this derivative is not defined for \(h=0\) but is otherwise continuous. We find a root by solving \(C'(h)=0\) and finding a common denominator:
Only \(h = +\sqrt{\frac{1000}{3}} \approx 18.257\) is in the domain.
We can test the signs of \(C'(h)\) using \(h=10\) and \(h=20\text{.}\)
The First Derivative Test shows that \(C\) has a local minimum at \(h=\sqrt{\frac{1000}{3}}\text{.}\) Because \(C\) is decreasing on \((0,\sqrt{\frac{1000}{3}}]\) and increasing on \([\sqrt{\frac{1000}{3}},\infty)\text{,}\) this minimum is a global minimum.
We finish by interpreting our mathematics. The question was how to find the dimensions of the rectangle. Our analysis gave us a value for \(h=\sqrt{\frac{1000}{3}} \approx 18.257 \; cm\text{.}\) We also need \(v\text{,}\) which was another dependent variable:
The minimal cost to trim a rectangle would have a horizontal length of 18.26 cm, one of which has the more expensive trim, and a vertical length of 27.386 cm.
Subsection 12.1.3 Summary
Optimization is the application of finding extreme values to physical problems. The dependent variable is the quantity that should be as large or as small as possible. The independent variable(s) are the quantities we can adjust. The map from the independent variable to the dependent variable is called the objective function.
When more than one independent variable is involved, an extra equation called a constraint allows us to solve for one of the independent variables in terms of the other.
A physical domain for the objective function represents the values of the independent variable(s) that are physically relevant.
Exercises 12.1.4 Exercises
1.
A rectangular frame will be made with horizontal edges that cost $0.50 per inch and vertical edges that cost $0.40 per inch. What are the dimensions of a rectangle that will maximize the enclosed area for a total cost of $20.00?
2.
Suppose that the survival probability for a species is related to fecundity so that it decreases linearly. If each organism has five offspring, the survival probability is \(s=0.9\text{.}\) If each organism has twenty offspring, the survival probability drops to \(s=0.75\text{.}\) How many offspring should the organism have to maximize fitness?
3.
A population of animals has the property that each individual has fewer offspring per year when the population is bigger. When the population has 200 individuals, the average number of offspring per individual per year is 4.8. When the population has 300 individuals, the average number of offspring per individual per year drops to 4.2. Assuming a linear relation between the per capita number of offspring per year and the population size, what population size corresponds to the largest total number of offspring per year? (The total number of offspring equals the per capita number of offspring times the population size.)
4.
A company sells bowling balls. The higher the price the company charges, the fewer balls are sold. When the price is $50, the company can sell 500 balls per week. When the price is $60, the company can sell 400 balls per week. Assuming a linear relation between the price and the number of balls sold per week, find the price for which the company earns the most revenue per week. (Weekly revenue equals the price per ball times the number of balls sold per week.)
5.
A rectangular container with a square base (top/bottom) is to be manufactured. The top and bottom (squares) are made from a material that costs $1.50 per square meter while the other four sides (rectangles) are made from a material that costs $1.00 per square meter. What should be the dimensions of the container that would maximize the volume and cost $20 in materials?
6.
A rectangular container with a square profile (front/back) is to be manufactured. The top and bottom (rectangles) are made from a material that costs $1.50 per square meter while the other four sides (two squares and two rectangles) are made from a material that costs $1.00 per square meter. What should be the dimensions of the container that would maximize the volume and cost $20 in materials?
7.
A beverage can is being designed in the shape of a circular cylinder (volume=\(\pi r^2 h\)). The top and bottom (circles, area=\(\pi r^2\)) are made from metal that costs $0.01 per square centimeter while the curved wall of the can (curved rectangle, area=\(2\pi r h\)) is made from metal that costs $0.004 per square centimeter. What should be the radius and height of the can that would maximize the volume in the container for a can that costs $0.25 in materials?
8.
A rectangular box with a square base and no top needs to contain a volume of 1000 cubic centimeters. The square base (all sides equal) is made from a material that costs 10 cents per square centimeter. The other four sides are made from a material that costs 6 cents per square centimeter. What dimensions should the box have to minimize the total cost of materials?
9.
A beverage can is being designed in the shape of a circular cylinder to hold 360 cubic centimeters (volume=\(\pi r^2 h\)). The top and bottom (circles, area=\(\pi r^2\)) are made from metal that costs $0.01 per square centimeter while the curved wall of the can (curved rectangle, area=\(2\pi r h\)) is made from metal that costs $0.004 per square centimeter. What should be the radius and height of the can that would minimize the materials cost?