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