<?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 Excel Solver using Proc Optmodel in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Excel-Solver-using-Proc-Optmodel/m-p/476386#M2304</link>
    <description>&lt;P&gt;I am wondering how to replicate what I currently do in Excel using Solver, in SAS using Proc Optmodel. The example with sample data is attached. There are a number of columns with formulas that reference previous columns and also rows within the same column. The final derived value/column is then compared against an actual value/column to come up with the difference/error, which I would like to minimise by changing 3 other values used in the cell formulas. Would greatly appreciate your help on this. Thank you in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jul 2018 09:05:01 GMT</pubDate>
    <dc:creator>MC29</dc:creator>
    <dc:date>2018-07-09T09:05:01Z</dc:date>
    <item>
      <title>Excel Solver using Proc Optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Excel-Solver-using-Proc-Optmodel/m-p/476386#M2304</link>
      <description>&lt;P&gt;I am wondering how to replicate what I currently do in Excel using Solver, in SAS using Proc Optmodel. The example with sample data is attached. There are a number of columns with formulas that reference previous columns and also rows within the same column. The final derived value/column is then compared against an actual value/column to come up with the difference/error, which I would like to minimise by changing 3 other values used in the cell formulas. Would greatly appreciate your help on this. Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2018 09:05:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Excel-Solver-using-Proc-Optmodel/m-p/476386#M2304</guid>
      <dc:creator>MC29</dc:creator>
      <dc:date>2018-07-09T09:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Solver using Proc Optmodel</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Excel-Solver-using-Proc-Optmodel/m-p/476504#M2305</link>
      <description>&lt;P&gt;Here's one way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel;
   set OBS;
   num actual {OBS};
   read data indata into OBS=[_N_] actual;
   num L5 = (sum {i in 1..5} actual[i]) / 5;
   num T5 = 0;
   set OBS6 = {i in OBS: i &amp;gt;= 6};

   var Alpha, Beta, Gamma;
   var L {OBS6} init L5;
   var T {OBS6} init 0;
   var S {OBS} init 1;
   con Lcon {i in OBS6}: L[i] = (
      if i = 6 then Alpha*actual[i]/S[i-5]+(1-Alpha)*L5 
      else Alpha*actual[i]/S[i-5]+(1-Alpha)*(L[i-1]+T[i-1])
   );
   con Tcon {i in OBS6}: T[i] = (
      if i = 6 then Beta*(L[i]-L5)+(1-Beta)*T5
      else Beta*(L[i]-L[i-1])+(1-Beta)*T[i-1]
   );
   con Scon {i in OBS}: S[i] = (
      if i &amp;lt;= 5 then actual[i]/L5
      else Gamma*actual[i]/L[i]+(1-Gamma)*S[i-5]
   );
   impvar Forecast {i in OBS6} = (
      if i = 6 then L5*S[i-5]
      else (L[i-1]+T[i-1])*S[i-5]
   );
   impvar Error {i in OBS6} = Forecast[i] - actual[i];
   min SSE = sum {i in 6..50} Error[i]^2;

   solve with nlp / ms;
   print Alpha Beta Gamma;
   print actual L T S Forecast Error;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The resulting optimal solution yields an objective value of&amp;nbsp;558543.93638, with:&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;Alpha&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Beta&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Gamma&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;0.17297&lt;/TD&gt;
&lt;TD class="r data"&gt;-0.039394&lt;/TD&gt;
&lt;TD class="r data"&gt;0.13006&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>Mon, 09 Jul 2018 15:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Excel-Solver-using-Proc-Optmodel/m-p/476504#M2305</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2018-07-09T15:54:42Z</dc:date>
    </item>
  </channel>
</rss>

