<?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 Optmodel problem in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-problem/m-p/515007#M2491</link>
    <description>&lt;P&gt;A question about constraint statement of optmodel&amp;nbsp; procedure, sum of elements in array x must be less or equal to 100, and number of elements greater than 0 must be less or equal to 3, I don't know how to write this properly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc optmodel:&lt;/P&gt;
&lt;P&gt;set&amp;lt;number&amp;gt; dates=1..10;&lt;/P&gt;
&lt;P&gt;var x{dates} &amp;gt;=0 init 0;&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;con c1: sum{i in dates} x[i] &amp;lt;=100;&lt;/P&gt;
&lt;P&gt;con c2: sum{i in dates}&amp;nbsp; /*&lt;SPAN&gt;(x[i]&amp;gt;0)*/&amp;nbsp; &amp;lt;= 3;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Nov 2018 07:12:38 GMT</pubDate>
    <dc:creator>qkaiwei</dc:creator>
    <dc:date>2018-11-21T07:12:38Z</dc:date>
    <item>
      <title>Optmodel problem</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-problem/m-p/515007#M2491</link>
      <description>&lt;P&gt;A question about constraint statement of optmodel&amp;nbsp; procedure, sum of elements in array x must be less or equal to 100, and number of elements greater than 0 must be less or equal to 3, I don't know how to write this properly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc optmodel:&lt;/P&gt;
&lt;P&gt;set&amp;lt;number&amp;gt; dates=1..10;&lt;/P&gt;
&lt;P&gt;var x{dates} &amp;gt;=0 init 0;&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;con c1: sum{i in dates} x[i] &amp;lt;=100;&lt;/P&gt;
&lt;P&gt;con c2: sum{i in dates}&amp;nbsp; /*&lt;SPAN&gt;(x[i]&amp;gt;0)*/&amp;nbsp; &amp;lt;= 3;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 07:12:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-problem/m-p/515007#M2491</guid>
      <dc:creator>qkaiwei</dc:creator>
      <dc:date>2018-11-21T07:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Optmodel problem</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-problem/m-p/515186#M2492</link>
      <description>&lt;P&gt;Introduce a binary variable y[i] that is 1 if x[i] &amp;gt; 0:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   var x{dates} &amp;gt;=0 init 0 &amp;lt;= 100;
   con c1: sum{i in dates} x[i] &amp;lt;=100;
   var y{dates} binary;
   con c2: sum{i in dates} y[i] &amp;lt;= 3;
   con c3 {i in dates}: x[i] &amp;lt;= x[i].ub * y[i];
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Nov 2018 17:57:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Optmodel-problem/m-p/515186#M2492</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-11-21T17:57:55Z</dc:date>
    </item>
  </channel>
</rss>

