The constraint I modeled is not working

710 views
Skip to first unread message

Rajan S

unread,
Jul 29, 2017, 11:58:12 PM7/29/17
to YALMIP
SO I have a Integer program I am trying to solve. The decision variables are A(action) G( min of action and demand), B( no of products) and StateMatrix ( which tells the no of products left at any given state. The functionNA computes the state .. state(:,1) = B, State(:,j) = State(:, j-1) - G((:j-1)) It is a 4 stage problem(j =4). Now I have to impose a constraint that the Action is the same for a given state value in any particular stage (Non anticipativity constraint). I created this as a function (FunctionNACon) The solver solves my problem however in the optimal values I see that the above constraint is not satisfied. As a related query whats the way to debug this on matlab so that I can see every iteration that the solver does with these variables? I tried to run on debug mode but once it goes to solve I lose track of what is going on. Attached are the files


Thanks a lot!!
functionNA.m
functionNACon.m
functiontest.m
nonanticipative2.m

Rajan S

unread,
Jul 30, 2017, 12:01:24 AM7/30/17
to YALMIP
As  a follow up to this I tried a totally dfferent way to impose the above constraint by choosing an action (t) corresponding to a state (t) (FunctionNOnAntAct) and removing NACon from the constraints of my previous problem. Same error here as well.. see attached
functionNA.m
functionNonAntAct.m
nonanticipative3.m

Johan Löfberg

unread,
Jul 30, 2017, 2:19:00 AM7/30/17
to YALMIP

All the constraints you have defined are satisfied

 

>> check(Constraints)

 

++++++++++++++++++++++++++++++++++++++++++++++++++++

|   ID|               Constraint|   Primal residual|

++++++++++++++++++++++++++++++++++++++++++++++++++++

|   #1|   Elementwise inequality|                 0|

|   #2|   Elementwise inequality|                 8|

|   #3|   Elementwise inequality|                 0|

|   #4|   Elementwise inequality|                 0|

|   #5|   Elementwise inequality|                 0|

|   #6|   Elementwise inequality|                 0|

|   #7|   Elementwise inequality|                 0|

++++++++++++++++++++++++++++++++++++++++++++++++++++

 


Could be that you are using variables first, and then you manipulate it to impose a structure. I.e., you're doing the equivalent of


sdpvar x1 x2

y = x1 + x2;

x1 = x2;


y will depend on two variables. To do this correctly, you do either


sdpvar x1 x2

x1 = x2;

y = x1 + x2;


or


sdpvar x1 x2

y = x1 + x2;

Constraints = [x1 == x2]






Rajan S

unread,
Jul 30, 2017, 8:51:19 AM7/30/17
to YALMIP
Johan .. Here are the results I get for the action and state as defined in the problem above,. It satisfies for the first stage (1st column where fr a given state value =8 action =3) But from column 2-4 of the action optimal results they dont satisfy the constraint that the action is the same for a given state value in that particular stage (column).. i tried to play around with the order but no success!! also debug mode doesnt help me see when/how matlab assigns value to the sdpvars during optimization

obj value =-45.02
results.xlsx

Johan Löfberg

unread,
Jul 30, 2017, 9:36:38 AM7/30/17
to YALMIP
so either you've missed to ad some constraint, or you're defining the wrong structure.

to try to see the variables, use sdisplay(stateMatrix) etc

Rajan S

unread,
Jul 31, 2017, 12:51:30 AM7/31/17
to YALMIP
Thanks Johan- I tried using the function sdisplay At some level i started getting  the below with the sdisplay of my action matirx. the state matrix looked good but i am unable to make anything out here. Clearly something is not working here. I checked my constraints they seem to be all right I think something is not quite right with the structure. Can you help/suggest something?

'internal(21910)' 'internal(22166)' 'internal(22422)'
'internal(21911)' 'internal(22167)' 'internal(22423)'
'internal(21912)' 'internal(22168)' 'internal(22424)'
'internal(21913)' 'internal(22169)' 'internal(22425)'
'internal(21914)' 'internal(22170)' 'internal(22426)'
'internal(21915)' 'internal(22171)' 'internal(22427)'


Johan Löfberg

unread,
Jul 31, 2017, 1:26:24 AM7/31/17
to YALMIP
we don't know what structure you want

actionM appears to have a first column with all same values, and then all other rows unstructured
sdisplay(actionM(1:5,1:4))

ans =

  5×4 cell array

    'internal(24662)'    'internal(22858)'    'internal(23114)'    'internal(23370)'
    'internal(24662)'    'internal(22859)'    'internal(23115)'    'internal(23371)'
    'internal(24662)'    'internal(22860)'    'internal(23116)'    'internal(23372)'
    'internal(24662)'    'internal(22861)'    'internal(23117)'    'internal(23373)'
    'internal(24662)'    'internal(22862)'    'internal(23118)'    'internal(23374)'


actM is a completely unstructured matrix (defined in functionNonanact but called NACon in there, very confusing)


stateMatrix
>> sdisplay(StateMatrix(1:5,1:4))

ans =

  5×4 cell array

    'B'    'B-G(1)'    'B-G(1)-G(257)'    'B-G(1)-G(257)-G(513)'
    'B'    'B-G(2)'    'B-G(2)-G(258)'    'B-G(2)-G(258)-G(514)'
    'B'    'B-G(3)'    'B-G(3)-G(259)'    'B-G(3)-G(259)-G(515)'
    'B'    'B-G(4)'    'B-G(4)-G(260)'    'B-G(4)-G(260)-G(516)'
    'B'    'B-G(5)'    'B-G(5)-G(261)'    'B-G(5)-G(261)-G(517)'




etc. You have to figure out if these are the forms you intended to create

Rajan S

unread,
Jul 31, 2017, 1:54:46 AM7/31/17
to YALMIP
StateMatrix is the right form. WRT to action, it shouldnt be all unstructured but i think i feel why this is happening. The reason being  given StateMatrix is a function of (B ,G) and G is a sdpvar. Action which is a function of State Matrix seems to be therefore unstructured In reality G = min(Action, D) where D is deterministic. Should I use that to define G before hand to see if it makes a difference I really dont want to use a min function in an optimization problem because i can cause it to be min by adding G in the obj fn and putting in constraints G< Action, G< D. what would you suggest?

Johan Löfberg

unread,
Jul 31, 2017, 2:04:16 AM7/31/17
to YALMIP
Well then, if it does not have the structure you want (you mean actM?) then you simply have to look at where you create it and fix that error. The variable is created in functionNonAntAct and is clearly unstructured as it is created as NACon = intvar(size(stateM,1), size(stateM,2),'full');. My guess is that you don't want the output argument ordering as you have it now, as it appears very weird.

Rajan S

unread,
Jul 31, 2017, 3:46:33 AM7/31/17
to YALMIP
i meant actionM.. wrt to adding constraints i have them in the part of the code just before optimization. Would it be worthwhile to put those constraints in the function or right after that in the code? does it make a difference where the constraints are defined?

Johan Löfberg

unread,
Jul 31, 2017, 4:08:56 AM7/31/17
to YALMIP
To begin with, is the logic in the input output arguments really what you want. actM is the third output which isn't used outside the function, but you assign it to the second output, which means that the variable you call actM in your outer code is the variable called NAcon in the function. If nothing else, this is terrible coding practice and has to be cleaned up

actionM is not a completely unstructured matrix. It's first column are all equal to actM(13) ( as it is called in functionnonantact) , while the remaining columns are completely unstructured and unrelated to any other variables.


Rajan S

unread,
Jul 31, 2017, 5:48:10 PM7/31/17
to YALMIP
Thanks for the feedback Johan. So i cleaned up the program rejigged some constraints and ran the solver. It seems to be running and is giving me an obj function value that i expect.. however the solver doesnt seem to stop.
Starting YALMIP integer branch & bound.
* Lower solver   : fmincon-standard
* Upper solver   : rounder
* Max iterations : 300
  Now is there a way for it to stop after a specified amount of time and show me whatever solution it has achieved? should i try and use a specific solver because at this point yalmip is automatically choosing a solver based on the problem?

Rajan S

unread,
Jul 31, 2017, 6:00:30 PM7/31/17
to YALMIP
This is what i get..after a long time... is it possible to stop earlier and get whatever optimal/best solution the solver has at that point so I can check the variables?
* Starting YALMIP integer branch & bound.
* Lower solver   : fmincon-standard
* Upper solver   : rounder
* Max iterations : 300
 
Warning : The continuous relaxation may be nonconvex. This means 
that the branching process is not guaranteed to find a
globally optimal solution, since the lower bound can be
invalid. Hence, do not trust the bound or the gap...
 Node       Upper       Gap(%)      Lower    Open
    1 :          Inf      Inf     -2.978E+01   2  Successfully solved 
    2 :          Inf      Inf     -2.978E+01   3  Successfully solved 
    3 :          Inf      Inf     -2.978E+01   4  Successfully solved 
    4 :          Inf      Inf     -2.978E+01   3  Infeasible problem 
    5 :          Inf      Inf     -2.978E+01   2  Infeasible problem 
    6 :          Inf      Inf     -2.978E+01   3  Successfully solved 
    7 :          Inf      Inf     -2.978E+01   2  Infeasible problem 
    8 :          Inf      Inf     -2.978E+01   1  Infeasible problem 
> In backsolveSys
  In solveKKTsystem
  In computeTrialStep
  In barrier
  In fmincon (line 797)
  In callfmincon (line 58)
  In bnb_solvelower (line 136)
  In bnb>branch_and_bound (line 593)
  In bnb (line 276)
  In solvesdp (line 338)
  In optimize (line 31)
  In nonanticipative3 (line 57) 
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =  3.235037e-18. 
> In backsolveSys
  In solveKKTsystem
  In computeTrialStep
  In barrier
  In fmincon (line 797)
  In callfmincon (line 58)
  In bnb_solvelower (line 136)
  In bnb>branch_and_bound (line 593)
  In bnb (line 276)
  In solvesdp (line 338)
  In optimize (line 31)
  In nonanticipative3 (line 57) 
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =  6.183143e-17. 
> In backsolveSys
  In solveKKTsystem
  In computeTrialStep
  In barrier
  In fmincon (line 797)
  In callfmincon (line 58)
  In bnb_solvelower (line 136)
  In bnb>branch_and_bound (line 593)
  In bnb (line 276)
  In solvesdp (line 338)
  In optimize (line 31)
  In nonanticipative3 (line 57) 
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =  5.807326e-17. 
> In backsolveSys
  In solveKKTsystem
  In computeTrialStep
  In barrier
  In fmincon (line 797)
  In callfmincon (line 58)
  In bnb_solvelower (line 136)
  In bnb>branch_and_bound (line 593)
  In bnb (line 276)
  In solvesdp (line 338)
  In optimize (line 31)
  In nonanticipative3 (line 57) 
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =  5.539754e-17. 
> In backsolveSys
  In solveKKTsystem
  In computeTrialStep
  In barrier
  In fmincon (line 797)
  In callfmincon (line 58)
  In bnb_solvelower (line 136)
  In bnb>branch_and_bound (line 593)
  In bnb (line 276)
  In solvesdp (line 338)
  In optimize (line 31)
  In nonanticipative3 (line 57) 
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =  1.145443e-17. 
> In backsolveSys
  In solveKKTsystem
  In computeTrialStep
  In barrier
  In fmincon (line 797)
  In callfmincon (line 58)
  In bnb_solvelower (line 136)
  In bnb>branch_and_bound (line 593)
  In bnb (line 276)
  In solvesdp (line 338)
  In optimize (line 31)
  In nonanticipative3 (line 57) 

Johan Löfberg

unread,
Aug 1, 2017, 2:43:00 AM8/1/17
to YALMIP
That tells us that you've managed to setup a nonlinear integer program, i.e. typically totally intractable, and you don't have any solver for it (solver yalmip starts its own branch and bound code)

Did you really intend to create a nonlinear model. Typically you should spend effort on trying to get a linear model

Johan Löfberg

unread,
Aug 1, 2017, 2:46:56 AM8/1/17
to YALMIP
If you terminate after these iterations, you won't have any solution, as no solution has been found yet

To terminate, you have options such as maxiter, or you can set gaptol and reltol to huge numbers to ensure the solver exits when the first solution is found

but as I said, you should improve the model instead and get rid of the offending nonlinearities

Rajan S

unread,
Aug 1, 2017, 4:15:00 AM8/1/17
to YALMIP
actually i though i linearized the model as I used linear and binary constraints to model a fn of the form y = min(a,b).. clearly it has had quite the contrary effect.. my previous run is fast and gives a solution it is just that in that solution G is not equal to min(A, D). because in my optimal solution i find G values which are lesser than both A and D

Rajan S

unread,
Aug 1, 2017, 4:21:06 AM8/1/17
to YALMIP
does yalmip offer OR constraints which can be fed to a linear solver? or is there a way to manipulate the solver to form an OR constraint? say a constraint of the form[ G>=A OR G>=D] 

Johan Löfberg

unread,
Aug 1, 2017, 5:19:40 AM8/1/17
to YALMIP
min operator will lead to a linear (possibly integer representable) model, so that is not where the nonlinearity comes from. If you post the model it can easily be seen

Johan Löfberg

unread,
Aug 1, 2017, 5:22:03 AM8/1/17
to YALMIP
Yes, use or function, or  | operator. Using min is more robust in YALMIP though

Rajan S

unread,
Aug 1, 2017, 4:00:29 PM8/1/17
to YALMIP
Thanks using Min seems to work..  though it is solving faster and converging better than before however it is still using bnb..(it did however say at the end of my run that the intlinprog ran out of time but has a feasible solution) does bnb run an integer linear program ? I need to run the same program with a quadratic objective function so using bnb might make sense there.. should i think of forcing yalmip into using a different solver?. i wanted to know if there is any yalmip documentation that explains all the parametrs in solvers and their options. For eg in my case it is using branchrule: 'max'         method: 'depthbest'. what are the other rules and methods available? Is there a best breadthfirst we could try.. also it ops.bnb did not give me reltol but it has a gaptol parameter.. is there no specific time parameter to control the run? Also the presolve option says 0. what will happen if we set it to 1 or -1 (as cplex provides) will presolving help here? Also what about nodetight and nodefix??  In any case documentation would be very very useful here ( even if it isnt relevant to my particular problem, in the general scheme of things i am sure it will help)

Johan Löfberg

unread,
Aug 1, 2017, 5:19:08 PM8/1/17
to YALMIP
weird that it employs intlinprog as bnb it self is a nonlinear mixed-integer solver. You should post the code

You basically shouldn't try to get bnb to run faster, but explain why you have a nonlinear program (by posting it) so you hopefully can derive a better model. bnb is not intended for real use (and in your case, it appears to be a nonlinear model, so bnb is not guaranteed to supply a good solution, as it assumes convexity of the relaxations. it is developed for mixed-integer SDPs)

Rajan S

unread,
Aug 1, 2017, 5:34:41 PM8/1/17
to YALMIP
Here is the main and the function it uses created as text docs as the program still runs I am unable to control the length of the run even though i tried to set the following in my solver settings. this is the format of the output solver is giving me in the run

  LP:                Optimal objective value is -610.984405.                                          

Cut Generation:    Applied 61 Gomory cuts,                                                          
                   50 implication cuts, 5 flow cover cuts,                                          
                   and 17 mir cuts.                                                                 
                   Lower bound is -420.569518.                                                      

Heuristics:        Found 1 solution using rounding.                                                 
                   Upper bound is 44.296875.                                                        
                   Relative gap is 1.03e+03%.                                                      

Branch and Bound:

   nodes     total   num int        integer       relative                                          
explored  time (s)  solution           fval        gap (%)                                         
     184      0.40         1   4.429687e+01   9.789189e+02                                          
     378      0.55         1   4.429687e+01   8.886361e+02                                          
     397      0.57         2   1.800000e+01   1.958368e+03                                          
     623      0.75         2   1.800000e+01   1.874669e+03                                          
     835      0.95         2   1.800000e+01   1.808602e+03                                          
 ...................................................................................................                                      
 2713928   1587.78        10  -4.050000e+01   2.160098e+02                                          
 2723928   1592.56        10  -4.050000e+01   2.160098e+02                                          
 2733928   1597.29        10  -4.050000e+01   2.160098e+02                                          
 2743928   1606.04        10  -4.050000e+01   1.956336e+02                                          
 2753928   1612.00        10  -4.050000e+01   1.956336e+02                                          
 2763928   1618.02        10  -4.050000e+01   1.956336e+02                                          
 2773928   1623.89        10  -4.050000e+01   1.956336e+02                                          
 2783928   1629.14        10  -4.050000e+01   1.956336e+02                                          
 2793928   1633.81        10  -4.050000e+01   1.956336e+02                                          
 2803928   1638.77        10  -4.050000e+01   1.956336e+02                                          
Operation terminated by user during slbiClient


In optim.algorithm.IntlinprogBranchAndCut/run

In intlinprog (line 126)
[x, fval, exitflag, output] = run(algorithm, problem);

In callintlinprog (line 43)
[x,fval,exitflag,output] = intlinprog(c, intcon, A, b, Aeq, beq, lb, ub,ops);

In solvesdp (line 338)
        eval(['output = ' solver.call '(interfacedata);']);

In optimize (line 31)
[varargout{1:nargout}] = solvesdp(varargin{:});

In nonanticipative3v2 (line 54)
     sol = optimize(Constraints,Objective,ops);
 
>>                            
  


 i assume that bnb.gaptol will address the  relative gap % ( it doesnt) , bnb.nodefix will set the number of nodes explored to a limit (it doesnt) and i generally tried breadth best instead of depth best hoping to see if it would be faster. the last time it ran for 2 hours and said the intlinprog found a feasible solution this time it aborted..

ops = sdpsettings('savesolveroutput', 2,'solver','','bnb.gaptol', 260,'bnb.method','breadthbest','bnb.nodefix',500000,'bnb.presolve',1)

function.txt
main.txt

Rajan S

unread,
Aug 1, 2017, 5:38:27 PM8/1/17
to YALMIP
at this point as long as i can get to stop this i should be fine.. -40.5 is the fval i expect.. i want to see what the variables looks like for a feasible (if not optimal solution) how could i manipulate the settings for this to work?

Johan Löfberg

unread,
Aug 1, 2017, 6:08:10 PM8/1/17
to YALMIP
THat is one absolutely horrible model you got there

You do realize that a simple expression such as actM(B+1) actually is incredibly complex combinatorial object leading to a very hard model, just to begin with?

Rajan S

unread,
Aug 1, 2017, 6:13:40 PM8/1/17
to YALMIP
yes. i tried other ways earlier and was getting into all functions and all kinds of trouble.. that said i think if i can stop this solver i will have atleast a feasible solution to work with..  

Johan Löfberg

unread,
Aug 2, 2017, 12:37:09 AM8/2/17
to YALMIP
why are you using assign, assign(B,12);, it makes no sense.

Johan Löfberg

unread,
Aug 2, 2017, 12:44:29 AM8/2/17
to YALMIP
Don't understand your claim that bnb is used. It is a MILP, so any MILP solver will be invoked. In your case, intlinprog is used. Your expression K = 10*G-actionM.^1 confused me as I read it as .^-1 (nonlinear)

All MILP solvers I tried managed to solve it in 0s, except intlinprog. Hence, install a better MILP solver such as gurobi, mosek or scip

Rajan S

unread,
Aug 2, 2017, 12:54:44 AM8/2/17
to YALMIP
as you suggested i spent time linearizing the problem and got an output in 3 secs however, it still used bnb though it said it found the optimal through intlinprog Please see below. Is this something that sounds right?
LP:                Optimal objective value is -1.700534e+05.                                        

Cut Generation:    Applied 101 Gomory cuts,                                                         
                   55 implication cuts,                                                             
                   and 4 flow cover cuts.                                                           
                   Lower bound is -4302.569876.                                                     

Heuristics:        Found 1 solution using rounding.                                                 
                   Upper bound is 4620.984375.                                                      
                   Relative gap is 193.08%.                                                        

Heuristics:        Found 2 solutions using rss.                                                     
                   Upper bound is 113.500000.                                                       
                   Relative gap is 3.86e+03%.                                                      

Branch and Bound:

   nodes     total   num int        integer       relative                                          
explored  time (s)  solution           fval        gap (%)                                         
     353      0.30         3   1.135000e+02   2.441111e+03                                          
     779      0.45         3   1.135000e+02   4.193857e+02                                          
     975      0.52         4  -3.825000e+01   6.667833e+02                                          
    1603      0.71         5  -3.912500e+01   7.722941e+00                                          
    1839      0.80         6  -3.956250e+01   5.689061e+00                                          
    2399      0.99         7  -4.012500e+01   3.710550e+00                                          
    5431      2.03         7  -4.012500e+01   2.357224e+00                                          
    5507      2.06         8  -4.050000e+01   1.419705e+00                                          
   15507      5.36         8  -4.050000e+01   7.807471e-01                                          
   20508      6.92         8  -4.050000e+01   0.000000e+00                                          

Optimal solution found.

Johan Löfberg

unread,
Aug 2, 2017, 1:00:52 AM8/2/17
to YALMIP
Well it uses branch and bound strategy of course (with intlinprog), but it is not using the internal solver bnb. On your machine intlinprog appears more lucky as it finds the global solution in 6.92 seconds, while it hasn't fond it after a couple of minutes on mine when I terminate it

Rajan S

unread,
Aug 2, 2017, 1:05:50 AM8/2/17
to YALMIP
ok now i have a problem with the solver Given my  model now is linearized and runs fast, it solved the problem where the objective was linear (K = 10*G-actionM.^1 ) using intlinprog. When i change this to a quadratic merely by changing K to K = 10*G-actionM.^2, the solver fails me. What do you suggest I do?  which solver should i try installing  and which would be the best source to do the download? and i am assuming it will still work in the matlab/yalmip environment?

Johan Löfberg

unread,
Aug 2, 2017, 1:16:47 AM8/2/17
to YALMIP
With quadratic, you have a convex quadratic mixed integer program, and solvers such as gurobi or mosek easily solves the problem

Rajan S

unread,
Aug 2, 2017, 1:29:59 AM8/2/17
to YALMIP
ok this installation works on matlab and can i still invoke the solver using yalmip once installed or would it be a stand alone installation. I hope to run the model with the same code on the matlab/yalmip environment

Thanks again for all your help.

Johan Löfberg

unread,
Aug 2, 2017, 2:00:33 AM8/2/17
to YALMIP
yalmip supports most relevant solvers

Rajan S

unread,
Aug 3, 2017, 12:50:49 AM8/3/17
to YALMIP
I installed mosek. Now i am having trouble inputtig parameters for having a stoppinbg criteria for the model. i identified the following in mosek which could be used. 
MSK_DPAR_MIO_MAX_TIME
2 MSK_DPAR_MIO_NEAR_TOL_REL_GAP

 How do I invoke this through yalmip? i am unable to successfully add them to the solver settings.. i tried ops.mosek and also just the parameters in apostrophe . I even tried to change the values of these parametrs in the struct file. it didnt work. How do I impose stopping criteria I am happy if there is 2% gap between the minimum and maximum solution. alternatively i am willing to accept an optimal if the model runs for say 10 minutes how should i do this?

here is the code i tried but isnt working

ops = sdpsettings('savesolveroutput', 2,'solver','mosek',' MSK_DPAR_MIO_MAX_TIME',300,'MSK_DPAR_MIO_NEAR_TOL_REL_GAP',0.8)
ops = sdpsettings('savesolveroutput', 2,'solver','mosek',' mosek.MSK_DPAR_MIO_MAX_TIME',300,'mosek.MSK_DPAR_MIO_NEAR_TOL_REL_GAP',0.8)
    
          i tried to type in values for the variables through the command window as well.. didnt work

are there better ways to achieve the same?

Thanks

Rajan S

unread,
Aug 3, 2017, 1:31:52 AM8/3/17
to YALMIP
in addition i have a problem stopping mosek from running on my matlab. Whenever I pause a run or use ctrl C the run doesnt stop I have to forcefully shut my matlab each time. can you suggest a better way?

Johan Löfberg

unread,
Aug 3, 2017, 3:04:04 AM8/3/17
to YALMIP
works here

A = randn(20,15);
b = randn(20,1)*20;
x = sdpvar(15,1);

e = b-A*x;
[s,location] = sort(x);
F = [s(1)+s(end) == 1, -100 <= x <= 100];
ops = sdpsettings('mosek.MSK_DPAR_OPTIMIZER_MAX_TIME',1);
optimize(F,norm(e,1),ops);

Optimizer terminated. Time: 1.17    

Integer solution solution summary
  Problem status  : PRIMAL_FEASIBLE
  Solution status : PRIMAL_FEASIBLE
  Primal.  obj: 2.6754295295e+002   nrm: 3e+002   Viol.  con: 1e-014   var: 0e+000   itg: 0e+000 
Optimizer summary
  Optimizer                 -                        time: 1.17    
    Interior-point          - iterations : 0         time: 0.00    
      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: 3         time: 1.03    

Mosek error: MSK_RES_TRM_MAX_TIME ()


Milad Dehnamaki

unread,
Mar 3, 2020, 2:05:22 PM3/3/20
to YALMIP
Hellow. please help me. I have been working on Minimization problem for 2 months,but I can't understand what is the wrong in my code. I have changed my solver to Mosek but when I run the matlab, yalmip shows these error :
MOSEK Version 9.1.13 (Build date: 2020-2-20 14:26:57)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6583) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6616) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6649) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6682) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6807) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6808) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6809) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (6810) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (7683) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (7716) of matrix 'A'.
Warning number 710 is disabled.
MOSEK warning 57: A large value of -1.0e+09 has been specified in c for variable '' (136).
MOSEK warning 57: A large value of -1.0e+09 has been specified in c for variable '' (1232).
MOSEK warning 57: A large value of -1.0e+09 has been specified in c for variable '' (2328).
MOSEK warning 57: A large value of -1.0e+09 has been specified in c for variable '' (3424).
MOSEK warning 57: A large value of -1.0e+09 has been specified in c for variable '' (4520).
MOSEK warning 57: A large value of -1.0e+09 has been specified in c for variable '' (5616).
MOSEK warning 57: A large value of -1.0e+09 has been specified in c for variable '' (6712).
MOSEK warning 57: A large value of -1.0e+09 has been specified in c for variable '' (7808).
MOSEK warning 57: A large value of -1.0e+09 has been specified in c for variable '' (8904).
MOSEK warning 57: A large value of -1.0e+09 has been specified in c for variable '' (9992).
Warning number 57 is disabled.
Problem
I would like to tank you for helping me.

Johan Löfberg

unread,
Mar 3, 2020, 2:28:02 PM3/3/20
to YALMIP
You have nonsense data, like a model such as

sdpvar x y
Model = [x>=0, y>=0, 1e-10*x + y <= 1e15]
optimize(Model,x + 1e-12*y,sdpsettings('solver','mosek'))

Clean the data from numerical noise, and think through why some of your coefficients are huge (wrong units in modelling?)

Milad Dehnamaki

unread,
Mar 5, 2020, 9:11:38 AM3/5/20
to YALMIP
hellow my freind.excuse me
can I send you my code?
really I don't understand which part of my code is incorrect
all of my Variables has been obtainded NAN by Yalmip and solver Mosek
thank you

Johan Löfberg

unread,
Mar 5, 2020, 9:15:19 AM3/5/20
to YALMIP
sure
Reply all
Reply to author
Forward
0 new messages