Hello, I’m new to Gams and having some trouble extracting particular values from a table.
I have the following table,
Table s(Ext,k) Constraints of Turbine Flow
T1-1 T1-2 T2-1 T2-2 T3 T4 DRV1 DRV2 T5 T6
Max 45 25 30 20 63.6 67.4 53 20 25.1 29.6
Min 0 0.3 0 2.9 19.2 15.2 2.9 2.9 4.7 11
this table simple states the max and min flow that can go through a steam turbine (T1, T2…etc.).
I would like to be able to take data from columns 1-6 and rows 1-2, so all of the max and min vales for T1-1 to T4. As I need to use these in a mass balance.
How do I do this in Gams?
Cheers, Justin
\
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
\
Hi Justin
You can, for example, define a subset
Set sk(k) /T1-1,T1-2,T2-1,T2-2,T3,T4/;
And then define a parameter for the values you want:
Parameter constraints(ext,sk);
Constraints(ext,sk) = s(ext,sk);
Cheers
Renger
\
Modelworks
Gewerbestrasse 16
3600 Thun – Switzerland
+41 79 818 53 73
Info@modelworks.ch
From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Justin Worden
Sent: Friday, April 19, 2013 9:00 AM
To: gamsworld@googlegroups.com
Subject: Extract values from Table Matrix
Hello, I’m new to Gams and having some trouble extracting particular values from a table.
I have the following table,
Table s(Ext,k) Constraints of Turbine Flow
T1-1 T1-2 T2-1 T2-2 T3 T4 DRV1 DRV2 T5 T6
Max 45 25 30 20 63.6 67.4 53 20 25.1 29.6
Min 0 0.3 0 2.9 19.2 15.2 2.9 2.9 4.7 11
this table simple states the max and min flow that can go through a steam turbine (T1, T2…etc.).
I would like to be able to take data from columns 1-6 and rows 1-2, so all of the max and min vales for T1-1 to T4. As I need to use these in a mass balance.
How do I do this in Gams?
Cheers, Justin
\
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
\