how to model abs(variable) linearly Topic is solved

Problems with syntax of GAMS
User avatar
Gideon Kruseman
User
User
Posts: 24
Joined: 6 years ago

Re: how to model abs(variable) linearly

Post by Gideon Kruseman »

Yanzhiping,

Thet way I initially formulated the response to your question is that you have some sort of variable Q that can be either positive or negative. I assumed you wanted to have the absolute value of Q.

If this is not the case I misunderstood your question. If thgis is the case, the code I provided is the correct way to model this problem.

best,

Gideon
Gideon Kruseman
ex-ante and foresight lead @CIMMYT, big data focal point @CIMMYT, coordinator CoP socio-economic data @CGIAR_BigData
phallyka
User
User
Posts: 1
Joined: 6 years ago

Re: how to model abs(variable) linearly

Post by phallyka »

but in this way the abs() will make the problem non-linear.



เย็ดสาว
User avatar
Gideon Kruseman
User
User
Posts: 24
Joined: 6 years ago

Re: how to model abs(variable) linearly

Post by Gideon Kruseman »

Hi Phallylka,
That's why you use the Steve and I described, so your system remains linear.
Best, Gideon
Gideon Kruseman
ex-ante and foresight lead @CIMMYT, big data focal point @CIMMYT, coordinator CoP socio-economic data @CGIAR_BigData
Post Reply