Fill in equation_Basic IO model

Problems with syntax of GAMS
Post Reply
m_tanawat
User
User
Posts: 13
Joined: 6 years ago

Fill in equation_Basic IO model

Post by m_tanawat »

Hi,

I am practicing building IO model by using GAMS.
Could you please help me fill me the equation to let model calculate x1,x2,x3,m,w,depr and profit per sector.
As I know, I have to use the equation x=Ax+d.
But how to code above eqn in to program is a problem. I try to do it many times but still cannot do it.
Could you please advise?
Thank you in advance.


$Title Basic input-output model
$ontext
Author Ekko van Ierland
$offtext

SET
ALLSET "Set with all elements in order"
/AGRI "Agricultural sector"
INDU "Industrial sector"
SERV "Services sector"
CONS "Consumer - final demand"
INV "Investments by origin - final demand"
GOVT "Government - final demand"
EXPORT "Exports - final demand"
TOTOUT "Total production outputs"
IMPO "Imports"
DEPR "Depreciation - primary inputs"
WAGES "Total labour expenditures - primary inputs"
PROFIT "Total profits and capital payments - primary inputs"
TOTIN "Total inputs in production or total demand by sector"
/
J(ALLSET) "Production sectors"
/AGRI, INDU, SERV/
D(ALLSET) "Final demand sectors"
/CONS, INV, GOVT, EXPORT/
Prim(ALLSET) "Primary inputs"
/DEPR, WAGES, PROFIT/
;

*The following says that you can use both names I and J to refer to set J.
ALIAS (I,J);

TABLE IODATA(ALLSET,ALLSET) Input-output table in billions of US dollars
AGRI INDU SERV CONS INV GOVT EXPORT TOTOUT
AGRI 10 30 40 100 0 40 180 400
INDU 20 60 50 300 200 30 340 1000
SERV 40 60 10 200 0 20 170 500
IMPO 60 120 20 400 100 100 0 800
DEPR 10 20 10 40
WAGES 200 600 300 1100
PROFIT 60 110 70 240

TOTIN 400 1000 500 1000 300 190 690
;

$ontext
out(i) = sum(j, IODATA(i,j)) + IODATA(i,"D") ;
va0(j) = IO("cap",j) + IO("lab",j) ;
ene0(j) = sum(en, IO(en,j)) ;
vae0(j) = va0(j) + ene0(j) ;

ax(i,j) = IODATA(i,j)/out(j) ;
avae(j) = vae0(j)/out(j) ;
ax(i,j) = IODATA(i,j)/out(j) ;
$offtext

PARAMETERS
FD(I,D) Final demand (billion US dollars) by demand sector D for goods made by sector I
INCOME(D) Total income of final demand sector D (billion US dollars)
A(I,J) Input-output coefficients from sector I to sector J
PI_coef(Prim,J) Primary inputs coefficients of input Prim in sector J
Imp_coef(ALLSET) Import coefficients of production or final demand sector
RESULT(ALLSET,ALLSET) Resulting IO-table;
;

FD(I,D) = IODATA(I,D);
INCOME(D) = IODATA("TOTIN",D);
A(I,J) = IODATA(I,J)/IODATA(J,"TOTOUT");
PI_coef(Prim,J) = IODATA(Prim,J)/IODATA(J,"TOTOUT");
Imp_coef(J) = IODATA("IMPO",J)/IODATA(J,"TOTOUT");
Imp_coef(D) = IODATA("IMPO",D)/INCOME(D);

display FD, INCOME, A, PI_coef, Imp_coef;



VARIABLES
X(I,j) Production quantity of good I (billion US dollars)
IMPORT Import quantities (billion US dollars)
PI(Prim) Primary inputs (billion US dollars)
OBJ Objective (dummy);

EQUATIONS

QX(I,j) equation of goods I
Qimport import equation
QPI(prim) primary input equation
QOBJ objective value euqation
;

QX(I,j).. X(I,j)=e= (A(i,j)*X(i,j))+d(j);


QOBJ.. obj=e= sum((i,j),(X(i,j)));

* build the basic input-output equations using the given parameters and variables


MODEL IO /ALL/

SOLVE IO USING DNLP MAXIMIZING OBJ;
m_tanawat
User
User
Posts: 13
Joined: 6 years ago

Re: Fill in equation_Basic IO model

Post by m_tanawat »

Above problem might not be difficult.
But your help will help me identify the key concept to code the equation more efficiently.

Thank you very much.
Post Reply