I want to instantiate a QCP model with modifiers in the objective function. As an example, the attached file contains the QCP and LP version of a simple electricity dispatch model with objective functions:
Demand DEM and generation X are model variables. The rest are parameters.
Code: Select all
obj_qp.. WELFARE =E= dem_a/dem_b*DEM - 1/(2*dem_b)*(DEM*DEM) - COST; obj_lp.. COST =E= sum(g, X(g)*c(g)) + sum(m(g,f), pf(f)*X(g)/eta(g));
Instantiating with modifiers on linear terms (e.g., fuel prices pf or demand intercept dem_a) works well and the model solves to optimality.
However, as soon as I add a modifier on the quadratic objective term, i.e., add demand slope dem_b, instantiating fails. It seems, by adding the modifier on the quadratic term, the solve no longer recognizes the model as quadratic:
Is there any way to add a modifier to the quadratic term of a QCP still being able to solve the model as a QCP?=E "General nonlinearity detected in row " 1 ""
=C*** Could not load data from file: Detected 1 general nonlinear rows in model
P.S. The attached file reproduces the error under the GAMS version 31.1.0 with the API installed for Python 3.8