(2a)
either yup[t] = 0 and x[t] - x[t-1] <= 0
or yup[t] = 1 and x[t] - x[t-1] <= B--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-1656502147-4839691038-1633968084-57735778%40helpscout.net.
Dear Robert,
Thanks for your response,
The original constraints are
1) 0 <= x(t) <= A;
2) -B*ydw(t) <= x(t) - x(t-1) <= B*yup(t)
For example:
Of the constraint (2) it seems that:
When x(t-1) = 5 and x(t)=10, yup(t)=1 and ydw=0, because the difference x(t) - x(t-1) is positive. Now when x(t-1) = 10 and x(t)=5, yup(t)=0 and ydw=1, because the difference x(t) - x(t-1) is negative. Acts only one binary variable at time. When there are differences between x(t) and x(t-1) all is ok in the model, but if for example t-1) = 5 and x(t)=5, any binary variable should be activate, due there is not change, however, in some periods when there is not change the any binary variable seems active. I am thinking that the (2) says when binary variables are 1, but does not say anything about when it is zero. Similar to x(t) - x(t-1) >= 0.0001*yaux.
Regards
On Mon, Oct 11, 2021 at 4:01 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Consider constraint (2) in particular. It expresses the following restriction:(2a) either yup[t] = 0 and x[t] - x[t-1] <= 0 or yup[t] = 1 and x[t] - x[t-1] <= B
I guess this is not acceptable for your model, because when x[t] = x[t-1] it allows both yup[t] = 0 and yup[t] = 1. But I am not sure how you want to fix it. How would you change (2a) so that it is the correct restriction for your model?
--
Robert Fourer
am...@googlegroups.com