Previous in Forum: SA 335 P22 Induction Bend In Un-Normalized Condition   Next in Forum: When Did High Precision Three Dimensional Pattern Reproduction in Wood Begin?
Close
Close
Close
11 comments
Active Contributor

Join Date: Sep 2017
Posts: 17

Linearizing a Non-linear Constraint

12/01/2019 6:35 PM

Hi everyone!

I have this demand constraint that I want to linearize in order to use cplex solver in ampl:

Demand{i in c, q in Q}: x[i,q]*f[i,q]= D[i,q];

where x is a continuous variable on the number of units produced, and f is a binary variable on what factory is used. Does anyone know how to do that? Thank you in advance.

Register to Reply
This discussion was "closed" on 12/03/2019 3:12 PM. No new comments are allowed.
Message from admins:
This discussion has gotten off topic and bullying is prevalent despite previous admin requests to stop.
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33231
Good Answers: 1807
#1

Re: Linearizing a non-linear constraint

12/01/2019 7:17 PM

Why not just look it up yourself in the free book provided for users...?

https://ampl.com/resources/the-ampl-book/

__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply
Active Contributor

Join Date: Sep 2017
Posts: 17
#2
In reply to #1

Re: Linearizing a non-linear constraint

12/02/2019 4:58 AM

Don't just assume that I didn't. I have memorized the book. They just have a very brief example regarding this topic in ch 20, pg 445. Which is totally different than what I'm posting. In addition, I'm looking for a mathematical way to transform it to use it in ampl, so ampl book won't be really helpful for this matter. Kindly if you don't have a valuable input to offer, I would appreciate it if you don't comment for the sake of commenting.

Thank you anyways.

Register to Reply
Guru
United Kingdom - Member - Indeterminate Engineering Fields - Control Engineering - New Member

Join Date: Jan 2007
Location: In the bothy, 7 chains down the line from Dodman's Lane level crossing, in the nation formerly known as Great Britain. Kettle's on.
Posts: 32046
Good Answers: 838
#3
In reply to #2

Re: Linearizing a non-linear constraint

12/02/2019 5:02 AM

<...Don't just assume...didn't...>

A positive statement on the matter was missing from the original post. Such a statement would have been helpful to CR4 subscribers.

__________________
"Did you get my e-mail?" - "The biggest problem in communication is the illusion that it has taken place" - George Bernard Shaw, 1856
Register to Reply
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33231
Good Answers: 1807
#4
In reply to #2

Re: Linearizing a non-linear constraint

12/02/2019 5:12 AM

Maybe my advice is more valuable than you realize...have you contacted the authors for help as well, or am I assuming too much again? Your advice for posters to butt out is not conducive to a satisfactory result here....

__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply
Active Contributor

Join Date: Sep 2017
Posts: 17
#5
In reply to #4

Re: Linearizing a non-linear constraint

12/02/2019 5:44 AM

Yeah, just as I was expecting. You have nothing valuable and you are just good for arguing and garbage talks. This site allows asking questions, so it is very simple if you don't know the answer just shut up. I don't understand how someone doesn't know the answer still bullies the one who is asking. I'm not asking you BTW, clearly, you don't know anything in this area, you just typed ampl on Google and posted the first thing appeared, and you're still trying to sound smart. I feel sorry for you. I'm asking the respectful people here who are thoughtful, humble and trying to help each other.

Register to Reply Off Topic (Score 3)
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33231
Good Answers: 1807
#6
In reply to #5

Re: Linearizing a non-linear constraint

12/02/2019 12:36 PM

How is anything you're saying any more relevant than what I'm saying?

__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply Score 1 for Off Topic
Active Contributor

Join Date: Sep 2017
Posts: 17
#7
In reply to #6

Re: Linearizing a non-linear constraint

12/02/2019 6:10 PM

Currently, it's not more relevant. You get us off track. Anyways, sorry for being rude earlier. I'm usually not like that.

And if anyone is interested in knowing the answer to this question in the future I tried the following and it worked fine for me, hopefully, it does for you too:

Demand{i in c, q in Q}: xp[i,q]= min (D[i,q]*fp[i,q]);

Register to Reply
Guru
Hobbies - Musician - Engineering Fields - Chemical Engineering - New Member Engineering Fields - Control Engineering - New Member Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jan 2007
Location: Moses Lake, WA, USA, Thulcandra - The Silent Planet (C.S. Lewis)
Posts: 4216
Good Answers: 194
#8
In reply to #2

Re: Linearizing a non-linear constraint

12/03/2019 3:08 AM

I have memorized the book.

Oh, really?

Kindly, if you haven't gone through a fair amount of agonizing over an answer to a legitimate scholastic question, LIKE I DID MANY, MANY TIMES, do not post your questions here until you have.

__________________
"Reason is not automatic. Those who deny it cannot be conquered by it. Do not count on them. Leave them alone." - Ayn Rand
Register to Reply Off Topic (Score 5)
Active Contributor

Join Date: Sep 2017
Posts: 17
#9
In reply to #8

Re: Linearizing a non-linear constraint

12/03/2019 4:56 AM

Seriously, I don't understand why everyone is bulling me. I just posted a question after days of searching and trying by myself, isn't this the purpose of the questions section? is it like unallowed here in cr4 to ask a question or what? if I were you, and I saw a question that I don't know the answer to, I won't just post a rude comment to someone who didn't offend me personally, I would just let people who knows the answer to answer it.

Honestly, this is such a bad representation to cr4 community, I know not all of the people here are like that, and for sure, this makes the cr4 community lose many great people, cuz if I was a scientist, I won't like it to read rude comments from people with less experience. There should be rules to manage that for the sight to still be valuable, cuz there are 8 comments here on this question none of them is on topic, including mine, and you can't just expect me to be productive and on the topic while everyone else is posting rude comments!

Register to Reply Score 2 for Off Topic
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33231
Good Answers: 1807
#11
In reply to #9

Re: Linearizing a non-linear constraint

12/03/2019 2:51 PM

You have been telling people to "shut up" since you started posting here, you are a rude person...

https://cr4.globalspec.com/search/sitesearch?do=show&us=90983&srchobjs=t,be,c,otr

__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply
Active Contributor

Join Date: Nov 2016
Posts: 24
Good Answers: 1
#10
In reply to #8

Re: Linearizing a non-linear constraint

12/03/2019 11:31 AM

Mikerho,

Please review and abide by the CR4 community rules, namely:

5. Please stay on topic. Posts and comments should be of a technical nature and involve some aspect of engineering, science or technology. If you delve into other topical areas (business, entertainment, sports, etc.), please do your best to tie them back to one of CR4's main focal points. Posts focusing on politics or religion will probably be removed. There are plenty of places on the Web to talk about politics or religion. CR4 isn't one of them. Likewise, strong political and religious sentiments should be kept out of profiles, signatures and other content.

12. CR4 is a professional, moderated site. If you do not feel you can abide by the rules, we invite you to visit some of the millions of other sites on the Web.

Thank you

Register to Reply Off Topic (Score 7)
Register to Reply 11 comments
This discussion was "closed" on 12/03/2019 3:12 PM. No new comments are allowed.
Message from admins:
This discussion has gotten off topic and bullying is prevalent despite previous admin requests to stop.
Copy to Clipboard

Users who posted comments:

IronWoman (1); kaka.kaka (4); Mikerho (1); PWSlack (1); SolarEagle (4)

Previous in Forum: SA 335 P22 Induction Bend In Un-Normalized Condition   Next in Forum: When Did High Precision Three Dimensional Pattern Reproduction in Wood Begin?

Advertisement