I have a parameter, say demand, which is over two dimensions
Set t;
Set usage /elc, gas/;
Parameter demand(t,usage);
$include test.inc
Now, I want to create a .inc file, where I want to set value for demand, BUT, at first only for 'elc'. I tried this:
*test.inc...
Parameter demand(t,'elc')
\
1 1.0
2 2.0
3 3.0
... (skipped)
1200 1200.0
\;
however, it doesn't work. Can some one kindly tell me what is the correct syntax?
Thanks!
how to set value only for a parameter's first dimension
Re: how to set value only for a parameter's first dimension
Hi,
Your code snippet has so many flaws, that I think it might be a good idea if you look at introductory material like the tutorial first: https://www.gams.com/latest/docs/UG_Tutorial.html
If you want to define values for parameter demand for 'elc' only, you could do this for example as follows:
I hope this helps!
Fred
Your code snippet has so many flaws, that I think it might be a good idea if you look at introductory material like the tutorial first: https://www.gams.com/latest/docs/UG_Tutorial.html
If you want to define values for parameter demand for 'elc' only, you could do this for example as follows:
Code: Select all
parameter demand(t,usage) /
1.'elc' 1.0
2.'elc' 2.0
3.'elc' 3.0
/;
Fred