Page 1 of 1

Result for Variable on sets returns same value, why?

Posted: Sat Oct 23, 2021 8:07 am
by araya
Hello,

I am exploring gams for a modelling task in irrigation systems. I attempted the attached model of least square fit of the form:

y= a*x^2 + b*x +c to a small data set. where i know that a= 1, b= 0 and c=0.

the model runs well and gives expected results when using variables a, b, c as follows:
LOWER LEVEL UPPER MARGINAL

---- VAR a -INF 1.0000 +INF EPS
---- VAR b -INF 5.551115E-17 +INF EPS
---- VAR c -INF -6.24500E-16 +INF EPS
---- VAR sse -INF . +INF .


however, it gives unexpected results when using variables coef(j) defined over sets j /1*3/ as in:

y= coef(j)*x^2 + coef(j)*x + coef(j)
---- VAR coef

LOWER LEVEL UPPER MARGINAL

a -INF 0.7246 +INF EPS
b -INF 0.7246 +INF EPS
c -INF 0.7246 +INF EPS

what am i missing? I appreciate quick help on this, and thanks.
testFit_LInear.log
The model file
(2.24 KiB) Downloaded 195 times
testFit_LInear.gms
the log file
(599 Bytes) Downloaded 194 times