sets q quantity demanded and supplied /qd11,qd12,qs11,qs12,qd21,qd22,qs21,qs22/ qd1(q) /qd11,qd12/ qd2(q) /qd21,qd22/ qs1(q) /qs11,qs12/ qs2(q) /qs21,qs22/; alias(qd1,qqd1); alias(qd2,qqd2); alias(qs1,qqs1); alias(qs2,qqs2); table aa1(qd1,qqd1) Quadratic Component of Consumer Demand in Market 1 qd11 qd12 qd11 -0.00478 -0.00796 qd12 -0.00796 -0.0259 table aa2(qd2,qqd2) Quadratic Component of Consumer Demand in Market 2 qd21 qd22 qd21 -0.02753 -0.07342 qd22 -0.07342 -0.21178 table bb1(qs1,qqs1) Quadratic Component of Producer Supply in Market 1 qs11 qs12 qs11 0.007097 0.001577 qs12 0.001577 0.025684 table bb2(qs2,qqs2) Quadratic Component of Producer Supply in Market 2 qs21 qs22 qs21 0.004457 0.00195 qs22 0.00195 0.030853 parameter a1(qd1) Linear Component of Consumer Demand in Market 1 /qd11 14.252, qd12 33.119/; parameter a2(qd2) Linear Compenent of Consumer Demand in Market 2 /qd21 74.372, qd22 203.658/; parameter b1(qs1) Linear Component of Producers Supply in Market 1 /qs11 -4.780, qs12 -15.140/; parameter b2(qs2) Linear Component of Producers Supply in Market 2 /qs21 -3.296, qs22 -11.864/; variables w total social welfare quant(q) quantity of each good produced and consumed; positive variable quant(q); equations sb social welfare mkt1 market for good 1 mkt2 market for good 2; sb.. sum(qd1,a1(qd1)*quant(qd1)+.5*sum(qqd1,quant(qd1)*aa1(qd1,qqd1)*quant(qqd1))) -sum(qs1,b1(qs1)*quant(qs1)+.5*sum(qqs1,quant(qs1)*bb1(qs1,qqs1)*quant(qqs1))) +sum(qd2,a2(qd2)*quant(qd2)+.5*sum(qqd2,quant(qd2)*aa2(qd2,qqd2)*quant(qqd2))) -sum(qs2,b2(qs2)*quant(qs2)+.5*sum(qqs2,quant(qs2)*bb2(qs2,qqs2)*quant(qqs2))) =e= w; mkt1.. quant("qd11")-quant("qs11")+quant("qd21")-quant("qs21") =e= 0; mkt2.. quant("qd12")-quant("qs12")+quant("qd22")-quant("qs22") =e= 0; model trade using /all/; solve trade using nlp maximizing w;