<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Changing a nonlinear constraint to a linear one in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Changing-a-nonlinear-constraint-to-a-linear-one/m-p/315325#M1540</link>
    <description>&lt;P&gt;Thank you so much! Binary variables make my problem huge and I am trying to avoide them. But I think it is a good idea and I will give it another try. Thank you&lt;/P&gt;</description>
    <pubDate>Tue, 29 Nov 2016 20:02:00 GMT</pubDate>
    <dc:creator>Afdoone</dc:creator>
    <dc:date>2016-11-29T20:02:00Z</dc:date>
    <item>
      <title>Changing a nonlinear constraint to a linear one</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Changing-a-nonlinear-constraint-to-a-linear-one/m-p/315262#M1537</link>
      <description>&lt;P&gt;Hi. &amp;nbsp;I have a binary variable and a nonlinear constraint in my model. Since I dont want to use MINLP I would like to change my non-linear constraint to a linear one and use MILP.(If it is possible).&amp;nbsp;I could not convert the constraint&amp;nbsp;yet so I thought maybe you have an idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two variables as "D" and "Ad" and&amp;nbsp;the condition is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if D&amp;lt;0 then Ad=D&lt;/P&gt;&lt;P&gt;if D&amp;gt;=0 then 0&amp;lt;=Ad&amp;lt;=D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I model the constraint as&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(D-|D|)/2&amp;lt;= Ad &amp;lt;=D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so the left side takes "D" if "D" is negative and "Ad" will be equal to "D" and it takes 0 if "D" is positive. I could not change this problem to linear. I know we can use&amp;nbsp;binary variable to change absolute value to the linear form but since I already have a binary variable, by adding a new one the size will be huge and it is not solvable with the memory we have. I appreciate any idea you have.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 17:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Changing-a-nonlinear-constraint-to-a-linear-one/m-p/315262#M1537</guid>
      <dc:creator>Afdoone</dc:creator>
      <dc:date>2016-11-29T17:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Changing a nonlinear constraint to a linear one</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Changing-a-nonlinear-constraint-to-a-linear-one/m-p/315320#M1538</link>
      <description>&lt;P&gt;Assuming D is bounded both above and below, you can linearize this as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   var X binary;

   con C1:
      Ad &amp;lt;= D;

   /* if X = 1 then D &amp;lt;= 0 else redundant */
   con C2:
      D &amp;lt;= D.ub * (1 - X);

   /* if X = 1 then D &amp;lt;= Ad else redundant */
   con C3:
      D - Ad &amp;lt;= (D.ub - D.lb) * (1 - X);

   /* if X = 0 then D &amp;gt;= 0 else redundant */
   con C4:
      D &amp;gt;= D.lb * X;

   /* if X = 0 then Ad &amp;gt;= 0 else redundant */
   con C5:
      Ad &amp;gt;= D.lb * X;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 19:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Changing-a-nonlinear-constraint-to-a-linear-one/m-p/315320#M1538</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-11-29T19:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Changing a nonlinear constraint to a linear one</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Changing-a-nonlinear-constraint-to-a-linear-one/m-p/315325#M1540</link>
      <description>&lt;P&gt;Thank you so much! Binary variables make my problem huge and I am trying to avoide them. But I think it is a good idea and I will give it another try. Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 20:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Changing-a-nonlinear-constraint-to-a-linear-one/m-p/315325#M1540</guid>
      <dc:creator>Afdoone</dc:creator>
      <dc:date>2016-11-29T20:02:00Z</dc:date>
    </item>
  </channel>
</rss>

