Decision Optimization

Decision Optimization

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

 View Only
  • 1.  cplex error 5002: Q in objective is not positive semi-definite

    Posted Wed December 09, 2015 08:37 AM

    Originally posted by: NiuX-HNU


    Hello everyone:
       I'm using cplex to do some research on MIP problem, but when I try to execute this script I have the error "cplex error 5002: Q in objective is not positive semi-definite."

    The model:
      
       int T=...;      
       int nw=...;     
       int ns=...;      
       int np=...; 

       range time=1..T;    
       range wind=1..nw;   
       range solar=1..ns;  
       range price=1..np;  

       float gbmax=...;

       dvar float+ gc[wind,solar,price,time];           
       dvar float+ gch[wind,solar,price,time];
       dvar float+ gb[wind,solar,price,time];
       dvar boolean u[wind,solar,price,time];   
       dvar boolean v[wind,solar,price,time];

       int Cbat=...;
       int At=...;
     
       float effic=...; 
       float effid=...;
       float climt=...;
       float dlimt=...;

       

      sum(w in wind,s in solar,p in price,t in time)
          pip[p]*(gb[w,s,p,t]/gbmax)*(gch[w,s,p,t]+gd[w,s,p,t])*Cbat/At;  

     

      subject to{
         ct1
          forall(w in wind,s in solar,p in price,t in 2..T)
          gb[w,s,p,t]==gb[w,s,p,t-1]+effic*gch[w,s,p,t]-gd[w,s,p,t]/effid;

          ct2:
        forall(w in wind,s in solar,p in price,t in time)
         gch[w,s,p,t]<=climt*u[w,s,p,t];      
      
        forall(w in wind,s in solar,p in price,t in time)
         gd[w,s,p,t]<=dlimt*v[w,s,p,t];
              
        ct3:
        forall(w in wind,s in solar,p in price,t in time)
          u[w,s,p,t]+v[w,s,p,t]<=1;
       
        ......
    }

           I guess (gb[w,s,p,t]/gbmax)*(gch[w,s,p,t]+gd[w,s,p,t])*Cbat/At' in the objective function may be the reason, because gb[w,s,p,t], gch[w,s,p,t] and gd[w,s,p,t] are all decision variables, that makes the objective function quadratic.

           So I'm wondering how to solve this problem? Are there any methods to linearize this formulation? Thanks very much!


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: cplex error 5002: Q in objective is not positive semi-definite

    Posted Wed December 09, 2015 11:33 AM

    I suggest to search for this error message (cplex error 5002)  in this Forum. Questions very similar to yours have been asked and answered many times.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: cplex error 5002: Q in objective is not positive semi-definite

    Posted Fri December 11, 2015 04:12 AM

    Originally posted by: NiuX-HNU


    Thank you for your generous help. I had add  cplex.solutiontarget=3 before my objective function. Now my script can execute without error, however the computational speed is too slow. Please tell me how to acclerate the computatianal speed.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: cplex error 5002: Q in objective is not positive semi-definite

    Posted Tue January 05, 2016 03:45 AM

    Am I correct that you started a new thread about improving performance here?


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: cplex error 5002: Q in objective is not positive semi-definite

    Posted Thu January 07, 2016 10:13 PM

    Originally posted by: EdKlotz


    Running with solutiontarget = 3 only makes since if you have a truly nonconvex quadratic objective and want so solve the associated MIQP.

    Is that the case?   If so, this thread is now a performance issue as Daniel said.   However, if you believe your quadratic objective is actually

    convex (or concave and a maximization problem), then the 5002 error typically indicates that the quadratic objective you have created is not

    the one you have intended, and you need to identify the part of the associated Q matrix that is indefinite.    I see you are using OPL.   You can

    export a SAV file of the model, then run the diagnostic program (written in C or Python, so you'll need access to a C compiler or Python interpreter

    and the CPLEX Callable Library). available at http://www-01.ibm.com/support/docview.wss?uid=swg21400047.

     

    Ed

     

     


    #CPLEXOptimizers
    #DecisionOptimization