0

I'm dealing with a mathematical optimization problem, in more detail it is a semi-definite program (see code-snipped below), which is used to solve another problem iteratively.

It is required that the equality-constraints are met up to ~10^(-10) or better. Even if I start my optimization with a matrix M that meets the constraints up to 10^(-12) or better, the optimization result X doesn't meet the requirements for X+M very close (at least two or three of them are only met up to 10**(-7)). Is there a way to improve the accuracy of how close cvx (mosek) meets the constraints?

Sidenote: I got the initial value of my optimization as solution of exactly the same problem, so it seems to be possible to yield a higher accuracy, but I guess this was only lucky. Unfortunatly, this matrix isn't close to minimum, so I need to do another iteration.

# defining variable
X = cp.Variable((m,m), hermitian=True)
#pos. semi-definite constraint
constraints = [M+X >> 0]                                             
# all the other constraints
for i in range(0,len(b)):
    constraints += [ cp.trace(A[i]@(M+X)) == b[i]]                     

#problem formulation
prob = cp.Problem(cp.Minimize(cp.real(cp.trace(C@X))), constraints)
Result = prob.solve(solver=cp.MOSEK, verbose = False, parallel = True)

Here M and C are known matrices, A and b is a list of matrices and scalars respectively.

I've already tried to find an answer in the documentation and on the internet, but I couldn't find a solution. Therefore, I'd be grateful for any help!

Thank's in advance!

pcalc
  • 153
  • 5
  • 1) Check cvxpy's support in terms of param-passing/wrapping. Best-case: there is some general form allowing to use all of moseks params. Worst-case: only hardcoded params work and yours needed is not there. Start with the docs, if not enough: look at cvxpy's wrapper sources. 2) check mosek-docs for the name of the parameter needed. Probably somewhat like "tolerance". Wrap it then to whatever cvxpy needs. – sascha Apr 08 '20 at 18:57
  • 1
    Update: All you need for 1) is documented [here](https://www.cvxpy.org/tutorial/advanced/index.html#setting-solver-options) – sascha Apr 08 '20 at 19:03
  • 2
    You can of course try to tighten all the termination criteria mentioned in https://docs.mosek.com/9.2/pythonapi/solving-conic.html#adjusting-optimality-criteria. In here: https://docs.mosek.com/9.2/faq/faq.html#cvxpy it is shown how to set Mosek parameters from cvxpy. However expecting violations of less than 1e-10 on a realistic SDP is extremely wishful thinking. – Michal Adamaszek Apr 08 '20 at 19:46
  • And always use verbose=True to see how the solver is doing and if it is struggling numerically etc. You may have to rethink scaling. – Michal Adamaszek Apr 08 '20 at 19:50
  • @sascha, Michal Adamaszek thank you for your help! I tried to tighten the criteria mentioned in the docs. If I undstood their meaning right non of them directly influences the max. constraint violation. Therefore, I tried to lower the four mentioned parameter as much as possible, but some of them still are violated by (absolute) 1e-7. Contrary, if I use the CVX-Solver constraint violation is 1e-11 or lower (with default settings). So, maybe the method MOSEK works with can't handle small violations? (Since MOSEK is a commercial product, I don't think that techical issues are the problem..) – pcalc Apr 10 '20 at 07:53
  • @pcalc If you can make a fully reproducible example or generate a Mosek task file you would like investigated then you can try posting on https://groups.google.com/forum/#!forum/mosek – Michal Adamaszek Apr 14 '20 at 19:24

0 Answers0