Search code examples
mathoptimizationlindo

I need to determine the Minimum value between the 8 variables using LINGO. But i am getting Syntax Error. Can anyone help me with the following model


Good Day. I am trying to develop a Cut Order Planning model using LINGO

!There are 8 integer variables; x1+x2+x3+x4+x5+x6+x7+x8 <=16;

  !Identify the values of the following variables:
    y1 = 160/x1;
    y2 = 448/x2;
    y3 = 832/x3;
    y4 = 1408/x4;
    y5 = 896/x5;
    y6 = 544/x6;
    y7 = 320/x7;
    y8 = 192 / x8;
    
   !Determine the minimum variable with the lowest value:
 min(y1, y2, y3, y4, y5, y6, y7, y8);

Solution

  • In Lingo scripting language, it could be written as:

    MODEL:
    SETS:
    S  /1..8/: X,Y,D;
    ENDSETS
    DATA:
    D = 160 488 832 1408 896 544 320 192;
    ENDDATA
    minimize = z;
    @SUM(S(I): X(I)) <=16;
    @FOR(S(I): 
        Z>=Y(I);
        Y(I) = D(I)/X(I);
        @GIN(X(I));
    );
    END
    

    Use 'Solver|Generate|Display-Model menu item to see the scalar version.