Approach to reduce a thermal load profile results in the error message 53 (Endogenous $ operation not allowed)

Hi,

i have a problem with my gams model and need some help. I´m trying to reduce a given thermal load profile (24 h) by combining some time steps which are similar.
Attached is a picture to illustrated my problem. Now i want to programm a gams model which shows me the range and the mean thermal load, so that the difference (Q_m - Q)^2 is minimal.
I had some ideas for implementation but for all of them i need a variable in a $-condition which is not allowed. Here is my last try:

Sets
i hour /1 * 24/
a range /a1 * a12/

Parameter Q(i) thermal load [kWh] /1 1.283, 2 1.316, 3 1.35, 4 1.383, 5 1.83, 6 2.7, 7 3.458, 8 3.224, 9 2.94, 10 2.711, 11 2.516, 12 2.399, 13 2.365, 14 2.242, 15 2.226, 16 2.315, 17 2.466, 18 2.672, 19 2.884, 20 2.94, 21 2.806, 22 2.443, 23 1.668, 24 1.216/

Integer Variable
a_max(a) range boundary
;
a_max.up(a) = 24;

Binary Variable
Y(a,i) binary varibable equals 1 if a_max(a-1) a_max(a-1) and ord(i)a_max(a)) =e= 0;

Model Typt_E /all/;

Solve Typt_E using minlp minimizing var_c;



I hope my question is clear. Is there someone who has an idea for a problem forumlation without using a variable in a $-control statment? Thank you.

Jonas


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.
For more options, visit https://groups.google.com/d/optout.

Dear Jonas

Please find below my proposal to avoid endogenous $ conditions :
The idea is to define a “start time” binary variable for each pair (a,i), ensure that there can be only one starting time for each “range” (eq5), and that range a starts after range a-1 (eq 4).
Then Y(a,i) should be set to one only between the starting hour of range a (inclusive) and the starting hour of range a+1 (exclusive), as specified in eq3.
It works – yet it is numerically difficult to solve.
You need to provide a starting point for binary variables (that’s the whold point of the section below “build starting point”).
On my computer, BONMIN solves it, but KNITRO fails – though I did not really spend too much time trying to configure solver options.

hope this helps
cheers
dax

\


Sets
i hour /1 * 24/
a range /a1 * a12/

alias (i,j) ;

Parameter Q(*) thermal load [kWh] /1 1.283, 2 1.316, 3 1.35, 4 1.383, 5 1.83, 6 2.7, 7 3.458, 8 3.224, 9 2.94, 10 2.711, 11 2.516, 12 2.399, 13 2.365, 14 2.242, 15 2.226, 16 2.315, 17 2.466, 18 2.672, 19 2.884, 20 2.94, 21 2.806, 22 2.443, 23 1.668, 24 1.216/

Integer Variable
a_max(a) range boundary
;
a_max.up(a) = 24;

Binary Variable
Y(a,i) binary varibable equals 1 if a_max(a-1) a_max(a-1) and ord(i)a_max(a)) =e= 0;

Model Typt_E /all/;

Solve Typt_E using minlp minimizing var_c;



I hope my question is clear. Is there someone who has an idea for a problem forumlation without using a variable in a $-control statment? Thank you.

Jonas


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.
For more options, visit https://groups.google.com/d/optout.

Hi Dax,

you helped me a lot. Thank you very much.

Jonas

Am Samstag, 13. September 2014 15:56:26 UTC+2 schrieb Jonas:



Hi,

i have a problem with my gams model and need some help. I´m trying to reduce a given thermal load profile (24 h) by combining some time steps which are similar.
Attached is a picture to illustrated my problem. Now i want to programm a gams model which shows me the range and the mean thermal load, so that the difference (Q_m - Q)^2 is minimal.
I had some ideas for implementation but for all of them i need a variable in a $-condition which is not allowed. Here is my last try:

Sets
i hour /1 * 24/
a range /a1 * a12/

Parameter Q(i) thermal load [kWh] /1 1.283, 2 1.316, 3 1.35, 4 1.383, 5 1.83, 6 2.7, 7 3.458, 8 3.224, 9 2.94, 10 2.711, 11 2.516, 12 2.399, 13 2.365, 14 2.242, 15 2.226, 16 2.315, 17 2.466, 18 2.672, 19 2.884, 20 2.94, 21 2.806, 22 2.443, 23 1.668, 24 1.216/

Integer Variable
a_max(a) range boundary
;
a_max.up(a) = 24;

Binary Variable
Y(a,i) binary varibable equals 1 if a_max(a-1) a_max(a-1) and ord(i)a_max(a)) =e= 0;

Model Typt_E /all/;

Solve Typt_E using minlp minimizing var_c;



I hope my question is clear. Is there someone who has an idea for a problem forumlation without using a variable in a $-control statment? Thank you.

Jonas


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.
For more options, visit https://groups.google.com/d/optout.