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.

01

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.
0 or 1 weak itemsContinue with this module.
2 weak itemsRevisit design and stress limits in Machine Elements, Module 4.
3 or more weak itemsReview optimization basics in Mathematics, Module 19.
02

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 constraints

Every 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 skill works when: you name the variables, write one objective, and list every constraint before reaching for a method.
The skill breaks down when: a real constraint is left out, or the objective mixes two goals that should be traded off.
The concept. The constraints bound a feasible region; the objective's contours sweep across it. The optimum is the feasible point a contour reaches last, often on the boundary.
03

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.

PartSymbolExample
Design variablesxbeam width b, height h
Objectivef(x)minimise cross-section area bh
Inequality constraintg(x) ≤ 0stress σ ≤ σallow
Equality constrainth(x) = 0fixed 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.

04

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).

Figure 1. Design B has the smaller area but its stress exceeds the limit, so it is infeasible. The lighter design is not allowed; feasibility comes first.
  1. ProblemDecide which of the two beams in Figure 1 is feasible and compare their objectives.
  2. Given / findM = 2 × 106 N·mm, σallow = 100 MPa. For each design find σ and the area bh, and state feasibility.
  3. AssumptionsSimple bending; the stress constraint is the only active requirement.
  4. ModelObjective bh to minimise; constraint σ = 6M/(bh²) ≤ σallow.
  5. Equationsσ = 6M/(bh²)feasible if σ ≤ σallow
  6. 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².
  7. CheckB has the smaller area but violates the stress limit, so it cannot be chosen despite its lighter objective. Only A is a candidate.
  8. ConclusionAmong these two, only A is feasible. A smaller objective is worthless if the design is infeasible: the constraint decides first.
Result. A is feasible (σ = 62.5 MPa, area 2400 mm²); B is infeasible (σ = 166.7 MPa).
05

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.

Figure 2. Using the fixed volume to eliminate the height leaves the area as a function of the base alone, with a clear minimum where its slope is zero.
  1. ProblemMinimise the open-top box area for the fixed volume in Figure 2.
  2. Given / findV = 4000 cm³, square base side x, height h. Find the minimising x, h, and area.
  3. AssumptionsThe volume constraint x2h = V is used to eliminate h, leaving one variable.
  4. ModelS = base + four sides = x2 + 4xh, with h = V/x2, so S(x) = x2 + 4V/x; set dS/dx = 0.
  5. EquationsS(x) = x2 + 4V/xdS/dx = 2x − 4V/x2 = 0 ⇒ x3 = 2V
  6. Solvex3 = 2(4000) = 8000, so x = 20 cm. h = V/x2 = 4000/400 = 10 cm. S = 400 + 4(4000)/20 = 400 + 800 = 1200 cm².
  7. 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.
  8. 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.
Result. x = 20 cm, h = 10 cm, minimum area 1200 cm².
06

Misconceptions and diagnostics

MistakeSymptomDiagnostic questionCorrection
Optimising an infeasible designBest objective violates a limit"Does this point satisfy every constraint?"Check feasibility before comparing objectives.
Missing a constraintSolver returns an impossible design"What real requirement did I omit?"List every physical and practical constraint.
Two goals in one objectiveObjective mixes weight and cost"Is this a single number?"Keep one objective; trade off the rest as constraints or later.
Redundant variablesProblem larger than needed"Can an equality eliminate a variable?"Use equality constraints to reduce the variable count.
07

Practice ladder

Level 1 · Direct skill

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).

Level 2 · Mixed concept

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.

Level 3 · Independent problem

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.)

Transfer task | Real engineering

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.

08

Working with AI, and proving it yourself

Use AI as an examiner, not a solver

"Check that my objective is a single scalar and my constraints are complete."
"Give me three design goals; I will write each in standard form."
"Formulate the problem for me." Naming the variables and constraints is the skill.
"Which design is best?" Checking feasibility first is the point.

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.

Must include: a standard-form statement, a feasibility check, and two compared candidates.
09

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.

TodayFinish this quiz and Levels 1 and 2 of the ladder.
+1 dayRe-formulate the box problem from a blank page.
+3 daysWrite three new design problems in standard form.
+7 daysCarry the formulation into optimality conditions, Module 2.
+30 daysReuse standard form whenever a design goal appears.
10

Textbook mapping

This module follows Nocedal and Wright, Numerical Optimization, 2nd edition. Use these references to read further.

Topic in this moduleWhere to read more
Formulating an optimization problemNocedal & Wright, Chapter 1
Objective, constraints, feasible regionNocedal & Wright, Chapter 1
Standard form and problem typesNocedal & Wright, Chapter 1

Chapter numbers refer to the 2nd edition. The formulation framework is standard, so any recent edition will align closely.