MODEL:
! General Equilibrium Model of an economy in LINGO, (GENEQLBM);
! Data based on Kehoe, Math Prog, Study 23(1985);
! Find clearing prices for commodities/goods and
equilibrium production levels for processes in an economy;
! Keywords: Equilibrium, General equilibrium, Complementarity constraints;
SETS:
GOOD: PRICE, H;
SECTOR;
GXS( GOOD, SECTOR): ALPHA, W;
PROCESS: LEVEL, RC;
GXP( GOOD, PROCESS): MAKE;
ENDSETS DATA:
! There are 4 goods, 4 sectors. In general need not be same;
GOOD = 1..4; SECTOR = 1..4;
! Demand curve parameter for each good i & sector j;
ALPHA =
.5200 .8600 .5000 .0600
.4000 .1 .2 .25
.04 .02 .2975 .0025
.04 .02 .0025 .6875;
! Initial wealth of good i held by sector j;
W =
50 0 0 0
0 50 0 0
0 0 400 0
0 0 0 400;
PROCESS= 1 2; ! There are two processes to make goods;
! The processes are linear, with
amount produced of good i per unit of process j;
MAKE =
6 1
1 3
4 1
1 1;
! Weights for price normalization constraint;
H = .25 .25 .25 .25; ! Make simple average = 1;
ENDDATA
!;
! Variables:
LEVEL(p) = level or amount at which we operate
process p.
PRICE(g) = equilibrium price for good g.
RC(p) = reduced cost of process p
= cost of inputs to process p  revenues from outputs
of process p, per unit;
! The objective function is optional.
Arbitrarily maximize some price;
MAX = PRICE(1);
! For each good G must have supply = demand, i.e.,
initial amount + production = sum over sectors, S,
of amount demanded of G at given prices;
@FOR( GOOD( G):
@SUM( SECTOR( M): W( G, M))
+ @SUM( PROCESS( P): MAKE( G, P) * LEVEL( P))
= @SUM( SECTOR( S):
ALPHA( G, S) *
@SUM( GOOD( I): PRICE( I) * W( I, S))/ PRICE( G));
);
! Each process at best breaks even, RC is constrained >= 0;
@FOR( PROCESS( P):
RC(P) = @SUM( GOOD( G):  MAKE( G, P) * PRICE( G));
! Complementarity constraint to enforce that
if process does not break even(RC > 0), then
do not use it. Also, if use it, then RC = 0;
RC(P)*LEVEL(P) = 0;
);
! Prices scale to 1. otherwise there is an infinity of solutions;
@SUM( GOOD( G): H( G) * PRICE( G)) = 1;
END
