*==> sppe.gms $TITLE: Spatial Price Equilibrium Example $offsymxref offsymlist offuellist offuelxref offupper $inlinecom /* */ /* ***************************************************************** Reference: P.T. Harker, "Alternative Models of Spatial Competition," Operations Research 34(1986). 410 - 425 This particular model is described on page 414 of the reference, with the actual data given later on page 419 (Example 1). This is the Oligopoly model. N.B. The problem definition we had been using uses most of the data from this problem; however, the mu parameter is multiplied by a factor of 3 in the earlier work. In the oligopoly model, each firm q controls a subset of the regions l, which serves to partition the set of regions (L). The problem formed is a straightforward MCP formulation of the VI found in page 414 of the reference. Here, we use non-negative dual variables, and require only that the constraints be "complementary" to the dual vars at solution. ***************************************************************** */ sets run / run1 * run3 /, L / 1 * 3 /, /* regions in our economy */ Q / 1 * 3 / ; /* firms in our economy */ alias (Q,QQ), (L,LL); parameters includerun (run) / /* first two init pts are from Harker & Xiao's paper */ run1 01 run2 01 run3 01 /, control (L) / /* firm control(l) controls region l */ 1 1 2 2 3 3 /, alpha (L) / 1 1 2 2 3 1.5 /, beta (L) / 1 .5 2 .4 3 .3 /, rho (L) / 1 19 2 27 3 30 /, eta (L) / 1 .2 2 .01 3 .3 / ; table gamma (L,LL) /* transportation cost parameter */ 1 2 3 1 1 2 2 1 3 3 1 4 ; table mu (L,LL) /* transportation cost parameter */ 1 2 3 1 .1 .4 2 .2 .3 3 .1 .4 ; table idem (L,Q,run) /* initial demands */ run1 run2 run3 1.1 10 7.3 1.2 10 1.3 10 .44 2.1 10 5.65 2.2 10 30.39 2.3 10 2.29 3.1 10 1.9 3.2 10 3.3 10 21.9 ; table isup (L,run) /* initial supplies */ run1 run2 run3 1 10 15 2 10 30 3 10 25; table iflow (L,LL,run) /* initial flows */ run1 run2 run3 1.2 10 6 1.3 10 2 2.1 10 2.3 10 3.1 10 .4 3.2 10 2.3 ; table iy (L,Q,run) /* initial dual vars */ run1 run2 run3 1.1 10 16 1.2 10 17 1.3 10 17 2.1 10 27 2.2 10 26 2.3 10 27 3.1 10 22 3.2 10 23 3.3 10 16 ; positive variables demand (L,Q), /* demand in region l for firm q's goods */ supply (L), /* supply of the good in region l */ flow (L,LL), /* flow from region l to region ll */ y (L,Q) ; /* dual variables */ flow.fx (L,L) = 0; * no tranport from a region to itself equations mrev (L,Q) marginal revenue of firm q in region l mcost (L) marginal cost of production in region l tcost (L,LL) cost of transport from region l to ll cf (L,Q) conservation of flow for firm q in region l ; mrev (L,Q) .. -rho(L) + eta(L)*sum(QQ, demand(L,QQ)) + demand(L,Q)*eta(L) *below is gradient of constraint function + y(L,Q) =g= 0; mcost (L) .. alpha(L) + 2*beta(L)*supply(L) *below is gradient of constraint function - sum (Q$(control(L) eq ord(Q)), y(L,Q)) =g= 0; tcost (L,LL) .. gamma(L,LL) + mu(L,LL)*power(flow(L,LL),2) *below is gradient of constraint function + (sum(Q$(ord(Q) eq control(L)), y(L,Q)-y(LL,Q))) * + (sum(Q$(ord(Q) eq control(L)), y(LL,Q)-y(L,Q)))$(control(L) ne control(LL)) =g= 0; cf (L,Q) .. (supply(L))$(control(L) eq ord(Q)) - demand(L,Q) + sum (LL$(control(LL) eq ord(Q)), flow(LL,L)) - (sum (LL, flow(L,LL)))$(control(L) eq ord(Q)) =g= 0; model sppe / mrev.demand, mcost.supply, tcost.flow, cf.y /; option real1 = 200.; option limrow = 0; option limcol = 0; option iterlim = 1000; option reslim = 120; loop (run, if (includerun (run), demand.l (L,Q) = idem (L,Q,run); supply.l (L) = isup (L,run); flow.l (L,LL) = iflow (L,LL,run); y.l (L,Q) = iy (L,Q,run); solve sppe using mcp; ));