Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  a problem about getting dual variables in Matlab

    Posted 07/13/11 10:14 AM

    Originally posted by: SystemAdmin


    Hi to all,

    I am calling CPLEX_Studio_AcademicResearch122 from Matlab to solve my linear programming problem.
    I used

    way 1:

    secondstage.addCols(second_obj, [], second_lb, second_ub, second_ctype);
    secondstage.addRows(lhs_1;lhs_2;lhs_3;lhs_4;lhs_5;lhs_6, W_1;W_2;W_3;W_4;W_5;W_6, rhs_1;rhs_2;rhs_3;rhs_4;rhs_5;rhs_6);

    where all matrices and vectors are defined in my program

    and way 2:

    secondstage.Model.obj = second_obj;
    secondstage.Model.lb = second_lb;
    secondstage.Model.ub = second_ub;
    secondstage.Model.ctype = second_ctype;
    secondstage.Model.A = W_1;W_2;W_3;W_4;W_5;W_6;
    secondstage.Model.lhs = lhs_1;lhs_2;lhs_3;lhs_4;lhs_5;lhs_6;
    secondstage.Model.rhs = rhs_1;rhs_2;rhs_3;rhs_4;rhs_5;rhs_6;

    where again all matrices and vectors are defined in my program. Cplex solved this problem using both ways and obtained the optimal solution for the primal problem but gave the following error message for the optimal dual variables

    Error using ==> subsref
    Reference to non-existent field 'dual'.

    What is the reason for this error message?

    I could not attach my files since only one file is allowed to be attached and I have many, but I can send them all in case someone wants to get them.

    Thanks in advance
    Ebru
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: a problem about getting dual variables in Matlab

    Posted 07/13/11 10:57 AM

    Originally posted by: John Cui


    I saw you used ctype in your model, your model will be a MIP if ctype is not empty.
    Then no dual valur is expected. Only LP model have dual solution.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: a problem about getting dual variables in Matlab

    Posted 07/14/11 10:49 AM

    Originally posted by: SystemAdmin


    Thank you, it worked.

    Ebru
    #CPLEXOptimizers
    #DecisionOptimization