GAMS Rev 236 WEX-WEI 23.6.3 x86_64/MS Windows 01/19/12 10:37:30 Page 1 G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m C o m p i l a t i o n 4-year version of CJL Modifications: (1) 4-year version when time interval of one period becomes a parameter (2) get rid of CO2 time travel in Forcing (3) use explicit finite difference scheme in temperature in atmosphere (4) cancel fixed saving rate (s.fx(t) = .22) (5) cancel extra variables and equations and simplify (6) cancel terminal condition of capital (7) use nonzero terminal value function (8) cancel the fixed emission control rate for the first period (9) change sum(t$(ord(t)100); 155 156 157 *********************************** 158 * get terminal value function 159 *********************************** 160 161 set dim indices of dimensions /1*6/; 162 163 parameters 164 SVmin(dim) minimal state variables 165 SVmax(dim) maximal state variables 166 dz(dim) derivative of z over x 167 ; 168 169 set d index /1*5/; 170 alias(d,d2,d3,d4,d5,d6); 171 172 parameter coefs(d,d2,d3,d4,d5,d6) complete Chebyshev coefficients; 173 174 execute_load 'coefs_Climate_termValue',SVmin, SVmax, dz, coefs; 175 176 177 ***************************************************************** 178 179 VARIABLES 180 K(T) Capital stock trillions US dollars 181 MAT(T) Carbon concentration in atmosphere GtC 182 MU(T) Carbon concentration in shallow oceans Gtc 183 ML(T) Carbon concentration in lower oceans GtC 184 TATM(T) Temperature of atmosphere in degrees C 185 TOCEAN(T) Temperature of lower oceans degrees C 186 E(T) CO2-equivalent emissions GtC 187 C(T) Consumption trillions US dollars 188 MIU(T) Emission control rate GHGs 189 UTILITY; 190 191 POSITIVE VARIABLES K, MAT, MU, ML, TATM, TOCEAN, C, MIU, E; 192 193 194 free variable zPlus(dim) normalized tomorrow state variables; 195 zPlus.lo(dim) = -1; 196 zPlus.up(dim) = 1; 197 zPlus.l(dim) = 0; 198 199 free variable ChebyBasis(dim,d) Chebyshev polynomial basis; 200 201 variable SVend(dim) terminal state variables; 202 variable termUtil terminal utility function 203 204 205 ***************************************************************** 206 207 EQUATIONS 208 209 KK0 Initial condition for capital 210 MMAT0 Starting atmospheric concentration 211 MMU0 Initial shallow ocean concentration 212 MML0 Initial lower ocean concentration 213 TATM0EQ Initial condition for atmospheric temperature 214 TOCEAN0EQ Initial condition for lower ocean temperature 215 216 KK(T) Capital balance equation 217 MMAT(T) Atmospheric concentration equation 218 MMU(T) Shallow ocean concentration 219 MML(T) Lower ocean concentration 220 TATMEQ(T) Temperature-climate equation for atmosphere 221 TOCEANEQ(T) Temperature-climate equation for lower oceans 222 EE(T) Emissions equation 223 224 CCACCA total cumulative carbon emissions GTX 225 UTIL Objective function 226 227 KendC Terminal capital 228 CAendC Terminal atmospheric carbon concentration 229 CSendC Terminal shallow ocean concentration 230 CDendC Terminal lower ocean concentration 231 TAendC Terminal atmospheric temperature 232 TLendC Terminal lower ocean temperature 233 normalizeSVend(dim) normalized state variables 234 ChebyBasisFunDeg0(dim) Chebyshev polynomial basis with degree 0 235 ChebyBasisFunDeg1(dim) Chebyshev polynomial basis with degree 1 236 recursiveCheby(dim,d) recursive formula for Chebyshev polynomial basi s 237 TerminalUtilEQ terminal utility equation 238 ; 239 240 ** Equations of the model 241 242 KK0.. K('1') =E= K0; 243 MMAT0.. MAT('1') =E= MAT2000; 244 MMU0.. MU('1') =E= MU2000; 245 MML0.. ML('1') =E= ML2000; 246 TATM0EQ.. TATM('1') =E= TATM0; 247 TOCEAN0EQ.. TOCEAN('1') =E= TOCEAN0; 248 249 KK(T).. K(T+1) =L= (1-DK)**deltat *K(T)+deltat*( ( 1 - co st1(T)*(MIU(T)**EXPcost2) )* 250 (AL(T)*L(T)**(1-GAMA)*K(T)**GAMA) / (1 +A1*TATM(T)+ A2*TATM(T)**A3) - C(T) ); 251 MMAT(T+1).. MAT(T+1) =E= MAT(T)*bb11+MU(T)*bb21 + E(T); 252 MML(T+1).. ML(T+1) =E= ML(T)*bb33+bb23*MU(T); 253 MMU(T+1).. MU(T+1) =E= MAT(T)*bb12+MU(T)*bb22+ML(T)*bb32; 254 TATMEQ(T+1).. TATM(T+1) =E= TATM(t)+CC1*(FCO22X*(log(MAT(T)/596.4) /log(2))+FORCOTH(T) - LAM*TATM(t)-CC3*(TATM(t)-TOCEAN(t))); 255 TOCEANEQ(T+1).. TOCEAN(T+1) =E= TOCEAN(T)+CC4*(TATM(T)-TOCEAN(T)); 256 EE(T).. E(T) =E= deltat*SIGMA(T)*(1-MIU(T))* (AL(T)*L(T )**(1-GAMA)*K(T)**GAMA) + ETREE(T); 257 258 CCACCA.. sum(T, E(T)) =L= FOSSLIM; 259 UTIL.. UTILITY =E= sum( T, (((C(T)/L(T))**(1-B_ELASMU)-1) /(1-B_ELASMU)) * (RR(T)*L(T)*deltat/scale1) ) + termUtil* (beta*sum(TLAST, RR(TLAST))*POPASYM/scale1) ; 260 261 KendC.. SVend('1') =e= sum(TLAST, (1-DK)**deltat*K(TLAST)+deltat*( ( 1 - cost1(TLAST)*(MIU(TLAST)**EXPcost2) )* 262 (AL(TLAST)*L(TLAST)**(1-GAMA)*K(TLAST) **GAMA) / (1+A1*TATM(TLAST)+ A2*TATM(TLAST)**A3) - C(TLAST) )); 263 CAendC.. SVend('2') =e= sum(TLAST, MAT(TLAST)*bb11+MU(TLAST)*bb21 + E(TLAST)); 264 CSendC(T).. SVend('3') =e= sum(TLAST, MAT(TLAST)*bb12+MU(TLAST)*bb22+M L(TLAST)*bb32); 265 CDendC(T).. SVend('4') =e= sum(TLAST, ML(TLAST)*bb33+bb23*MU(TLAST)); 266 TAendC(T).. SVend('5') =e= sum(TLAST, TATM(TLAST)+CC1*( FCO22X*(log(MA T(TLAST)/596.4)/log(2))+FORCOTH(TLAST) - LAM*TATM(TLAST)-CC3*(TATM(TLAST)- TOCEAN(TLAST)))); 267 TLendC(T).. SVend('6') =e= sum(TLAST, TOCEAN(TLAST)+CC4*(TATM(TLAST)-T OCEAN(TLAST))); 268 normalizeSVend(dim).. zPlus(dim) =e= (SVend(dim)-SVmin(dim))*dz( dim)-1; 269 ChebyBasisFunDeg0(dim).. ChebyBasis(dim,'1') =e= 1; 270 ChebyBasisFunDeg1(dim).. ChebyBasis(dim,'2') =e= zPlus(dim); 271 recursiveCheby(dim,d)$(ord(d)>=2 and ord(d)