<?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: Proc Optmodel Problem Scaling in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384810#M1946</link>
    <description>&lt;P&gt;OK. &amp;nbsp;By the way, you can impose those bounds in the variable declarations, without having to introduce explicit constraints, as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var pr &amp;gt;= 0;
var s &amp;gt;= 0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2017 21:22:21 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2017-08-01T21:22:21Z</dc:date>
    <item>
      <title>Proc Optmodel Problem Scaling</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/379640#M1934</link>
      <description>&lt;P&gt;Hi-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use proc optmodel and scale beyond 1 set of parameters for optimization (i.e. extend a 1 case example to a dataset). In the first instance I've written the following to find s such that the difference between the variables newrate and r are minimized:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Proc Optmodel */&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;BR /&gt;number b=.33267, a1=.4361836, a2=-.1201676, a3=.937298, ey=198, yg=168.3, r=.038;&lt;BR /&gt;var s init ey, z, t, p, el;&lt;/P&gt;&lt;P&gt;min newrate = r;&lt;/P&gt;&lt;P&gt;con z=(1/sqrt(2*3.14))*exp(-.5*((ey-yg)/s)**2);&lt;BR /&gt;con t=1/(1+b*((ey-yg)/s));&lt;BR /&gt;con p=z*(a1*t+a2*t**2+a3*t**3);&lt;BR /&gt;con el=p*(yg-ey)+z*s;&lt;BR /&gt;con newrate=el/yg;&lt;/P&gt;&lt;P&gt;solve;&lt;BR /&gt;print s;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I am having trouble extending this to the case where I have multiple observations for parameters ey, yg, r, and I am picking S for each observation. &amp;nbsp;Here's as far as I've gotten:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; parms;&lt;/P&gt;&lt;P&gt;input name $ ey yg b a1 a2 a3 r;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;COL1 100 80 .33267 .4361836 -.120167 .937298 .038&lt;/P&gt;&lt;P&gt;COL2 150 130 .33267 .4361836 -.120167 .937298 .038&lt;/P&gt;&lt;P&gt;COL3 100 75 .33267 .4361836 -.120167 .937298 .038&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;optmodel&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;set &amp;lt;string&amp;gt; parameters;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;number ey{parameters};&lt;/P&gt;&lt;P&gt;number yg{parameters};&lt;/P&gt;&lt;P&gt;number b{parameters};&lt;/P&gt;&lt;P&gt;number a1{parameters};&lt;/P&gt;&lt;P&gt;number a2{parameters};&lt;/P&gt;&lt;P&gt;number a3{parameters};&lt;/P&gt;&lt;P&gt;number r{parameters};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;read data parms into parameters=[name] ey=ey yg=yg b=b a1=a1 a2=a2 a3=a3 r=r;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var s{parameters} init &lt;STRONG&gt;10&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;var z{parameters};&lt;/P&gt;&lt;P&gt;var t{parameters};&lt;/P&gt;&lt;P&gt;var pr{parameters};&lt;/P&gt;&lt;P&gt;var el{parameters};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;minimize newrate = r;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;con z{p in parameters} = (&lt;STRONG&gt;1&lt;/STRONG&gt;/sqrt(&lt;STRONG&gt;2&lt;/STRONG&gt;*&lt;STRONG&gt;3.14&lt;/STRONG&gt;))*exp(-&lt;STRONG&gt;.5&lt;/STRONG&gt;*((ey-yg)/s)**&lt;STRONG&gt;2&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;con t{p in parameters} = &lt;STRONG&gt;1&lt;/STRONG&gt;/(&lt;STRONG&gt;1&lt;/STRONG&gt;+b*((ey-yg)/s));&lt;/P&gt;&lt;P&gt;con pr{p in parameters} =z*(a1*t+a2*t**&lt;STRONG&gt;2&lt;/STRONG&gt;+a3*t**&lt;STRONG&gt;3&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;con el{p in parameters}=p*(yg-ey)+z*s;&lt;/P&gt;&lt;P&gt;con newrate=el/yg;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;solve;&lt;/P&gt;&lt;P&gt;print s;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;SVO&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 06:27:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/379640#M1934</guid>
      <dc:creator>svo</dc:creator>
      <dc:date>2017-07-27T06:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Optmodel Problem Scaling</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/383868#M1937</link>
      <description>&lt;P&gt;To clarify, do you want to solve a separate optimization problem for each observation in the parms data set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, your model does not minimize the difference between newrate and r. &amp;nbsp;Instead, it forces newrate to be equal to r. &amp;nbsp;Your objective function is a constant, and the following constraint would achieve the same purpose:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con r=el/yg;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Jul 2017 19:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/383868#M1937</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-07-28T19:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Optmodel Problem Scaling</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/383883#M1938</link>
      <description>&lt;P&gt;Hi Rob-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, that's exactly what I'm trying to do. &amp;nbsp;Solve for the value of s such that new rate =/~ rate for each observation where ey and yg vary (r could also vary but not in my example code). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any thoughts on your end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2017 19:31:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/383883#M1938</guid>
      <dc:creator>svo</dc:creator>
      <dc:date>2017-07-28T19:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Optmodel Problem Scaling</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/383895#M1939</link>
      <description>&lt;P&gt;Here is a way to solve one problem per observation and store the resulting values of s:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc optmodel;
   set &amp;lt;string&amp;gt; parameters;
    
   number ey{parameters};
   number yg{parameters};
   number b{parameters};
   number a1{parameters};
   number a2{parameters};
   number a3{parameters};
   number r{parameters};
    
   read data parms into parameters=[name] ey=ey yg=yg b=b a1=a1 a2=a2 a3=a3 r=r;
    
   var s init 10;
   var z;
   var t;
   var pr;
   var el;

   str p; 
   minimize newrate = r[p];
    
   con z = (1/sqrt(2*3.14))*exp(-.5*((ey[p]-yg[p])/s)**2);
   con t = 1/(1+b[p]*((ey[p]-yg[p])/s));
   con pr =z*(a1[p]*t+a2[p]*t**2+a3[p]*t**3);
   con el=pr*(yg[p]-ey[p])+z*s;
   con newrate=el/yg[p];

   num s_sol {parameters};
   do p = parameters; 
      solve;
      print s;
      s_sol[p] = s;
   end;
   print s_sol;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can instead solve these independent problems in parallel by replacing the DO loop with a COFOR loop:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   cofor {pp in parameters} do;
      p = pp;
      solve;
      print s;
      s_sol[p] = s;
   end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A similar idea is illustrated in &lt;A href="http://go.documentation.sas.com/?docsetId=ormpex&amp;amp;docsetVersion=14.2&amp;amp;docsetTarget=ormpex_ex22_toc.htm&amp;amp;locale=en" target="_self"&gt;this documentation example&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2017 19:41:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/383895#M1939</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-07-28T19:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Optmodel Problem Scaling</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/383911#M1940</link>
      <description>&lt;P&gt;Thanks Rob- appreciate it. &amp;nbsp;This is exactly what I was trying to achieve. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2017 20:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/383911#M1940</guid>
      <dc:creator>svo</dc:creator>
      <dc:date>2017-07-28T20:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Optmodel Problem Scaling</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384752#M1943</link>
      <description>&lt;P&gt;Rob-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I spoke to fast. &amp;nbsp;I'm not sure why (maybe I am misunderstanding something) but I am seeing some weird behavior when I extend this to a large group of observations. &amp;nbsp;For instance:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Proc Optmodel Example One*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data parms;&lt;BR /&gt;input name $ ey yg b a1 a2 a3 r;&lt;BR /&gt;datalines;&lt;BR /&gt;ID1 100 80 .33267 .4361836 -.120167 .937298 .038&lt;BR /&gt;ID2 150 130 .33267 .4361836 -.120167 .937298 .038&lt;BR /&gt;ID3 100 75 .33267 .4361836 -.120167 .937298 .038&lt;BR /&gt;ID4 198 168.63 .33267 .4361836 -.120167 .937298 .038&lt;BR /&gt;ID5 1053 684.45 .33267 .4361836 -.120167 .937298 .0301141374&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;BR /&gt;set &amp;lt;string&amp;gt; parameters;&lt;BR /&gt;&lt;BR /&gt;number ey{parameters};&lt;BR /&gt;number yg{parameters};&lt;BR /&gt;number b{parameters};&lt;BR /&gt;number a1{parameters};&lt;BR /&gt;number a2{parameters};&lt;BR /&gt;number a3{parameters};&lt;BR /&gt;number r{parameters};&lt;BR /&gt;&lt;BR /&gt;read data parms into parameters=[name] ey=ey yg=yg b=b a1=a1 a2=a2 a3=a3 r=r;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;var s init 10;&lt;BR /&gt;var z;&lt;BR /&gt;var t;&lt;BR /&gt;var pr;&lt;BR /&gt;var el;&lt;/P&gt;&lt;P&gt;str p;&lt;BR /&gt;minimize newrate = r[p];&lt;BR /&gt;&lt;BR /&gt;con z = (1/sqrt(2*3.14))*exp(-.5*((ey[p]-yg[p])/s)**2);&lt;BR /&gt;con t = 1/(1+b[p]*((ey[p]-yg[p])/s));&lt;BR /&gt;con pr =z*(a1[p]*t+a2[p]*t**2+a3[p]*t**3);&lt;BR /&gt;con el=pr*(yg[p]-ey[p])+z*s;&lt;BR /&gt;con newrate=el/yg[p];&lt;/P&gt;&lt;P&gt;/* Do Loop Version */&lt;/P&gt;&lt;P&gt;num s_sol_do {parameters};&lt;BR /&gt;do p = parameters;&lt;BR /&gt;solve;&lt;BR /&gt;s_sol_do[p] = s;&lt;BR /&gt;end;&lt;BR /&gt;create data solution_do from [name] s_sol_do;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Parallel Example */&lt;BR /&gt;num s_sol_cofor {parameters};&lt;BR /&gt;cofor {pp in parameters} do;&lt;BR /&gt;p = pp;&lt;BR /&gt;solve;&lt;BR /&gt;s_sol_cofor[p] = s;&lt;BR /&gt;create data solution_cofor from [name] s_sol_cofor;&lt;BR /&gt;end;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=solution_cofor; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obs name cofor&lt;/P&gt;&lt;P&gt;1 ID1 25.118&lt;BR /&gt;2 ID2 31.258&lt;BR /&gt;3 ID3 28.001&lt;BR /&gt;4 ID4 43.266&lt;BR /&gt;5 ID5 323.855&lt;BR /&gt;&amp;#12;&lt;/P&gt;&lt;P&gt;proc print data=solution_do; run;&lt;/P&gt;&lt;P&gt;Obs name s_sol_do&lt;/P&gt;&lt;P&gt;1 ID1 25.118&lt;BR /&gt;2 ID2 31.258&lt;BR /&gt;3 ID3 28.001&lt;BR /&gt;4 ID4 43.266&lt;BR /&gt;5 ID5 123.713&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So ID5 has a different answer in the do version vs cofor version. &amp;nbsp;Using a different optimization package in R and brute force method in SAS agree that the answer should be around 323.8 (the cofor version). &amp;nbsp;This is also confirmed in the one case verion below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Proc Optmodel */&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;BR /&gt;number b=.33267, a1=.4361836, a2=-.1201676, a3=.937298, ey=1053, yg=684.45, r=.0301141374;&lt;BR /&gt;var s init ey, z, t, p, el;&lt;/P&gt;&lt;P&gt;min newrate = r;&lt;/P&gt;&lt;P&gt;con z=(1/sqrt(2*3.14))*exp(-.5*((ey-yg)/s)**2);&lt;BR /&gt;con t=1/(1+b*((ey-yg)/s));&lt;BR /&gt;con p=z*(a1*t+a2*t**2+a3*t**3);&lt;BR /&gt;con el=p*(yg-ey)+z*s;&lt;BR /&gt;con newrate=el/yg;&lt;/P&gt;&lt;P&gt;solve;&lt;BR /&gt;print s;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* OUTPUT */&lt;/P&gt;&lt;P&gt;Solver NLP&lt;BR /&gt;Algorithm Interior Point&lt;BR /&gt;Objective Function newrate&lt;BR /&gt;Solution Status Optimal&lt;BR /&gt;Objective Value 0.0301141374&lt;/P&gt;&lt;P&gt;Optimality Error 8.4013373E-8&lt;BR /&gt;Infeasibility 8.4013373E-8&lt;/P&gt;&lt;P&gt;Iterations 14&lt;BR /&gt;Presolve Time 0.00&lt;BR /&gt;Solution Time 0.04&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;s&lt;/P&gt;&lt;P&gt;323.85&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, suppose I add another two lines of input data to the parms dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data parms;&lt;BR /&gt;input name $ ey yg b a1 a2 a3 r;&lt;BR /&gt;datalines;&lt;BR /&gt;ID1 100 80 .33267 .4361836 -.120167 .937298 .038&lt;BR /&gt;ID2 150 130 .33267 .4361836 -.120167 .937298 .038&lt;BR /&gt;ID3 100 75 .33267 .4361836 -.120167 .937298 .038&lt;BR /&gt;ID4 198 168.63 .33267 .4361836 -.120167 .937298 .038&lt;BR /&gt;ID5 1053 684.45 .33267 .4361836 -.120167 .937298 .0301141374&lt;BR /&gt;ID6 1180 826 .33267 .4361836 -.120167 .937298 .1345990522&lt;BR /&gt;ID7 100 80 .33267 .4361836 -.120167 .937298 .1345990522&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc optmodel;&lt;BR /&gt;set &amp;lt;string&amp;gt; parameters;&lt;BR /&gt;&lt;BR /&gt;number ey{parameters};&lt;BR /&gt;number yg{parameters};&lt;BR /&gt;number b{parameters};&lt;BR /&gt;number a1{parameters};&lt;BR /&gt;number a2{parameters};&lt;BR /&gt;number a3{parameters};&lt;BR /&gt;number r{parameters};&lt;BR /&gt;&lt;BR /&gt;read data parms into parameters=[name] ey=ey yg=yg b=b a1=a1 a2=a2 a3=a3 r=r;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;var s init 10;&lt;BR /&gt;var z;&lt;BR /&gt;var t;&lt;BR /&gt;var pr;&lt;BR /&gt;var el;&lt;/P&gt;&lt;P&gt;str p;&lt;BR /&gt;minimize newrate = r[p];&lt;BR /&gt;&lt;BR /&gt;con z = (1/sqrt(2*3.14))*exp(-.5*((ey[p]-yg[p])/s)**2);&lt;BR /&gt;con t = 1/(1+b[p]*((ey[p]-yg[p])/s));&lt;BR /&gt;con pr =z*(a1[p]*t+a2[p]*t**2+a3[p]*t**3);&lt;BR /&gt;con el=pr*(yg[p]-ey[p])+z*s;&lt;BR /&gt;con newrate=el/yg[p];&lt;/P&gt;&lt;P&gt;/* Do Loop Version */&lt;/P&gt;&lt;P&gt;num s_sol_do {parameters};&lt;BR /&gt;do p = parameters;&lt;BR /&gt;solve;&lt;BR /&gt;s_sol_do[p] = s;&lt;BR /&gt;end;&lt;BR /&gt;create data solution_do from [name] s_sol_do;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Parallel Example */&lt;BR /&gt;num s_sol_cofor {parameters};&lt;BR /&gt;cofor {pp in parameters} do;&lt;BR /&gt;p = pp;&lt;BR /&gt;solve;&lt;BR /&gt;s_sol_cofor[p] = s;&lt;BR /&gt;create data solution_cofor from [name] s_sol_cofor;&lt;BR /&gt;end;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=solution_cofor; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obs name cofor&lt;/P&gt;&lt;P&gt;1 ID1 -5.67537&lt;BR /&gt;2 ID2 -5.75878&lt;BR /&gt;3 ID3 -6.55722&lt;BR /&gt;4 ID4 -7.71885&lt;BR /&gt;5 ID5 -5.71067&lt;BR /&gt;6 ID6 -5.71067&lt;BR /&gt;7 ID7 -5.88630&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc print data=solution_do; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obs name s_sol_do&lt;/P&gt;&lt;P&gt;1 ID1 25.118&lt;BR /&gt;2 ID2 31.258&lt;BR /&gt;3 ID3 28.001&lt;BR /&gt;4 ID4 43.266&lt;BR /&gt;5 ID5 123.713&lt;BR /&gt;6 ID6 624.578&lt;BR /&gt;7 ID7 -5.711&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So some very weird answers and I'm not sure what I've done to send things haywire like this. &amp;nbsp;Would appreciate any thoughts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 19:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384752#M1943</guid>
      <dc:creator>svo</dc:creator>
      <dc:date>2017-08-01T19:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Optmodel Problem Scaling</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384782#M1944</link>
      <description>&lt;P&gt;I'm not sure anything is wrong here. &amp;nbsp;Your objective function is a constant, so all feasible solutions are equally desirable. &amp;nbsp;Different starting solutions can lead to different optimal solutions. &amp;nbsp;When you solve serially (with the DO loop), each solve starts from the previous solution. &amp;nbsp;When you run in parallel (with COFOR), the solves are independent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have some way to quantify&amp;nbsp;that one feasible solution is preferable to another, you can make that your objective instead. &amp;nbsp;For example, if you prefer larger values of&amp;nbsp;s, you can make the following changes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*minimize newrate = r[p];*/
maximize myobj = s;

/*con newrate=el/yg[p];*/
con r[p]=el/yg[p];
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2017 20:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384782#M1944</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-08-01T20:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Optmodel Problem Scaling</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384804#M1945</link>
      <description>&lt;P&gt;My misunderstanding, I needed to impose two additional constraints including:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;con pr &amp;gt;= 0&lt;/P&gt;&lt;P&gt;con s &amp;gt;= 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to achieve the desired result. &amp;nbsp;Thanks again. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 21:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384804#M1945</guid>
      <dc:creator>svo</dc:creator>
      <dc:date>2017-08-01T21:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Optmodel Problem Scaling</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384810#M1946</link>
      <description>&lt;P&gt;OK. &amp;nbsp;By the way, you can impose those bounds in the variable declarations, without having to introduce explicit constraints, as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var pr &amp;gt;= 0;
var s &amp;gt;= 0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 21:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384810#M1946</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-08-01T21:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Optmodel Problem Scaling</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384991#M1947</link>
      <description>&lt;P&gt;Got it. &amp;nbsp;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 14:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Proc-Optmodel-Problem-Scaling/m-p/384991#M1947</guid>
      <dc:creator>svo</dc:creator>
      <dc:date>2017-08-02T14:42:19Z</dc:date>
    </item>
  </channel>
</rss>

