Dear GAMS community,
I have a doubt about the best way to formulate an optimization problem.
Basically I am trying to find the minimal steam consumption that depends on a temperature variable which level can be anywhere between 50°C and 150°C. So I would like the program to calculate what is the lowest steam consumption and the corresponding level of my temperature variable.
I defined a set for all temperatures between 50 and 150 degrees and used a binary variable over this set for finding the optimal value for my temperature. This worked but I realized that if I start applying this procedure for further variables the complexity of the solving procedure increases too much.
Is there any other way I could do such calculation without using a binary variable? (To find the best value of a variable over an interval)
I hope my beginner's question is understandable, if not please let me know
To binary or not to binary...
-
- User
- Posts: 9
- Joined: 7 years ago
- Location: Stuttgart, Germany
-
- User
- Posts: 119
- Joined: 7 years ago
- Location: Rosario - Argentina
Re: To binary or not to binary...
Hi, you can use a bounded continuous variable.
positive variable
T
;
T.lo=50;
T.up=150;
This works, except if you need that the variable take integer values.
Bye
positive variable
T
;
T.lo=50;
T.up=150;
This works, except if you need that the variable take integer values.
Bye
-
- User
- Posts: 9
- Joined: 7 years ago
- Location: Stuttgart, Germany
Re: To binary or not to binary...
Thank you so much Manassaldi!
Discovering that a variable doesn't have to be defined over a set is life-changing
Discovering that a variable doesn't have to be defined over a set is life-changing
-
- User
- Posts: 72
- Joined: 6 years ago
- Location: Dallas, TX, USA
- Contact:
Re: To binary or not to binary...
More precisely, if your variable can ONLY take integer values from 50 to 150, as you stated in the post, then define the variable used by Manassaldi as integer variable like the following.
For more definition reference, you can visit the documentation site.
https://www.gams.com/latest/docs/UG_Variables.html
Cheers.
Gabriel
Code: Select all
Integer Variable T;
T.lo=50;
T.up=150;
https://www.gams.com/latest/docs/UG_Variables.html
Cheers.
Gabriel
-
- User
- Posts: 9
- Joined: 7 years ago
- Location: Stuttgart, Germany
Re: To binary or not to binary...
Great, it is so much easier than I thought!!
Thank you,
Helene
Thank you,
Helene