<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Bhrett,<div class=""><br class=""></div><div class="">Please find my answers below:</div><div class=""><br class="">
<br class=""><div><blockquote type="cite" class=""><div class="">Am 27.11.2017 um 20:22 schrieb Ogden, Bhrett A. <<a href="mailto:ogdenba@cdmsmith.com" class="">ogdenba@cdmsmith.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi Mike,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thanks for your correction here. I have a few more syntax-related questions from the attached file.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">1. What does unexpected symbol var mean in the instance below? Normally I find that I’ve used an undefined variable, but I don’t see any issue with that here:<br class=""><br class=""><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class=""># Force x_(i+1) = 0 whenever x_i < u_i (pg 574)<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">special_condition$1${<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">e in export_ports,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">i in import_ports,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">r in route_types,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">s in seasons,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">g in grains,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">n in approximation_intervals:<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">{ n < len(approximation_intervals) && #Syntax error unexpected SYMBOL_VAR<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">x_val_interval[e,i,r,s,g,n] < tonnage_intervals[s,g,n]:<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">x_val_interval[e,i,r,s,g,n+1] = 0;<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt;" class="">}<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">}<br class=""></div></div></div></blockquote><div><br class=""></div><span class="">You try to compare the values of two variables (x_val_interval[e,i,r,s,g,n] < tonnage_intervals[s,g,n]), which is not possible within a Cmpl programme, because these values are only available after obtaining the solution by the solver.<br class=""></span><span class=""><br class=""></span><span class=""><br class=""></span><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><br class="">2. What does “product of variable has too much indexes” error message mean?<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">transport_cost$1$ {<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">e in export_ports,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">i in import_ports,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">r in route_types,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">s in seasons,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">g in grains:<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">transport_cost[e,i,r,s,g] = sum{<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">n in approximation_intervals:<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">x_val_interval[e,i,r,s,g,n] * m[e,i,s,g,n] * route_nmiles[e,i,r] * transport_cost_per_mton_nmile #Syntax issue: Product of variable has too much indexes<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">};<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">}</div></div></div></blockquote><div><br class=""></div><div><br class=""></div><div>First of all … you want to multiply two variables: <span style="font-family: Calibri, sans-serif; font-size: 11pt;" class="">x_val_interval[e,i,r,s,g,n] * m[e,i,s,g,n]. </span> Cmpl is able to transform equivalentely a product of variables into a system of linear inequations, if at least one of the factors is integer. But your variables are continuous variables. </div><div><br class=""></div><div>Cmpl tries also to transform a product of continues variables, but this is not an exact transformation and I cannot recommend it. </div><div><br class=""></div><div>The second issue is that the number of indices are restricted in Cmpl and the reformulation of products of variables leads to generated artificial variables which have in your example more indices as allowed. I could increase the maximum number of indices in the Cmpl source code and could send a new binary if necessary.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">3. How can I properly format this stamen involving a power? I’m not having any luck with this.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">#Get cost for the tonnage intervals<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">solve_fx$1$ {<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">e in export_ports,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">i in import_ports,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">s in seasons,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">g in grains,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">n in approximation_intervals:<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">fx[e,i,s,g,n] = exp(a[e,i]) * (n*tonnage_intervals[s,g])^b[e,i]; # Syntax issue with power<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">}</div></div></div></blockquote><div><br class=""></div><div><br class=""></div><div><div class="WordSection1" style="page: WordSection1;"><div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">The expression (n*tonnage_intervals[s,g])^b[e,i]; is non-linear because you want to calculate the exponentiation of the variable tonnage_intervals[s,g]. Cmpl only supports linear programmes. </div><div class="" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"> </div></div></div><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">4. What is proper format for this statement? I’m having an issue getting the operators and parenthesis in a format that CMPL accepts.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">#Get slope for piece-wise approximation<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">solve_m$1$ {<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">e in export_ports,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">i in import_ports,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">s in seasons,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">g in grains,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">n in approximation_intervals:<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">{<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">n = 1:<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">m[e,i,s,g,n] = fx[e,i,s,g,n] * (1/tonnage_intervals[s,g]); # Arithmetic syntax issue<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">| n > 1:<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">m[e,i,s,g,n] = (fx[e,i,s,g,n] - fx[e,i,s,g,n-1])/(n*tonnage_intervals[s,g] - (n-1)*tonnage_intervals[s,g,]); # Arithmetic syntax issue<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">}<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">}</div></div></div></blockquote><div><br class=""></div><div>You cannot divide by a variable in a constraint. You could re-arrange the first constraint into : m[e,i,s,g,n] * tonnage_intervals[s,g] = fx[e,i,s,g,n] ; But this leads to a product of variables ( m[e,i,s,g,n] * tonnage_intervals[s,g]). As mentioned before, Cmpl is able to transform equivalently a product of variables into a system of linear inequations, if at least one of the factors is integer. But your variables are continuous variables. (fx[export_ports,import_ports,seasons,grains,approximation_intervals]:real[0..]; and m[export_ports,import_ports,seasons,grains,approximation_intervals]:real[0..];) </div><div><br class=""></div><div>This issues also happens for the second constraint in you if clause.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thank you for any advice or clarification.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Best,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-size: 10pt;" class="">Bhrett Ogden</span></b><span style="font-size: 10pt;" class=""><o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10pt;" class="">Information Management Software Developer<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10pt;" class="">CDM Smith<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10pt;" class="">1050 N Reed Station Rd Suite D<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10pt;" class="">Carbondale, IL 62902<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10pt;" class="">T: 312.780.7869<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10pt;" class=""><a href="mailto:ogdenba@cdmsmith.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">ogdenba@cdmsmith.com</a><o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10pt;" class=""><font color="#954f72" class=""><u class=""><a href="http://cdmsmith.com" class="">cdmsmith.com</a></u></font></span></div></div></div></div></blockquote><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div>Cheers,</div><div><br class=""></div><div>Mike</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10pt;" class=""><o:p class=""></o:p></span></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>Mike Steglich [<a href="mailto:mike.steglich@th-wildau.de" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">mailto:mike.steglich@th-wildau.de</a>]<span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Monday, November 20, 2017 6:24 AM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Ogden, Bhrett A. <<a href="mailto:ogdenba@cdmsmith.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">ogdenba@cdmsmith.com</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:cmpl@list.coin-or.org" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">cmpl@list.coin-or.org</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [Cmpl] Piece-Wise Linearization Syntax Question<o:p class=""></o:p></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hi Bhrett,<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hmm I am actually scatty because I forgotten to answer your second question:<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">This expression works:<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">tonnage_intervals$1$ {</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">s in seasons,</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">g in grains,</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">i in approximation_intervals:</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">tonnage_intervals[i,s,g] = worldwide_demand[s,g] * i * 1/len(approximation_intervals); # Division won't work. I'm having to hardcode 0.25 for now.</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">}</span><o:p class=""></o:p></div></div></blockquote></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">if you imbed 1/len(approximation_intervals in brackets:<o:p class=""></o:p></div></div><div class=""><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">tonnage_intervals$1$ {</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">s in seasons,</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">g in grains,</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">i in approximation_intervals:</span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class="">tonnage_intervals[i,s,g] = worldwide_demand[s,g] * i * (1/len(approximation_intervals));</span><o:p class=""></o:p></div></div></blockquote><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-family: UICTFontTextStyleTallBody, serif;" class="">}</span><o:p class=""></o:p></div></div></blockquote><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Mike<o:p class=""></o:p></div></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt; font-family: UICTFontTextStyleTallBody, serif;" class=""><br class=""><br class=""></span><o:p class=""></o:p></div></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 11pt; font-family: Calibri, sans-serif;"><br class="">Am 15.11.2017 um 20:52 schrieb Ogden, Bhrett A. <<a href="mailto:ogdenba@cdmsmith.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">ogdenba@cdmsmith.com</a>>:<o:p class=""></o:p></p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thank you for your prompt answer to my last question.<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I have another question regarding syntax of CMPL. I have a power function that represents a route cost that I would like to linearize. I am using linear approximation to consider the range of options and break the non-linear equation into a four-part piece-wise equation, f(x) ~= f(n) + f’(n)(x-n), where n is the mean route tonnage in the interval. The power function is C = e^a * x^b where a and b are constants that depend on the route origin/destination and x is the route tonnage. One element that I am trying to minimize is the sum of the transport costs.<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I have approximated the cost to f(x) = e^a * n^b * (1 + b * n^-1 * x – b), where n is the mean route tonnage in the interval and a and b are constants with respect to the route. Assuming that all tonnages lie within the first interval for now (to avoid complicating this question with piece-wise syntax), how can I represent this in CMPL? I was having issues with using parenthesis so I have done all of the distributions. Now I am receiving syntax errors about ^. What is the proper way to represent this?<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">transport_cost$1$ {<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">e in export_ports,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">i in import_ports,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">s in seasons,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">g in grains,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">r in route_type:<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">transport_cost[e,i,r,s,g] = exp(a[e,i]) * mean_tonnage_for_interval[1,s,g] ^ b[e,i] + b[e,i] * exp(a[e,i]) * route_tonnage[e,i,r,s,g] * mean_tonnage_for_interval[1,s,g] ^ b[e,i] * mean_tonnage_for_interval[1,s,g] ^ -1 - exp(a[e,i])* b * mean_tonnage_for_interval[1,s,g] ^ b[e,i];<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">}<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Would you also be able to explain why I get a syntax error if I divide in the following situation?:<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">tonnage_intervals$1$ {<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">s in seasons,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">g in grains,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">i in approximation_intervals:<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">tonnage_intervals[i,s,g] = worldwide_demand[s,g] * i * 1/len(approximation_intervals); # Division won't work. I'm having to hardcode 0.25 for now.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">}<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thank you for your assistance.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""> <o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Best,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Bhrett Ogden<o:p class=""></o:p></div></div></blockquote><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">_______________________________________________<br class="">Cmpl mailing list<br class=""><a href="mailto:Cmpl@list.coin-or.org" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">Cmpl@list.coin-or.org</a><br class=""><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cmpl&d=DwMFaQ&c=NpiPIT1KNSO0vXgGk6ogJQ&r=lti1h6i9rU5mEC99NvhtD9QtmLoHcyEs5V5LTq78EsM&m=iakxlbWQOSKuVBjy57i_AAXrPmasU7QkeNtxBBAYFNY&s=Xzgr46f-5U3RODSHpP9XNrS1zNErazUh_atWM2K16HM&e=" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">https://list.coin-or.org/mailman/listinfo/cmpl</a><o:p class=""></o:p></div></div></blockquote></div><span id="cid:8781FD5A-15F3-40E0-AC9F-FFB45DACF169"><Seasonal.cmpl></span><span id="cid:08031D39-12F4-4E61-B56D-E17DBBBD6E4C"><Seasonal.cdat></span><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Cmpl mailing list</span><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:Cmpl@list.coin-or.org" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Cmpl@list.coin-or.org</a><br style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://list.coin-or.org/mailman/listinfo/cmpl" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://list.coin-or.org/mailman/listinfo/cmpl</a></div></blockquote></div><br class=""></div></body></html>