<?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: Syntax for 'proc optmodel': Sum - Sum ... in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Syntax-for-proc-optmodel-Sum-Sum/m-p/357354#M1819</link>
    <description>&lt;P&gt;Your constraint refers to variables that don't exist, and that is why you get these error messages:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: The array subscript 'x['1V','1V']' is invalid at line 15 column 82.
ERROR: The array subscript 'x['1V','2V']' is invalid at line 15 column 82.
ERROR: The array subscript 'x['1V','3V']' is invalid at line 15 column 82.
ERROR: The array subscript 'x['1V','4V']' is invalid at line 15 column 82.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you might need to collapse your Hor_nodes and Ver_nodes into a single set of nodes, as in &lt;A href="http://go.documentation.sas.com/?docsetId=ormpug&amp;amp;docsetVersion=14.2&amp;amp;docsetTarget=ormpug_lpsolver_examples05.htm&amp;amp;locale=en" target="_self"&gt;this documentation example&lt;/A&gt;. &amp;nbsp;But if all your supplies and demands are 0, the trivial solution&amp;nbsp;with x[j,i] = 0 everywhere is optimal. &amp;nbsp;Maybe it would help to take a step back and describe your business problem in words without any algebra.&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2017 01:22:58 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2017-05-10T01:22:58Z</dc:date>
    <item>
      <title>Syntax for 'proc optmodel': Sum - Sum ...</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Syntax-for-proc-optmodel-Sum-Sum/m-p/357331#M1818</link>
      <description>&lt;P&gt;Having trouble with defining a constraint for optimization model:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- keeps 'sum' - 'sum' not working .... ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel;
	set Hor_Nodes={'1H', '2H', '3H', '4H', '5H'};
	set Ver_Nodes={'1V', '2V', '3V', '4V', '5V'};
	number Matrix{Ver_Nodes,Hor_Nodes}=[
	0 3 4 5 0
	3 0 0 0 7
	4 0 0 2 4
	5 0 2 0 1 
	0 7 4 1 0];
	
	var x{Ver_Nodes, Hor_Nodes}&amp;gt;=0;
	
	min z = sum{i in Hor_Nodes}(sum{j in Ver_Nodes}x[j,i]*Matrix[j,i]);
	
	con Flow_const{j in Ver_Nodes}: sum{i in Hor_nodes}x[j,i] -sum{i in Ver_Nodes}x[i,j]=0;
	
	solve;
	
	print Matrix;
	print z;
	
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 May 2017 23:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Syntax-for-proc-optmodel-Sum-Sum/m-p/357331#M1818</guid>
      <dc:creator>indi5000</dc:creator>
      <dc:date>2017-05-09T23:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for 'proc optmodel': Sum - Sum ...</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Syntax-for-proc-optmodel-Sum-Sum/m-p/357354#M1819</link>
      <description>&lt;P&gt;Your constraint refers to variables that don't exist, and that is why you get these error messages:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: The array subscript 'x['1V','1V']' is invalid at line 15 column 82.
ERROR: The array subscript 'x['1V','2V']' is invalid at line 15 column 82.
ERROR: The array subscript 'x['1V','3V']' is invalid at line 15 column 82.
ERROR: The array subscript 'x['1V','4V']' is invalid at line 15 column 82.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you might need to collapse your Hor_nodes and Ver_nodes into a single set of nodes, as in &lt;A href="http://go.documentation.sas.com/?docsetId=ormpug&amp;amp;docsetVersion=14.2&amp;amp;docsetTarget=ormpug_lpsolver_examples05.htm&amp;amp;locale=en" target="_self"&gt;this documentation example&lt;/A&gt;. &amp;nbsp;But if all your supplies and demands are 0, the trivial solution&amp;nbsp;with x[j,i] = 0 everywhere is optimal. &amp;nbsp;Maybe it would help to take a step back and describe your business problem in words without any algebra.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 01:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Syntax-for-proc-optmodel-Sum-Sum/m-p/357354#M1819</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-05-10T01:22:58Z</dc:date>
    </item>
  </channel>
</rss>

