I am stuck in a problem where the Looping Index is also used as a Domain Variable in a Table. Here Please refer to the code below:
Code: Select all
SET m 'operating modes' / A, B, C/
p 'liquid fractions'
/ GO
HN
LD
HD
BR / ;
Table ratio(m,p) ' ratios for different operating modes'
GO HN LD HD BR
A 0.1117 0.0946 0.2004 0.0688 0.5245
B 0.1172 0.0279 0.2621 0.0687 0.524
C 0.1173 0.0279 0.2103 0.1289 0.5156;
VARIABLES
unit(u)
Qfeed(p)
z;
EQUATIONS
Q
Objective;
PARAMETERS
Qfeedm(p,m)
unitm(p,m)
zm(m);
Q(p,m).. QFeed(p) =E= unit(u)*ratio(p,m);
Objective.. z(m) =E= ratio(p,m)*500;
Model test /ALL/
LOOP(m,
*Here I want to LOOP over Parameter ratio, which is in Table form --- I DON'T KNOW HOW?
SOLVE test using LP maximizing z
Qfeedm(p,m) = Qfeed.L(p)
unit(u,m) = unit.L(u)
zm(m) = z.L;
Regards,