<?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: Linear programming in SAS in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306596#M1469</link>
    <description>&lt;P&gt;Check out this example for polynomial regression with LP:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/ormpex/68157/HTML/default/viewer.htm#ormpex_ex11_toc.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/ormpex/68157/HTML/default/viewer.htm#ormpex_ex11_toc.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also do least-squares by using a quadratic objective instead.&lt;/P&gt;</description>
    <pubDate>Sat, 22 Oct 2016 23:47:33 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2016-10-22T23:47:33Z</dc:date>
    <item>
      <title>Linear programming in SAS</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306580#M1466</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to solve a linear programming problem in SAS. I am using proc optmodel.&lt;/P&gt;
&lt;P&gt;The relation between objective var and input var is not lineal and the procedure doesn't work in that kind of relationship.&lt;/P&gt;
&lt;P&gt;This is my code, can anybody help me?. Any advice will be greatly appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* I want to know the mix pub1 + pub2 thar maximaces sales */&lt;/P&gt;
&lt;P&gt;proc optmodel;&lt;BR /&gt; /* declare variables */&lt;BR /&gt; var pub1 &amp;gt;= 0, pub2 &amp;gt;= 0;&lt;/P&gt;
&lt;P&gt;/* maximize objective function */&lt;BR /&gt; maximize sale = 3*pub1 - 0.15*pub1*pub1 + 1.5*pub2 - 0.05*pub2*pub2;&lt;/P&gt;
&lt;P&gt;/* subject to constraints */&lt;BR /&gt; con process1: pub1 + pub2 = 10;&lt;BR /&gt; /* solve LP using primal simplex solver */&lt;BR /&gt; solve with milp / presolver=none;&lt;BR /&gt; &lt;BR /&gt; /* display solution */&lt;BR /&gt; print pub1 pub2;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2016 22:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306580#M1466</guid>
      <dc:creator>juanvg1972</dc:creator>
      <dc:date>2016-10-22T22:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Linear programming in SAS</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306583#M1467</link>
      <description>&lt;P&gt;First note that your SOLVE statement invokes the MILP solver, not the LP solver. &amp;nbsp;But both MILP and LP require a linear objective. &amp;nbsp;For your problem with a quadratic objective and linear constraints, use instead the QP solver:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/ormpug/68156/HTML/default/viewer.htm#ormpug_qpsolver_toc.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/ormpug/68156/HTML/default/viewer.htm#ormpug_qpsolver_toc.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SOLVE WITH QP;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or just:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SOLVE;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The optimal objective value turns out to be&amp;nbsp;17.8125, with optimal solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Optmodel: PrintTable" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;pub1&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;pub2&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;6.25&lt;/TD&gt;
&lt;TD class="r data"&gt;3.75&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2016 22:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306583#M1467</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-10-22T22:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Linear programming in SAS</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306589#M1468</link>
      <description>&lt;P&gt;Thank you very much for your help Rob.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have another question I have a table with two vars, that have a non-linear relation, it is a polinomic relation like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;y = a.x + b.x2 + cx3 + ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is there anyway to obtain that model?, something simllar to proc reg but with polinomic relattonship??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2016 23:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306589#M1468</guid>
      <dc:creator>juanvg1972</dc:creator>
      <dc:date>2016-10-22T23:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Linear programming in SAS</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306596#M1469</link>
      <description>&lt;P&gt;Check out this example for polynomial regression with LP:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/ormpex/68157/HTML/default/viewer.htm#ormpex_ex11_toc.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/ormpex/68157/HTML/default/viewer.htm#ormpex_ex11_toc.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also do least-squares by using a quadratic objective instead.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2016 23:47:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306596#M1469</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2016-10-22T23:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Linear programming in SAS</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306612#M1470</link>
      <description>&lt;P&gt;It is not called Linear Programming. your variable is countinuous , not discrete .&lt;/P&gt;
&lt;P&gt;It is called Nonlinear Optimization, Check IML documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
start function(x);
 sale=3#x[1]-0.15#x[1]#x[1]+1.5#x[2]-0.05#x[2]#x[2];
 return (sale);
finish;
con={0 0 . .,
     . . . .,
     1 1 0 10};
optn={1 2};
x={0.5 0.5};
call nlpnra(rc,xres,'function',x,optn,con);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OUTPUT:&lt;/P&gt;
&lt;TABLE id="IDX6" class="table"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="data"&gt;GCONV convergence criterion satisfied.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;
&lt;ARTICLE id="IDX7"&gt;
&lt;TABLE class="table"&gt;&lt;COLGROUP&gt;&lt;COL /&gt;&lt;COL /&gt;&lt;/COLGROUP&gt;&lt;COLGROUP&gt;&lt;COL /&gt;&lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;Optimization Results&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;Parameter Estimates&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;N&lt;/TH&gt;
&lt;TH class="b header" scope="col"&gt;Parameter&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Estimate&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Gradient&lt;BR /&gt;Objective&lt;BR /&gt;Function&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TH class="rowheader" scope="row"&gt;X1&lt;/TH&gt;
&lt;TD class="r data"&gt;6.250000&lt;/TD&gt;
&lt;TD class="r data"&gt;1.125000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TH class="rowheader" scope="row"&gt;X2&lt;/TH&gt;
&lt;TD class="r data"&gt;3.750000&lt;/TD&gt;
&lt;TD class="r data"&gt;1.125000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/ARTICLE&gt;
&lt;DIV class="proc_note_group"&gt;
&lt;P class="c proctitle"&gt;Value of Objective Function = 17.8125&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 23 Oct 2016 03:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306612#M1470</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-23T03:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Linear programming in SAS</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306613#M1471</link>
      <description>&lt;P&gt;IML can do that. Check IML forum. There is already an example in there.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2016 03:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Linear-programming-in-SAS/m-p/306613#M1471</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-23T03:59:28Z</dc:date>
    </item>
  </channel>
</rss>

