Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Solve MILP in Matlab call cplex

    Posted Fri October 11, 2013 05:16 PM

    Originally posted by: TongGuo


    Dear all:

    I have a model whose objective function can be defined like    

     

    sigma    a(i)*x(i)+b(i)*x(i)*y(i)

    Subject to :

    0<=x(i)<=Pmax;   when i between  [M N]

    x(i)=0; when other   

     

     

    a and b are parameter vector, they are known.

    X(i) are the continue variables, and y(i) are integar variables which are define 1 or 0 .

    My question is which example can i consult for CPLEX package? 

    They is no example which deal with this problem. Because i have x(i) time y(i) in the objective function.

    it may be called like a quadratic problem, but after i do some paper research, some of articles says that this is a MILP problem not MIQP problem

    Can some one share me a file which can use matlab to  call cplex solver to deal with this model

    I am really appreciaite it

    My email address is 

    sin6113140@gmail.com

    Thank you so much !!!


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Solve MILP in Matlab call cplex

    Posted Thu October 31, 2013 04:50 AM

    The cplexmiqpex.m example shipped with CPLEX illustrates how to solve an MIQP. The example has 3 continuous variables (x1, x2, x3) and one integer variable (x4) and a product of them in the objective function. So it should illustrate exactly what you want.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Solve LP in Matlab call cplex but...

    Posted Sun December 22, 2013 08:10 AM

    Originally posted by: yekdane87


    Hello every one

    I'm phd student and it's my first time using cplex for solving linear programming problem . So I installed it in my computer and I installed also the license file

    After that I added the path where the ilogcplex is installed and I did the same way with the example and I checked it by , help cplex in matlab and the result good I had all the functions

    But my problem is when i run an exemples i have this error

    Undefined function or method 'cplexlink123' for input arguments of type 'Cplex' please can you tell me what is the problem located

    thank you

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Solve LP in Matlab call cplex but...

    Posted Mon January 20, 2014 09:36 AM

    The only thing I can think of is that something went wrong with your setup of CPLEX in matlab.

    Maybe double-check the instructions here and make sure you can run the examples that are shipped with CPLEX.

    CPLEX 12.3 is a pretty old version of CPLEX. You may want to try to upgrade to a more recent version (the most recent version is 12.6).


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Solve LP in Matlab call cplex but...

    Posted Sun February 02, 2014 01:11 PM

    Originally posted by: yekdane87


    thank you very much Mr.Daniel Junglas for your help to me later, firstly  I want to let you know that my problem is solved by installing a new version of matlab 2012b .

    Secondly, i have another question sir about a linear program model in the attachment picture i want to solve it using cplex in matlab.

    can you sir guide me to solve it, and if you have a similar examples to this model send it to me please.

    my email is : yekdane87@yahoo.fr

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Solve LP in Matlab call cplex but...

    Posted Mon February 03, 2014 04:37 AM

    The first thing you should do is take a look at the various matlab examples that are shipped with CPLEX. They are in folder cplex/examples/src/matlab. You should also read this chapter in the user manually, specifically the section Using CPLEX for MATLAB. This section shows a linear program and how to enter it in matlab so that it can be solved with CPLEX.


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Solve LP in Matlab call cplex but...

    Posted Tue February 04, 2014 09:32 AM

    Originally posted by: yekdane87


    good morning sir, 

    i readed all the examples and the article of using cplex in matlab to solve a linear program, but i didn't code this model

    can you sir tell me what i do, or show me how the implementation of this model in matlab using the cplex librery.

     

    please guide me .


    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Solve LP in Matlab call cplex but...

    Posted Tue February 18, 2014 01:04 AM

    I think you should start with the mipex1.m example that is shipped with CPLEX. This example explicitly shows the model that is setup in its comments. This should be good enough to illustrate how to create variables and add constraints or objective functions.

    The next thing you could look at is the diet.m example. This illustrates how to sum variables (in this case for the objective function) and how to create a bunch of similar constraints.


    #CPLEXOptimizers
    #DecisionOptimization