Optimization in Engineering: Applications and Case Studies
Twenty-nine chapters have built a toolbox: linear and nonlinear programming, integer and dynamic methods, metaheuristics, multi-objective and stochastic optimization, game theory. This last chapter is about using it. The hardest step in real engineering is rarely running a solver — it is the leap from a messy physical problem to a clean mathematical model, and then the judgement to reach for the right tool among all the ones you now know. We close by making that leap four times, on real problems from power systems, finance, logistics and design, and by drawing the whole course together into a single picture of how an engineer decides what to optimize, and how.
- The modelling process — turning a verbal problem into decision variables, an objective, and constraints.
- A technique-selection map: reading a problem's structure to choose LP, integer, convex, multi-objective, metaheuristic or stochastic methods.
- Economic load dispatch by the equal-incremental-cost criterion — Lagrange and KKT in a power system.
- Mean-variance portfolio optimization as a quadratic program, and the efficient frontier.
- Capital budgeting as integer programming — and why a greedy relaxation is not enough.
- Black-box design and control by metaheuristics, common pitfalls, and a synthesis of the whole course.
From Problem to Formulation
Every solver in this book expects the same three ingredients, and supplying them is the real work of applied optimization. Decision variables are the quantities you control — the knobs to be set. The objective function is the single scalar you want to make as good as possible. The constraints are the rules the solution must obey: physical laws, resource limits, safety margins, logical requirements. Naming these three, precisely, converts an engineering problem into a mathematical one.
The skill is deciding what belongs where, and it is genuinely hard. A quantity you first think of as fixed may actually be a decision; a goal you first write as a constraint ("efficiency at least 90%") may be better as an objective ("maximise efficiency") or vice versa; and the choice of variables silently fixes which methods are even available. Good formulation is iterative — model, solve, look at the answer, discover it is absurd, and find the missing constraint that makes it absurd.
Choosing the Right Technique
With the model written, its structure dictates the method — and using the wrong one is the most common and most expensive mistake in applied optimization. A convex problem thrown at a genetic algorithm wastes thousands of evaluations reaching an answer that KKT would give in closed form; a rugged black-box handed to a gradient method converges confidently to the nearest bad local optimum. The map below is the course in one table.
| If the problem is… | Reach for… | From |
|---|---|---|
| Linear objective and constraints | Linear programming, the simplex method | Part 2 |
| Linear but variables must be whole | Integer programming, branch & bound, cutting planes | Part 4 |
| Smooth and convex, with constraints | KKT conditions, gradient and Newton methods, QP | Part 5 |
| Network- or flow-structured | Transportation, assignment, network models | Part 3 |
| Several conflicting objectives | Weighted sum, ε-constraint, NSGA-II (Pareto front) | Ch 27 |
| Non-differentiable, rugged, or black-box | GA, PSO, ACO, simulated annealing, tabu search | Part 6 |
| Data random or decisions sequential | Stochastic programming, chance constraints, MDPs | Ch 28 |
| Against a rational adversary | Game theory, saddle point, Nash equilibrium | Ch 29 |
Case Study: Economic Load Dispatch
A power utility runs several generators, each with a different fuel-cost curve, and must together meet the system demand \(D\) at every instant. Economic load dispatch asks how to split the demand among them at least total cost. It is the daily bread of power-system operation, and it is a constrained nonlinear program straight out of Part 5.
Each generator's cost is well modelled as a quadratic in its output \(P_i\): \(C_i(P_i) = a_i + b_i P_i + c_i P_i^2\). The formulation is then compact — minimise total cost subject to meeting demand and respecting each unit's capacity:
Ignore the capacity limits for a moment and attach a Lagrange multiplier \(\lambda\) to the demand equality. Stationarity of the Lagrangian gives \(\partial C_i/\partial P_i = \lambda\) for every generator — the celebrated equal incremental cost criterion. At the optimum, every running unit operates where its marginal cost equals a common system value \(\lambda\); if one unit's marginal cost were lower than another's, shifting output toward it would cut total cost, so optimality demands they be equal.
Solve each \(P_i = (\lambda - b_i)/(2 c_i)\) in terms of the unknown \(\lambda\), then pick \(\lambda\) so the outputs sum to \(D\) — the classic "lambda iteration." The multiplier \(\lambda\) is the system's marginal cost of electricity: the extra cost of one more megawatt of demand, and exactly the shadow price of Chapter 10.
The capacity limits are handled by the KKT conditions of Chapter 21. A unit whose unconstrained solution exceeds \(P_i^{\max}\) is simply fixed at that bound — its limit constraint becomes active, carrying its own multiplier — and the remaining demand is redispatched among the rest. Examples 1 and 2 work both cases numerically, and the answer confirms the physical intuition: the cheapest units at the margin are loaded hardest, up to their limits.
Case Study: Portfolio Optimization
An investor allocates capital across assets with uncertain returns. Harry Markowitz's insight — worth a Nobel Prize — was that the right objective is not return alone but the trade-off between expected return and risk, with risk measured as the variance of the portfolio. It is simultaneously a quadratic program (Chapter 22) and a multi-objective problem (Chapter 27), and it shows those two threads of the course meeting.
Let \(\mathbf{w}\) be the fraction of capital in each asset, \(\boldsymbol{\mu}\) the expected returns, and \(\Sigma\) the covariance matrix. Portfolio return is \(\boldsymbol{\mu}^{\mathsf T}\mathbf{w}\) and portfolio variance is the quadratic form \(\mathbf{w}^{\mathsf T}\Sigma\mathbf{w}\). Minimising risk for a required return is a QP:
Sweeping the required return \(R\) traces the efficient frontier — the Pareto front of this two-objective problem, each point a portfolio that gives the least risk for its level of return. The frontier's most celebrated feature is diversification: because assets are imperfectly correlated, a blend can have lower variance than any single asset in it, as Example 3 shows numerically. Splitting risk across uncorrelated bets is, mathematically, the same convexity that makes the frontier bulge toward the ideal corner of low-risk, high-return.
Case Study: Integer Decisions
Many engineering choices are not "how much" but "whether": build this substation or not, select this project or not, open this warehouse or not. Such yes/no decisions are binary variables, and the resulting models are integer programs from Part 4 — where, as Chapter 16 warned, rounding a continuous solution is not a reliable shortcut.
Capital budgeting is the archetype. Given a set of projects, each with a cost and a net present value, and a fixed budget, choose the subset that maximises total NPV without exceeding the budget. With \(x_j \in \{0,1\}\) indicating whether project \(j\) is chosen, this is exactly the \(0\)–\(1\) knapsack problem:
It is tempting to rank projects by their NPV-per-cost ratio and greedily fill the budget — the continuous (LP-relaxation) instinct. Example 4 shows it failing: the greedy pick leaves a better combination on the table, because a slightly less efficient project can fit the budget with a partner that the greedy leader crowds out. Recovering the true optimum needs the systematic search of branch and bound, which is precisely why integer programming is its own discipline and not a footnote to linear programming.
Black-Box Design & Control
The three case studies so far had exploitable structure — quadratic costs, convex variance, linear constraints. Some engineering problems have none. When the objective is computed by a simulation — a finite-element stress solver, a circuit simulator, a fluid-dynamics run — there is no formula, no gradient, and often a rugged, multi-modal landscape riddled with local optima. This is the native territory of the metaheuristics of Part 6.
Two everyday examples make it concrete. Tuning a PID controller means choosing three gains to minimise a performance index (overshoot, settling time, steady-state error) that can only be measured by running the closed loop — a black box in three variables, routinely tuned by PSO or a GA. Designing a truss means choosing member sizes to minimise weight subject to stress and deflection limits computed by a structural solver; with discrete catalogue sizes and a nonlinear analysis, metaheuristics or specialised structural-optimization methods take over. In each, the engineer trades the guarantee of optimality for the ability to optimize something that has no equation at all — a trade worth making only when the structure genuinely is not there.
Pitfalls & the Whole Course
A handful of mistakes account for most failed optimization projects, and none of them are about the solver.
| Pitfall | Symptom | Remedy |
|---|---|---|
| Wrong objective | The optimum is technically correct but useless or perverse | Make sure the objective encodes what you actually want; watch for gamed proxies |
| Missing constraint | A physically impossible or unsafe "optimal" solution | Validate against reality; add the constraint the absurd answer reveals |
| Wrong method for the structure | Slow runs, or confident convergence to a poor local optimum | Diagnose linearity, convexity, integrality first; match the method |
| Trusting a local optimum | A metaheuristic or gradient method reports one answer as "the" optimum | Restart from many points; know that only convex problems guarantee global |
| Ignoring uncertainty | A plan optimal for the mean fails badly in practice | Model the uncertainty (Ch 28) and check the value of doing so |
| Over-fitting the model | A beautiful model of a problem no one actually has | Prefer the simplest model that captures the decision that matters |
Step back, and the whole course tells one story. It opened with a single idea — choose the decision variables that make an objective as good as possible while respecting the constraints — and everything since has been that idea meeting a new complication. Linearity gave us the simplex method and duality; the shadow prices of duality became the multipliers of Lagrange, then the KKT conditions of nonlinear programming, then the \(\lambda\) of economic dispatch. Integrality forced branch and bound; multiple objectives forced the Pareto front; ruggedness forced the metaheuristics; randomness forced recourse and the Bellman equation; and an adversary forced the minimax theorem — which turned out to be duality wearing a different hat.
That recurrence is the deepest lesson of the book. These are not thirty separate techniques but one principle refracted through thirty kinds of difficulty, and the mark of a skilled engineer is seeing which refraction a given problem calls for. The methods will keep evolving — better solvers, learned heuristics, new hybrids — but the discipline of stating clearly what you want, what you can control, and what you must respect, and then choosing the least powerful tool that fits, will not. That discipline is what this course has really been about. Go build something optimal with it.
Everything from the simplex method to the Bellman equation is this sentence, specialised to a particular kind of objective, constraint, or uncertainty. Return to the full table of contents →
Worked Examples
Problem. Two generators supply \(D = 150\) MW. Their costs give incremental costs \(dC_1/dP_1 = 0.01 P_1 + 8\) and \(dC_2/dP_2 = 0.02 P_2 + 8\) (in \$/MWh). Find the least-cost dispatch and the system \(\lambda\).
Solution. Set both incremental costs equal to \(\lambda\): \(P_1 = (\lambda - 8)/0.01 = 100(\lambda - 8)\) and \(P_2 = (\lambda - 8)/0.02 = 50(\lambda - 8)\). Impose demand: \(P_1 + P_2 = 150(\lambda - 8) = 150\), so \(\lambda - 8 = 1\) and \(\lambda = 9\) \$/MWh. Back-substitute: \(P_1 = 100(1) = 100\) MW and \(P_2 = 50(1) = 50\) MW, summing to \(150\) as required. Both units run at an incremental cost of exactly \(9\) — the equal-\(\lambda\) condition — and the flatter-marginal-cost generator 1 carries twice the load of generator 2. The multiplier \(\lambda = 9\) is the marginal price of energy: serving one more megawatt of demand would cost about \$9 more per hour.
Problem. Repeat Example 1, but now generator 2 has a capacity limit \(P_2 \le 40\) MW. Re-dispatch.
Solution. The unconstrained answer wanted \(P_2 = 50 > 40\), so the limit is violated and, by the KKT conditions, generator 2 is fixed at its bound \(P_2 = 40\) MW with an active-constraint multiplier \(\mu > 0\). Generator 1 then supplies the remainder: \(P_1 = 150 - 40 = 110\) MW. Check the economics: at \(P_1 = 110\), \(dC_1/dP_1 = 0.01(110) + 8 = 9.1\), which is now the system \(\lambda\); at the capped \(P_2 = 40\), \(dC_2/dP_2 = 0.02(40) + 8 = 8.8\). Generator 2's marginal cost (\(8.8\)) is below \(\lambda\) (\(9.1\)) — it would happily produce more, but cannot — which is exactly the KKT signature of a beneficial constraint pushed to its limit: the cheaper unit at the margin is maxed out, and its shadow price \(\mu = 9.1 - 8.8 = 0.3\) measures the value of one more MW of its capacity.
Problem. Two uncorrelated assets have standard deviations \(\sigma_A = 10\%\) and \(\sigma_B = 20\%\) and expected returns \(8\%\) and \(12\%\). Find the portfolio of least variance and show diversification at work.
Solution. Put weight \(w\) in \(A\) and \(1-w\) in \(B\). With zero correlation the variance is \(\sigma_p^2 = w^2\sigma_A^2 + (1-w)^2\sigma_B^2 = 100 w^2 + 400(1-w)^2\). Differentiate and set to zero: \(200w - 800(1-w) = 0 \Rightarrow 1000w = 800 \Rightarrow w = 0.8\) — the tidy result \(w_A = \sigma_B^2/(\sigma_A^2 + \sigma_B^2) = 400/500 = 0.8\). So hold \(80\%\) in \(A\), \(20\%\) in \(B\). The variance is \(100(0.64) + 400(0.04) = 64 + 16 = 80\), giving \(\sigma_p = \sqrt{80} = 8.94\%\), with expected return \(0.8(8) + 0.2(12) = 8.8\%\). The punchline: \(8.94\%\) risk is lower than either asset alone (\(10\%\) and \(20\%\)) — combining imperfectly correlated assets cancels some risk for free, the whole point of the efficient frontier.
Problem. Four projects have (cost, NPV): \(A(4,7)\), \(B(3,4)\), \(C(5,9)\), \(D(2,3)\). The budget is \(8\). Compare the NPV-per-cost greedy rule with the true integer optimum.
Solution. The efficiency ratios are \(C = 9/5 = 1.8\), \(A = 7/4 = 1.75\), \(D = 3/2 = 1.5\), \(B = 4/3 = 1.33\). Greedy takes \(C\) (cost 5), then cannot fit \(A\) (\(5+4 = 9 > 8\)), takes \(D\) (\(5+2 = 7\)), and cannot fit \(B\) (\(7+3 = 10 > 8\)) — landing on \(\{C, D\}\) with NPV \(9 + 3 = 12\). But enumerate the budget-feasible subsets and \(\{B, C\}\) uses exactly \(3 + 5 = 8\) and returns \(4 + 9 = 13\) — strictly better. Greedy failed because taking the highest-ratio project \(C\) then filling with the small leftover \(D\) crowded out the better partner \(B\), which needed room \(D\) had taken. Only a systematic search — branch and bound — is guaranteed to find the \(13\); this is precisely why a fractional or greedy relaxation is a bound, not a solution, and integer programming earns its own machinery.
Problem. For each, name the most appropriate technique: (a) blend fuels to minimise cost meeting linear quality specs; (b) place 5 warehouses among 20 sites to minimise cost; (c) tune 3 controller gains against a simulator with no gradient; (d) choose pipe diameters to minimise pumping cost and capital cost together.
Solution. (a) A linear objective with linear constraints and continuous variables is a textbook linear program — solve with the simplex method (Part 2). (b) "Which sites" is a set of yes/no choices — binary variables and a cost objective make this a facility-location integer program, solved by branch and bound (Part 4). (c) No formula, no gradient, a rugged black box in three variables — a metaheuristic such as PSO or a GA (Part 6). (d) Two conflicting objectives, pumping cost versus capital cost, define a trade-off — a multi-objective problem whose Pareto front (Ch 27) shows the options, from which the engineer picks. The exercise is the whole chapter in miniature: diagnose the structure, then match the least powerful method that fits it.
Problem. A workshop makes two products. Each unit of product 1 needs 2 hours of machining and 1 of finishing and earns \$30; each unit of product 2 needs 1 hour of machining and 3 of finishing and earns \$50. There are 100 machining and 90 finishing hours available. Formulate the profit-maximising plan.
Solution. First the decision variables: let \(x_1, x_2 \ge 0\) be the units of each product made — the quantities the workshop controls. Next the objective: total profit \(\max\ 30 x_1 + 50 x_2\). Then the constraints, one per scarce resource: machining \(2x_1 + x_2 \le 100\), finishing \(x_1 + 3x_2 \le 90\), and non-negativity \(x_1, x_2 \ge 0\). That is the complete model — \(\max\ 30x_1 + 50x_2\) subject to the two resource limits — and its structure is unmistakable: a linear objective, linear constraints, continuous variables, so it is a linear program for the simplex method of Part 2. (If the products came only in whole units, the single change \(x_1, x_2 \in \mathbb{Z}_{\ge 0}\) would make it an integer program instead — a one-word edit to the model that changes the whole solution method.) The lesson is that naming variables, objective and constraints, in that order, is what turns a paragraph of English into something solvable.
Chapter Summary
The hard part is the model, not the solver: name the decision variables, the objective, and the constraints — and iterate when the answer looks absurd.
Linear → LP; integer → branch & bound; convex → KKT; many objectives → Pareto; black-box → metaheuristic; random → stochastic. Use the least powerful tool that fits.
Equal incremental cost \(dC_i/dP_i = \lambda\); bounds handled by KKT. Here \(\lambda = 9\), \(P_1 = 100\), \(P_2 = 50\); a cap on gen 2 gives \(P_1 = 110\).
Mean-variance is a QP and a two-objective problem. Diversification: the \(80/20\) blend has \(\sigma = 8.94\% <\) either asset alone.
Yes/no choices are binary variables. Greedy ratios can miss the optimum (\(12\) vs \(13\)); branch and bound is needed for a guarantee.
Duality, KKT, dispatch's \(\lambda\), and the minimax theorem are the same idea. State what you want, control, and must respect — then match the method.
Problems
These problems ask you to do the two things this chapter is about: formulate, and choose a method. For each, state the variables, objective and constraints explicitly, and name the technique before solving. Difficulty rises down the list.
- List the three ingredients every optimization model needs, and explain why the choice of decision variables constrains which methods are available.
- For each problem, name the most appropriate method and the part of the course it comes from: (a) shortest route through a road network; (b) mixing ingredients to hit nutritional targets at least cost; (c) scheduling generators on/off over 24 hours; (d) trading cost against reliability in a design.
- Two generators have incremental costs \(dC_1/dP_1 = 0.02P_1 + 6\) and \(dC_2/dP_2 = 0.025P_2 + 7\). For a demand of \(500\) MW, find the economic dispatch and the system \(\lambda\).
- Repeat Problem 3 with a limit \(P_1 \le 200\) MW, and interpret the shadow price of that limit.
- Two uncorrelated assets have \(\sigma_A = 15\%\), \(\sigma_B = 25\%\). Find the minimum-variance weights and the portfolio standard deviation, and confirm it is below \(\sigma_A\).
- Five projects have (cost, NPV): \((3,6),(4,7),(2,3),(5,9),(3,5)\) and a budget of \(9\). Find the greedy-ratio selection and, by enumeration, the true optimum; comment on any gap.
- A wind-plus-battery system must decide how much energy to store now, before tomorrow's price and generation are known. Name the framework from Chapter 28 that fits, and identify the here-and-now and recourse decisions.
- Formulate (variables, objective, constraints) the problem of choosing rectangular beam dimensions to minimise material while carrying a given load within a stress limit, and state whether it is linear, convex, or black-box.
- Give one engineering example each of a problem best solved by (a) linear programming, (b) integer programming, (c) a metaheuristic, and (d) multi-objective optimization, justifying each choice by the problem's structure.
- Explain the pitfall of "optimizing the wrong objective" with a concrete engineering example, and describe how you would detect and fix it.
- Take any problem from your own field, formulate it fully as an optimization model, classify its structure, choose a method from this course, and outline how you would solve and validate it.
- In one paragraph, explain the sense in which linear-programming duality, the KKT conditions, the economic-dispatch \(\lambda\), and the minimax theorem are the same idea, referencing the relevant chapters.