Dear GAMS experts,
I coded the binary variable (Y(T)) in my model, and I think the binary variable must be 0 or 1. But in my model, I got the binary variable = 0.5 or other numbers.
I don’t know how to solve this problem. I attached my model here.
Can you help me?
Sincerely yours,
Redwood
SETS T TIME PERIODS /05/
TFIRST(T) FIRST PERIOD
TLAST(T) LAST PERIOD
N Regions /U, C/;
SCALARS
** constant
ep Exchange rate / 1.0 /
Gbar1 Limits of carbon emissions in country 1 / 4.88 /
r1 Interest rate in country 1 / 0.03 /
L1 Labor force in country 1 / 157.5 /
Gbar2 Limits of carbon emissions in country 2 / 3 /
r2 Interest rate in country 2 / 0.05 /
L2 Labor force in country 2 / 799.5 /
Pw World price of energy / 1 /
GHGs Target of greenhouse gas emissions / 2748.39 /
delta1 Discount rate / .02 /
gam1 Coefficient of utility 1 / -0.000000005964 /
eta11 Elasticity of MGS in country 1 / 0.1726 /
eta12 Elasticity of EQ in country 1 / 0.6868 /
ag1 Clean capital in country 1 / 1.675 /
alpha1 Target green house gas emissions / 1.032 /
rhoq1 Target green house gas emissions / 0.351 /
beta11 Elasticity of capital in county 1 / 0.228 /
beta12 Elasticity of labor force in country 1 / 0.472 /
beta13 Elasticity of energy in country 1 / 0.301 /
g11 Emissions coefficient in country 1 / 2.352 /
g12 Scale factor of emissions in country 1 / -0.1869 /
xi1 Target green house gas emissions / 0.8898 /
rhom1 Target green house gas emissions / 0.004 /
delta2 Discount rate / .04 /
gam2 Coefficient of utility 2 / -0.00000002672 /
eta21 Elasticity of MGS in country 2 / 0.5341 /
eta22 Elasticity of EQ in country 2 / 0.2305 /
ag2 Clean capital in country 2 / -1.239 /
alpha2 Target green house gas emissions / 0.786628 /
rhoq2 Target green house gas emissions / 0.044 /
beta21 Elasticity of capital in country 2 / 0.269 /
beta22 Elasticity of labor force in country 2 / 0.324 /
beta23 Elasticity of energy in country 2 / 0.407 /
g21 Emissions coefficient in country 2 / 0.5398 /
g22 Scale factor of emissions in country 2 / 0.015 /
xi2 Target green house gas emissions / 1.05 /
rhom2 Target green house gas emissions / 0.0453 /
d Greenhouse gas emissions discout facot / .005 /
psi1 Elasticity of offsets price / .001 /
Ku0 Initial dirty capital stock in country 1 / 43007 /
Kc0 Initial dirty capital stock in country 2 / 16113 /
Kgu0 Initial clean capital stock in country 1 / 43.007 /
Kgc0 Initial clean capital stock in country 2 / 16.113 /
Pg0 Initial price of offset / 0.005 /
GHG0 Initial greenhouse gas emissions / 3026.09 /
Cu0 Initial consumtion in country 1 / 12.8 /
Cc0 Initial consumtion in country 2 /2.84/
Igu0 Initial clean investment in country 1 /0.062460245/
Igc0 Initial clean investment in country 2 /0.081370566/
Eu0 Energy consumption in country 1 /2.22/
Ec0 Energy consumption in country 2 /2.42/
Qu0 /14.4/
Qc0 /5.93/
mu1 /0.8562/
mu2 /0.4911/
MGSu0 Initial consumtion in country 1 /2.66/
MGSc0 Initial consumtion in country 2 /1.58/;
PARAMETERS ZU(T) DISCOUNT FACTOR
ZC(T) DISCOUNT FACTOR
FU(T)
FC(T);
TFIRST(T) = YES$(ORD(T) EQ 1);
TLAST(T) = YES$(ORD(T) EQ CARD(T));
ZU(T) = EXP(rhoq1(ORD(T)-1));
ZC(T) = EXP(rhoq2(ORD(T)-1));
FU(T) = EXP(-rhom1(ORD(T)-1));
FC(T) = EXP(-rhom2*(ORD(T)-1));
Parameter BigM/15000/;
VARIABLES
-
Control variables
*C(T,N) Consumption
MGS(T,N) Imports
Ig(T,N) Clean investment
E(T,N) Energy -
State variables
K(T,N) Dirty capital stocks
Kg(T,N) Clean capital stocks
Pg(T) Price of offsets
GHG(T) The concentration of carbon dioxide (CO2) in Earth’s atmosphere -
Other variables
Op(T) Offsets
Q(T,N) GDP(Output)
Dummy(T)
Utility1
Utility2
M(T,N)
;
Binary Variable
Y(T);
EQUATIONS
MMu(T,N)
MMc(T,N)
QQu(T,N) Output in country 1
QQc(T,N) Output in country 2
OOp1(T) Offsets 1
OOp2(T) Offsets 2
OOp3(T) Offsets 3
OOp4(T) Offsets 4
*OOp5(T)
*OOp6(T)
Ku(T,N) Dirty capital stocks in country 1
TKu(T,N) Termial condition for dirty capital stocks in country 1
Kc(T,N) Dirty capital stocks in country 2
TKc(T,N) Termial condition for dirty capital stocks in country 2
KKg(T,N) Clean capital stocks
TKg(T,N) Terminal condition for clean capital stocks
PPg(T) Price of offsets
TPg(T) Terminal condition for price of offsets
GGHG(T) The concentration of carbon dioxide (CO2) in Earth’s atmosphere
TGHG(T) Terminal condition for the concentration of CO2
UTIL1 Discounted utility 1 : OBJECTIVE FUNCTION
UTIL2 Discounted utility 2 : OBJECTIVE FUNCTION;
MMu(T,N)… M(T,“U”) =e= (g11FU(T)-g12(Kg(T,“U”)/(K(T,“U”)+ Kg(T,“U”)))xi1)E(T, “U”);
MMc(T,N)… M(T,“C”) =e= (g21FC(T)-g22(Kg(T,“C”)/(K(T,“C”)+ Kg(T,“C”)))xi2)E(T, “C”);
QQu(T,N)… Q(T,“U”) =e= ZU(T)alpha1((K(T, “U”)+ Kg(T, “U”))**beta11)(L1beta12)(E(T, “U”)**beta13);
QQc(T,N)… Q(T,“C”) =e= ZC(T)alpha2((K(T, “C”)+ Kg(T, “C”))**beta21)(L2beta22)*(E(T, “C”)beta23);
OOp1(T)… Gbar2 - M(T,“C”) + Gbar1 - M(T,“U”) + BigM(1-Y(T)) =g= 0;
OOp2(T)… Gbar2 - M(T,“C”) + Gbar1 - M(T,“U”) - BigM(Y(T)) =l= 0;
OOp3(T)… Op(T) + (1-Y(T))*Dummy(T) =e= M(T,“U”) - Gbar1;
OOp4(T)… Op(T) + Y(T)*Dummy(T) =e= Gbar2 - M(T,“C”);
OOp5(T)… Dummy1(T)-BigM(1-Y(T)) =l= 0;
OOp6(T)… Dummy2(T)-BigM(Y(T)) =l= 0;
Ku(T+1,N)… K(T+1, “U”) =e= (1-mu1)ZU(T)alpha1((K(T, “U”)+ Kg(T, “U”))**beta11)(L1*beta12)*(E(T, “U”)**beta13)
- MGS(T,“U”)ep - Ig(T, “U”)(1+ag1Ig(T, “U”)/(2Kg(T, “U”)))
- Pg(T)Op(T)+ K(T, “U”);
TKu(TLAST,N)… 0 =l= (1-mu1)ZU(TLAST)alpha1((K(TLAST, “U”)+ Kg(TLAST, “U”))**beta11)(L1**beta12)(E(TLAST, “U”)**beta13) - MGS(TLAST,“U”)ep - Ig(TLAST, “U”)(1+ag1Ig(TLAST, “U”)/(2Kg(TLAST, “U”)))
- Pg(TLAST)Op(TLAST)+ K(TLAST, “U”);
Kc(T+1,N)… K(T+1, “C”) =e= (1-mu2)ZC(T)alpha2((K(T, “C”)+ Kg(T, “C”))**beta21)(L2**beta22)(E(T, “C”)**beta23) - MGS(T,“C”)/ep - Ig(T, “C”)(1+ag2Ig(T, “C”)/(2*Kg(T, “C”)))
- Pg(T)Op(T)/ep + K(T, “C”);
TKc(TLAST,N)… 0 =l= (1-mu2)ZC(TLAST)alpha2((K(TLAST, “C”)+ Kg(TLAST, “C”))**beta21)(L2**beta22)(E(TLAST, “C”)**beta23)
- MGS(TLAST,“U”)ep - Ig(TLAST, “C”)(1+ag2Ig(TLAST, “C”)/(2Kg(TLAST, “C”)))
- Pg(TLAST)Op(TLAST)/ep + K(TLAST, “C”);
KKg(T+1,N)… Kg(T+1,N) =e= Ig(T,N)+ Kg(T,N);
TKg(TLAST,N)… 0 =l= Ig(TLAST,N) + Kg(TLAST,N);
PPg(T+1)… Pg(T+1) =e= psi1Pg(T)
((g11FU(T)- g12*(Kg(T,“U”)/(K(T,“U”)+ Kg(T,“U”)))**xi1)beta13Q(T,“U”)/(Pw+Pg(T)*Op(T)/E(T, “U”)) - (g21FC(T)-g22(Kg(T,“C”)/(K(T,“C”)+ Kg(T,“C”)))*xi2)beta23Q(T,“C”)/Pw - Gbar1 - Gbar2)
/sqrt(Gbar1Gbar2) + Pg(T);
TPg(TLAST)… 0 =l= psi1Pg(TLAST)
((g11FU(TLAST)-g12(Kg(TLAST,“U”)/(K(TLAST,“U”)+ Kg(TLAST,“U”)))**xi1)beta13Q(TLAST,“U”)/(Pw+Pg(TLAST)*Op(TLAST)/E(TLAST, “U”)) - (g21FC(TLAST)-g22(Kg(TLAST,“C”)/(K(TLAST,“C”)+ Kg(TLAST,“C”)))**xi2)beta23Q(TLAST,“C”)/Pw - Gbar1 - Gbar2)
/sqrt(Gbar1Gbar2) + Pg(TLAST);
GGHG(T+1)… GHG(T+1) =e= - dGHG(T) - (g11FU(T)-g12(Kg(T,“U”)/(K(T,“U”)+ Kg(T,“U”)))**xi1)*E(T, “U”)
- (g21FC(T)-g22(Kg(T,“C”)/(K(T,“C”)+ Kg(T,“C”)))**xi2)*E(T, “C”)
- GHG(T);
TGHG(TLAST)… 0 =l= - d*GHG(TLAST) - (g11FU(TLAST)-g12(Kg(TLAST,“U”)/(K(TLAST,“U”)+ Kg(TLAST,“U”)))**xi1)*E(TLAST, “U”)
- (g21FC(TLAST)-g22(Kg(TLAST,“C”)/(K(TLAST,“C”)+ Kg(TLAST,“C”)))**xi2)*E(TLAST, “C”)
- GHG(TLAST);
UTIL1… UTILITY1 =e= SUM(T, EXP(delta1*(ORD(T)-1))(1/gam1)(mu1ZU(T)alpha1((K(T, “U”)+ Kg(T, “U”))**beta11)(L1beta12)(E(T, “U”)**beta13)
MGS(T, “U”)*eta11(GHGs/GHG(T))**eta12)*gam1);
UTIL2… UTILITY2 =e= SUM(T, EXP(delta2(ORD(T)-1))(1/gam2)(mu2ZC(T)alpha2((K(T, “C”)+ Kg(T, “C”))**beta21)(L2beta22)*(E(T, “C”)**beta23)
*MGS(T, “C”)*eta21(GHGs/GHG(T))**eta22)**gam2);
Parameters
K7
Kg7
*C7
MGS7
Ig7
GHG7
Pg7
Op7
M7
Me7
;
MODEL Nash /all/;
*############################ Lower and upper #############################
K.LO(T,N) = 10000;
Kg.LO(T,N) = 1;
Pg.LO(T) = 0.0001; Pg.up(T) = 10000;
GHG.lo(T) = 2000; GHG.up(T) = 3500;
*C.LO(T,N)= 0.01;C.UP(T,N) = 150;
MGS.LO(T,N)= 0.01;MGS.UP(T,N) = 150;
Ig.LO(T,N)= 0.01;Ig.UP(T,N) = 100;
E.LO(T,N)= 0.01;E.UP(T,N) = 20;
Op.lO(T) = 0; Op.up(T) = 10;
K.fx(TFIRST, “U”) = Ku0;
K.fx(TFIRST, “C”) = Kc0;
Kg.fx(TFIRST, “U”) = Kgu0;
Kg.fx(TFIRST, “C”) = Kgc0;
Pg.fx(TFIRST) = Pg0;
GHG.fx(TFIRST) = GHG0;
*C.fx(TFIRST, “U”) = Cu0;
*C.fx(TFIRST, “C”) = Cc0;
MGS.fx(TFIRST, “U”) = MGSu0;
MGS.fx(TFIRST, “C”) = MGSc0;
Ig.fx(TFIRST, “U”) = Igu0;
Ig.fx(TFIRST, “C”) = Igc0;
E.fx(TFIRST, “U”) = Eu0;
E.fx(TFIRST, “C”) = Ec0;
*Dummy1.lo(T) = 0;
*Dummy2.lo(T) = 0;
SOLVE Nash MAXIMIZING UTILITY1 USING RMINLP;
SOLVE Nash MAXIMIZING UTILITY2 USING RMINLP;
DISPLAY K.L, Kg.L, Q.L, MGS.L, Ig.L, E.L, Pg.L, Op.L, M.L, GHG.L, Y.L;
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
\