$ontext this is the basic x,y trade model with no pollution - useful for seeing what goes on in absence of pollution. the model includes a single country and we change the price of the non-numeraire good to simulate the trade liberalization effect. As the price of the X good is increased the country switches from being an importer to being an exporter of the X good. $offtext option limcol=0,limrow=0; parameter * tweak these to experiment with model beta labor share in x / 0.3 /, sigma labor share in y / 0.7 /, omega income share of x / 0.6 /, l labor endowment / 1 /, k capitalendowment / 1 /, xprice price of good x / 1 /, yprice price of good y / 1 /, xinc price increment of x / .1 /; positive variables xs prodn of dirty good x, kx capital used in dirty good (x) prodn, lx labor used in dirty good (x) prodn, ys prodn of clean good y, ky capital used in clean good (y) prodn, ly labor used in clean good (y) prodn, xd dirty good (x) demand, yd clean good (y) demand, r capital rent, w labor wage, px price of dirty good (x), py price of clean good (y); variables u utility, i income; equations xsdef dirty good (x) production, kxdef demand for capital in dirty good (x) prodn, lxdef demand for labor in dirty good (x) prodn, ysdef clean good (y) production kydef demand for capital in clean good (y) prodn, lydef demand for labor in clean good (y) prodn, udef utility function, xddef derived demand for dirty good (x), yddef derived demand for clean good (y), rdef capital market clearing condition, wdef labor market clearing condition, idef total income clearing condition; * supply side equations xsdef.. xs =e= (lx**beta) * (kx**(1-beta)); kxdef.. r*kx =e= px*(1-beta)*xs; lxdef.. w*lx =e= px*beta*xs; ysdef.. ys =e= (ky**(1-sigma)) * (ly**(sigma)); kydef.. r*ky =e= (1-sigma)*py*ys; lydef.. w*ly =e= sigma*py*ys; * demand side equations udef.. u =e= (xd**omega) * (yd**(1-omega)); xddef.. px*xd =e= omega*i; yddef.. py*yd =e= (1-omega)*i; * clearing conditions rdef.. k =e= kx + ky; wdef.. l =e= lx + ly; idef.. w*l + r*k =e= px*xd+py*yd; * start with some reasonable values xs.l=1; kx.l=1; lx.l=1; ys.l=1; ky.l=1; ly.l=1; u.l=1; xd.l=1; yd.l=1; r.l=1; w.l=1; i.l=3; * we want a solution where both goods are produced xs.lo=.001; ys.lo=.001; xd.lo=.001; yd.lo=.001; * numeraire good price fixed py.fx=yprice; px.fx=xprice; model permit /all/; * we are solving a set of equality constraints so * it shouldn't make any difference which variable * we maximize over but nlp requires that we pick one solve permit using nlp maximizing u; * rerun model for different prices of dirty good set index /1*10/; PARAMETER REPORT(INDEX,*); loop(index, px.fx=.8+ord(index)*.05; solve permit using nlp maximizing u; * collect results from each interation in table REPORT(INDEX, "WORLD PRICE - LEVEL") = PX.l + EPS; REPORT(INDEX, "XD") = XD.L+EPS; REPORT(INDEX, "XS") = XS.L + EPS; report(index, "MX") = XD.L-XS.L + EPS; report(index, "pMX") = px.l*(XD.L-XS.L)+EPS; REPORT(INDEX, "YD") = YD.L+EPS; REPORT(INDEX, "YS") = YS.L+EPS; report(index, "MY") = YD.L-YS.L+EPS; report(index, "pMY") = py.l*(YD.L-YS.L)+EPS; REPORT(INDEX, "UTILITY") = U.L + EPS; ); display report;