Equations 3 and 4 define non-differentiable, nonconvex optimization problems and finding the globally optimally solution is not feasible.
various methods used to solve convex problems work well in practice.