Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX(default) cannot extract model: IloAlgorithm cannot extract extractable.

    Posted 12/02/14 04:18 PM

    Originally posted by: K_Darkwah


    Hi all,

    I am a newbie in using OPL, but i have to figure this for my project due Thursay.

    I have multilple biomass, potential plant and supply centers. The initial aim was to find the optimal plant location for various plants, for eg. if we decided we wanted one plant, for two etc. and this has been ok.

    The next thing is to use trucks of different mass and sizes to haul the biomass and different trucks for the fuel. I taught of defining 3 binary variables (B1, B2, B3) and using these with the respective costs and then add the constraint B1+B2+B3 ==1 since we wanted to select the best truck. I wanted to use the big M to make use the truck that is chosen is used to transport the product but i am not sure if what i have written makes sense by using the number of trucks <=M*PlantOpen. 

    When I run the code i get errors like:

    Description Resource Path Location Type
    CPLEX(default) cannot extract expression: CSMass[d][b][(m)] / (12.35*B1+14.1192934782562*B2+15.7514925827285*B3). New CS Ferm Unknown OPL Problem Marker

    Description Resource Path Location Type

    CPLEX(default) cannot extract expression: EtOHVol[d][e][(m)] / (6060*B1+6928.17153669899*B2+7729.07247379229*B3). New CS Ferm Unknown OPL Problem Marker

    Description Resource Path Location Type

    CPLEX(default) cannot extract model: IloAlgorithm cannot extract extractable. New CS Ferm Unknown OPL Problem Marker
     

    I know the division of the expressions below by B1, B2, B3 which a binary decision variables is causing the problem but I dont know how to fix this or other problems in the code. If what I have provided is not enough I can send the code to anyone willing to help me out. Thanks for your time.

    Sample code

    dvar boolean PlantOpen[PlantLocation];

     
    dvar boolean B1;
    dvar boolean B2;
    dvar boolean B3;
    dvar float+ CSMass[PlantLocation][BiomassLocation][ onth]; //Mass of biomass transported

    dvar float+ CSAgedSupply[BiomassLocation][Month];  //Old stock of biomass

    dvar float+ EtOHVol[PlantLocation][ProductLocation][Month]; // Gallons of Ethanol Shipped

    dexpr float CSTotalSupply[b in BiomassLocation,m in Month]=CSAgedSupply[b][m]+CSNewSupply[b][m]; //Total biomass supply per month

    dexpr float CSTrucks [d in PlantLocation,b in BiomassLocation,m in Month]=(CSMass[d][b]
    [m]/(B1*CSTruckMassA+B2*CSTruckMassB+B3*CSTruckMassC)); // Number of Trucks to transport biomass

    dexpr float EtOHTrucks[d in PlantLocation,e in ProductLocation,m in Month]=(EtOHVol[d][e][m]/((B1*EtOHTruckVolA)+B2*EtOHTruckVolB+B3*EtOHTruckVolC)); // Number of trucks to transport fuel

    //making sure Truck that is chosen is used

    forall(d in PlantLocation)
    sum(b in BiomassLocation, m in Month)
    /CSTrucksZ[d][b][m])<=M*(B1+B2+B3);

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: CPLEX(default) cannot extract model: IloAlgorithm cannot extract extractable.

    Posted 12/03/14 04:53 AM

    Hi

    have you tried to use logical constraints ?

    According to the binary values, you will compute what is under the division and get rid of the division

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: CPLEX(default) cannot extract model: IloAlgorithm cannot extract extractable.

    Posted 12/03/14 12:27 PM

    Originally posted by: K_Darkwah


    Thanks for the reply. I am very new to this. could please give me an example of using the logical constraint to get rid of the division? I tried looking at the help on this but it is too much for me to rap my mind around. 

    The other thing I am trying to figure out is why in the error i have this CPLEX(default) cannot extract expression: CSMass[d][b][(m)], why is the m like this [(m)], i defined it as range Month = 1..12 and so I expect [m]

    Best wishes.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: CPLEX(default) cannot extract model: IloAlgorithm cannot extract extractable.

    Posted 12/04/14 03:07 AM

    Hi,

    let me show you how I would get rid of the division.

    float CSTruckMassA=100;

    float CSTruckMassB=100;

    float CSTruckMassC=100;

    dvar boolean B1;

    dvar boolean B2;

    dvar boolean B3;

     

    dvar float CSMass in 0..1000;

    dvar float z;

     

     

    //dexpr float CSTrucks =CSMass /(B1*CSTruckMassA+B2*CSTruckMassB+B3*CSTruckMassC);

     

    dexpr float CSTrucks =z;

     

    maximize CSTrucks;

    subject to

    {

    forall(b1,b2,b3 in 0..1)

    ((b1==B1) && (b2==B2) && (b3==B3)) ==

    (z==CSMass /(b1*CSTruckMassA+b2*CSTruckMassB+b3*CSTruckMassC));

     

     

    }

    I suggest you to spend more time reading the help and having a look at some good videos we have either on youtube or on our Virtual user GROUP

     

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: CPLEX(default) cannot extract model: IloAlgorithm cannot extract extractable.

    Posted 12/04/14 01:22 PM

    Originally posted by: K_Darkwah


    Thanks so much. I am going to watch some videos and work with what you provided. I will give you a feedback on this. Thanks so much.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer