Optimization · Module 1 of 10
Formulating an Optimization Problem
A solver is only as good as the problem you hand it. Before any method runs, you name the design variables, write the objective, and state the constraints that carve out the feasible region.
Readiness check
This module opens the course. Tick only what you can do closed-notes.
- Write a quantity of interest as a function of a few variables.
- Recall the bending stress σ = 6M/(bh²) of a rectangular beam.
- Check whether a value satisfies an inequality.
- Recognise a maximisation as a minimisation of the negative.
- Sketch a region defined by linear inequalities.
The core idea
An optimization problem has three parts: design variables you may change, an objective to minimise or maximise, and constraints that must hold. The constraints define a feasible region, and the best point inside it is the solution.
minimise f(x) over xsubject to g(x) ≤ 0, h(x) = 0feasible region = all x satisfying the constraintsEvery optimization problem is stated the same way. The design variables x are the quantities you are free to choose, the dimensions, materials, or settings of a design. The objective function f(x) is the single number you want to make as small (or large) as possible: weight, cost, stress, or energy. The constraints are the requirements the design must meet, written as inequalities g(x) ≤ 0 (a stress below a limit, a size within bounds) or equalities h(x) = 0 (a fixed volume, a balance law). Together the constraints define the feasible region, the set of all designs that are allowed; the optimum is the feasible point with the best objective. A maximisation is just the minimisation of the negative objective, so one standard form covers both. Getting this formulation right, choosing the variables, writing the objective, and listing every constraint, is more than half the work, because a solver can only find the best point in the region you actually described.
The skills, taught in order
Five skills build a clean formulation, the piece every later method depends on.
1.1 Design variables
The design variables are the quantities you may change, collected in a vector x. Choosing them well, independent, and enough to describe the design but no more, sets the dimension of the problem. Everything else is either computed from them or holds them in check.
1.2 The objective function
The objective f(x) is the single scalar to be optimised: minimise weight or cost, maximise stiffness or efficiency. It must be one number; when two goals compete, they are traded off later, not summed carelessly now. A maximisation is handled as minimising −f.
1.3 Constraints and the feasible region
Constraints state what a design must satisfy: inequality constraints g(x) ≤ 0 for limits like stress or size, equality constraints h(x) = 0 for fixed relationships like a set volume. The set of all designs satisfying every constraint is the feasible region.
| Part | Symbol | Example |
|---|---|---|
| Design variables | x | beam width b, height h |
| Objective | f(x) | minimise cross-section area bh |
| Inequality constraint | g(x) ≤ 0 | stress σ ≤ σallow |
| Equality constraint | h(x) = 0 | fixed volume or length |
The four parts of a formulation. Naming each one turns a vague design goal into a solvable problem.
1.4 Feasibility and active constraints
A design is feasible if it satisfies every constraint. At the optimum some inequality constraints are active (satisfied as equalities, holding the solution back) and others are inactive (slack). Recognising which constraints bind is the key to understanding a result.
1.5 Standard form
Writing the problem in a standard form, minimise f(x) subject to g(x) ≤ 0 and h(x) = 0, lets any solver read it. Converting a maximisation, flipping inequality signs, and moving all terms to one side are routine steps that make the formulation unambiguous.
Engineering connection: every design task, lightest bracket, cheapest gearbox, stiffest frame, becomes an optimization the moment you write its variables, objective, and constraints.
Worked example 1: feasibility of two beam designs
A rectangular beam carries a bending moment M = 2 × 106 N·mm and must keep its stress σ = 6M/(bh²) below σallow = 100 MPa. The objective is to minimise the cross-section area bh. Check two candidate designs: A (b = 30, h = 80 mm) and B (b = 20, h = 60 mm).
- ProblemDecide which of the two beams in Figure 1 is feasible and compare their objectives.
- Given / findM = 2 × 106 N·mm, σallow = 100 MPa. For each design find σ and the area bh, and state feasibility.
- AssumptionsSimple bending; the stress constraint is the only active requirement.
- ModelObjective bh to minimise; constraint σ = 6M/(bh²) ≤ σallow.
- Equationsσ = 6M/(bh²)feasible if σ ≤ σallow
- SolveA: σ = 6(2×106)/(30 · 802) = 12×106/192000 = 62.5 MPa ≤ 100, feasible, area = 2400 mm². B: σ = 12×106/(20 · 3600) = 166.7 MPa > 100, infeasible, area = 1200 mm².
- CheckB has the smaller area but violates the stress limit, so it cannot be chosen despite its lighter objective. Only A is a candidate.
- ConclusionAmong these two, only A is feasible. A smaller objective is worthless if the design is infeasible: the constraint decides first.
Worked example 2: sizing an open-top box
An open-top box with a square base of side x and height h must hold a fixed volume V = 4000 cm³. Formulate the surface area as a function of x alone and find the x that minimises it.
- ProblemMinimise the open-top box area for the fixed volume in Figure 2.
- Given / findV = 4000 cm³, square base side x, height h. Find the minimising x, h, and area.
- AssumptionsThe volume constraint x2h = V is used to eliminate h, leaving one variable.
- ModelS = base + four sides = x2 + 4xh, with h = V/x2, so S(x) = x2 + 4V/x; set dS/dx = 0.
- EquationsS(x) = x2 + 4V/xdS/dx = 2x − 4V/x2 = 0 ⇒ x3 = 2V
- Solvex3 = 2(4000) = 8000, so x = 20 cm. h = V/x2 = 4000/400 = 10 cm. S = 400 + 4(4000)/20 = 400 + 800 = 1200 cm².
- CheckThe second derivative 2 + 8V/x3 is positive, so this is a minimum. Using the volume constraint to remove h turned a two-variable problem into one variable.
- ConclusionThe lightest box uses x = 20 cm and h = 10 cm for 1200 cm² of material. Eliminating a variable with an equality constraint is the first move in many formulations.
Misconceptions and diagnostics
| Mistake | Symptom | Diagnostic question | Correction |
|---|---|---|---|
| Optimising an infeasible design | Best objective violates a limit | "Does this point satisfy every constraint?" | Check feasibility before comparing objectives. |
| Missing a constraint | Solver returns an impossible design | "What real requirement did I omit?" | List every physical and practical constraint. |
| Two goals in one objective | Objective mixes weight and cost | "Is this a single number?" | Keep one objective; trade off the rest as constraints or later. |
| Redundant variables | Problem larger than needed | "Can an equality eliminate a variable?" | Use equality constraints to reduce the variable count. |
Practice ladder
A beam design gives σ = 90 MPa with a limit of 100 MPa. Is it feasible?
Show answer
Yes: 90 ≤ 100, so the stress constraint is satisfied (and inactive, with slack).
Rewrite "maximise stiffness k(x)" in standard minimisation form.
Show answer
Minimise −k(x). Maximising a quantity is minimising its negative, so one standard form serves both.
A closed box (top and bottom) of square base x and fixed volume V = 2000 cm³ has area S = 2x2 + 4V/x. Find the minimising x.
Show answer
dS/dx = 4x − 4V/x2 = 0 ⇒ x3 = V = 2000, x = 12.6 cm. (The closed box gives x3 = V, not 2V.)
Take a real component you could redesign. Write its design variables, one objective, and at least two constraints in standard form.
What good work looks like
A clear variable list, a single scalar objective (say minimise mass), and constraints such as a stress limit and a size bound, all written as g(x) ≤ 0 or h(x) = 0, with a note on which are likely to be active.
Working with AI, and proving it yourself
Use AI as an examiner, not a solver
Portfolio task
Formulate a real design as an optimization: variables, one objective, and every constraint, then test two candidate designs for feasibility and objective value.
Retrieval and spaced review
Closed notes. Answer out loud, then reveal.
1. Name the three parts of an optimization problem.
Design variables, an objective function, and constraints.
2. What is the feasible region?
The set of all designs satisfying every constraint.
3. How is a maximisation put in standard form?
Minimise the negative of the objective.
4. What is an active constraint?
One satisfied as an equality at the optimum, holding the solution back.
5. Why check feasibility before objective?
A better objective is worthless if the design breaks a constraint.
Textbook mapping
This module follows Nocedal and Wright, Numerical Optimization, 2nd edition. Use these references to read further.
| Topic in this module | Where to read more |
|---|---|
| Formulating an optimization problem | Nocedal & Wright, Chapter 1 |
| Objective, constraints, feasible region | Nocedal & Wright, Chapter 1 |
| Standard form and problem types | Nocedal & Wright, Chapter 1 |
Chapter numbers refer to the 2nd edition. The formulation framework is standard, so any recent edition will align closely.