It depends what you mean when you say that you have "a binary variable that is not working as a binary":To get more help, you'll need to give a more detailed explanation of when the binary variables are not working. Also, copy all of the output from your AMPL session -- everything you typed, and all the messages that AMPL and the solver displayed -- into your email. And if possible, also attach your files.
- If the solver is giving you solutions that have fractional values (not 0 or 1) for your binary variable, then check that you are using a solver that can handle binary variables. For example, a message like "ignoring integrality of 21 variables" at the beginning of the solver run indicates that you're using a solver that cannot handle binary variables.
- If the solver is giving you a solution that does not satisfy all of the limite_chave1 and limite_chave2 constraints, then check that the solver reported an "optimal solution". Other messages like "infeasible" or "unbounded" indicate that there's an error in your model that needs to be fixed.
--
Robert Fourer
am...@googlegroups.com
On Thu, Oct 28, 2021 at 10:58 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/96y13ETQJrQ/unsubscribe.
To unsubscribe from this group and all its topics, 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-1679719276-4921948628-1635775924-1048845163%40helpscout.net.
Frederico M. da Costa
Engenheiro Eletricista - UFG
Especialista em Sistemas Eletroenergéticos - IDS
Mestrando em Engenharia Elétrica - UFG
(62) 9 9428-3679
Hi Robert,
First of all, thanks for your explanation.
I am using knitro solver so in my eyes it's possible that the problem is in my model.
I am attaching an image of my output with the solution.
Unfortunately, I cannot attach my files yet because it is a Master's research that is in process.
On Mon, Nov 1, 2021 at 2:43 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Also, in a variable definition, := only assigns an initial value. To define a variable by an expression involving other variables, use = instead:
On Mon, Nov 1, 2021 at 2:11 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
It depends what you mean when you say that you have "a binary variable that is not working as a binary":To get more help, you'll need to give a more detailed explanation of when the binary variables are not working. Also, copy all of the output from your AMPL session -- everything you typed, and all the messages that AMPL and the solver displayed -- into your email. And if possible, also attach your files.
- If the solver is giving you solutions that have fractional values (not 0 or 1) for your binary variable, then check that you are using a solver that can handle binary variables. For example, a message like "ignoring integrality of 21 variables" at the beginning of the solver run indicates that you're using a solver that cannot handle binary variables.
- If the solver is giving you a solution that does not satisfy all of the limite_chave1 and limite_chave2 constraints, then check that the solver reported an "optimal solution". Other messages like "infeasible" or "unbounded" indicate that there's an error in your model that needs to be fixed.
--
Robert Fourer
am...@googlegroups.com
--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/96y13ETQJrQ/unsubscribe.
To unsubscribe from this group and all its topics, 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-1679719276-4926619703-1635871825-1611894973%40helpscout.net.