Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Why is this treated as non-linear

    Posted 06/13/09 12:38 AM

    Originally posted by: SystemAdmin


    [arunjotshi said:]

    Sorry for the re-post.
    I am trying to solve simplified version of my model using AMPL 10.1 and CPLEX 10

    var n integer default 10;
    var r=20+16*n;
    var t=<<2,4,8;2,4,8,16>>r;
    var s=16*n + t;
    maximize obj: n;
    subject to limit: s <=10000;<br />subject to n_limit: n <=20;<br />
    It is giving me the following error:
    CPLEX 10.1.0: /tmp/at2609.nl contains a nonquadratic nonlinear constraint.


    Eventhough if I display the values of the variables and objective function before solving the problem, I get the values as:

    ampl: display n,r,t,s,obj;
    n = 10
    r = 180
    t = 2796
    s = 2956
    obj = 10

    Any reason, why AMPL is treating it as non-linear. I read something about option linelim and tried setting it explicitily as 1; still did not help.
    Thanks,
    Arun.

    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Why is this treated as non-linear

    Posted 07/09/09 08:04 PM

    Originally posted by: SystemAdmin


    [arunjotshi said:]

    Hope this helps -- Please see below :

    -------
    Please refer to the following discussion of defined variables on page 467 in the second edition AMPL manual:
    "Some solvers give special treatment to linear variable because their higher derivatives
    vanish.  For such solvers, it may be helpful to treat linear defined variables specially.
    Otherwise, variables involved in the right hand side of the equation for a defined variable appear to solvers
    as nonlinear variables, even if they are used only linearly in the right-hand side."

    This is precisely what we see in your examples. In the one that gives the error message, "t" is a defined variable that is used in the model. 
    The bottom line is that piecewise linear functions are nonlinear, even though they can be linearized into linear or integer programs.

    Hence, AMPL's general treatment of defined variables results in the error message. 

    In contrast, the code segment that works resembles the way the AMPL manual uses piecewise linear functions, i.e. it uses them explicitly rather than associating defined variables with them.


    -----
    Thanks,
    Arun


    #CPLEXOptimizers
    #DecisionOptimization