Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Function operator^(dvar float,float) not available in context CPLEX.

  • 1.  Function operator^(dvar float,float) not available in context CPLEX.

    Posted Tue April 08, 2014 08:33 AM

    Originally posted by: vamshi.IIT


    Here is my code. 

    prod(i in comp,j in period) (2.71828^(-(f[i]*(((Y[i,j])^B[i])-((X[i,j])^B[i]))))) >= S ;

    Y[i,j] and X[i,j] are decision variables. B[i] is float variable. 

    I am not able to use (dvar float) ^ (float)

    Please help me.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Function operator^(dvar float,float) not available in context CPLEX.

    Posted Tue April 08, 2014 08:49 AM

    Originally posted by: vamshi.IIT


    here is my complete code:

     

    {code}

    {int}comp = {1,2,3,4,5};
    {int}period = {1,2,3,4,5,6,7,8,9,10};
    float f[comp] = [0.00022,0.00035,0.00038,0.00034,0.00032];
    float B[comp] = [2.2,2,2.05,1.9,1.75];
    float a[comp] = [0.62,0.58,0.55,0.5,0.48];
    float MC[comp] = [35,32,65,42,50];
    float FC[comp] = [250,240,270,210,220];
    float PC[comp] = [200,210,245,180,205];
    float MT[comp] = [0,0,0,0,0];
    float RT[comp] = [0,0,0,0,0];
    int T=10;
    int JP=10;
    float S=0.50;
    int Z=800;
    int BD=25000;
    dvar float+ X[comp,period];
    dvar float+ Y[comp,period];
    dvar boolean m[comp,period];
    dvar boolean r[comp,period];
     
     
    maximize // **************** OBJECTIVE*************************
    (sum(i in comp,j in period)(((Y[i,j])^B[i])-((X[i,j])^B[i]))) / ((sum(i in comp,j in period)(((Y[i,j])^B[i])-((X[i,j])^B[i])))-((sum(i in comp,j in period)((MT[i]*m[i,j])+(RT[i]*r[i,j])))*(prod(i in comp,j in period)(2.71828^(-(f[i]*(((Y[i,j])^B[i])-((X[i,j])^B[i]))))))));
     
    subject to {
      
      forall(i in comp,j in period)
    ct1:
    X[i,1] == 0 ;

     

    forall(i in comp,j in period : j>=2)
    ct2:
    X[i,j] == ( (1-m[i,j-1])*(1-r[i,j-1])*Y[i,j] ) + ( a[i] * m[i,j-1] * Y[i,j-1] );

     

    forall(i in comp,j in period)
    ct3:
    Y[i,j] == X[i,j] + (T/JP) ;

     

    forall(i in comp,j in period)
    ct4:
    m[i,j] + r[i,j] <= 1 ;

     

    forall(i in comp,j in period)
    ct5:
    prod(i in comp,j in period) (2.71828^(-(f[i]*(((Y[i,j])^B[i])-((X[i,j])^B[i]))))) >= S ;
     
    forall(i in comp,j in period)
      ct7:
       X[i,j] >= 0 ;

     

    forall(i in comp,j in period)
    ct8:
     Y[i,j] >= 0 ;
    }
    {code}

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Function operator^(dvar float,float) not available in context CPLEX.

    Posted Tue April 08, 2014 12:18 PM

    Hi,

    your model is not linear or quadratic. So what you get is normal.

    2 options:

    1) Try to linearize with piecewise linear functions

    2) Try constraint programming

    Add using CP;

    and use

     

    dvar int+ x[comp,period] in 0..1000;
    dvar int+ y[comp,period] in 0..1000;



    dexpr float X[c  in comp,p in period]=x[c,p]/100;
    dexpr float Y[c in comp,p in period]=y[c,p]/100;

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer