Calculator Inputs
Use a symmetric Hessian with coefficients a, b, and c for the quadratic objective. Set step size to 0 for automatic selection.
Example data table
| Parameter | Sample value | Meaning |
|---|---|---|
| a | 4 | Curvature on x² |
| b | 1 | Cross coupling between x and y |
| c | 3 | Curvature on y² |
| d | -8 | Linear tilt in x direction |
| e | -6 | Linear tilt in y direction |
| f₀ | 5 | Constant objective shift |
| Initial point | (0, 0) | Starting guess for the solver |
| Bounds | x, y in [-5, 5] | Feasible box constraints |
| Expected behavior | Interior optimum | Solution 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
- Enter the quadratic coefficients a, b, c, d, e, and f₀.
- Provide a starting point using initial x and initial y.
- Set lower and upper bounds for both decision variables.
- Use step size 0 if you want the calculator to choose 1/L automatically.
- Enter a tolerance and maximum iteration limit.
- Press Solve Optimization Problem to compute the bounded optimum.
- Review the diagnostic table to confirm convexity, convergence, and bound activity.
- 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.