test_qp_modelinstance.txt (5.23 KB)
Hello,
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:
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));
Demand DEM and generation X are model variables. The rest are parameters.
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:
=E "General nonlinearity detected in row " 1 “”
=C*** Could not load data from file: Detected 1 general nonlinear rows in model
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?
Best regards
Jan
P.S. The attached file reproduces the error under the GAMS version 31.1.0 with the API installed for Python 3.8