<?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: Question of constraint in Proc Optmodel in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194172#M988</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand what is wrong with what you tried.&amp;nbsp; What I suggested should work no matter what values the A variables take.&amp;nbsp; If you post your code, I'll take a look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's how you can define B with an explicit variable and constraint:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; B {PSET};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;con&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; Bcon {p in PSET}: B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; = A[p,&lt;SPAN style="; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;You can do something similar for C.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Aug 2015 22:29:20 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2015-08-06T22:29:20Z</dc:date>
    <item>
      <title>Question of constraint in Proc Optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194169#M985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On SAS Proc Optmodel, &lt;/P&gt;&lt;P&gt;I set variable A, which is a 2*2 matrix [p,k]&lt;/P&gt;&lt;P&gt;And variable B, and C are both 2*1 matrix [p,k], where B and C are one particular value of k. Like A = [B,C]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For coding convenience, sometimes I used A, and sometimes I used B and C. &lt;/P&gt;&lt;P&gt;I may need a constraint to describe the relationship between them. A = [B, C]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I put it as a constraint?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 20:58:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194169#M985</guid>
      <dc:creator>Crubal</dc:creator>
      <dc:date>2015-08-06T20:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Question of constraint in Proc Optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194170#M986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can define explicit constraints, but this looks to me like a good place to instead use implicit variables:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;impvar&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; B {p in PSET} = A[p,&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;impvar&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; C {p in PSET} = A[p,&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 21:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194170#M986</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2015-08-06T21:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Question of constraint in Proc Optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194171#M987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I tried in this way but it seems A is a 0 matrix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May I ask how to define specific constraint?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 22:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194171#M987</guid>
      <dc:creator>Crubal</dc:creator>
      <dc:date>2015-08-06T22:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Question of constraint in Proc Optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194172#M988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand what is wrong with what you tried.&amp;nbsp; What I suggested should work no matter what values the A variables take.&amp;nbsp; If you post your code, I'll take a look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's how you can define B with an explicit variable and constraint:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; B {PSET};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;con&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; Bcon {p in PSET}: B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; = A[p,&lt;SPAN style="; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;You can do something similar for C.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 22:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194172#M988</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2015-08-06T22:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Question of constraint in Proc Optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194173#M989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry it seems I cannot upload a file larger than 1kb. &lt;/P&gt;&lt;P&gt;And below is part of my code: &lt;/P&gt;&lt;P&gt;var rep_size_1 {PRODUCTS, STAGES2}&amp;gt;=0 integer;&lt;/P&gt;&lt;P&gt;var rep_size_12 {PRODUCTS}&amp;gt;=0 integer;&lt;/P&gt;&lt;P&gt;var rep_size_13 {PRODUCTS}&amp;gt;=0 integer;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constraint c1 {p in PRODUCTS}:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rep_size_12 &lt;/P&gt;&lt;P&gt; = rep_size_1 [p,1];&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;constraint c2 {p in PRODUCTS}:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rep_size_13 &lt;/P&gt;&lt;P&gt; = rep_size_1 [p,2];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the error message:&lt;/P&gt;&lt;P&gt;ERROR: The array subscript 'rep_size_1[1,1]' is invalid at line 1051 column 38.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 23:02:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194173#M989</guid>
      <dc:creator>Crubal</dc:creator>
      <dc:date>2015-08-06T23:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Question of constraint in Proc Optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194174#M990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Evidently, STAGES2 does not contain 1.&amp;nbsp; In that case, you will get the same error if you use IMPVAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to use other values for k if they are not 1 and 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 23:10:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194174#M990</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2015-08-06T23:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Question of constraint in Proc Optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194175#M991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are the best, Rob！&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 00:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Question-of-constraint-in-Proc-Optmodel/m-p/194175#M991</guid>
      <dc:creator>Crubal</dc:creator>
      <dc:date>2015-08-07T00:04:23Z</dc:date>
    </item>
  </channel>
</rss>

