Norm constrain in optimization

21 views
Skip to first unread message

optimizer

unread,
Sep 13, 2019, 4:17:18 AM9/13/19
to YALMIP
Hello, 

i would like to improve my minimization with a norm constraint.
My old problem was:

diag=optimize([s==a]+ConstrT+ConstrB,s'*s,sdpsettings('solver','gurobi','verbose',0,'usex0',0))

diag = 

  struct with fields:

    yalmiptime: 0.5723
    solvertime: 0.0037
          info: 'Successfully solved (GUROBI-GUROBI)'
       problem: 0

Now i add this non linear scalar sp such that -> Nonlinear scalar (real, models 'norm', 1 variable)

Then i impose this constraint:
ConstrSp=[sp<=45434];

I try to solve once again my problem adding this constraint:

diag=optimize([s==a]+ConstrT+ConstrB+ConstrSp,s'*s,sdpsettings('solver','gurobi','verbose',0,'usex0',0))
Warning: Solver not applicable (gurobi)

diag = 

  struct with fields:

    solvertime: 0
          info: 'Solver not applicable (gurobi)'
       problem: -4
    yalmiptime: 0.1970

Any suggestion on which solver should i use to solve this problem?

Johan Löfberg

unread,
Sep 13, 2019, 5:14:45 AM9/13/19
to YALMIP
You would have to be more explicit about what sp actually is, since it looks like you are defining a simple 1-norm constraint which gurobi should be able to solve

optimizer

unread,
Sep 13, 2019, 5:30:21 AM9/13/19
to YALMIP
Sorry, sp is defined as follows:

sp=norm(A*(inv(B)*C)*inv(A));

with:

A =

    0.1106    0.2685   -0.0478    0.7017    0.0020
    0.2013    0.3539   -0.0295   -0.1691   -0.0030
    0.2944   -0.1495    0.1086    0.0181    0.0242
    0.1405   -0.1250   -0.4738   -0.0056   -0.3513
    0.0769   -0.0847   -0.4804   -0.0144    0.7091

B =

    1.7270         0         0         0         0
         0    5.1230         0         0         0
         0         0    8.2140         0         0
         0         0         0    2.6090         0
         0         0         0         0    1.3390

C=
Linear matrix variable 5x5 (full, real, 7 variables)

sdisplay(C)

ans =

  5×5 cell array

    {'internal(1)'}    {'0'                }    {'0'          }    {'0'          }    {'0'          }
    {'internal(6)'}    {'internal(2)+int…'}    {'0'          }    {'0'          }    {'0'          }
    {'0'          }    {'0'                }    {'internal(3)'}    {'0'          }    {'0'          }
    {'0'          }    {'0'                }    {'0'          }    {'internal(4)'}    {'0'          }
    {'0'          }    {'0'                }    {'0'          }    {'0'          }    {'internal(5)'}

Johan Löfberg

unread,
Sep 13, 2019, 5:52:24 AM9/13/19
to YALMIP
The interesting thing is what C contains. Looks like it involves some nonlinear stuff, hence the model is not SOCP representable

optimizer

unread,
Sep 13, 2019, 5:56:40 AM9/13/19
to YALMIP
This is weird to me since I defined it as:

Cp=sdpvar(5,1);
DCp=diag(Cp);

Ca=sdpvar(2,1);
DCa=[0      0       0   0   0;
     Ca(1) Ca(2)    0   0   0;
     0      0       0   0   0;
     0      0       0   0   0;
     0      0       0   0   0];

dC=[Cp;Ca];

C=DCp+DCa;

optimizer

unread,
Sep 13, 2019, 6:01:15 AM9/13/19
to YALMIP
Indeed:

(inv(B)*C)
Linear matrix variable 5x5 (full, real, 7 variables)

A*(inv(B)*C)*inv(A)
Linear matrix variable 5x5 (full, real, 7 variables)

norm(A*(inv(B)*C)*inv(A))

Johan Löfberg

unread,
Sep 13, 2019, 6:08:18 AM9/13/19
to YALMIP
so C was linear (the norm is nonlinear so that is as expected)

However, you are using 2-norm on a matrix, and that is not SOCP representable as it involves eigenvalues, but requires an SDP solver

optimizer

unread,
Sep 13, 2019, 6:27:25 AM9/13/19
to YALMIP
Ok, then i have to use mosek as a solver.

Let us assume that my constraint ConstrT becomes non-linear. The solver 'mosek' is not suitable anymore exactly?

Which solver do you suggest?

Johan Löfberg

unread,
Sep 13, 2019, 6:29:10 AM9/13/19
to YALMIP
depends on what nonlinearity

If you have a general nonlinearity, and keep the SDP-representable 2-norm, you are out of luck, as there is no SDP solver supporting general nonlinearities

optimizer

unread,
Sep 13, 2019, 6:33:43 AM9/13/19
to YALMIP
So do you suggest to recast the 2-norm? 

Or in another way I could avoid introducing the non-linear ConstrT, keeping it linear but introducing a non-linear cost function. Does this change anything?

Johan Löfberg

unread,
Sep 13, 2019, 6:40:01 AM9/13/19
to YALMIP
No. But as I said, it all depends on what nonlinearity there is. x^2 is nonlinear but not an issue

I have no idea what you mean with recasting the 2-norm. You will have to use another non-sdp norm such as frobenious or 1-norm if you want to avoid moving into sdp territory


Reply all
Reply to author
Forward
0 new messages