# Failed status with MOSEK solver but solved with SDPT3

Hi,
I am working on the following optimization problem, and I am still a beginner in CVX. I am getting the problem solved using SDPT3 solver but, failed with MOSEK. I am wondering what would be the reason behind that. Also, when I change the precision to “Low”, MOSEK was able to solve the problem, but not with the exact results .
Here is my code:

function [f1,f2,f3,f4,MSE]=MMSE_expanded(H,sigma1,sigma2,sigma3,sigma4,c1,c2,c3,c4)
Idc= 0.5; Il= 0.3; Iu=0.7;
h11=H(1,1:2);
h12=H(1,3:4);
h21=H(2,1:2);
h22=H(2,3:4);
h31=H(3,1:2);
h32=H(3,3:4);
h41=H(4,1:2);
h42=H(4,3:4);
NL=2;
cvx_begin
variable f1(2,1)
variable f2(2,1)
variable f3(2,1)
variable f4(2,1)

V1=(square((h11f1))+square((h11f2))+ square((h12f3))+ square((h12f4))+sigma1);
V2= (square((h21f2))+square((h21f1))+square((h22f3))+square((h22f4))+sigma2);
V3= (square((h31f1))+square((h31f2))+ square((h32f3))+ square((h32f4))+sigma3);
V4= (square((h41f1))+ square((h41f2))+square((h42f3))+square((h42f4))+sigma4);

E1= ((c1)^2)V1-(2c1h11f1)+1;
E2= ((c2)^2)V2-(2c2h21f2)+1;
E3= ((c3)^2)V3-(2c3h32f3)+1;
E4= ((c4)^2) V4-(2c4h42f4)+1;

WSMSE= E1+E2+E3+E4;

%objective function

object= WSMSE;

minimize(object)

``````%constraints
``````

constraints(1:NL)= (abs(f1)+abs(f2))-[0.2;0.2]; %%% Idc-Il= 200 mA
constraints(NL+1:2*NL)= (abs(f3)+abs(f4)) -[0.2;0.2];
subject to
constraints<=zeros(size(constraints));

cvx_end

MSE=object;

end

Here is the output dialog:

## Calling Mosek 8.0.0.60: 50 variables, 24 equality constraints

MOSEK Version 8.0.0.60 (Build date: 2017-3-1 13:09:33)
Platform: Windows/64-X86

MOSEK warning 57: A large value of 2.0e+010 has been specified in cx for variable ‘’ (2).
MOSEK warning 57: A large value of 2.0e+010 has been specified in cx for variable ‘’ (5).
MOSEK warning 57: A large value of 2.0e+010 has been specified in cx for variable ‘’ (8).
MOSEK warning 57: A large value of 2.0e+010 has been specified in cx for variable ‘’ (11).
MOSEK warning 57: A large value of 2.4e+009 has been specified in cx for variable ‘’ (14).
MOSEK warning 57: A large value of 2.4e+009 has been specified in cx for variable ‘’ (17).
MOSEK warning 57: A large value of 4.6e+009 has been specified in cx for variable ‘’ (20).
MOSEK warning 57: A large value of 4.6e+009 has been specified in cx for variable ‘’ (23).
MOSEK warning 57: A large value of 7.1e+009 has been specified in cx for variable ‘’ (26).
MOSEK warning 57: A large value of 7.1e+009 has been specified in cx for variable ‘’ (29).
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 24
Cones : 18
Scalar variables : 50
Matrix variables : 0
Integer variables : 0

Optimizer started.
Conic interior-point optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator - tries : 0 time : 0.00
Lin. dep. - tries : 1 time : 0.00
Lin. dep. - number : 0
Presolve terminated. Time: 0.00
Optimizer - solved problem : the primal
Optimizer - Constraints : 14
Optimizer - Cones : 18
Optimizer - Scalar variables : 50 conic : 46
Optimizer - Semi-definite variables: 0 scalarized : 0
Factor - setup time : 0.00 dense det. time : 0.00
Factor - ML order time : 0.00 GP order time : 0.00
Factor - nonzeros before factor : 42 after factor : 44
Factor - dense dim. : 0 flops : 4.32e+002
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 2.0e+000 4.0e+007 1.5e+008 0.00e+000 3.957291289e+013 0.000000000e+000 1.0e+000 0.05
1 3.3e-001 6.6e+006 1.0e+007 -1.00e+000 3.957290584e+013 -1.485364191e+004 1.7e-001 0.09
2 2.6e-002 5.2e+005 2.3e+005 -1.00e+000 3.957279618e+013 -2.216917145e+005 1.3e-002 0.09
3 5.4e-005 1.1e+003 2.1e+001 -1.00e+000 3.951433543e+013 -1.103855617e+008 2.7e-005 0.09
4 7.9e-008 1.6e+000 1.6e-003 -9.98e-001 1.790602595e+013 -4.083008270e+010 4.0e-008 0.11
5 7.1e-009 1.4e-001 2.0e-004 4.42e-003 1.468041089e+012 -7.136513755e+010 3.5e-009 0.11
6 3.1e-010 6.1e-003 5.9e-005 9.61e-001 3.666494225e+010 -6.854753480e+010 1.5e-010 0.11
7 6.4e-011 1.3e-003 7.3e-005 1.98e+000 2.730991691e+009 -1.363622934e+010 3.2e-011 0.11
8 1.4e-011 2.7e-004 4.8e-005 1.92e+000 3.599249534e+008 -1.871729805e+009 6.9e-012 0.13
9 3.7e-013 7.3e-006 5.8e-006 1.55e+000 1.969164845e+007 -2.235847019e+007 1.8e-013 0.13
10 8.6e-018 1.6e-010 3.6e-008 1.00e+000 2.723960244e+002 -7.570290272e+002 4.3e-018 0.13
11 4.9e-019 1.9e-011 8.7e-009 1.00e+000 1.544276187e+001 -4.364338922e+001 2.5e-019 0.13
12 4.9e-019 1.9e-011 8.7e-009 1.00e+000 1.544276187e+001 -4.364338922e+001 2.5e-019 0.14
Interior-point optimizer terminated. Time: 0.14.

Optimizer terminated. Time: 0.20

Interior-point solution summary
Problem status : UNKNOWN
Solution status : UNKNOWN
Primal. obj: 1.5442761872e+001 nrm: 1e+000 Viol. con: 2e-009 var: 0e+000 cones: 0e+000
Dual. obj: -4.3643389220e+001 nrm: 2e+010 Viol. con: 0e+000 var: 6e-002 cones: 0e+000
Optimizer summary
Optimizer - time: 0.20
Interior-point - iterations : 13 time: 0.14
Basis identification - time: 0.00
Primal - iterations : 0 time: 0.00
Dual - iterations : 0 time: 0.00
Clean primal - iterations : 0 time: 0.00
Clean dual - iterations : 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations : 0 time: 0.00
Dual simplex - iterations : 0 time: 0.00
Mixed integer - relaxations: 0 time: 0.00

Status: Failed
Optimal value (cvx_optval): NaN

Error using .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {invalid} .* {convex}

Error in * (line 36)
z = feval( oper, x, y );

Error in MMSE_expanded (line 26)
E1= ((c1)^2)V1-(2c1h11f1)+1;

Error in CB_expanded (line 65)
[f1,f2,f3,f4, MSE]=MMSE_expanded(H,sigma1,sigma2,sigma3,sigma4,c1,c2,c3,c4); %%% function for
solving problem P2

CB_expanded

Without seeing the data the best advice is:

1. Clean up the huge coefficients you are being warned about.

2. Use Mosek 9.2.

3. Save the Mosek task file and contact support@mosek.com https://docs.mosek.com/9.2/faq/faq.html#how-do-i-dump-the-problem-to-a-file-to-attach-with-my-support-question

Dear Michal,

I tried to use MOSEK 9.2 and scaled my problem.
It is working now and gives reasonable results.

BTW, presumably the CVX error message at the end of the output is because `MMSE_expanded`, and therefore CVX, is called in a loop, and the variable values from the previous iteration are used as input in the next CVX invocation; but those values are `NaN` due to CVX’s failed status, and the NaN input values cause the CVX “invalid” error message.

Dear Mark,