"An unexpected error has occurred: Index exceeds array bounds." error message while formulation benders decomposition via yalmip in matlab environment

952 views
Skip to first unread message

Jihyun Yi

unread,
Jul 9, 2018, 2:59:49 PM7/9/18
to YALMIP

I am now trying to build up a benders decomposition.

However, it seems like the converging process cannot go on because I have an error while building up constraints for master problem.

When I try to look at the master problem's constraint, instead of the list of constraints(in a form of LMI), I only see "An unexpected error has occurred: Index exceeds array bounds"

However, there is no problem with debugging the file,(the problem is that the iteration goes on continuously because the convergence cannot take place. For the second iteration, I add the first benders cut to master problem by adding it to constraint like,

    function [rhat, chat, uhat, alpha, objmp, lowerB, conm, solmp] = Masterproblem(iter,NN,Ab,Icost, Rcost, Ccost,Budget, r_save,c_save,subprob_save, lambda_save, mu_save)
    %define parameters
    R_max = 1000;
    R_min = 50;
    C_max = 3000;
    C_min = 100;
    %%define variable
    u=binvar(NN,1);
    r=sdpvar(NN,1,'full');
    c=sdpvar(NN,1,'full');
    alpha=sdpvar(1,1,'full');
     bd=iter-1;
    %benders cut update
         bdcut=[];
         for k=1:bd
             bdcut=[bdcut, subprob_save(1,bd)+lambda_save(:,bd)'.*(1e3/3/Ab)*(r-r_save(:,bd))+mu_save(:,bd)'.*(1e3/3/Ab)*(c-c_save(:,bd))<=alpha];
         end
    %constraint
    conm = [];
    conm = [conm, Icost*sum(u)+Rcost*sum(r)+Ccost*sum(c)<=Budget];
    conm = [conm, r<=R_max*u, r>=R_min*u];
    conm = [conm, c<=C_max*u, c>=C_min*u];
    conm = [conm, alpha>=-10000];
    conm = [conm, bdcut];
    options=sdpsettings('solver','gurobi', 'gurobi.Presolve',2,'gurobi.NumericFocus',3,'gurobi.MIPGap',1e-5,'gurobi.MIPGapAbs',1e-5,'gurobi.BarConvTol',1e-6,'gurobi.BarQCPConvTol',1e-6,'gurobi.FeasibilityTol',1e-5,'gurobi.IntFeasTol',1e-6,'gurobi.OptimalityTol',1e-8,'gurobi.Method',2,'gurobi.NodefileStart',0.7);
        %'gurobi.MIPFocus',1,'gurobi.MIQCPMethod',0);
    objective = Icost*sum(u)+Rcost*sum(r)+Ccost*sum(c) + alpha; 
    solmp=solvesdp(conm, objective, options); %options***

I also tried to switch the constraint below

bdcut=[bdcut, subprob_save(1,bd)+lambda_save(:,bd)'.*(1e3/3/Ab)*(r-r_save(:,bd))+mu_save(:,bd)'.*(1e3/3/Ab)*(c-c_save(:,bd))<=alpha];

into equation with numerical values like,

bdcut=[bdcut, 2607+[0, 22003, 43893, 61445]*r]<=alpha];  %(using the value I attained before confronting the troubled constraint)

However, it did not work, as well.

When I try to look at 'conm', the error message comes up. On the other hand, when I look at if the master problem has been solved or not, What I see is "Successfully solved(GUROBI-GUROBI)"

So, because I cannot find the constraint list, I am not even sure if the problem has been solved actually or not

Also, I am having same benders cut for every iteration, which makes no progress on searching for a right solution.

Please give me a clue what kind of problem this is!!! 


Johan Löfberg

unread,
Jul 9, 2018, 3:27:34 PM7/9/18
to YALMIP
you would have to supply an easily run reproducible piece of code

Jihyun Yi

unread,
Jul 10, 2018, 7:33:44 AM7/10/18
to YALMIP
Thank you for your reply!!!

Here is the whole code. 

Main code is "DistFlowIdeal" 

In first iteration, master problem is solved within Masterproblem1.m, and the solution is passed on to the subproblem "With_Battery_Dist_Flow_Function_ideal2.m. Here I obtain dual variable values that will be used to form a benders cut for the masterproblem in next iteration. 

The code I pasted before is part of the "Masterproblem.m" 

Thank you. 
DistFlowIdeal.m
Masterproblem.m
Masterproblem1.m
With_Battery_Dist_Flow_Function_ideal2.m

Jihyun Yi

unread,
Jul 10, 2018, 8:25:50 AM7/10/18
to YALMIP
Actually, to make the code reproducible, there were other files required. 
So please check out this zip file.
Thank you so much your help!!
BendersDecomp.zip

Johan Löfberg

unread,
Jul 10, 2018, 9:04:59 AM7/10/18
to YALMIP
runs without problems

you will simply have to debug on your machine on the line which it fails, and run at all the involved expressions there, and see which fails

Jihyun Yi

unread,
Jul 10, 2018, 9:23:44 AM7/10/18
to YALMIP
Thank you for your swift answer. 

What do you mean by 'runs without problems'? Does that mean it succeeded to converge in your machine? 

In my computer, it never converges, and keeps going on.

Johan Löfberg

unread,
Jul 10, 2018, 9:25:00 AM7/10/18
to YALMIP
I get a plot afte ra while, and it never crashes with the "An unexpected error has occurred: Index exceeds array bounds"

Johan Löfberg

unread,
Jul 10, 2018, 9:33:46 AM7/10/18
to YALMIP
                                                 
*************************************************
*This script computes the [Y] admittance matrix.*
*************************************************
                                                 
STEP 1: Loading line parameters....
                                   
The network consists of 4 nodes and 3 lines.
                                                                                      
STEP 2: Transforming line parameters in p.u.....
                                                
STEP 3: Building the network primitive admittance matrix....
                                                            
STEP 4: Building the network incidence matrix....
                                                 
STEP 5: Computing the [Y] matrix....
                                                 
Elapsed time is 0.006514 seconds.
Warning: File: Cplex.p Line: 965 Column: 0
Defining "changedParam" in the nested function shares it with the parent function.  In a future
release, to share "changedParam" between parent and nested functions, explicitly define it in
the parent function. 
> In cplexoptimset
  In sdpsettings>setup_cplex_options (line 615)
  In sdpsettings (line 145)
  In Masterproblem1 (line 28) 
Academic license - for non-commercial use only
Optimize a model with 18 rows, 13 columns and 45 nonzeros
Variable types: 9 continuous, 4 integer (4 binary)
Coefficient statistics:
  Matrix range     [1e+00, 3e+03]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [5e+03, 1e+04]
Found heuristic solution: objective -10000.00000
Presolve removed 18 rows and 13 columns
Presolve time: 0.00s
Presolve: All rows and columns removed

Explored 0 nodes (0 simplex iterations) in 0.05 seconds
Thread count was 1 (of 4 available processors)

Solution count 1: -10000 

Optimal solution found (tolerance 1.00e-05)
Best objective -1.000000000000e+04, best bound -1.000000000000e+04, gap 0.0000%
Academic license - for non-commercial use only
Optimize a model with 4670 rows, 2543 columns and 10772 nonzeros
Model has 840 quadratic objective terms
Coefficient statistics:
  Matrix range     [1e-03, 1e+00]
  Objective range  [2e+03, 7e+03]
  QObjective range [2e+03, 1e+04]
  Bounds range     [0e+00, 0e+00]
  RHS range        [8e-03, 1e+00]
Presolve removed 4238 rows and 2063 columns
Presolve time: 0.04s
Presolved: 432 rows, 480 columns, 864 nonzeros
Presolved model has 600 quadratic objective terms
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 360
 AA' NZ     : 8.400e+02
 Factor NZ  : 4.800e+03 (roughly 1 MByte of memory)
 Factor Ops : 6.000e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   3.26798109e+07 -3.36817480e+07  1.36e+03 5.85e+00  2.86e+05     0s
   1   2.79603614e+05 -1.48809013e+06  1.35e+02 5.80e-01  3.02e+04     0s
   2   5.00999035e+02 -1.03873065e+06  1.33e+01 5.75e-02  4.52e+03     0s
   3   1.63416742e+03 -3.54191821e+05  1.32e+00 5.70e-03  8.27e+02     0s
   4   2.02922751e+03 -3.68364438e+04  1.31e-01 5.64e-04  8.21e+01     0s
   5   2.07115444e+03 -1.81557024e+03  1.30e-02 5.59e-05  8.13e+00     0s
   6   2.07533715e+03  1.68664961e+03  1.29e-03 5.54e-06  8.12e-01     0s
   7   2.07575193e+03  2.03688182e+03  1.28e-04 5.49e-07  8.12e-02     0s
   8   2.07579304e+03  2.07190589e+03  1.26e-05 5.44e-08  8.12e-03     0s
   9   2.07579711e+03  2.07540838e+03  1.25e-06 5.40e-09  8.12e-04     0s
  10   2.07579751e+03  2.07575864e+03  1.24e-07 5.35e-10  8.12e-05     0s
  11   2.07579755e+03  2.07579366e+03  1.23e-08 5.30e-11  8.12e-06     0s
  12   2.07579756e+03  2.07579717e+03  1.22e-09 5.25e-12  8.12e-07     0s

Barrier solved model in 12 iterations and 0.20 seconds
Optimal objective 2.07579756e+03

Academic license - for non-commercial use only
Optimize a model with 19 rows, 13 columns and 49 nonzeros
Variable types: 9 continuous, 4 integer (4 binary)
Coefficient statistics:
  Matrix range     [1e+00, 3e+03]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [2e+03, 1e+04]
Found heuristic solution: objective 2075.7975564
Presolve removed 19 rows and 13 columns
Presolve time: 0.00s
Presolve: All rows and columns removed

Explored 0 nodes (0 simplex iterations) in 0.04 seconds
Thread count was 1 (of 4 available processors)

Solution count 1: 2075.8 

Optimal solution found (tolerance 1.00e-05)
Best objective 2.075797556458e+03, best bound 2.075797556458e+03, gap 0.0000%
Academic license - for non-commercial use only
Optimize a model with 4670 rows, 2543 columns and 10772 nonzeros
Model has 840 quadratic objective terms
Coefficient statistics:
  Matrix range     [1e-03, 1e+00]
  Objective range  [2e+03, 7e+03]
  QObjective range [2e+03, 1e+04]
  Bounds range     [0e+00, 0e+00]
  RHS range        [8e-03, 1e+00]
Presolve removed 4238 rows and 2063 columns
Presolve time: 0.03s
Presolved: 432 rows, 480 columns, 864 nonzeros
Presolved model has 600 quadratic objective terms
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 360
 AA' NZ     : 8.400e+02
 Factor NZ  : 4.800e+03 (roughly 1 MByte of memory)
 Factor Ops : 6.000e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   3.26798109e+07 -3.36817480e+07  1.36e+03 5.85e+00  2.86e+05     0s
   1   2.79603614e+05 -1.48809013e+06  1.35e+02 5.80e-01  3.02e+04     0s
   2   5.00999035e+02 -1.03873065e+06  1.33e+01 5.75e-02  4.52e+03     0s
   3   1.63416742e+03 -3.54191821e+05  1.32e+00 5.70e-03  8.27e+02     0s
   4   2.02922751e+03 -3.68364438e+04  1.31e-01 5.64e-04  8.21e+01     0s
   5   2.07115444e+03 -1.81557024e+03  1.30e-02 5.59e-05  8.13e+00     0s
   6   2.07533715e+03  1.68664961e+03  1.29e-03 5.54e-06  8.12e-01     0s
   7   2.07575193e+03  2.03688182e+03  1.28e-04 5.49e-07  8.12e-02     0s
   8   2.07579304e+03  2.07190589e+03  1.26e-05 5.44e-08  8.12e-03     0s
   9   2.07579711e+03  2.07540838e+03  1.25e-06 5.40e-09  8.12e-04     0s
  10   2.07579751e+03  2.07575864e+03  1.24e-07 5.35e-10  8.12e-05     0s
  11   2.07579755e+03  2.07579366e+03  1.23e-08 5.30e-11  8.12e-06     0s
  12   2.07579756e+03  2.07579717e+03  1.22e-09 5.25e-12  8.12e-07     0s

Barrier solved model in 12 iterations and 0.14 seconds
Optimal objective 2.07579756e+03

Academic license - for non-commercial use only
Optimize a model with 20 rows, 13 columns and 53 nonzeros
Variable types: 9 continuous, 4 integer (4 binary)
Coefficient statistics:
  Matrix range     [1e+00, 3e+03]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [2e+03, 1e+04]
Found heuristic solution: objective 2075.7975564
Presolve removed 20 rows and 13 columns
Presolve time: 0.00s
Presolve: All rows and columns removed

Explored 0 nodes (0 simplex iterations) in 0.04 seconds
Thread count was 1 (of 4 available processors)

Solution count 1: 2075.8 

Optimal solution found (tolerance 1.00e-05)
Best objective 2.075797556458e+03, best bound 2.075797556458e+03, gap 0.0000%
Academic license - for non-commercial use only
Optimize a model with 4670 rows, 2543 columns and 10772 nonzeros
Model has 840 quadratic objective terms
Coefficient statistics:
  Matrix range     [1e-03, 1e+00]
  Objective range  [2e+03, 7e+03]
  QObjective range [2e+03, 1e+04]
  Bounds range     [0e+00, 0e+00]
  RHS range        [8e-03, 1e+00]
Presolve removed 4238 rows and 2063 columns
Presolve time: 0.04s
Presolved: 432 rows, 480 columns, 864 nonzeros
Presolved model has 600 quadratic objective terms
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 360
 AA' NZ     : 8.400e+02
 Factor NZ  : 4.800e+03 (roughly 1 MByte of memory)
 Factor Ops : 6.000e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   3.26798109e+07 -3.36817480e+07  1.36e+03 5.85e+00  2.86e+05     0s
   1   2.79603614e+05 -1.48809013e+06  1.35e+02 5.80e-01  3.02e+04     0s
   2   5.00999035e+02 -1.03873065e+06  1.33e+01 5.75e-02  4.52e+03     0s
   3   1.63416742e+03 -3.54191821e+05  1.32e+00 5.70e-03  8.27e+02     0s
   4   2.02922751e+03 -3.68364438e+04  1.31e-01 5.64e-04  8.21e+01     0s
   5   2.07115444e+03 -1.81557024e+03  1.30e-02 5.59e-05  8.13e+00     0s
   6   2.07533715e+03  1.68664961e+03  1.29e-03 5.54e-06  8.12e-01     0s
   7   2.07575193e+03  2.03688182e+03  1.28e-04 5.49e-07  8.12e-02     0s
   8   2.07579304e+03  2.07190589e+03  1.26e-05 5.44e-08  8.12e-03     0s
   9   2.07579711e+03  2.07540838e+03  1.25e-06 5.40e-09  8.12e-04     0s
  10   2.07579751e+03  2.07575864e+03  1.24e-07 5.35e-10  8.12e-05     0s
  11   2.07579755e+03  2.07579366e+03  1.23e-08 5.30e-11  8.12e-06     0s
  12   2.07579756e+03  2.07579717e+03  1.22e-09 5.25e-12  8.12e-07     0s

Barrier solved model in 12 iterations and 0.13 seconds
Optimal objective 2.07579756e+03

Academic license - for non-commercial use only
Optimize a model with 21 rows, 13 columns and 57 nonzeros
Variable types: 9 continuous, 4 integer (4 binary)
Coefficient statistics:
  Matrix range     [1e+00, 3e+03]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [2e+03, 1e+04]
Found heuristic solution: objective 2075.7975564
Presolve removed 21 rows and 13 columns
Presolve time: 0.00s
Presolve: All rows and columns removed

Explored 0 nodes (0 simplex iterations) in 0.04 seconds
Thread count was 1 (of 4 available processors)

Solution count 1: 2075.8 

Optimal solution found (tolerance 1.00e-05)
Best objective 2.075797556458e+03, best bound 2.075797556458e+03, gap 0.0000%
Academic license - for non-commercial use only
Optimize a model with 4670 rows, 2543 columns and 10772 nonzeros
Model has 840 quadratic objective terms
Coefficient statistics:
  Matrix range     [1e-03, 1e+00]
  Objective range  [2e+03, 7e+03]
  QObjective range [2e+03, 1e+04]
  Bounds range     [0e+00, 0e+00]
  RHS range        [8e-03, 1e+00]
Presolve removed 4238 rows and 2063 columns
Presolve time: 0.03s
Presolved: 432 rows, 480 columns, 864 nonzeros
Presolved model has 600 quadratic objective terms
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 360
 AA' NZ     : 8.400e+02
 Factor NZ  : 4.800e+03 (roughly 1 MByte of memory)
 Factor Ops : 6.000e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   3.26798109e+07 -3.36817480e+07  1.36e+03 5.85e+00  2.86e+05     0s
   1   2.79603614e+05 -1.48809013e+06  1.35e+02 5.80e-01  3.02e+04     0s
   2   5.00999035e+02 -1.03873065e+06  1.33e+01 5.75e-02  4.52e+03     0s
   3   1.63416742e+03 -3.54191821e+05  1.32e+00 5.70e-03  8.27e+02     0s
   4   2.02922751e+03 -3.68364438e+04  1.31e-01 5.64e-04  8.21e+01     0s
   5   2.07115444e+03 -1.81557024e+03  1.30e-02 5.59e-05  8.13e+00     0s
   6   2.07533715e+03  1.68664961e+03  1.29e-03 5.54e-06  8.12e-01     0s
   7   2.07575193e+03  2.03688182e+03  1.28e-04 5.49e-07  8.12e-02     0s
   8   2.07579304e+03  2.07190589e+03  1.26e-05 5.44e-08  8.12e-03     0s
   9   2.07579711e+03  2.07540838e+03  1.25e-06 5.40e-09  8.12e-04     0s
  10   2.07579751e+03  2.07575864e+03  1.24e-07 5.35e-10  8.12e-05     0s
  11   2.07579755e+03  2.07579366e+03  1.23e-08 5.30e-11  8.12e-06     0s
  12   2.07579756e+03  2.07579717e+03  1.22e-09 5.25e-12  8.12e-07     0s

Barrier solved model in 12 iterations and 0.14 seconds
Optimal objective 2.07579756e+03

Academic license - for non-commercial use only
Optimize a model with 22 rows, 13 columns and 61 nonzeros
Variable types: 9 continuous, 4 integer (4 binary)
Coefficient statistics:
  Matrix range     [1e+00, 3e+03]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [2e+03, 1e+04]
Found heuristic solution: objective 2075.7975564
Presolve removed 22 rows and 13 columns
Presolve time: 0.00s
Presolve: All rows and columns removed

Explored 0 nodes (0 simplex iterations) in 0.04 seconds
Thread count was 1 (of 4 available processors)

Solution count 1: 2075.8 

Optimal solution found (tolerance 1.00e-05)
Best objective 2.075797556458e+03, best bound 2.075797556458e+03, gap 0.0000%
Academic license - for non-commercial use only
Optimize a model with 4670 rows, 2543 columns and 10772 nonzeros
Model has 840 quadratic objective terms
Coefficient statistics:
  Matrix range     [1e-03, 1e+00]
  Objective range  [2e+03, 7e+03]
  QObjective range [2e+03, 1e+04]
  Bounds range     [0e+00, 0e+00]
  RHS range        [8e-03, 1e+00]
Presolve removed 4238 rows and 2063 columns
Presolve time: 0.03s
Presolved: 432 rows, 480 columns, 864 nonzeros
Presolved model has 600 quadratic objective terms
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 360
 AA' NZ     : 8.400e+02
 Factor NZ  : 4.800e+03 (roughly 1 MByte of memory)
 Factor Ops : 6.000e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   3.26798109e+07 -3.36817480e+07  1.36e+03 5.85e+00  2.86e+05     0s
   1   2.79603614e+05 -1.48809013e+06  1.35e+02 5.80e-01  3.02e+04     0s
   2   5.00999035e+02 -1.03873065e+06  1.33e+01 5.75e-02  4.52e+03     0s
   3   1.63416742e+03 -3.54191821e+05  1.32e+00 5.70e-03  8.27e+02     0s
   4   2.02922751e+03 -3.68364438e+04  1.31e-01 5.64e-04  8.21e+01     0s
   5   2.07115444e+03 -1.81557024e+03  1.30e-02 5.59e-05  8.13e+00     0s
   6   2.07533715e+03  1.68664961e+03  1.29e-03 5.54e-06  8.12e-01     0s
   7   2.07575193e+03  2.03688182e+03  1.28e-04 5.49e-07  8.12e-02     0s
   8   2.07579304e+03  2.07190589e+03  1.26e-05 5.44e-08  8.12e-03     0s
   9   2.07579711e+03  2.07540838e+03  1.25e-06 5.40e-09  8.12e-04     0s
  10   2.07579751e+03  2.07575864e+03  1.24e-07 5.35e-10  8.12e-05     0s
  11   2.07579755e+03  2.07579366e+03  1.23e-08 5.30e-11  8.12e-06     0s
  12   2.07579756e+03  2.07579717e+03  1.22e-09 5.25e-12  8.12e-07     0s

Barrier solved model in 12 iterations and 0.12 seconds
Optimal objective 2.07579756e+03

Academic license - for non-commercial use only
Optimize a model with 23 rows, 13 columns and 65 nonzeros
Variable types: 9 continuous, 4 integer (4 binary)
Coefficient statistics:
  Matrix range     [1e+00, 3e+03]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [2e+03, 1e+04]
Found heuristic solution: objective 2075.7975564
Presolve removed 23 rows and 13 columns
Presolve time: 0.00s
Presolve: All rows and columns removed

Explored 0 nodes (0 simplex iterations) in 0.04 seconds
Thread count was 1 (of 4 available processors)

Solution count 1: 2075.8 

Optimal solution found (tolerance 1.00e-05)
Best objective 2.075797556458e+03, best bound 2.075797556458e+03, gap 0.0000%
Academic license - for non-commercial use only
Optimize a model with 4670 rows, 2543 columns and 10772 nonzeros
Model has 840 quadratic objective terms
Coefficient statistics:
  Matrix range     [1e-03, 1e+00]
  Objective range  [2e+03, 7e+03]
  QObjective range [2e+03, 1e+04]
  Bounds range     [0e+00, 0e+00]
  RHS range        [8e-03, 1e+00]
Presolve removed 4238 rows and 2063 columns
Presolve time: 0.03s
Presolved: 432 rows, 480 columns, 864 nonzeros
Presolved model has 600 quadratic objective terms
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 360
 AA' NZ     : 8.400e+02
 Factor NZ  : 4.800e+03 (roughly 1 MByte of memory)
 Factor Ops : 6.000e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   3.26798109e+07 -3.36817480e+07  1.36e+03 5.85e+00  2.86e+05     0s
   1   2.79603614e+05 -1.48809013e+06  1.35e+02 5.80e-01  3.02e+04     0s
   2   5.00999035e+02 -1.03873065e+06  1.33e+01 5.75e-02  4.52e+03     0s
   3   1.63416742e+03 -3.54191821e+05  1.32e+00 5.70e-03  8.27e+02     0s
   4   2.02922751e+03 -3.68364438e+04  1.31e-01 5.64e-04  8.21e+01     0s
   5   2.07115444e+03 -1.81557024e+03  1.30e-02 5.59e-05  8.13e+00     0s
   6   2.07533715e+03  1.68664961e+03  1.29e-03 5.54e-06  8.12e-01     0s
   7   2.07575193e+03  2.03688182e+03  1.28e-04 5.49e-07  8.12e-02     0s
   8   2.07579304e+03  2.07190589e+03  1.26e-05 5.44e-08  8.12e-03     0s
   9   2.07579711e+03  2.07540838e+03  1.25e-06 5.40e-09  8.12e-04     0s
  10   2.07579751e+03  2.07575864e+03  1.24e-07 5.35e-10  8.12e-05     0s
  11   2.07579755e+03  2.07579366e+03  1.23e-08 5.30e-11  8.12e-06     0s
  12   2.07579756e+03  2.07579717e+03  1.22e-09 5.25e-12  8.12e-07     0s

Barrier solved model in 12 iterations and 0.12 seconds
Optimal objective 2.07579756e+03

Academic license - for non-commercial use only
Optimize a model with 24 rows, 13 columns and 69 nonzeros
Variable types: 9 continuous, 4 integer (4 binary)
Coefficient statistics:
  Matrix range     [1e+00, 3e+03]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [2e+03, 1e+04]
Found heuristic solution: objective 2075.7975564
Presolve removed 24 rows and 13 columns
Presolve time: 0.00s
Presolve: All rows and columns removed

Explored 0 nodes (0 simplex iterations) in 0.04 seconds
Thread count was 1 (of 4 available processors)

Solution count 1: 2075.8 

Optimal solution found (tolerance 1.00e-05)
Best objective 2.075797556458e+03, best bound 2.075797556458e+03, gap 0.0000%
Academic license - for non-commercial use only
Optimize a model with 4670 rows, 2543 columns and 10772 nonzeros
Model has 840 quadratic objective terms
Coefficient statistics:
  Matrix range     [1e-03, 1e+00]
  Objective range  [2e+03, 7e+03]
  QObjective range [2e+03, 1e+04]
  Bounds range     [0e+00, 0e+00]
  RHS range        [8e-03, 1e+00]
Presolve removed 4238 rows and 2063 columns
Presolve time: 0.03s
Presolved: 432 rows, 480 columns, 864 nonzeros
Presolved model has 600 quadratic objective terms
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 360
 AA' NZ     : 8.400e+02
 Factor NZ  : 4.800e+03 (roughly 1 MByte of memory)
 Factor Ops : 6.000e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   3.26798109e+07 -3.36817480e+07  1.36e+03 5.85e+00  2.86e+05     0s
   1   2.79603614e+05 -1.48809013e+06  1.35e+02 5.80e-01  3.02e+04     0s
   2   5.00999035e+02 -1.03873065e+06  1.33e+01 5.75e-02  4.52e+03     0s
   3   1.63416742e+03 -3.54191821e+05  1.32e+00 5.70e-03  8.27e+02     0s
   4   2.02922751e+03 -3.68364438e+04  1.31e-01 5.64e-04  8.21e+01     0s
   5   2.07115444e+03 -1.81557024e+03  1.30e-02 5.59e-05  8.13e+00     0s
   6   2.07533715e+03  1.68664961e+03  1.29e-03 5.54e-06  8.12e-01     0s
   7   2.07575193e+03  2.03688182e+03  1.28e-04 5.49e-07  8.12e-02     0s
   8   2.07579304e+03  2.07190589e+03  1.26e-05 5.44e-08  8.12e-03     0s
   9   2.07579711e+03  2.07540838e+03  1.25e-06 5.40e-09  8.12e-04     0s
  10   2.07579751e+03  2.07575864e+03  1.24e-07 5.35e-10  8.12e-05     0s
  11   2.07579755e+03  2.07579366e+03  1.23e-08 5.30e-11  8.12e-06     0s
  12   2.07579756e+03  2.07579717e+03  1.22e-09 5.25e-12  8.12e-07     0s

Barrier solved model in 12 iterations and 0.13 seconds
Optimal objective 2.07579756e+03

Academic license - for non-commercial use only
Optimize a model with 25 rows, 13 columns and 73 nonzeros
Variable types: 9 continuous, 4 integer (4 binary)
Coefficient statistics:
  Matrix range     [1e+00, 3e+03]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [2e+03, 1e+04]
Found heuristic solution: objective 2075.7975564
Presolve removed 25 rows and 13 columns
Presolve time: 0.00s
Presolve: All rows and columns removed

Explored 0 nodes (0 simplex iterations) in 0.04 seconds
Thread count was 1 (of 4 available processors)

Solution count 1: 2075.8 

Optimal solution found (tolerance 1.00e-05)
Best objective 2.075797556458e+03, best bound 2.075797556458e+03, gap 0.0000%
Academic license - for non-commercial use only
Optimize a model with 4670 rows, 2543 columns and 10772 nonzeros
Model has 840 quadratic objective terms
Coefficient statistics:
  Matrix range     [1e-03, 1e+00]
  Objective range  [2e+03, 7e+03]
  QObjective range [2e+03, 1e+04]
  Bounds range     [0e+00, 0e+00]
  RHS range        [8e-03, 1e+00]
Presolve removed 4238 rows and 2063 columns
Presolve time: 0.02s
Presolved: 432 rows, 480 columns, 864 nonzeros
Presolved model has 600 quadratic objective terms
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 360
 AA' NZ     : 8.400e+02
 Factor NZ  : 4.800e+03 (roughly 1 MByte of memory)
 Factor Ops : 6.000e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   3.26798109e+07 -3.36817480e+07  1.36e+03 5.85e+00  2.86e+05     0s
   1   2.79603614e+05 -1.48809013e+06  1.35e+02 5.80e-01  3.02e+04     0s
   2   5.00999035e+02 -1.03873065e+06  1.33e+01 5.75e-02  4.52e+03     0s
   3   1.63416742e+03 -3.54191821e+05  1.32e+00 5.70e-03  8.27e+02     0s
   4   2.02922751e+03 -3.68364438e+04  1.31e-01 5.64e-04  8.21e+01     0s
   5   2.07115444e+03 -1.81557024e+03  1.30e-02 5.59e-05  8.13e+00     0s
   6   2.07533715e+03  1.68664961e+03  1.29e-03 5.54e-06  8.12e-01     0s
   7   2.07575193e+03  2.03688182e+03  1.28e-04 5.49e-07  8.12e-02     0s
   8   2.07579304e+03  2.07190589e+03  1.26e-05 5.44e-08  8.12e-03     0s
   9   2.07579711e+03  2.07540838e+03  1.25e-06 5.40e-09  8.12e-04     0s
  10   2.07579751e+03  2.07575864e+03  1.24e-07 5.35e-10  8.12e-05     0s
  11   2.07579755e+03  2.07579366e+03  1.23e-08 5.30e-11  8.12e-06     0s
  12   2.07579756e+03  2.07579717e+03  1.22e-09 5.25e-12  8.12e-07     0s

Barrier solved model in 12 iterations and 0.12 seconds
Optimal objective 2.07579756e+03

Academic license - for non-commercial use only
Optimize a model with 26 rows, 13 columns and 77 nonzeros
Variable types: 9 continuous, 4 integer (4 binary)
Coefficient statistics:
  Matrix range     [1e+00, 3e+03]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [2e+03, 1e+04]
Found heuristic solution: objective 2075.7975564
Presolve removed 26 rows and 13 columns
Presolve time: 0.00s
Presolve: All rows and columns removed

Explored 0 nodes (0 simplex iterations) in 0.04 seconds
Thread count was 1 (of 4 available processors)

Solution count 1: 2075.8 

Optimal solution found (tolerance 1.00e-05)
Best objective 2.075797556458e+03, best bound 2.075797556458e+03, gap 0.0000%
Academic license - for non-commercial use only
Optimize a model with 4670 rows, 2543 columns and 10772 nonzeros
Model has 840 quadratic objective terms
Coefficient statistics:
  Matrix range     [1e-03, 1e+00]
  Objective range  [2e+03, 7e+03]
  QObjective range [2e+03, 1e+04]
  Bounds range     [0e+00, 0e+00]
  RHS range        [8e-03, 1e+00]
Presolve removed 4238 rows and 2063 columns
Presolve time: 0.03s
Presolved: 432 rows, 480 columns, 864 nonzeros
Presolved model has 600 quadratic objective terms
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 360
 AA' NZ     : 8.400e+02
 Factor NZ  : 4.800e+03 (roughly 1 MByte of memory)
 Factor Ops : 6.000e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   3.26798109e+07 -3.36817480e+07  1.36e+03 5.85e+00  2.86e+05     0s
   1   2.79603614e+05 -1.48809013e+06  1.35e+02 5.80e-01  3.02e+04     0s
   2   5.00999035e+02 -1.03873065e+06  1.33e+01 5.75e-02  4.52e+03     0s
   3   1.63416742e+03 -3.54191821e+05  1.32e+00 5.70e-03  8.27e+02     0s
   4   2.02922751e+03 -3.68364438e+04  1.31e-01 5.64e-04  8.21e+01     0s
   5   2.07115444e+03 -1.81557024e+03  1.30e-02 5.59e-05  8.13e+00     0s
   6   2.07533715e+03  1.68664961e+03  1.29e-03 5.54e-06  8.12e-01     0s
   7   2.07575193e+03  2.03688182e+03  1.28e-04 5.49e-07  8.12e-02     0s
   8   2.07579304e+03  2.07190589e+03  1.26e-05 5.44e-08  8.12e-03     0s
   9   2.07579711e+03  2.07540838e+03  1.25e-06 5.40e-09  8.12e-04     0s
  10   2.07579751e+03  2.07575864e+03  1.24e-07 5.35e-10  8.12e-05     0s
  11   2.07579755e+03  2.07579366e+03  1.23e-08 5.30e-11  8.12e-06     0s
  12   2.07579756e+03  2.07579717e+03  1.22e-09 5.25e-12  8.12e-07     0s

Barrier solved model in 12 iterations and 0.14 seconds
Optimal objective 2.07579756e+03

Academic license - for non-commercial use only
Optimize a model with 27 rows, 13 columns and 81 nonzeros
Variable types: 9 continuous, 4 integer (4 binary)
Coefficient statistics:
  Matrix range     [1e+00, 3e+03]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [2e+03, 1e+04]
Found heuristic solution: objective 2075.7975564
Presolve removed 27 rows and 13 columns
Presolve time: 0.00s
Presolve: All rows and columns removed

Explored 0 nodes (0 simplex iterations) in 0.05 seconds
Thread count was 1 (of 4 available processors)

Solution count 1: 2075.8 

Optimal solution found (tolerance 1.00e-05)
Best objective 2.075797556458e+03, best bound 2.075797556458e+03, gap 0.0000%
Academic license - for non-commercial use only
Optimize a model with 4670 rows, 2543 columns and 10772 nonzeros
Model has 840 quadratic objective terms
Coefficient statistics:
  Matrix range     [1e-03, 1e+00]
  Objective range  [2e+03, 7e+03]
  QObjective range [2e+03, 1e+04]
  Bounds range     [0e+00, 0e+00]
  RHS range        [8e-03, 1e+00]
Presolve removed 4238 rows and 2063 columns
Presolve time: 0.03s
Presolved: 432 rows, 480 columns, 864 nonzeros
Presolved model has 600 quadratic objective terms
Ordering time: 0.00s

Barrier statistics:
 Free vars  : 360
 AA' NZ     : 8.400e+02
 Factor NZ  : 4.800e+03 (roughly 1 MByte of memory)
 Factor Ops : 6.000e+04 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   3.26798109e+07 -3.36817480e+07  1.36e+03 5.85e+00  2.86e+05     0s
   1   2.79603614e+05 -1.48809013e+06  1.35e+02 5.80e-01  3.02e+04     0s
   2   5.00999035e+02 -1.03873065e+06  1.33e+01 5.75e-02  4.52e+03     0s
   3   1.63416742e+03 -3.54191821e+05  1.32e+00 5.70e-03  8.27e+02     0s
   4   2.02922751e+03 -3.68364438e+04  1.31e-01 5.64e-04  8.21e+01     0s
   5   2.07115444e+03 -1.81557024e+03  1.30e-02 5.59e-05  8.13e+00     0s
   6   2.07533715e+03  1.68664961e+03  1.29e-03 5.54e-06  8.12e-01     0s
   7   2.07575193e+03  2.03688182e+03  1.28e-04 5.49e-07  8.12e-02     0s
   8   2.07579304e+03  2.07190589e+03  1.26e-05 5.44e-08  8.12e-03     0s
   9   2.07579711e+03  2.07540838e+03  1.25e-06 5.40e-09  8.12e-04     0s
  10   2.07579751e+03  2.07575864e+03  1.24e-07 5.35e-10  8.12e-05     0s
  11   2.07579755e+03  2.07579366e+03  1.23e-08 5.30e-11  8.12e-06     0s
  12   2.07579756e+03  2.07579717e+03  1.22e-09 5.25e-12  8.12e-07     0s

Barrier solved model in 12 iterations and 0.13 seconds
Optimal objective 2.07579756e+03

>> 

Jihyun Yi

unread,
Jul 10, 2018, 9:54:54 AM7/10/18
to YALMIP
Sorry to bother you, but could you show me what kind of plot you are having? I get the plot as well, but it never converges. 

I looked for the reason of unconvergence, and found out I cannot open the workspace of
'conm'. 
I will post the pictures so that you know what I am exactly having.

If you're having different plot and 'conm', could you post me as pictures? Sorry for causing inconvenience.
Capture1.PNG
Capture2.PNG

Jihyun Yi

unread,
Jul 10, 2018, 9:58:16 AM7/10/18
to YALMIP
I just saw what you uploaded. 

Yes, we are having same problem. 

As you can see, as the iteration proceeds, there's no change in objective value, nor convergence. 

Please try to open the workspace of 'conm', and you'll find the same problem, I suppose

Johan Löfberg

unread,
Jul 10, 2018, 11:38:15 AM7/10/18
to YALMIP
I get the same plots.


and I can reproduce the error if I try to display the list of constraints. Will have to look at that

>> conm
Index exceeds array bounds.

Error in sdpvar/is (line 53)
        variabletype = variabletype(X.lmi_variables);

Error in lmi/display (line 76)
            linearbilinearquadraticsigmonial = is(X.clauses{i}.data,'LBQS');
 


Johan Löfberg

unread,
Jul 10, 2018, 11:45:56 AM7/10/18
to YALMIP
you are resetting yalmips database inside With_Battery_Dist_Flow_Function_ideal2, hence you cannot look at conm after calling that function, as it involves variables which no longer exist

Jihyun Yi

unread,
Jul 10, 2018, 11:57:26 AM7/10/18
to YALMIP
So I guess even though I cannot see the constraint set 'conm', it doesn't mean that 'conm' is not considered within the given problem rightly. 

I guess, however, this problem does not have to do with convergence of the problem. 
So for the convergence, I should have a look at other factors... 

By the way, is there a way to display the 'conm'? Can I store the constraint set as an array so that I can have a look at it whenever I want? 

Johan Löfberg

unread,
Jul 10, 2018, 12:26:35 PM7/10/18
to YALMIP
after the call to With_Battery_Dist_Flow_Function_ideal2, the object conm is a orphan object which has no meaning, since you have run yalmip('clear')

Jihyun Yi

unread,
Jul 11, 2018, 4:39:32 AM7/11/18
to YALMIP
Thank you very much! 
I modified that part, and now that problem is fixed. 
At least I know now that the convergence problem has nothing to do with the error message. 


I really appreciate your swift, and helpful comments. 

Christeins

unread,
Jan 2, 2019, 5:39:58 PM1/2/19
to YALMIP
I noticed that it should be -dual(Constraint) rather than dual(Constraint) in the sub-problem file. I think this may be the reason about the convergence problem.

Johan Löfberg

unread,
Jan 2, 2019, 5:50:01 PM1/2/19
to YALMIP
there is no agreed upon definition of the sign, so you have to make sure yours is consistent with yalmips
Reply all
Reply to author
Forward
0 new messages