From a Story to a Mathematical Model
Many optimization problems begin with a practical question: Which design gives the greatest area? Which plan costs the least? The calculus comes later. First, the situation must be translated into mathematics without changing what the question asks.
A useful model separates three things. Decision variables describe the quantities that a designer may choose. The objective function gives the quantity to maximize or minimize. Constraints state the equations or inequalities that the choices must satisfy.
For example, if a rectangle’s side lengths can vary but its perimeter is fixed, the side lengths are decision variables. Its area is the objective if the goal is to make the rectangle as large as possible. The fixed perimeter is a constraint. These roles are different: the objective measures what is being optimized, while the constraint describes a requirement that every allowed design must meet.
A Reliable Translation Process
Before writing formulas, identify the goal and the fixed information. Then assign variables to the quantities that can change. Give each variable a clear meaning and unit. Write the objective from its definition, and write each constraint from the corresponding fixed total, geometric relationship, or resource limit.
Name the quantities the design can vary, and attach units to them.
Decide whether the problem asks to maximize or minimize a specific quantity.
Use a definition or a sum of contributions to express the quantity being optimized.
Translate fixed dimensions, totals, budgets, and geometric relationships into equations or inequalities.
Substitute a possible design and verify the relationships, arithmetic, and units.
The variables and fixed numbers should not be confused. A fixed perimeter of \(40\) meters is a parameter supplied by the situation; the side lengths \(x\) and \(y\) are choices. A formula involving those choices is not automatically the objective: it could instead express a constraint. The wording of the problem determines its role.
Worked Example: Area of a Rectangle with Fixed Perimeter
Worked Example: Area of a Rectangle with Fixed Perimeter
A rectangular garden must use exactly \(40\) meters of edging. Choose variables and formulate the objective and constraint if the goal is to maximize the garden’s area.
Let \(x\) be the garden’s length in meters and \(y\) its width in meters. Both are decision variables. The goal is to maximize area, so the objective function is the rectangle’s area:
The edging covers all four sides. There are two sides of length \(x\) and two of length \(y\), so the total edging requirement gives the constraint
Thus the model is to maximize \(A(x,y)=xy\) subject to \(2x+2y=40\), with \(x>0\) and \(y>0\). The positivity conditions express that the garden has nonzero side lengths; they do not replace the perimeter equation.
Check the formulas with the possible design \(x=8\) meters and \(y=12\) meters. Its perimeter is
so it satisfies the constraint. Its area is
The units agree: meters times meters gives square meters. This substitution checks that the model correctly measures the perimeter and area. It does not establish that this design has the greatest possible area.
Worked Example: Area of a Triangular Enclosure
Worked Example: Area of a Triangular Enclosure
A right-triangular enclosure has a fixed perimeter of \(24\) meters. Formulate a model for maximizing its area.
Let \(x\) and \(y\) be the lengths, in meters, of the two perpendicular sides. These are the decision variables. By the Pythagorean theorem, the third side has length \(\sqrt{x^2+y^2}\) meters. The area of a right triangle is half the product of its perpendicular sides, so the objective is
The fixed perimeter includes all three sides. Therefore the constraint is
The model is to maximize \(A(x,y)=\frac12xy\) subject to this perimeter equation, with \(x>0\) and \(y>0\).
Check the equations using \(x=6\) meters and \(y=8\) meters. The third side is
The perimeter is \(6+8+10=24\) meters, as required. The area is
The perimeter equation uses lengths, while the objective uses square meters. This is an important check: adding lengths gives a perimeter, but multiplying two lengths gives an area.
Worked Example: Modeling Total Production Cost
Worked Example: Modeling Total Production Cost
A sign must have a printed area of \(24\) square feet. Its width is \(x\) feet and its height is \(y\) feet. Printing costs \(\$2\) per square foot, horizontal border material costs \(\$3\) per foot, vertical border material costs \(\$5\) per foot, and setup costs \(\$40\). Formulate the cost-minimization model.
The decision variables are the sign’s width \(x\) and height \(y\), measured in feet. The fixed printed area gives the constraint
The objective is total cost. The printing charge is \(\$2\) for each of \(xy\) square feet, so it is \(2xy\) dollars. The two horizontal edges have a combined length of \(2x\) feet, so their border cost is \(3(2x)=6x\) dollars. The two vertical edges have a combined length of \(2y\) feet, giving a cost of \(5(2y)=10y\) dollars. Adding the fixed setup charge gives
The model is to minimize \(C(x,y)\) subject to \(xy=24\), with \(x>0\) and \(y>0\). Each term in the cost function has units of dollars: for instance, \((\$2/\text{ft}^2)(xy\text{ ft}^2)\) is a dollar amount.
Check the model at \(x=4\) feet and \(y=6\) feet. The area is \((4)(6)=24\) square feet, so the constraint holds. The printing costs \((\$2/\text{ft}^2)(24\text{ ft}^2)=\$48\). The horizontal border costs \((\$3/\text{ft})(2\cdot4\text{ ft})=\$24\), and the vertical border costs \((\$5/\text{ft})(2\cdot6\text{ ft})=\$60\). Including setup, the total is \(\$48+\$24+\$60+\$40=\$172\). Substitution in the formula confirms this: \(C(4,6)=2(24)+6(4)+10(6)+40=48+24+60+40=172\).
Why the Model Represents the Problem
A model is useful only if its formulas preserve the meaning of the story. This can be justified directly. Each allowable design determines values for its decision variables. Applying the stated geometric definitions or cost rates to those values gives the actual quantity of interest. The objective function is constructed to equal that quantity, and the constraints are constructed to hold precisely when the design meets the stated requirements.
For the rectangular garden, a design with side lengths \(x\) and \(y\) has area \(xy\) by the definition of rectangle area, and edging length \(2x+2y\) by adding the lengths of its four sides. Therefore designs using exactly \(40\) meters of edging are represented by \(2x+2y=40\), and for every such design, \(A(x,y)=xy\) is its actual area. Consequently, maximizing the modeled area over designs satisfying the constraint is exactly the original goal of maximizing garden area. The same reasoning applies to the triangle and sign: their objectives calculate the requested area or cost, while their constraints encode the fixed requirements.
Common Modeling Pitfall
A frequent error is to put the constrained quantity in the objective. For the garden, someone might write “maximize \(2x+2y\) subject to \(2x+2y=40\).” This does not model the request to maximize area. The proposed objective is the perimeter, and the constraint fixes that same perimeter at \(40\). Every feasible design would have the same objective value, \(40\), regardless of its area.
The correction is to distinguish the two roles: \(2x+2y=40\) is the perimeter constraint, while \(xy\) is the area objective. Another common error is to omit a contribution from a cost objective. In the sign example, counting only the printing charge would leave out border and setup costs, so the resulting function would not represent total production cost. Listing each cost source before adding the terms helps prevent this mistake.
Check Your Understanding
For each question, identify the variables, objective, and constraint before considering how an optimum might be found.
- A rectangle has a fixed perimeter of \(30\) meters. If its area is to be maximized, what are suitable decision variables, objective function, and perimeter constraint?
- A right triangle has perpendicular sides \(a\) and \(b\), and its perimeter is \(18\) centimeters. Write its area objective and perimeter constraint.
- A rectangular surface has width \(x\) feet and length \(y\) feet, with a fixed area of \(50\) square feet. If the goal is to minimize a stated total installation cost, which relationship is the area constraint?
- Why is a setup charge included in total cost even if it does not vary with the dimensions?
- In a model, what question does the objective answer, and what question do the constraints answer?