Quadratic penalty method (source code)

= Quadratic penalty method
{title2=$f(x)+\frac1{2\mu}\bigl(\|h(x)\|^2+\|g(x)^-\|^2\bigr)$}

For constraints $h=0$, $g\geq0$, minimize the displayed <merit function> for progressively smaller $\mu>0$, where $g_i^- =\min(g_i,0)$. Increasing the quadratic penalty discourages <constraint violation>. In a violated inequality, differentiation gives the multiplier estimate $\lambda_i=-g_i/\mu$; an inactive inequality has estimate zero. Thus obtaining small violations by this method alone typically requires a very small $\mu$, which may cause a large <condition number> in the inner minimization.