Second-order cones

The geometry and algorithms of SOCP optimization

Foundation

Definition

A second-order cone is the convex set of points (t, x) satisfying ‖x‖2 ≤ t — geometrically, the ice-cream-cone-shaped region in ℜn+1 above the Euclidean norm of x. Optimization problems whose constraints are intersections of second-order cones and affine hyperplanes are called second-order cone programs (SOCPs). They sit between linear programs (LPs) and semidefinite programs (SDPs) in expressiveness and tractability — strictly more powerful than LPs (they handle quadratic constraints), strictly easier than SDPs to solve at scale, and the natural setting for the convex relaxations of OPF used in Lirion.

The standard second-order cone

$$\mathcal{Q}^{n+1} = \left\{ (t, x) \in \mathbb{R} \times \mathbb{R}^n : \|x\|_2 \le t \right\}.$$

The scalar t is constrained to be at least the Euclidean norm of the vector x. Geometrically, for n = 2, the cone is a circular cone with apex at the origin, axis along the t-direction, and aperture angle 45°. The boundary ‖x‖2 = t is the curved surface; the interior is the open set where the inequality is strict.

Three properties make second-order cones useful in optimization:

  1. They are convex — the conic combination of any two cone points stays in the cone.
  2. They are self-dual under the standard inner product — important for primal-dual interior-point algorithms.
  3. They are smooth except at the apex — allowing barrier functions that are twice differentiable everywhere relevant to interior-point methods.

Rotated second-order cones

$$\mathcal{Q}_r^{n+2} = \left\{ (u, v, x) \in \mathbb{R} \times \mathbb{R} \times \mathbb{R}^n : \|x\|_2^2 \le 2\, u\, v, \; u \ge 0, \; v \ge 0 \right\}.$$

The rotated cone is equivalent to the standard cone under a 45° rotation of two coordinates: setting t = (u+v)/√2 and t′ = (u−v)/√2 transforms one into the other. The rotated form is convenient when the natural problem expression involves a product uv on the right-hand side rather than a square t².

SOCWR’s central constraint, (wikr)² + (wiki)² ≤ wii · wkk, is exactly a rotated second-order cone with u = wii, v = wkk, x = (wikr, wiki). SOCBF’s constraint Pij² + Qij² ≤ ℓij · vi is another. Recognizing these as rotated cones lets standard SOCP solvers (Clarabel, Mosek, ECOS) handle them natively.

The SOCP problem

$$\begin{aligned}\min_{x \in \mathbb{R}^n} \quad & c^T x \\\text{s.t.} \quad & \|A_i x + b_i\|_2 \le c_i^T x + d_i, \quad i = 1, \ldots, m \\& F x = g\end{aligned}$$

The objective is linear, equality constraints are affine, and each inequality is an affine map of x landing inside the standard second-order cone. SOCP strictly generalizes linear programming (an LP is an SOCP with empty cone constraints) and convex quadratic programming (a QP with positive-semidefinite Hessian can be cast as SOCP). SDPs strictly generalize SOCPs in turn.

Solving SOCPs by interior point

Modern SOCP solvers use primal-dual interior-point algorithms, an evolution of the methods developed for linear programming in the 1980s and extended to conic settings by Nesterov, Todd, and Tsuchiya in the 1990s. The core idea: replace the constraint x ∈ ℚ by an interior penalty (barrier function) that diverges as x approaches the boundary, then solve the resulting unconstrained problem with Newton’s method, gradually reducing the barrier weight.

For the standard cone, the barrier function is f(t, x) = −log(t² − ‖x‖2²). Its gradient and Hessian are computable in O(n) operations, and its self-concordance properties guarantee polynomial-time convergence: an SOCP with m cones of total dimension N is solved to ε-accuracy in O(√m log(1/ε)) Newton iterations.

In practice, modern solvers (Clarabel, Mosek, ECOS, SCS) handle SOCPs with hundreds of thousands of variables and constraints in seconds. The bottleneck is typically the linear-system solve at each Newton iteration, dominated by the sparsity of Ai and the problem structure. For OPF problems, the natural network sparsity translates directly to fast SOCP solves.

What can be modeled as SOCP

SOCP is expressive enough to handle many problem classes that go beyond LP:

  • Quadratic constraints: any constraint of the form xTQx + bTx + c ≤ 0 with Q ⪰ 0 can be written as a second-order cone constraint.
  • Euclidean-norm constraints: ‖x‖2 ≤ k is trivially a cone with t = k.
  • Hyperbolic constraints: x² ≤ uv with u, v ≥ 0 is a rotated cone constraint, useful in geometric and economic problems with multiplicative structure.
  • Sums of squares: x1² + … + xn² ≤ t is a single cone constraint, used in least-squares formulations and robust optimization.
  • Second-moment constraints: stochastic problems where uncertain parameters live on ellipsoids translate naturally into SOCP via robust counterpart formulations.

What SOCP cannot model directly are constraints requiring positive semidefiniteness of a general matrix (those need SDPs) or integrality (those need MISOCP). For OPF, SOCP covers the main convex relaxations of interest; SDP provides tighter bounds at higher computational cost; QC relaxations combine SOCP with additional valid inequalities.

SOCP solvers in practice

Lirion defaults to Clarabel, an interior-point SOCP solver in Julia developed by Goulart and Chen at Oxford. Clarabel is open-source, supports both standard and rotated cones natively, and is the recommended choice for OPF problems up to several thousand buses.

For larger problems or specialized needs, alternatives include:

  • Mosek: commercial, the fastest SOCP solver on most benchmarks. Free academic license.
  • ECOS: open-source, single-threaded, robust on small to medium problems.
  • SCS: open-source, first-order method (no Newton step). Scales to very large sparse problems at lower accuracy.
  • Gurobi, CPLEX: commercial LP/MIP solvers with SOCP capabilities, fastest on problems mixing SOC and linear constraints.

Lirion’s solver-agnostic interface lets you switch backends without rewriting the model, useful when comparing solve times or when license constraints favor a particular tool.

Further reading

  1. Boyd, S., & Vandenberghe, L. (2004). Convex Optimization. Cambridge University Press. — Chapter 4 covers cones and SOCP modeling.
  2. Lobo, M. S., Vandenberghe, L., Boyd, S., & Lebret, H. (1998). Applications of second-order cone programming. Linear Algebra and its Applications, 284(1–3), 193–228. — The classic survey of what SOCP can model.
  3. Alizadeh, F., & Goldfarb, D. (2003). Second-order cone programming. Mathematical Programming, 95(1), 3–51. — Algorithmic and theoretical foundations.
  4. Nesterov, Y., & Todd, M. J. (1997). Self-scaled barriers and interior-point methods for convex programming. Mathematics of Operations Research, 22(1), 1–42. — Theory behind modern interior-point cone solvers.
  5. Goulart, P. J., & Chen, Y. (2024). Clarabel: An interior-point solver for conic programs with quadratic objectives. arXiv:2405.12762. — Reference for Lirion’s default SOCP solver.