Single Element of a Set of a Parameter in a For Statement
Posted: Fri Mar 09, 2018 5:23 pm
Hello,
I have the following problem:
One of my defined parameters is as follows:
F(i) /a=1, b=2/
Later I would like to run my model for different values of F("a").
So far I have modelled that in the following way which leads to errors:
file output /output.dat/;
for(F("a") = 1 to 10 by 1,
put output;
solve Model1 using mcp;
put "F" F("a"):10:3/;
);
If I try that with a scalar instead of a parameter, it works.
I tried to model that in another way which works neither:
parameter
FIX
file output /output.dat/;
for(FIX = 1 to 10 by 1,
put output;
solve Model1 using mcp;
FIX = F("a");
put "F" FIX:10:3/;
);
Thanks for your help!
Kind regards,
Going
I have the following problem:
One of my defined parameters is as follows:
F(i) /a=1, b=2/
Later I would like to run my model for different values of F("a").
So far I have modelled that in the following way which leads to errors:
file output /output.dat/;
for(F("a") = 1 to 10 by 1,
put output;
solve Model1 using mcp;
put "F" F("a"):10:3/;
);
If I try that with a scalar instead of a parameter, it works.
I tried to model that in another way which works neither:
parameter
FIX
file output /output.dat/;
for(FIX = 1 to 10 by 1,
put output;
solve Model1 using mcp;
FIX = F("a");
put "F" FIX:10:3/;
);
Thanks for your help!
Kind regards,
Going