Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you enforce positivity constraints in non-linear optimization (e.g. a constraint $x > 0$)? I remember there being a good reason for why most models use non-negativity constraints.

share|cite|improve this question
How about the KKT conditions?… – matt Jan 18 '12 at 11:43
@matt:They handle non-negative and equality constraints. – Jacob Jan 18 '12 at 12:03
:You could use "Log Barrier methods". I will post an answer with more detail. – matt Jan 19 '12 at 10:12
up vote 3 down vote accepted

Consider the following: $$\begin{array}{rll} \min_x& f(x)&\\ \text{subject to}& g_i(x)\leq0 &\text{for each }i\\ & h_i(x)=0 &\text{for each }j \\ \end{array}$$

For $\alpha>0$ we define the log barrier penalty function, $P_\alpha$, to be:

$$ P_\alpha(x)=f(x)-\frac1\alpha\sum_i\log(-g(_i(x))+\alpha\sum_jh_j(x)^2 $$

where $x$ must be strictly feasible, i.e. $g_i(x)<0$ for each $i$, in order for the log term to be defined.

We seek to minimise $P_\alpha(x)$. The idea is that the boundary of the feasible region (i.e $g_i(x)=0$) acts a a barrier for $x$ close to $0$.

share|cite|improve this answer
Should that be $\log(-g_i(x))$? I think you have an extra left parenthesis. – rhombidodecahedron Nov 17 '14 at 19:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.