<?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: Apart from Optimised costs, How do i print portion of the objective function in SAS studio. in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Apart-from-Optimised-costs-How-do-i-print-portion-of-the/m-p/554563#M2705</link>
    <description>&lt;P&gt;Hello Rob,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your response. I am very sorry for my ignorance as I am new to this software.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had tried the same but without using parentheses.&lt;/P&gt;&lt;P&gt;With your suggestion, I am able to print the value and they appear just as a number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order that the results displayed are self-explanatory,&amp;nbsp; may I know how to associate it with a name.&amp;nbsp; Example for the objective function, the result is displayed as &lt;STRONG&gt;Total_cost&lt;/STRONG&gt; and then the numeric value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your response is highly appreciated and will be of great help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Errol Tauro&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Apr 2019 08:08:03 GMT</pubDate>
    <dc:creator>erroltauro</dc:creator>
    <dc:date>2019-04-28T08:08:03Z</dc:date>
    <item>
      <title>Apart from Optimised costs, How do i print portion of the objective function in SAS studio.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Apart-from-Optimised-costs-How-do-i-print-portion-of-the/m-p/554453#M2703</link>
      <description>&lt;P&gt;proc optmodel;&lt;/P&gt;&lt;P&gt;set supply= {"S1","S2"};&lt;BR /&gt;set distr= {"SGD","MYD","IDD","VND","THD"};&lt;BR /&gt;set plant= {"SG","MY","ID","VN","TH"};&lt;/P&gt;&lt;P&gt;number Suppliercap {supply}=[2000,2000];&lt;/P&gt;&lt;P&gt;number AnnualDemand {plant}=[&lt;BR /&gt;150 300 150 150 300];&lt;/P&gt;&lt;P&gt;number timeperiods = 6;&lt;/P&gt;&lt;P&gt;number matcost = 40;&lt;BR /&gt;number packcost = 5;&lt;/P&gt;&lt;P&gt;number Leg1Trcost {supply,distr}=[&lt;BR /&gt;12 12 14 16 18&lt;/P&gt;&lt;P&gt;14 12 14 18 16] ;&lt;/P&gt;&lt;P&gt;number Leg2Trcost {distr,plant}=[&lt;BR /&gt;0 4 4 6 5&lt;BR /&gt;3 0 4 4 5&lt;BR /&gt;3 4 0 4 6&lt;BR /&gt;5 4 6 0 3&lt;BR /&gt;5 6 4 3 0];&lt;/P&gt;&lt;P&gt;number Pmin = 1;&lt;BR /&gt;number Pmax = 5;&lt;BR /&gt;var Firstlegsupply {supply,distr} &amp;gt;= 0;&lt;BR /&gt;var Secondlegsupply {distr,plant} &amp;gt;= 0;&lt;BR /&gt;var open {distr} binary;&lt;/P&gt;&lt;P&gt;minimize Total_Cost= sum {i in supply,k in distr} Firstlegsupply[i,k]*(Leg1Trcost[i,k]+matcost) +&lt;BR /&gt;sum {k in distr,j in plant} Secondlegsupply[k,j]*(Leg2Trcost[k,j]+matcost+packcost);&lt;BR /&gt;&lt;BR /&gt;con MaxS {i in supply} :&lt;BR /&gt;sum {k in distr} Firstlegsupply[i,k] &amp;lt;= Suppliercap[i];&lt;/P&gt;&lt;P&gt;con MinD {j in plant} :&lt;BR /&gt;sum {k in distr} Secondlegsupply[k,j]*timeperiods = AnnualDemand[j];&lt;/P&gt;&lt;P&gt;con NoStock {k in distr} :&lt;BR /&gt;sum {i in supply} Firstlegsupply[i,k] = sum {j in plant} Secondlegsupply[k,j];&lt;/P&gt;&lt;P&gt;con linkingcons{k in distr,j in plant}:&lt;BR /&gt;Secondlegsupply[k,j]-2000*open[k]&amp;lt;=0;&lt;/P&gt;&lt;P&gt;con mindistr :&lt;BR /&gt;sum{k in distr}open[k]&amp;gt;= Pmin;&lt;BR /&gt;con maxdistr :&lt;BR /&gt;sum{k in distr}open[k]&amp;lt;= Pmax;&lt;BR /&gt;&lt;BR /&gt;con minqty{k in distr,j in plant}:&lt;BR /&gt;Secondlegsupply[k,j]&amp;lt;=25;&lt;BR /&gt;&lt;BR /&gt;con maxqty{k in distr,j in plant}:&lt;BR /&gt;Secondlegsupply[k,j]&amp;lt;=100;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;solve;&lt;/P&gt;&lt;P&gt;print Total_Cost;&lt;/P&gt;&lt;P&gt;print {k in distr} (sum {i in supply} Firstlegsupply[i,k]);&lt;/P&gt;&lt;P&gt;print Secondlegsupply;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above is my code which will output Total cost, and flows during 2 legs of material supply.&lt;/P&gt;&lt;P&gt;In addition to this i want to seperately print Transportation cost during both legs for the optimized quantities.i.e.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; sum {i in supply,k in distr} Firstlegsupply[i,k]*Leg1Trcost[i,k];&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;sum {k in distr,j in plant} Secondlegsupply[k,j]*Leg2Trcost[k,j];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you kindly advise on how to write code for this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do i need to define additional variables and assign this equation. As you can see this is portion of objective function. And i want the function to calculate the value based on optimised values for FirstLegsupply and Secondlegsupply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2019 05:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Apart-from-Optimised-costs-How-do-i-print-portion-of-the/m-p/554453#M2703</guid>
      <dc:creator>erroltauro</dc:creator>
      <dc:date>2019-04-27T05:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Apart from Optimised costs, How do i print portion of the objective function in SAS studio.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Apart-from-Optimised-costs-How-do-i-print-portion-of-the/m-p/554514#M2704</link>
      <description>Just use PRINT with parentheses:&lt;BR /&gt;print (your expression);</description>
      <pubDate>Sat, 27 Apr 2019 20:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Apart-from-Optimised-costs-How-do-i-print-portion-of-the/m-p/554514#M2704</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2019-04-27T20:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Apart from Optimised costs, How do i print portion of the objective function in SAS studio.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Apart-from-Optimised-costs-How-do-i-print-portion-of-the/m-p/554563#M2705</link>
      <description>&lt;P&gt;Hello Rob,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your response. I am very sorry for my ignorance as I am new to this software.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had tried the same but without using parentheses.&lt;/P&gt;&lt;P&gt;With your suggestion, I am able to print the value and they appear just as a number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order that the results displayed are self-explanatory,&amp;nbsp; may I know how to associate it with a name.&amp;nbsp; Example for the objective function, the result is displayed as &lt;STRONG&gt;Total_cost&lt;/STRONG&gt; and then the numeric value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your response is highly appreciated and will be of great help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Errol Tauro&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Apr 2019 08:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Apart-from-Optimised-costs-How-do-i-print-portion-of-the/m-p/554563#M2705</guid>
      <dc:creator>erroltauro</dc:creator>
      <dc:date>2019-04-28T08:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Apart from Optimised costs, How do i print portion of the objective function in SAS studio.</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Apart-from-Optimised-costs-How-do-i-print-portion-of-the/m-p/554630#M2708</link>
      <description>&lt;P&gt;Here are four ways:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   print "my string";
   print (expression);

   print "my string" (expression);

   impvar myimpvar = expression;
   print myimpvar;

   num mynum = expression with .sol suffix for each variable;
   print mynum;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Apr 2019 23:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Apart-from-Optimised-costs-How-do-i-print-portion-of-the/m-p/554630#M2708</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2019-04-28T23:03:44Z</dc:date>
    </item>
  </channel>
</rss>

