Part A: Sets Declaration and Definition Solve The Following Questions
Part A: Sets Declaration and Definition Solve The Following Questions
Enter the multi-dimensional labor data in a GAMS model once using using
Sets ¶meter, and again using sets & table reseved GAMS words.
4. Given the time set t = 2000 to 2005 and the non-homogenious rows
Shown in the following matrix:
2
Variance 10 12 16 18 20 20
Maximum 800 900 1000 1200 1400 1800
Read the above matrix in GAMS format using set and table reserved words.
5. Re-write the following data entry problem using the
“ Parameter” reserved GAMS word instead of “Table”.
Sets
L Labor by category / GOV, PUB, PRIV /
H Household type / URBAN, RURAL /;
TABLE LABOR (L,H) number of workers in thousands.
URBAN RURAL
GOV 200 150
PUB 20 30
PRV 300 250 ;
1. Given the following data items in the form of matrix, vector and scalar.
Sets
L Labor by Sector / GOV, PUB, PRIV /
H Household type / URBAN, RURAL / ;
TABLE LABOR (L,H) number of workers in thousands.
URBAN RURAL
GOV 200 150
PUB 20 30
PRV 300 250 ;
PARAMETER W(H) wage rate by household area /
URBAN 30 , RURAL 25 / ;
SCALAR GR average growth rate (in percent) of labor by sector
and Household Area / 2 / ;
a) Compute the new number of labor by Sector and Household area
Given the annual growth rate GR in perent (%).
b) Compute the total wage income by sector using the labor matrix and
the wage rate by household category.
2. Convert the following mathematical specifications or equations to a GAMS
Format:
3
TOTCm = ∑iCim
EMP= ∑t Lt Mt
Using Sets , Parameters , Tables , SUM and PROD reserved GAMS key words.
sqrt(x), sqr(x).
SETS
/ ;
Use the two GAMS reserved words “DISPLAY” and “OPTION” to design
4
a transparent output report to display the LABOR parameter.
1. Use the dollar sign ($) operator of GAMS to implement the following
algorithms:
A) Read the scalars X,Y. ((Y=2and X=1)
If X > 1.5 then X=2
Else X = 0
B) Read R(i) and S(i), i= 1,2, …..n
If S(i) = 0 then R(i) = inf
Else R(i) = 1/S(i)
C) S(I) = V(I) $ (V(I) GE 2 AND V(I) LE 4)
Read S(i), V(i) , i=1,2,….n
If 2 <= S(i) <= 4 then S(i) = V(i)
Else S(i) = 0
D) Read A(i), i=1,2… and S(k),T(k), B(k) , k=1,2,…
If S(k) and T(k) NE 0
Then U(i) = SUM((k), A(i)*B(k))
Else U(i) = 0
2. Given the following GAMS program:
SETS R Regions
/ UPPER-EGY , LOWER-EGY /
S Cities
/ CAIRO, ALEX, ASWAN, LUXOR /
CORR(R, S) correspondence of Reg. & Cities
/ UPPER-EGY . (ASWAN, LUXOR)
LOWER-EGY . (CAIRO, ALEX) /
6
PARAMETERS
Y(R) Income of each region (m LE )
INCOME (s) Income of cities (m LE)
/ CAIRO 100 , ALEX 70
ASWAN 50 , LUXOR 30 /
For each region R compute the summation over the S citie such that
CORR(R,S) exists.
Good Luck
Motaz Khorshid