Test candidate solutions for quadratic programs with constraints. Inspect feasibility, stationarity, and slackness clearly. Use responsive inputs, exports, tables, and visual diagnostic plots.
This calculator checks KKT conditions for a two-variable quadratic objective with up to three linear inequalities and one linear equality.
This sample matches the default loaded values and gives a numerically valid KKT point.
| Item | Sample Value | Meaning |
|---|---|---|
| Objective | f(x,y) = x² + y² | Set qxx = 2, qyy = 2, others zero. |
| Candidate Point | (1.5, 1.5) | Point to test against all KKT conditions. |
| g1 | -x - y + 3 ≤ 0, λ1 = 3 | Represents x + y ≥ 3 after rearrangement. |
| g2 | -x ≤ 0, λ2 = 0 | Nonnegativity for x. |
| g3 | -y ≤ 0, λ3 = 0 | Nonnegativity for y. |
| Expected Outcome | KKT satisfied | Primal, dual, slackness, and stationarity all pass. |
The calculator computes ∇f using the quadratic coefficients. It also checks the transformed Hessian for positive semidefiniteness. For linear constraints, satisfied KKT conditions plus convexity indicate a global optimum for the transformed problem.
Enter the candidate point x and y first. Then choose whether the problem is a minimization or maximization task.
Define the quadratic objective coefficients. The calculator uses a standard two-variable quadratic form, so you only need six coefficients.
Enable the constraints you want to test. For each enabled inequality, enter a, b, rhs, and the corresponding multiplier λ.
Enable the equality only when needed. Enter its coefficients and multiplier μ if your problem contains one.
Press the evaluate button. The report shows primal feasibility, dual feasibility, complementary slackness, stationarity, active constraints, exports, and a visual graph.
It checks the four main KKT conditions at a candidate point: primal feasibility, dual feasibility, complementary slackness, and stationarity. It also adds a simple LICQ and convexity review for extra interpretation.
No. It evaluates a supplied candidate point and the supplied multipliers. You can use it to verify suspected solutions, test manual work, or inspect numerical conditions around a point.
A quadratic objective keeps the tool practical and reliable inside one file. It still covers many common mathematical, engineering, and economics problems while allowing exact gradients and clear plotting.
The calculator transforms a maximization into a minimization of the negative objective when applying the stationarity and convexity checks. This keeps the KKT evaluation consistent and numerically simple.
A small value like 0.0001 works well for most classroom and practical examples. Increase it slightly if your numbers are large or rounded, and decrease it for stricter checks.
An inequality is active when its value is numerically near zero at the candidate point. Active constraints usually influence stationarity through their multipliers and help define the local boundary geometry.
Not always. KKT conditions are necessary under suitable regularity assumptions, but global optimality needs more structure. For this tool, convexity of the transformed quadratic objective and linear constraints greatly strengthens the conclusion.
You can export a CSV summary of the computed values and download a PDF snapshot of the report section, including the table content and the Plotly visualization.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.