Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Cplex Matlab

  • 1.  Cplex Matlab

    Posted 03/17/12 06:09 PM

    Originally posted by: Sothea


    Dear,

    I am phd student in France and i am working on irrigation scheduling optimisation. I use Ilog cplex optimizer 123 academic version. I would like to know why i cannot use cplex with matlab interface. i already added path to C:\ILOG\cplex\matlab\x86_win32. But when i use it, i got the message as below:

    >> cplexlp(f,Aineq,bineq)
    ??? Corrupt P-file "C:\ILOG\cplex\matlab\x86_win32\cplexlp.p".

    Do you know this problem? Can you help me? Thanks in advance.

    Best regard,
    Sothea
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplex Matlab

    Posted 03/18/12 07:32 AM

    Originally posted by: John Cui


    I guess your matlab version is a little bit older. Could you please tell us your matlab version? by run "ver" in you matlab.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cplex Matlab

    Posted 03/18/12 12:46 PM

    Originally posted by: Sothea


    Dear John Cui,

    Thanks for replying. In fact, i try to test the Matlab7.1 and 2010a. The both doest work. It is not cause of Cplex academic version?

    Best regards,
    Sothea
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Cplex Matlab

    Posted 03/18/12 01:08 PM

    Originally posted by: Sothea


    i correct to my message. I mean the both matlab version don't work with cplex.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Cplex Matlab

    Posted 03/18/12 07:43 PM

    Originally posted by: John Cui


    That is not expected, sometimes, I got the same error message because of matlab version < 7.5.

    Could you please run cplexlink123 in your matlab 2010a?

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Cplex Matlab

    Posted 03/19/12 11:09 AM

    Originally posted by: Sothea


    Dear John Cui,

    Thanks for replying. Here is the message error i got after testing cplexlp and cplexlink123 :

    >> f=1,2';
    >> Aineq=1 2;
    >> bineq=10;
    >> cplexlp(f,Aineq,bineq)
    ??? Error using ==> cplexlp at 254
    Invalid MEX-file 'C:\Program
    Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\matlab\x86_win32\cplexlink123.mexw32':
    Cette application n'a pas pu démarrer car la configuration de l'application est
    incorrecte. Réinstaller l'application pourrait résoudre ce problème.

    .

    >> cplexlink123
    ??? Invalid MEX-file 'C:\Program
    Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\matlab\x86_win32\cplexlink123.mexw32':
    Cette application n'a pas pu démarrer car la configuration de l'application est
    incorrecte. Réinstaller l'application pourrait résoudre ce problème.

    .

    I tried to reinstaller the cplex, but the problem still happends. The same message i got after testing. I would like show you also about my malab version.

    >> ver

    MATLAB Version 7.11.0.584 (R2010b)
    MATLAB License Number: 54626
    Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 3)
    Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode

    MATLAB Version 7.11 (R2010b)
    Simulink Version 7.6 (R2010b)
    Control System Toolbox Version 9.0 (R2010b)
    Database Toolbox Version 3.8 (R2010b)
    Fuzzy Logic Toolbox Version 2.2.12 (R2010b)
    Image Processing Toolbox Version 7.1 (R2010b)
    MATLAB Compiler Version 4.14 (R2010b)
    Mapping Toolbox Version 3.2 (R2010b)
    Neural Network Toolbox Version 7.0 (R2010b)
    Optimization Toolbox Version 5.1 (R2010b)
    Partial Differential Equation Toolbox Version 1.0.17 (R2010b)
    Robust Control Toolbox Version 3.5 (R2010b)
    Signal Processing Toolbox Version 6.14 (R2010b)
    Simulink Control Design Version 3.2 (R2010b)
    Statistics Toolbox Version 7.4 (R2010b)
    Symbolic Math Toolbox Version 5.5 (R2010b)
    System Identification Toolbox Version 7.4.1 (R2010b)
    Wavelet Toolbox Version 4.6 (R2010b)
    >
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Cplex Matlab

    Posted 03/19/12 11:18 AM

    Originally posted by: Sothea


    to complet my message above, when i run help cplexlp in matlab, the function is known.

    >> help cplexlp

    cplexlp
    Solve linear programming problems.

    x = cplexlp(f,Aineq,bineq) solves the linear programming problem min f*x
    such that Aineq*x <= bineq.

    x = cplexlp(f,Aineq,bineq,Aeq,beq) solves the preceding problem with the
    additional equality constraints Aeq*x = beq. If no inequalities exist,
    set Aineq=] and bineq=[.

    x = cplexlp(f,Aineq,bineq,Aeq,beq,lb,ub) defines a set of lower and upper
    bounds on the design variables, x, so that the solution is always in the
    range lb <= x <= ub. If no equalities exist, set Aeq=] and beq=[.

    x = cplexlp(f,Aineq,bineq,Aeq,beq,lb,ub,x0) sets the starting point for
    the algorithm to x0. If no bounds exist, set lb=] and ub=[.

    x = cplexlp(f,Aineq,bineq,Aeq,beq,lb,ub,x0,options) minimizes with the
    default optimization options replaced by values in the structure options,
    which can be created using the function cplexoptimset. If you do not wish
    to give an initial point, set x0=[].

    x = cplexlp(problem) where problem is a structure.

    x,fval = cplexlp(...) returns the value of the objective function at
    the solution x: fval = f*x.

    x,fval,exitflag = cplexlp(...) returns a value exitflag that describes
    the exit condition of cplexlp.

    x,fval,exitflag,output = cplexlp(...) returns a structure output that
    contains information about the optimization.

    x,fval,exitflag,output,lambda = cplexlp(...) returns a structure lambda
    whose fields contain the Lagrange multipliers at the solution x.

    See also cplexoptimset
    Thanks for your time again to dear my problem.
    Sothea
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Cplex Matlab

    Posted 03/19/12 11:38 AM

    Originally posted by: John Cui


    Please go to:
    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=26347

    to download/install the x86 version Redistributable Package.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Cplex Matlab

    Posted 03/19/12 12:40 PM

    Originally posted by: Sothea


    Dear John Cui,

    I am so happy that problem is fixed. Thanks so much for your time.

    Best regards,
    Sothea
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Cplex Matlab

    Posted 03/19/12 10:14 PM

    Originally posted by: John Cui


    In fact, I suggest you to upgrade to 12.4, not only it is faster than 12.3, we improved a lot in our MATLAB interface.
    Such as above issues you encounter, we have fixed it in 12.4.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: Cplex Matlab

    Posted 03/20/12 09:29 AM

    Originally posted by: Sothea


    Dear John Cui,

    Thanks so much for your help.

    Best regards,
    Sothea
    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: Cplex Matlab

    Posted 05/13/12 07:54 AM

    Originally posted by: Maissa


    Dear,
    I want to know if i can run a problem wich the resutlt is a matrix not a vector x[j].
    means, My problem has the form of contraint like this:

    Ai,j*xi,j<=b[j]

    and the result should be a matrix (xi,j) of 0 or 1

    the function 'cplexbilp' run the simple exemple (x1,x2,x3,...)
    can another function run the big problem (x11,x12,x13,...x21,x22,x23,........,xn1,xn2,...xnm)?

    Help me soon as possible! PLEeeASE
    #CPLEXOptimizers
    #DecisionOptimization


  • 13.  Re: Cplex Matlab

    Posted 05/13/12 09:19 AM

    Originally posted by: SystemAdmin


    Do I understand correctly: You want to have constraints
    A * X <= b
    

    where A and X are matrices and b is a vector? In that case the left-hand side of the inequality is a matrix (a product of two matrices) and the right-hand side a vector, right? What does it mean for a matrix to be less than or equal to a vector? Does it mean that every column in the matrix should be less than or equal to b?
    #CPLEXOptimizers
    #DecisionOptimization


  • 14.  Re: Cplex Matlab

    Posted 05/13/12 06:34 PM

    Originally posted by: Maissa


    thanks for replying Dear Daniel Junglas ,
    the problem has x is unknown & A,b are knows.
    So after the resolution, i should to get the solution is x who satisfied a set of contraints (set of contraites get forall i in A A(i,:)=the ligne i and all the colonnes of this ligne of A multiply with the all colonnes of x; and the same think to reste lignes of A)
    #CPLEXOptimizers
    #DecisionOptimization


  • 15.  Re: Cplex Matlab

    Posted 05/14/12 01:54 PM

    Originally posted by: SystemAdmin


    Sorry, it is still not clear to me what you are trying to do. The problems solved by CPLEX usually look like this:
    ( A[1][1]   A[1][2]   A[1][3] )      ( x[1] )        ( b[1] )
    ( A[2][1]   A[2][2]   A[2][3] )  *   ( x[2] )   <=   ( b[2] )
    ( A[3][1]   A[3][2]   A[3][3] )      ( x[3] )        ( b[3] )
    

    How would the problem look like that you try to solve?
    #CPLEXOptimizers
    #DecisionOptimization


  • 16.  Re: Cplex Matlab

    Posted 05/14/12 02:40 PM

    Originally posted by: Maissa


    Excuse me,
    So the assignment problem can't be soved by CPLEX?
    I can declare a variable with two argements like:
    xi,j=1 if the crew i assigned to the rotation j
    0 else
    So my variable isn't juste a vecteur, but it's a matrix!
    in the simple case, i can declare my variable in column.....each column from the matrix of the variable follows the previous one (in the same column I work) to get a standard variable (one column) as your example ... but it will be long and in the same time the rows of the matrix A is repeated several times.
    For this, I search if it's possible to input matrices of the problem as I had previously described?
    i hope that I was clear.

    thanks again to your help
    #CPLEXOptimizers
    #DecisionOptimization


  • 17.  Re: Cplex Matlab

    Posted 05/14/12 04:18 PM

    Originally posted by: Eumpfenbach


    You have to have a vector of decision variables, not a matrix. This is standard notation for mathematical formulation and solver in the world (pretty sure).

    If the rows of your A matrix are repeated exactly over and over, you might have an inefficient formulation. If you aren't sure, formulate the long way (ie, one long column of decision variables) and see if cplex's presolve removes a large number of the rows and columns. This will give you info about the efficiency of your initial formulation.
    #CPLEXOptimizers
    #DecisionOptimization


  • 18.  Re: Cplex Matlab

    Posted 03/27/14 05:40 PM

    Originally posted by: SofiK


    Hi,

    I am a student in Greece, first time using Cplex 12.5 for my thesis. I think I have the same problem as Sothea above... I have also added the path: C:\Program Files (x86)\IBM\ILOG\CPLEX_Studio125\cplex\matlab\x86_win32

    When I type the example below, I got the following error:

    >> f=[1 2]';
    Aineq=[1 2];
    bineq=10;
    cplexlp(f,Aineq,bineq)
    ??? Error using ==> cplexlp at 254
    Undefined function or method 'cplexlink125' for input arguments of type 'struct'.

    I have also tried to install the package you suggested: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=26347

    but without any success.

    Could you please help me?

    Thank you in advance.

    Best regards,

    Sofia


    #CPLEXOptimizers
    #DecisionOptimization


  • 19.  Re: Cplex Matlab

    Posted 03/27/14 05:43 PM

    Originally posted by: SofiK


    Also, you can see the version of Matlab that I am using. (I also tried Matlab 2011a but it had the same problem)

    MATLAB Version 7.11.0.584 (R2010b)
    MATLAB License Number: 161051
    Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1)
    Java VM Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
    -------------------------------------------------------------------------------------
    MATLAB                                                Version 7.11       (R2010b)
    Simulink                                              Version 7.6        (R2010b)
    Aerospace Blockset                                    Version 3.6        (R2010b)
    Aerospace Toolbox                                     Version 2.6        (R2010b)
    Bioinformatics Toolbox                                Version 3.6        (R2010b)
    Communications Blockset                               Version 5.0        (R2010b)
    Communications Toolbox                                Version 4.6        (R2010b)
    Control System Toolbox                                Version 9.0        (R2010b)
    Curve Fitting Toolbox                                 Version 3.0        (R2010b)
    DO Qualification Kit                                  Version 1.3        (R2010b)
    Database Toolbox                                      Version 3.8        (R2010b)
    Datafeed Toolbox                                      Version 4.0        (R2010b)
    EDA Simulator Link                                    Version 3.2        (R2010b)
    Econometrics Toolbox                                  Version 1.4        (R2010b)
    Filter Design HDL Coder                               Version 2.7        (R2010b)
    Filter Design Toolbox                                 Version 4.7.1      (R2010b)
    Financial Derivatives Toolbox                         Version 5.6        (R2010b)
    Financial Toolbox                                     Version 3.8        (R2010b)
    Fixed-Income Toolbox                                  Version 2.0        (R2010b)
    Fixed-Point Toolbox                                   Version 3.2        (R2010b)
    Fuzzy Logic Toolbox                                   Version 2.2.12     (R2010b)
    Global Optimization Toolbox                           Version 3.1        (R2010b)
    IEC Certification Kit                                 Version 1.3        (R2010b)
    Image Acquisition Toolbox                             Version 4.0        (R2010b)
    Image Processing Toolbox                              Version 7.1        (R2010b)
    Instrument Control Toolbox                            Version 2.11       (R2010b)
    MATLAB Builder EX                                     Version 1.3        (R2010b)
    MATLAB Builder JA                                     Version 2.2        (R2010b)
    MATLAB Builder NE                                     Version 3.2        (R2010b)
    MATLAB Compiler                                       Version 4.14       (R2010b)
    MATLAB Distributed Computing Server                   Version 5.0        (R2010b)
    MATLAB Report Generator                               Version 3.9        (R2010b)
    Mapping Toolbox                                       Version 3.2        (R2010b)
    Model Predictive Control Toolbox                      Version 3.2.1      (R2010b)
    Neural Network Toolbox                                Version 7.0        (R2010b)
    Optimization Toolbox                                  Version 5.1        (R2010b)
    Parallel Computing Toolbox                            Version 5.0        (R2010b)
    Parallel Computing Toolbox                            Version 5.0        (R2010b)
    Partial Differential Equation Toolbox                 Version 1.0.17     (R2010b)
    RF Toolbox                                            Version 2.8        (R2010b)
    Real-Time Workshop                                    Version 7.6        (R2010b)
    Real-Time Workshop Embedded Coder                     Version 5.6        (R2010b)
    Robust Control Toolbox                                Version 3.5        (R2010b)
    Signal Processing Blockset                            Version 7.1        (R2010b)
    Signal Processing Toolbox                             Version 6.14       (R2010b)
    SimBiology                                            Version 3.3        (R2010b)
    SimDriveline                                          Version 1.5.5      (R2010b)
    SimElectronics                                        Version 1.5        (R2010b)
    SimEvents                                             Version 3.1.1      (R2010b)
    SimHydraulics                                         Version 1.8        (R2010b)
    SimMechanics                                          Version 3.2.1      (R2010b)
    SimPowerSystems                                       Version 5.3        (R2010b)
    SimRF                                                 Version 3.0        (R2010b)
    Simscape                                              Version 3.4        (R2010b)
    Simulink 3D Animation                                 Version 5.2        (R2010b)
    Simulink Control Design                               Version 3.2        (R2010b)
    Simulink Design Optimization                          Version 1.2        (R2010b)
    Simulink Design Verifier                              Version 1.7        (R2010b)
    Simulink Fixed Point                                  Version 6.4        (R2010b)
    Simulink Report Generator                             Version 3.9        (R2010b)
    Simulink Verification and Validation                  Version 3.0        (R2010b)
    Spreadsheet Link EX                                   Version 3.1.2      (R2010b)
    Stateflow                                             Version 7.6        (R2010b)
    Stateflow Coder                                       Version 7.6        (R2010b)
    Statistics Toolbox                                    Version 7.4        (R2010b)
    Symbolic Math Toolbox                                 Version 5.5        (R2010b)
    System Identification Toolbox                         Version 7.4.1      (R2010b)
    SystemTest                                            Version 2.6        (R2010b)
    Video and Image Processing Blockset                   Version 3.1        (R2010b)
    Wavelet Toolbox                                       Version 4.6        (R2010b)


    #CPLEXOptimizers
    #DecisionOptimization