linear least squares and lagrange

348 Views Asked by At

I want to solve the standard problem $\min_{x\in D} \frac{1}{2}||Ax-b ||$ where:

D = \begin{matrix} 0\leq x_1 \leq C \\ |x_2| \leq x_1 \hspace{2mm} \text{and} \hspace{2mm} |x_2| \leq C- x_1 \\ 0\leq x_3\leq D \end{matrix}

where $C,D>0$. I want to find a solution numerically.

So the idea is the following:

1) Solve the unconstrained problem in which there exist a closed form solution. If the solution is in the domain $D$ stop. Else: 2) Seek for a solution in the boundary using Lagrange multipliers.

Does anyone know how may I solve the problem with Lagrange-multipliers on the boundary (especially in the second inequalities)?

There is a scipy-python optimizer but the bounds of the x-vector that can be used as inputs do not depend on the x-vector components...Any ideas?

Thanks in advance