Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Adding if-condition to optimization in Matlab

    Posted 06/24/14 04:31 PM

    Originally posted by: LeonardH


    Hello!

     

    Me and a friend are working on an optimization and it would be great if someone could give us some help.

    We are using Matlab to solve a MILP problem and therefore are calling up the CPLEX optimizer in the Matlab environment.

    After looking for quite a while we still didn't find out how to do it best or if it is even possible.

     

    So here is our problem:

    We want to express the following term, so the CPLEX Optimizer understands it:

     

    If sum( x(1-50) == 1) && sum( x(51-100) == 1)
    x(101) = 1
    end
    

     

    The problem is that I don't know the system and the commands to implement such thing into the optimization.

    Though it would be great if you could lend us a hand!

     

    Thanks so much

    Leo and Jannic


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Adding if-condition to optimization in Matlab



  • 3.  Re: Adding if-condition to optimization in Matlab

    Posted 07/02/14 05:04 AM

    Originally posted by: LeonardH


    Hey Mary,

    thanks for the answer! In the last couple of days we figured out a lot of new things and this was a great help.

    Unfortunately, we still have a problem:

    At the moment we write our model with the cplexmilp(...) command. In the link, you posted, the model is written with the Cplex() command.

    Is it possible to combine these two methods? Or to clarify: Is it possible to add indicators, collumns etc. to the cplexmilp-model?

     

    Here how it looks right now:

    options = cplexoptimset('cplex');
    options.diagnostics = 'on';
    options.timelimit = 1*60;
    options.exportmodel='test.lp';
    options.mip.tolerances.mipgap = 2e-4;
    
    [x,TotCost,exitflag,info] = cplexmilp(F,Ages,B,Aeq,beq,[],[],[],lb,ub,ctype,[],options);
    

     

    Hope I made myself understandable!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer