Forwarded by Keith Barnett/RTP/USEPA/US on 08/06/2010 08:59 PM

From:    Keith Barnett/RTP/USEPA/US                                                       

To:    Cortney_Higgins@omb.eop.gov                                                      

Date:    07/29/2010 02:37 PM                                                              

Subject: Fw: Emailing: cementgams.txt                                                     

Courtney ‐ here are two items you requested.  I need to at some information to

the idling kilns and then I'll sent that on.

Keith W. Barnett

USEPA/OAQPS/SPPD/MMG

Mail Code D243‐02

Research Triangle Park, NC  27711

919‐541‐5605

barnett.keith@epa.gov

‐ Forwarded by Keith Barnett/RTP/USEPA/US on 07/29/2010 02:35 PM‐‐‐‐‐ 

From:        Tom Walton/RTP/USEPA/US                                                          

To:     Keith Barnett/RTP/USEPA/US@EPA                                                   

Cc:     Ron Evans/RTP/USEPA/US@EPA                                                       

Date:    07/29/2010 09:50 AM                                                              

Subject:   Fw: Emailing: cementgams.txt                                                     

Keith,

From the OMB call yesterday, I took away three tasks.

   Idling kiln info ‐ sent list to you this morning for you to

   supplement compliance cost, parent company, year built, location, and

   parent company

   provide Gams code

   provide a one market example

Attached are the GAMS code and a spreadsheet example.

Please either forward to OMB or direct me as to whom I should send it.

Tom Walton

Economist, Air Benefit & Cost Group

HEID/OAQPS/OAR/EPA

Mail Drop C‐339‐01

919‐541‐5311

919‐541‐0839 fax
‐‐‐‐‐ Forwarded by Tom Walton/RTP/USEPA/US on 07/29/2010 09:42 AM ‐‐‐‐‐ 

From:    "Depro, Brooks M." <bmd@rti.org>                                                 

To:    Tom Walton/RTP/USEPA/US@EPA                                                      

Date:    07/28/2010 10:56 PM                                                              

Subject: Emailing: cementgams.txt                                                         

<<cementgams.txt>>  

the code for the model saved as a text file.  Please let me know if you

ed anything else.

sample worksheet of a single market that uses matrix

gebra to solve for the solution.  This may be more informative than the gams

ooks

tached file: atlanta_cement_example.xls)(See attached file:

.txt)

Tom,

Here is

ne

I also attached a rough

al

code.  Different people think of the problem in different ways.

Best,

Br

(See at

cementgams
$ontext

   U.S. PORTLAND CEMENT MARKET 2005

   ECONOMIC MODEL MODEL

   EPA Work Assignment 3‐74

   Last Updated June 17, 2010

   $offtext

   

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%

   *    BASELINE MARKET DATA

   

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%

   set     market    Markets   

/Atlanta,BaltimorePhiladelphia,Birmingham,Chicago,Cincinnati,

   Dallas,Denver,Detroit,Florida,KansasCity,LosAngeles,Minneapolis,NewYorkBoston,

   Phoenix,Pittsburgh,StLouis,SaltLakeCity,SanAntonio,SanFrancisco,Seattle/

   datatype2   I       /price, quantity, imports/;

parameter

   P0(market)          baseline price

   domestic0(market) baseline domestic production
   imports0(market) baseline cement imports

   c0(market)    consumption;

scalar

   DemandElasticity market demand elasticity

   importElasticity        import supply elasticity

   regid     regulatory program indicator 1=0n 0=off;

*This comes from the original portland cement study

   DemandElasticity = ‐0.88;

*See Broda, Limao, and Wienstein 2008, 34

   ImportElasticity =1/0.41;

regid=0;

parameter MarketData(market,datatype2)'cement market data';

$LIBInclude Xlimport MarketData CementData.xls marketdata

   P0(market) = MarketData(market,'price');

*converts million metric tons to 1000 metric tons

   domestic0(market)=MarketData(market,'quantity')*1000;
imports0(market)=MarketData(market,'imports')*1000;

c0(market) =(domestic0(market)+imports0(market));

display MarketData;

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%

   *    BASELINE KILN DATA

   

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%

   set   kiln     Kilns per plant     /1*8/

   plant    Plants per market          /1*9/

   datatype1 Input variables for kilns /AVC,production,capacity,AVCC,employees,SB/

   datatype3 output variables  

/capacity,production0,revenue0,varcosts0,fixedcosts,profits0,employees0,EBIT0,

   production1,revenue1,varcosts1,compliancecosts0,compliancecosts1,profits1,EBIT1,

   close,employees1,SB,EBITLOSS,EBITGAIN/;

parameter

   KilnData(market,plant,kiln,datatype1)    cement kiln data by market

   kiln_results(market,plant,kiln,datatype3)     cement results by kiln

   plant_results(market,plant,datatype3)     cement results by plant

   AVC(market,plant,kiln)          kiln average variable production costs $per

metric ton

   CAP(market,plant)            plant capacity metric tons per year

   AVCC(market,plant,kiln)          variable regulatory compliance costs $ per

metric ton

   q0(market,plant)         baseline plant production
   margKilnC(market,plant)       highest cost kiln with regulation $ per metric

ton

   margKilnQ0(market,plant,kiln)       highest cost kiln with regulation's baseline Q

   dqi_margKiln(market,plant,kiln)       highest cost kiln with regulation's change in Q

   q1Kiln(market,plant,kiln)          with regulation kiln quanties

   c(market,plant)         plant supply shift

   c1(market)           market supply shift

   kflag(market,plant,kiln)       kiln close flag

   pflag(market,plant)         plant close flag

   mkflag(market,plant,kiln)       marginal kiln flag

   fxcosts(market,plant)       estimated fixed costs

   check

   diff(market,plant,kiln)

   q0f(market,plant)         plants binary flag;

pflag(market,plant)=0;

   

**Read in kiln data from spreadsheet

   $LIBInclude Xlimport KilnData CementData.xls kiln

   display KilnData;

*Capacity constraint for plant

   CAP(market,plant)=sum(kiln,KilnData(market,plant,kiln,'capacity'));

*Cement Production for plant

   q0(market,plant)= sum(kiln,KilnData(market,plant,kiln,'production'));
q0f(market,plant)$q0(market,plant)=1;

*baseline variable costs $/metric ton

   AVC(market,plant,kiln)=KilnData(market,plant,kiln,'AVC');

*estimates plant‐level fixed costs (assumes median profit margin reported by PCA)

fxcosts(market,plant)=max(

        ((1‐0.157)*sum(kiln,Kilndata(market,plant,kiln,'production')*P0(market)))‐ 

        

sum(kiln,KilnData(market,plant,kiln,'production')*KilnData(market,plant,kiln,'AVC')),

        0);

*Regulatory Program Total Annualized Costs $/metric ton

   AVCC(market,plant,kiln)=KilnData(market,plant,kiln,'AVCC');

*Compute Plant Supply Shift

   c(market,plant) = smax(kiln,(AVC(market,plant,kiln)+AVCC(market,plant,kiln)))‐

smax(kiln,AVC(market,plant,kiln));

display c;

*identifies highest cost kiln with regulation

   margkilnC(market,plant)=  smax(kiln,(AVC(market,plant,kiln)+AVCC(market,plant,kiln)));

mkflag(market,plant,kiln)$((AVC(market,plant,kiln)+AVCC(market,plant,kiln))= margkilnC(market,plant)

and q0(market,plant))=1;

*populates table that lists the baseline production level for the marginal kiln
   margkilnQ0(market,plant,kiln)=

     mkflag(market,plant,kiln)*KilnData(market,plant,kiln,'production');

option margkilnQ0: 0:1:2, mkflag: 0:1:2;

display margkilnQ0, mkflag;

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%

*    PARTIAL EQUILIBRIUM MODEL

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%

   variables

   dqi(market,plant)     change in plant production

   dqImp(market)     change in imports

   dQ(market)       change in market quantity

   dP(market)       change in market price;

equations

   domestic_supply(market,plant)     first order condition for each plant (Eq 5b)

   import_supply(market)    import supply (Eq 6)

   market_supply(market)    market supply (Eq 7)

   market_demand(market)          market_demand (Eq 8);

domestic_supply(market,plant)$(q0(market,plant))..
   c(market,plant)*regid=e=

         

dP(market)*(1+(q0(market,plant)/(domestic0(market)+imports0(market)))/DemandElasticity)+

         

P0(market)/DemandElasticity*dqi(market,plant)/(domestic0(market)+imports0(market))‐ 

         

P0(market)/DemandElasticity*dQ(market)*(q0(market,plant)/(domestic0(market)+imports0(market))**

2);

import_supply(market)..

   dqImp(market) =e= ImportElasticity*dP(market)*imports0(market)/P0(market);

market_supply(market)..

   *    dQ(market) =e= sum(plant,(dqi(market,plant)$q0(market,plant))) ‐ 

sum(plant,(pflag(market,plant)*q0(market,plant)))+dqimp(market);

dQ(market) =e= sum(plant,(dqi(market,plant)$q0(market,plant)))+dqImp(market);

market_demand(market)..

   dQ(market) =e= DemandElasticity*dP(market)*(domestic0(market)+imports0(market))/P0(market);

*BASELINE MODEL

   Model pecement/All/;

Option cns = path;
Solve pecement using cns;

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%

*     COUNTERFACTUAL SIMULATION

*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%

   *turn "on" control cost flag

   regid=1;

*impose plant capacity constraint

   dqi.up(market,plant) = (CAP(market,plant)*1.08*0.95‐q0(market,plant));

*impose kiln output reduction constraint on marginal kiln

   dqi.lo(market,plant) = ‐smax(kiln,margkilnQ0(market,plant,kiln));

Option cns = path;

Solve pecement using cns;
11 21 74 99 11 21 11 21 11 21

market plant kiln AVC productionk productionp Si capacityk capacityp AVCC WR dMC

Atlanta 2 1 $38.09 778 778 10% 791 791 $1.05 $39.14 $1.05Atlanta 3 1 $47.72 638 638 8% 723 723 $1.17 $48.89 $1.17Atlanta 4 1 $44.68 1,014 1,014 13% 1,149 1,149 $4.67 $49.35 $4.67

Atlanta 5 1 $56.66 122 483 6% 168 665 $0.00 $56.66 $0.00

Atlanta 5 2 $56.22 116 160 $0.00 $56.22 $0.00

Atlanta 5 3 $55.80 122 168 $0.00 $55.80 $0.00

Atlanta 5 4 $54.63 122 168 $0.00 $54.63 $0.00

Atlanta 6 1 $42.66 724 724 9% 997 997 $5.92 $48.57 $5.92

Atlanta 7 1 $41.47 1,385 1,385 17% 1,908 1,908 $0.00 $41.47 $0.00

Atlanta 8 1 $45.37 673 673 8% 684 684 $4.99 $50.36 $4.99

Max: $56.66 5,695 6,918 $56.66

Market Infomarket price $81.31

market quantity baseline 7,965

import quantity 2,270

demand elasticity ‐0.88

import supply elasticity 2.41 2 3 4 5 6 7 8 9 10 11

A MATRIX solution 

dP dq2 dq3 dq4 dq5 dq6 dq7 dq8 dROW dQ c vector dP 

$

1 dq2 0.89 ‐0.0116 0 0 0 0 0 0 0 0.0011 13.03 dq2 

2 dq3 0.91 0 ‐0.0116 0 0 0 0 0 0 0.0009 1.17 dq3 

3 dq4 0.86 0 0 ‐0.0116 0 0 0 0 0 0.0015 4.67 dq4 

4 dq5 0.93 0 0 0 ‐0.0116 0 0 0 0 0.0007 182.28 dq5 

5 dq6 0.90 0 0 0 0 ‐0.0116 0 0 0 0.0011 5.92 dq6 

6 dq7 0.80 0 0 0 0 0 ‐0.0116 0 0 0.0020 0.00 dq7 

7 dq8 0.90 0 0 0 0 0 ‐0.0116 0 0.0010 4.99 dq8 8 dROW 68.089 0 0 0 0 0 0 0 ‐1 0 0 dROW 

9 d deman eq ‐86.195 0 0 0 0 0 0 0 0 ‐1 0 d deman eq 

10 supply eq 0 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 ‐1 1 0

AMATRIX (CELL REFERENCE)

dq2 0.89 ‐0.01 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 $1.05

dq3 0.91 0.00 ‐0.01 0.00 0.00 0.00 0.00 0.00 0.00 0.00 $1.17

dq4 0.86 0.00 0.00 ‐0.01 0.00 0.00 0.00 0.00 0.00 0.00 $4.67

dq5 0.93 0.00 0.00 0.00 ‐0.01 0.00 0.00 0.00 0.00 0.00 $0.00

dq6 0.90 0.00 0.00 0.00 0.00 ‐0.01 0.00 0.00 0.00 0.00 $5.92

dq7 0.80 0.00 0.00 0.00 0.00 0.00 ‐0.01 0.00 0.00 0.00 $0.00

dq8 0.90 0.00 0.00 0.00 0.00 0.00 0.00 ‐0.01 0.00 0.00 $4.99

dROW 68.09 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ‐1.00 0.00

demand eq ‐86.20 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ‐1.00

supply eq 0.00 ‐1.00 ‐1.00 ‐1.00 ‐1.00 ‐1.00 ‐1.00 ‐1.00 ‐1.00 1.00

AMATRIX (VALUES)

dq2 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

dq3 0.91 0.00 ‐0.01 0.00 0.00 0.00 0.00 0.00 0.00 0.00

dq4 0.86 0.00 0.00 ‐0.01 0.00 0.00 0.00 0.00 0.00 0.00

dq5 0.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00

dq6 0.90 0.00 0.00 0.00 0.00 ‐0.01 0.00 0.00 0.00 0.00

dq7 0.80 0.00 0.00 0.00 0.00 0.00 ‐0.01 0.00 0.00 0.00

dq8 0.90 0.00 0.00 0.00 0.00 0.00 0.00 ‐0.01 0.00 0.00

dROW 68.09 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ‐1.00 0.00

demand eq ‐86.20 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ‐1.00

supply eq 0.00 ‐1.00 ‐1.00 ‐1.00 ‐1.00 ‐1.00 ‐1.00 ‐1.00 ‐1.00 1.00

AMATRIX ^‐1)

0.00 0.18 0.18 0.00 0.18 0.18 0.18 0.00 0.00 0.00

1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

‐0.15 ‐73.44 12.76 ‐0.15 12.76 12.76 12.76 0.15 ‐0.15 ‐0.15

‐0 1.3 11.21 ‐74.99 ‐0 1.3 11.21 11.21 11.21 0 1.3 ‐0 1.8 ‐0 1.3

0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00

‐0.14 12.40 12.40 ‐0.14 ‐73.80 12.40 12.40 0.14 ‐0.15 ‐0.14

‐0.11 9.67 9.67 ‐0.11 9.67 ‐76.53 9.67 0.11 ‐0.22 ‐0.11

‐0.15 12.61 12.61 ‐0.15 12.61 12.61 ‐73.59 0.15 ‐0.15 ‐0.15

‐0.14 12.16 12.16 ‐0.14 12.16 12.16 12.16 ‐0.86 ‐0.06 ‐0.14

0.18 ‐15.39 ‐15.39 0.18 ‐15.39 ‐15.39 ‐15.39 ‐0.18 ‐0.92 0.18
SC104 SC Atlanta 5 2 56 116 17339 156

market plant kiln AVC production capacity AVCC

Atlanta 2 1 $38 778 771 $1.05 791.046

Atlanta 3 1 $48 638 705 $1.17Atlanta 4 1 $45 1014 1120 $4.67

Atlanta 5 1 $57 122 164 $0.00

Atlanta 5 2 $56 116 156 $0.00Atlanta 5 3 $56 122 164 $0.00Atlanta 5 4 $55 122 164 $0.00Atlanta 6 1 $43 724 972 $5.92Atlanta 7 1 $41 1385 1860 $0.00

Atlanta 8 1 $45 673 667 $4.99

market plant kiln AVC production capacity AVCC

GA201 GA Atlanta 2 1 38.087038 778.01537 771 1.052077SC101 SC Atlanta 3 1 47.719178 638.15701 705 1.172619SC102 SC Atlanta 4 1 44.67517 1013.8097 1120 4.674658SC103 SC Atlanta 5 1 56.655088 122.131 164SC104 SC Atlanta 5 2 56.222252 .222252 116.17339 156SC201 SC Atlanta 5 3 55.804157 122.131 164SC401 SC Atlanta 5 4 54.63338 122.131 164TN101 TN Atlanta 6 1 42.655466 723.84961 972 5.916908TN201 TN Atlanta 7 1 41.470449 1385.1443 1860VA101 VA Atlanta 8 1 45.371596 673.06907 667 4.990315