Convex Optimization Calculator

Build accurate convex optimization scenarios from matrix coefficients. Estimate minima, gradients, and constrained solutions clearly. Compare iterations, bounds, and objective paths using interactive visuals.

Calculator Inputs

Use a symmetric Hessian with coefficients a, b, and c for the quadratic objective. Set step size to 0 for automatic selection.

Quadratic weight on x².
Cross term weight in 2bxy.
Quadratic weight on y².
Linear term on x.
Linear term on y.
Constant offset in the objective.
Starting point for the iterative solver.
Second starting coordinate.
Use 0 for automatic 1/L step.
Lower bound on x.
Upper bound on x.
Lower bound on y.
Upper bound on y.
Stopping threshold for projected gradient norm.
Iteration cap for projected gradient descent.

Example data table

Parameter Sample value Meaning
a4Curvature on x²
b1Cross coupling between x and y
c3Curvature on y²
d-8Linear tilt in x direction
e-6Linear tilt in y direction
f₀5Constant objective shift
Initial point(0, 0)Starting guess for the solver
Boundsx, y in [-5, 5]Feasible box constraints
Expected behaviorInterior optimumSolution remains inside the feasible box

Formula used

Objective function

f(x, y) = 0.5(ax² + 2bxy + cy²) + dx + ey + f₀

Gradient

∇f(x, y) = [ax + by + d, bx + cy + e]

Hessian matrix

H = [[a, b], [b, c]]

Convexity conditions for this 2×2 quadratic model

a ≥ 0, c ≥ 0, and ac − b² ≥ 0

Projected gradient update

(xₖ₊₁, yₖ₊₁) = P[(xₖ, yₖ) − α∇f(xₖ, yₖ)]

Projection operator

P clips x and y to their lower and upper bounds.

This implementation solves a bounded convex quadratic objective in two decision variables. It also reports Hessian diagnostics, convergence behavior, and whether the final answer sits on an active bound.

How to use this calculator

  1. Enter the quadratic coefficients a, b, c, d, e, and f₀.
  2. Provide a starting point using initial x and initial y.
  3. Set lower and upper bounds for both decision variables.
  4. Use step size 0 if you want the calculator to choose 1/L automatically.
  5. Enter a tolerance and maximum iteration limit.
  6. Press Solve Optimization Problem to compute the bounded optimum.
  7. Review the diagnostic table to confirm convexity, convergence, and bound activity.
  8. Use the CSV and PDF buttons to export the computed results.

Frequently asked questions

1) What does this convex optimization calculator solve?

It solves a two-variable quadratic objective with lower and upper bounds on x and y. The calculator checks convexity, runs projected gradient descent, and reports the best feasible point it finds.

2) Why must the Hessian be positive semidefinite?

A positive semidefinite Hessian makes the quadratic surface convex. In that case, any feasible local minimum is also a global minimum inside the bounded region.

3) What happens when step size is set to zero?

The calculator automatically uses an inverse-Lipschitz step based on the largest Hessian eigenvalue. This choice is practical for many convex quadratic problems and often improves stability.

4) What is the projected gradient norm?

It measures how far the current point is from satisfying the bounded optimality conditions. Smaller values indicate the iterate is closer to a stationary feasible solution.

5) Why can the final answer lie on a bound?

Bounds define the feasible set. If the unconstrained minimum falls outside that set, the best feasible solution occurs on an edge or corner after projection.

6) What does strictly convex mean here?

Strict convexity means the smallest Hessian eigenvalue is positive. That usually implies a unique unconstrained minimizer, although box constraints may still activate at the final optimum.

7) Can I use this for general nonlinear programming?

This page is designed for quadratic convex objectives with simple box constraints only. General nonlinear programs may require line searches, penalties, or specialized solvers.

8) What should I do if convexity checks fail?

Review a, b, and c first. If ac − b² is negative or a or c is negative, the model is not convex. Adjust the quadratic coefficients before relying on the result.

Related Calculators

knapsack problem solverslack variable calculatorbranch and bound solverdual simplex solvertransportation problem solvershadow price calculatorbinary optimization calculatorconvex hull calculatorinterior point method solverportfolio optimization calculator

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.