Hi there,
My problem is about calculating the endpoint of a set(not a static predefined) in the problem constraints.
My code is:
obj… blabla
.
.
eLfp… Lfp =e= sum(k,(0.7 * Df) + (0.7 * Df * sqrt(3) * (i-1)) + Df * sqrt(3)) ;
eLfo… Lfo =e= sum(k,(i-1) * 0.7 * Df) ;
ek… k =e= ((Lc - Df * sqrt(3) - 0.7 * Df ) / (0.7 * Df * sqrt(3) )) + 1;
.
.
I try to let the solver come up with a k value and then use it as an index in other constraints.
I also wrote "Set i number of cycles /1*k/; ", but it doesnt work
I need help! Thanks for your kind attentions…
\
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/aSOhodnoZC0J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.
k is a set?
On Sun, Jan 6, 2013 at 7:08 AM, wrote:
Hi there,
My problem is about calculating the endpoint of a set(not a static predefined) in the problem constraints.
My code is:
obj… blabla
.
.
eLfp… Lfp =e= sum(k,(0.7 * Df) + (0.7 * Df * sqrt(3) * (i-1)) + Df * sqrt(3)) ;
eLfo… Lfo =e= sum(k,(i-1) * 0.7 * Df) ;
ek… k =e= ((Lc - Df * sqrt(3) - 0.7 * Df ) / (0.7 * Df * sqrt(3) )) + 1;
.
.
I try to let the solver come up with a k value and then use it as an index in other constraints.
I also wrote "Set i number of cycles /1*k/; ", but it doesnt work
I need help! Thanks for your kind attentions…
\
Babak Saleck Pay
M.Sc
Socio-Economic System Engineering
Group of Industrial Engineering
University of Tehran
Tehran,Iran
www.babaksp.com
–
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.
For as far as I know, k does not need to be a set, it needs to be an element of the set you investigate.
As it is neither (it’s a variable, whose value is defined in an equation), your idea won’t work (unfortunately).
Maybe setting a sufficiently large set will work, which you sum for all the elements lower then your value of k.
So, make sure something like this is in your model as well:
sets k1 very large set size /1*200/
variable
k2;
k2.l=1;
…
equations…
eLfp… Lfp=e=sum(k1,(…)§(ord(k1) wrote:
Hi there,
My problem is about calculating the endpoint of a set(not a static predefined) in the problem constraints.
My code is:
obj… blabla
.
.
eLfp… Lfp =e= sum(k,(0.7 * Df) + (0.7 * Df * sqrt(3) * (i-1)) + Df * sqrt(3)) ;
eLfo… Lfo =e= sum(k,(i-1) * 0.7 * Df) ;
ek… k =e= ((Lc - Df * sqrt(3) - 0.7 * Df ) / (0.7 * Df * sqrt(3) )) + 1;
.
.
I try to let the solver come up with a k value and then use it as an index in other constraints.
I also wrote "Set i number of cycles /1*k/; ", but it doesnt work
I need help! Thanks for your kind attentions…
\
Babak Saleck Pay
M.Sc
Socio-Economic System Engineering
Group of Industrial Engineering
University of Tehran
Tehran,Iran
www.babaksp.com
–
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/33FL6rxxsr0J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.
I forgot to see that in my response that equation “eLfo” is uncontrolled (and therefore needs to be checked multiple times), which makes it nonlinear.
So, unless you have a solver that can handle that, a loop (which scans the entire set k1) would be more advisable.
On Monday, January 7, 2013 4:29:03 PM UTC+1, B.Saleckpay wrote:
k is a set?
On Sun, Jan 6, 2013 at 7:08 AM, wrote:
Hi there,
My problem is about calculating the endpoint of a set(not a static predefined) in the problem constraints.
My code is:
obj… blabla
.
.
eLfp… Lfp =e= sum(k,(0.7 * Df) + (0.7 * Df * sqrt(3) * (i-1)) + Df * sqrt(3)) ;
eLfo… Lfo =e= sum(k,(i-1) * 0.7 * Df) ;
ek… k =e= ((Lc - Df * sqrt(3) - 0.7 * Df ) / (0.7 * Df * sqrt(3) )) + 1;
.
.
I try to let the solver come up with a k value and then use it as an index in other constraints.
I also wrote "Set i number of cycles /1*k/; ", but it doesnt work
I need help! Thanks for your kind attentions…
\
Babak Saleck Pay
M.Sc
Socio-Economic System Engineering
Group of Industrial Engineering
University of Tehran
Tehran,Iran
www.babaksp.com
–
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/UiNH1uKVa1sJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.