Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX Error 1422

    Posted 02/09/19 11:07 PM

    Originally posted by: Devin063


    Greetings,

     

    I am currently use cplexlp function in matlab to solve linear programming problem.

    I have two computers running same program. But one does not throw any error. Another one throws error 1422. Could anyone help me figure out what happen?

     

    Thank you very much!

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: CPLEX Error 1422

    Posted 02/10/19 11:39 AM

    Hi

    this means

    Could not open file

    Can that help ?

    regards


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: CPLEX Error 1422

    Posted 02/13/19 11:03 AM

    Originally posted by: Devin063


    But this is very weird. I don't try to open any file in optimization function. 


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: CPLEX Error 1422

    Posted 02/14/19 02:07 AM

    That indeed looks a little weird. Can you please show exactly how you are calling? In particular, what parameters you set?


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: CPLEX Error 1422

    Posted 02/14/19 10:17 AM

    Originally posted by: Devin063


    function iterate(plant, t, u, varargin)
                switch nargin
                    case 3
                        ...
                    case 4
                        if varargin{1,1} == false
                            ...
                        else
                            plant.needRecord = true;
                        end
                    otherwise
                        error('Number of arguments does not match.')
                end
                
                constraintsLeft = [plant.c.AC0; ...
                                   -plant.c.s*plant.x(27)*plant.dt; ...
                                   plant.c.Aeq;...
                                   plant.c.Aspec];    
                
                constraintsRight = [plant.c.bC0; ...
                                     plant.x-plant.c.lowConcLmt; ...
                                     plant.c.beq; ...
                                     plant.p.bspec];   
    
                plant.p.bspec(end-1) = 2.2 * 4e-5 * plant.x(5) / (1.5 + plant.x(5));
                          
                [j,fval,exitflag,output,lambda] = cplexlp(-plant.c.s(27,:), constraintsLeft, constraintsRight,...
                                                                    [], [], zeros(plant.c.numReac,1), [], [], plant.c.options);
    
                if exitflag ~= 1
                   disp(t);
                   error('Infeasible solution in the plant module!');
                end
                
                plant.hist.cnstr(:,t) = constraintsLeft * j - constraintsRight;
                plant.hist.j(:,t) = j;
                plant.hist.fval(t) = fval;            
                plant.p.vol = plant.p.vol + u * 1e-3 *plant.dt ;
                plant.x = plant.x + plant.c.s * j * plant.x(27) * plant.dt ...
                                    + ((u * 400 / 147) / (1 * plant.p.vol)) * plant.dt * plant.c.inp...
                                    - (u * 1e-3 / plant.p.vol) * plant.dt * plant.x;
                            
               if plant.needRecord == true
                   plant.hist.u(:,t) = u;
                   plant.hist.x(:,t) = plant.x;
                   plant.record(t);
               end
    
            end
    

    s is a coefficient matrix for linear programming problem.

     

    BTW, Sir, you asked me to upload engine file in another question. But I don't know how to generate engine file through Matlab APIs. Could you give me some hints?

     

    Thank you very much!


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 6.  Re: CPLEX Error 1422

    Posted 02/15/19 11:22 AM

    Can you please show how you set up plant.c.options? Or even dump that structure and all its elements and show the result here? Maybe you enabled by accident something that writes files.

    In order to get the CPLEX log output you have to set the Display parameter to "on", see https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/refmatlabcplex/html/cplexoptimset-m.html for details. Can you please attach the CPLEX engine output here as well?


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 7.  Re: CPLEX Error 1422

    Posted 02/15/19 12:01 PM

    Originally posted by: Devin063


    These attached are the files. On one computers, it works well. In the main file, I set the cplexoptimset.

     

    Is the engine file what displays on the command window of matlab? I save the output on my command window as engine file. Could you check is that what you want?

    Because the program needs to run about 4 days, I just show the small initial part of the engine file.

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 8.  Re: CPLEX Error 1422

    Posted 02/18/19 03:39 AM

    Yes, these are the files I was asking for.

    This all seems pretty weird. Do I understand correctly that the code runs fine for a while, performs a large number of solves in a loop and then all of a sudden you get this CPLEX Error 1422?

    Can you please do this

    • Try to not set the clonelog parameter, i.e., leave that parameter at its default value.
    • In case the issue still persists, can you please show the engine log for the solve that raises this CPLEX Error 1422? For each solve, the first thing that CPLEX shows in the log is the set of non-default parameter settings. We need to check whether you have (by accident) set any parameter that would require CPLEX to write something to disk. Also, can you export and post here the SAV file for the model that is solved when the 1422 error is triggered?

    #DecisionOptimization
    #OPLusingCPOptimizer


  • 9.  Re: CPLEX Error 1422

    Posted 02/18/19 03:00 PM

    Originally posted by: Devin063


    My program is a nested optimization:

    exterior nonlinear optimization (Parallel computation by matlab)
      for loop
        interior linear programming
        end
      end 
    end
    


    I tried to not set the clonelog parameter. Within few minutes and one iteration has not finished, it still threw error 1422. 

    I turn on the 'iter' parameter to let engine log display on my command window of matlab and save it as a file. Very Interesting, after 11 interations (exterior optimization) about the entire morning, it still threw error 1422. I found even for the same program, the error occurs very occasionally. Sometimes, it throws just after I run the program; sometimes, it throws the error 1422 after random number of iterations.

    I suspect it is an error related to parallel computation of Matlab. It seems very hard to repeat the error if I turned off the parallel computation for exterior optimization.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 10.  Re: CPLEX Error 1422

    Posted 02/20/19 09:01 PM

    Originally posted by: Devin063


    Just now, I was running another simpler but similar program on the computer never threw Error 1422. Unfortunately, I got same error 1422 that it mentioned that  I tried to write %s. I am pretty sure that I don't write anything.

    In this simpler program, there is no parallel computation and exterior optimization (nonlinear optimization). I only used cplexlp for linear programming. So it probably not a problem of parallel computation.

     

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 11.  Re: CPLEX Error 1422

    Posted 02/21/19 04:10 AM

    Are the files attached in your latest post all I need to reproduce the problem? If you, can you please tell me how to run your code, what matlab version and what operating system you are using?
    I can then try to reproduce the issue here.

    By the way, even though you don't write anything, do you observe any sort of files being created on your disk? In particular in the directory in which matlab runs?


    #DecisionOptimization
    #OPLusingCPOptimizer