## implement conditions related to variables in a model

Problems with syntax of GAMS
ZNSen
User
Posts: 9
Joined: 3 years ago

### implement conditions related to variables in a model

Hello dear all,
I am back a new challenge I´m facing now. I want to add a buffer stock scheme to a partial equilibrium model I have built. My problem is that I have no clue about how to implement the conditions that must be fulfilled, especially where and how to write these conditions to run the model successfully. See below the problem statement.

I will be happy to have some useful comments from you.

Thanks

[Stock building
The government offers a price support level (Ps) at which the buy an unlimited amount of commodity and sell any quantities in its possession at a release price (Pr).
The government starts any ordinary year with a carryover stock (Xi,t-1).
The distribution of the total supply is between the market and the government and thus gives the following equation of supply in a way that the net government purchases (Gn) in year t
S(i,t)= αP(i,t) - Gn(i,t)
And the final government stocks by
X(i,t) = X(i,t-1) + Gn(i,t)
with X(i,t) stock bought by the government at year t
The government does not purchase stocks if the market price exceeds the support level and does not sell any if the market price falls below the release level :
P(i,t) > Ps(i) ➔ Gn(i,t) ≤ 0
P(i,t) < Pr(i) ➔ Gn(i,t) ≥ 0
Since the government is willing to acquire any amount of the commodity at the support price, market price never falls below the support level
Pt(i,t) ≥ Ps(i)
The government, however, is able to release only as much as it holds in its stockpile initially, Gn ≥ - Xt-1
Thus, market price can rise above the release level, though only if the government stock- pile is depleted:
Pt(i,t) >Pr(i) ➔ Gn(i,t) = - (X(i,t-1))

Pr and Ps are known parameters while S,X,Pt and Gn are variables
]

ZNSen
User
Posts: 9
Joined: 3 years ago

### Re: implement conditions related to variables in a model

Just to tell you that I´ve already included all the parameters and variables already. All I need now is to include these 2 conditions:

if P(i,t) > Ps(i) ➔ Gn(i,t) ≤ 0
if P(i,t) < Pr(i) ➔ Gn(i,t) ≥ 0