Intro

OpenSoT provides an API to setup and solve generic Least-Squares like optimization problems in the form:

\[\begin{align} &\min\limits_{\mathbf{x}} \lVert \mathbf{A}\mathbf{x} - \mathbf{b}\rVert_{\mathbf{W}} + \mathbf{c}^T\mathbf{x}+\epsilon\lVert \mathbf{x} \rVert \newline &s.t. \quad \mathbf{d}_m\leq \mathbf{C}\mathbf{x}\leq\mathbf{d}_M \end{align}\]

with \(\mathbf{x} \in \mathbb{R}^n\), \(\mathbf{A} \in \mathbb{R}^{m \times n}\), \(\mathbf{b} \in \mathbb{R}^{m}\), \(\mathbf{W} \in \mathbb{R}^{m \times m}\), \(\mathbf{c} \in \mathbb{R}^{n}\), \(\mathbf{C} \in \mathbb{R}^{l \times n}\), \(\mathbf{d}_m\) and \(\mathbf{d}_M \in \mathbb{R}^{l}\), and \(\epsilon \in \mathbb{R}^+\). This optimization problem is equivalent to the following QP problem:

\[\begin{align} &\min\limits_{\mathbf{x}} \mathbf{x}^T\mathbf{H}\mathbf{x} + \mathbf{g}^T\mathbf{x} \newline &s.t. \quad \mathbf{d}_m\leq \mathbf{C}\mathbf{x}\leq\mathbf{d}_M \end{align}\]

with \(\mathbf{H} = \mathbf{A}^T\mathbf{W}\mathbf{A} + \epsilon\mathbf{I}\) and \(\mathbf{g}^T = \mathbf{c}^T - 2\mathbf{b}^T\mathbf{W}\mathbf{A}\), and can be solved by dedicated solvers.