∇ProvenDecisions
Ctrl K

Economic order quantity: a convex optimization example, solved and checked

The economic order quantity is a classic convex optimization problem. Here it is solved by a real solver (CLARABEL) and checked: every constraint, and the optimality certificate. Change the numbers below and solve your own.

Answer. You asked for: the optimal order size q. The smallest objective value is 600, at q = 200.001. The constraint is satisfied exactly. Optimal, numerically checked.

Solve your own version free, no account needed

Say it or snap it

You can give ProvenDecisions this problem out loud or as a photo. The app wrote down both, solved them, and got the same checked answer as the typed version.

🎙️ Spoken (11 seconds)

What the app heard: “A shop sells 1200 units a year, each order costs $50 to place and holding one unit for a year costs $3, what order size minimizes the yearly ordering plus holding cost?”

📷 Photographed
Photo of the economic order quantity written on a note

The problem

A shop sells 1200 units a year. Each order costs $50 to place and holding one unit for a year costs $3. What order size minimizes yearly ordering plus holding cost?

How the model was built

The objective as written from the problem, before the numbers are multiplied out:

The model

Each line has a plain-language note on the right.

make this as small as possible
order size (units per order) is at least 0.001

What is being decided

There is one decision variable.

VariableTypeMeaning
qreal numberorder size (units per order)

Goal and limits

Minimize the objective subject to 1 constraint, of which 1 are simple bounds on a single variable.

Problem type

Conic (convex), complexity level 4: convex nonlinear functions such as log, exp, square roots or powers. Solved with CLARABEL at the Medium solver tier.

The answer at a glance

The optimal value of each decision, as the solver returned it.

q200.001

Which constraints hold the answer in place

No constraint is binding. Changing a binding constraint changes the answer; a slack one can move a little without effect.

#ConstraintValueLimitSlackBinding
1q >= 0.001200.0010.001200

Algebraic model (low level)

Decision variables, objective and every constraint written out; this is exactly what the solver receives.

Model code (cvxpy)

The same model in cvxpy, ready to run.

import cvxpy as cp

q = cp.Variable(name='q')  # order size (units per order)

objective = cp.Minimize(3*q/2 + 60000/q)
constraints = [
    q >= 0.00100000000000000,
]
problem = cp.Problem(objective, constraints)
problem.solve(solver='CLARABEL')
print(problem.status, problem.value)
print('q =', q.value)

Solve your own

This is the model as the app reads it. Change any number and solve it in the free box on the front page (no account needed).

minimize 50*1200/q + 3*q/2
subject to
q >= 0.001
# q = order size (units per order)
# asked: the optimal order size q

Change the numbers and solve it

Checked: the app's answer matches the reference answer in our test set. Built 2026-11-10.

Related examples

All 50 solved examples

Try ProvenDecisions free: type, photograph or say an optimization problem; every answer is checked by a solver.

What do you want to optimize?

Type the math, describe it in words, snap a photo or say it. ProvenDecisions builds the model, solves it, checks it and walks you through it.

One constraint per line, or separated by commas. Add integer: x, y or binary: z for whole-number decisions. LaTeX works too.

Try: