Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  help needed urgently fd

    Posted 12/17/11 08:24 AM

    Originally posted by: shatha


    hello, the model below is a transportation model using lingo 9.0, but when solving it the lingo keeps giving me "unexpected jacobian overflow, can anyone help?
    MODEL:
    ! A 3 Warehouse, 4 Customer
    Transportation Problem;

    SETS:
    country / morroco, poland, ksa/ :available_veh1, sc ;
    warehouse / marka, layan/ :available_veh2;
    CUSTOMER / carrefoure, safeway, cozmo/;
    item / cheese, cornd_beef, milk/;
    time/ 1,2/;
    transfer1 ( country, warehouse, item, time) : quantity1;
    transfer2 (warehouse, customer, item, time) : quantity2;
    pair1 (country, item,time) : supply, price;
    pair2 (customer, item, time) : demand;
    pair3 (warehouse, item) ;
    pair4 (customer, item);
    link1 (country,warehouse, time) :cost1, travel_time1, arrival_time1;
    link2 (warehouse,customer, time) :cost2, travel_time2, arrival_time2;
    link3 (country, time) :required_veh1;
    link4 (warehouse, time) :required_veh2;

    ENDSETS

    ! The objective;
    OBJ MIN = 0.75*(@SUM( transfer1(i,j,r,t):(sc(i))+ ((COST1(i,j,t)+price(i,r,t)) * quantity1(i,j,r,t))+ (fixed1 * required_veh1(i,t)))
    + @SUM( transfer2(j,k,r,t): (COST2(j,k,t) * quantity2(j,k,r,t))+ (fixed2 * required_veh2(j,t))))
    + 0.25*(@SUM( link1(i,j,t): arrival_time1(i,j,t)) + @SUM ( link2(j,k,t):arrival_time2(j,k,t)));

    ! The demand constraints;
    @FOR( pair2(k,r,t): DEM
    @SUM( warehouse(j): quantity2( j,k,r,t)) >=
    DEMAND( k,r,t));

    ! The supply constraints;
    @FOR( pair1(i,r,t): SUP
    @SUM( warehouse( j): quantity1( i,j,r,t)) <=
    supply( i,r,t));

    !The flow conservation;
    @sum (transfer1(i,j,r,t): quantity1(i,j,r,t)) = @sum (transfer2(j,k,r,t): quantity2(j,k,r,t));

    ! The vehicles requirement;
    @for (link3(i,t):vehicles1
    required_veh1= @if ((@sum (pair3(j,r): quantity1(i,j,r,t))/capacity1) #LE# 1, 1,
    @sum (pair3(j,r): quantity1(i,j,r,t))/capacity1));

    @for ( link3(i,t):
    required_veh1 <= available_veh1);
    @for (link4(j,t):vehicles2
    required_veh2= @if ((@sum (pair4(k,r): quantity2(j,k,r,t))/capacity2) #LE# 1, 1,
    @sum (pair4(k,r): quantity2(j,k,r,t))/capacity2));

    @for ( link4(j,t):
    required_veh2 <= available_veh2);

    !arrival time;

    @for (link1(i,j,t): arvl1
    arrival_time1= @if(@sum(item(r): quantity1(i,j,r,t)) #GT# 0, travel_time1(i,j,t), 0));

    @for (link2(j,k,t): arvl2
    arrival_time2= @if(@sum(item(r): quantity2(j,k,r,t)) #GT# 0, travel_time2(j,k,t), 0));

    !integer values;
    @for (link3(i,t): @GIN (required_veh1(i,t)));
    @for (link4(j,t):@GIN (required_veh2(j,t)));

    @for (transfer1(i,j,r,t): @GIN (quantity1(i,j,r,t)));
    @for (transfer2(j,k,r,t):@GIN (quantity2(j,k,r,t)));

    ! Here are the parameters;
    DATA:
    sc = 2000 4000 2000;

    travel_time1 = 115 227
    763 236
    353 165;

    travel_time2= 2.5 4 1.5
    4 1.5 6;
    supply = 4000 2000 4000
    4000 2000 4000
    2000 1000 3000
    4000 2000 4000
    4000 2000 4000
    2000 1000 3000
    ;

    DEMAND = 2000 1000 2500
    1700 850 2125
    1530 522 1915
    2000 1000 2500
    1700 850 2125
    1530 522 1915
    ;

    COST1 = 0.49 0.5
    0.49 0.5
    0.4 0.25;

    cost2 = 0.5 0.85 0.5
    0.7 1 1.2 ;
    price= 1.189 0.55 4.3
    1.56 0.50 4.1
    1.2 0.47 4.06;

    Fixed1=100;
    Fixed2=70;

    available_veh1=60;
    available_veh2=25;

    capacity1=10000;
    capacity2=1000;

    ENDDATA
    END
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: help needed urgently fd

    Posted 01/11/12 09:13 PM

    Originally posted by: EdKlotz


    > shatha wrote:
    > hello, the model below is a transportation model using lingo 9.0, but when solving it the lingo keeps giving me "unexpected jacobian overflow, can anyone help?
    >
    >
    >
    >
    >
    >
    > MODEL:
    > ! A 3 Warehouse, 4 Customer
    > Transportation Problem;
    >
    > SETS:
    > country / morroco, poland, ksa/ :available_veh1, sc ;
    > warehouse / marka, layan/ :available_veh2;
    > CUSTOMER / carrefoure, safeway, cozmo/;
    > item / cheese, cornd_beef, milk/;
    > time/ 1,2/;
    > transfer1 ( country, warehouse, item, time) : quantity1;
    > transfer2 (warehouse, customer, item, time) : quantity2;
    > pair1 (country, item,time) : supply, price;
    > pair2 (customer, item, time) : demand;
    > pair3 (warehouse, item) ;
    > pair4 (customer, item);
    > link1 (country,warehouse, time) :cost1, travel_time1, arrival_time1;
    > link2 (warehouse,customer, time) :cost2, travel_time2, arrival_time2;
    > link3 (country, time) :required_veh1;
    > link4 (warehouse, time) :required_veh2;
    >
    > ENDSETS
    >
    > ! The objective;
    > OBJ MIN = 0.75*(@SUM( transfer1(i,j,r,t):(sc(i))+ ((COST1(i,j,t)+price(i,r,t)) * quantity1(i,j,r,t))+ (fixed1 * required_veh1(i,t)))
    > + @SUM( transfer2(j,k,r,t): (COST2(j,k,t) * quantity2(j,k,r,t))+ (fixed2 * required_veh2(j,t))))
    > + 0.25*(@SUM( link1(i,j,t): arrival_time1(i,j,t)) + @SUM ( link2(j,k,t):arrival_time2(j,k,t)));
    >
    >
    >
    > ! The demand constraints;
    > @FOR( pair2(k,r,t): DEM
    > @SUM( warehouse(j): quantity2( j,k,r,t)) >=
    > DEMAND( k,r,t));
    >
    >
    >
    > ! The supply constraints;
    > @FOR( pair1(i,r,t): SUP
    > @SUM( warehouse( j): quantity1( i,j,r,t)) <=
    > supply( i,r,t));
    >
    >
    >
    > !The flow conservation;
    > @sum (transfer1(i,j,r,t): quantity1(i,j,r,t)) = @sum (transfer2(j,k,r,t): quantity2(j,k,r,t));
    >
    >
    >
    > ! The vehicles requirement;
    > @for (link3(i,t):vehicles1
    > required_veh1= @if ((@sum (pair3(j,r): quantity1(i,j,r,t))/capacity1) #LE# 1, 1,
    > @sum (pair3(j,r): quantity1(i,j,r,t))/capacity1));
    >
    > @for ( link3(i,t):
    > required_veh1 <= available_veh1);
    >
    >
    > @for (link4(j,t):vehicles2
    > required_veh2= @if ((@sum (pair4(k,r): quantity2(j,k,r,t))/capacity2) #LE# 1, 1,
    > @sum (pair4(k,r): quantity2(j,k,r,t))/capacity2));
    >
    > @for ( link4(j,t):
    > required_veh2 <= available_veh2);
    >
    >
    >
    > !arrival time;
    >
    > @for (link1(i,j,t): arvl1
    > arrival_time1= @if(@sum(item(r): quantity1(i,j,r,t)) #GT# 0, travel_time1(i,j,t), 0));
    >
    > @for (link2(j,k,t): arvl2
    > arrival_time2= @if(@sum(item(r): quantity2(j,k,r,t)) #GT# 0, travel_time2(j,k,t), 0));
    >
    > !integer values;
    > @for (link3(i,t): @GIN (required_veh1(i,t)));
    > @for (link4(j,t):@GIN (required_veh2(j,t)));
    >
    > @for (transfer1(i,j,r,t): @GIN (quantity1(i,j,r,t)));
    > @for (transfer2(j,k,r,t):@GIN (quantity2(j,k,r,t)));
    >
    >
    >
    > ! Here are the parameters;
    > DATA:
    > sc = 2000 4000 2000;
    >
    > travel_time1 = 115 227
    > 763 236
    > 353 165;
    >
    > travel_time2= 2.5 4 1.5
    > 4 1.5 6;
    >
    >
    > supply = 4000 2000 4000
    > 4000 2000 4000
    > 2000 1000 3000
    > 4000 2000 4000
    > 4000 2000 4000
    > 2000 1000 3000
    > ;
    >
    > DEMAND = 2000 1000 2500
    > 1700 850 2125
    > 1530 522 1915
    > 2000 1000 2500
    > 1700 850 2125
    > 1530 522 1915
    > ;
    >
    > COST1 = 0.49 0.5
    > 0.49 0.5
    > 0.4 0.25;
    >
    > cost2 = 0.5 0.85 0.5
    > 0.7 1 1.2 ;
    >
    >
    > price= 1.189 0.55 4.3
    > 1.56 0.50 4.1
    > 1.2 0.47 4.06;
    >
    > Fixed1=100;
    > Fixed2=70;
    >
    > available_veh1=60;
    > available_veh2=25;
    >
    > capacity1=10000;
    > capacity2=1000;
    >
    > ENDDATA
    > END
    This forum is for CPLEX, not Lingo. You might try a more general O.R. forum such as
    www.or-exchange.com. Beyond that, while I'm not familiar with Lingo, since the Jacobian
    involves gradients of the nonlinear constraints, you might try systematically commenting out
    the nonlinear constraints in the model to see which constraint(s) appear to cause the error message.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: help needed urgently fd

    Posted 01/11/12 09:21 PM

    Originally posted by: EdKlotz


    > This forum is for CPLEX, not Lingo. You might try a more general O.R. forum such as
    > www.or-exchange.com.

    My apologies; I mistakenly thought I was on the CPLEX forum, not the Mathematical Programming
    Forum. So, your post is appropriate here. That said, since IBM provides ILOG modelling and
    optimization tools, you still may find more Lingo users in or-exchange.com.
    > Beyond that, while I'm not familiar with Lingo, since the Jacobian
    > involves gradients of the nonlinear constraints, you might try systematically commenting out
    > the nonlinear constraints in the model to see which constraint(s) appear to cause the error message.

    This still is worth trying.
    #DecisionOptimization
    #MathematicalProgramming-General