[AMPL 2612] change variable bound

View: New views
6 Messages — Rating Filter:   Alert me  

[AMPL 2612] change variable bound

by Ali Baharev :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I would like to change the upper bound of x[28] from 1.0 to 0.8 in

var x{ i in 1..1000} >= 0.1, <= 1.0;

How can i do that?

Any help is appreciated,

Ali

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: [AMPL 2612] change variable bound

by Yasin053 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think you should add a constraint into your model that ensures that x[28] <=0.8.

Ali Baharev wrote:
I would like to change the upper bound of x[28] from 1.0 to 0.8 in

var x{ i in 1..1000} >= 0.1, <= 1.0;

How can i do that?

Any help is appreciated,

Ali

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@googlegroups.com
To unsubscribe from this group, send email to ampl+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

[AMPL 2619] Re: change variable bound

by Ali Baharev :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks.

Unfortunately I HAVE TO set the upper bound directly. Is there a way to do it?

Ali

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---


[AMPL 2617] Re: change variable bound

by Ali Baharev :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Sorry, it works, it is may fault, i just disabled presolve.

With presolve enabled, it gives the effect i was looking for.

Thank you very much!

Ali

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---


[AMPL 2620] Re: change variable bound

by Robert Fourer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



The best way to change an upper bound is to define a parameter to represent
it.  For example, in this case, you could say

   param x_ub > 0, default 1.0;
   var x {i in 1..1000} >= 0.1, <= x_ub;

Initially x_ub will be 1.0 by default, but you can change this bound to 0.8
by means of the command "let x_ub := 0.8;".

-- Bob


> -----Original Message-----
> From: ampl@... [mailto:ampl@...]
> On Behalf Of Ali Baharev [ali.baharev@...]
> Sent: Friday, June 26, 2009 9:23 AM
> To: ampl@...
> Subject: [AMPL 2612] change variable bound
>
>
> I would like to change the upper bound of x[28] from 1.0 to 0.8 in
>
> var x{ i in 1..1000} >= 0.1, <= 1.0;
>
> How can i do that?
>
> Any help is appreciated,
>
> Ali
>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---


Parent Message unknown [AMPL 2621] Re: change variable bound

by Robert Fourer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



I didn't notice you only wanted to change the upper bound of x[28].  Of
course adding a constraint that x[28] <= 0.8 will work fine, as long as you
are always going to be trying to make the bound smaller.  But if you are
going to want to change bounds any way you like, then a more general way to
do it is

   param x_ub {1..1000} > 0, default 1.0;
   var x {i in 1..1000} >= 0.1, <= x_ub[i];
   ...
   let x_ub[28] := 0.8;


> -----Original Message-----
> From: Ali Baharev [mailto:ali.baharev@...]
> Sent: Wednesday, July 01, 2009 10:48 AM
> To: 4er@...
> Cc: ampl@...
> Subject: Re: [AMPL 2612] change variable bound
>
> Dear Profesor Fourer,
>
> Thank you for the response. Unfortunately, i am afraid i do not
> understand your proposal.
>
> I want all x[i]-s to have the upper bound 1.0 except x[28] which
> should have an upper bound 0.8. Yasin053's proposal with presolve
> enabled gives the expected result.
>
> Is there another way to do this?
>
> Many thanks,
>
> Ali



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---