Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

penalty function

A term added to the objective that charges an increasing cost for breaking a constraint.

For an inequality constraint g(x)\le0, the quadratic penalty function is P(x;\rho)=f(x)+\rho\,[\max(0,g(x))]^2, where \rho>0 is the penalty weight. It contributes nothing at a feasible point and grows with the square of the violation at an infeasible one, letting an ordinary unconstrained solver stand in for a constrained one.

Read the full section →
Graph settings

Calculator