Penalty method (source code)

= Penalty method
{wiki}

A <penalty method> incorporates constraint violation into the objective with a parameter controlling its cost. For an equality constraint $c(x)=0$, the <quadratic penalty method> adds a multiple of $\|c(x)\|_2^2$; a <power penalty> uses higher even powers. The penalty can allow infeasible iterates while encouraging feasibility as the cost grows. This differs from a <logarithmic barrier>, whose domain itself excludes the constraint boundary and exterior. Existence of a penalized stationary point, convergence of its constraint violation and convergence of the primal points are separate questions.