[Cmpl] Piece-Wise Linearization Syntax Question

Mike Steglich mike.steglich at th-wildau.de
Mon Nov 20 06:48:35 EST 2017


Hi Bhrett,

… Sorry again for my delayed answer …

I would like to suggest an easier way to linearise your non-linear function. I usually use an approach described in Hillier/Liebermann, Introduction to OR, 9th ed. pp 574ff. 



Thanks,

Mike



> Am 15.11.2017 um 22:58 schrieb Ogden, Bhrett A. <ogdenba at cdmsmith.com>:
> 
> Hi Mike,
>  
> I have attached the model. I would also like to know if it will be possible to make transportation_cost piecewise based on route_tonnage and the tonnage_interval that the route_tonnage is in. If you have a better way of doing a piecewise linearization of a non-linear function, I’m not tied to my way of doing things and would be interested to hear suggestions.
>  
> Thanks for your assistance.
>  
> Best,
>  
> Bhrett Ogden
>  
> From: Mike Steglich [mailto:mike.steglich at th-wildau.de <mailto:mike.steglich at th-wildau.de>] 
> Sent: Wednesday, November 15, 2017 3:18 PM
> To: Ogden, Bhrett A. <ogdenba at cdmsmith.com <mailto:ogdenba at cdmsmith.com>>
> Cc: cmpl at list.coin-or.org <mailto:cmpl at list.coin-or.org>
> Subject: Re: [Cmpl] Piece-Wise Linearization Syntax Question
>  
> Hello Bhrett,
>  
> Could you send the entire CMPL model directly to me (mike.steglich at th-wildau.de <https://urldefense.proofpoint.com/v2/url?u=http-3A__th-2Dwildau.de&d=DwMFaQ&c=NpiPIT1KNSO0vXgGk6ogJQ&r=lti1h6i9rU5mEC99NvhtD9QtmLoHcyEs5V5LTq78EsM&m=Ipk_fpGX-ipPspLHRSvw8Of85roj14XEkGRAdrLRxzk&s=3cM3FNPh5wLfl0BdQrdMBDr-KMgaAjjPTZnU0f0qjlk&e=>)? It would makes it easier to find the problem.
>  
> Thanks,
>  
> Mike
> 
> Am 15.11.2017 um 20:52 schrieb Ogden, Bhrett A. <ogdenba at cdmsmith.com <mailto:ogdenba at cdmsmith.com>>:
> 
> Thank you for your prompt answer to my last question. 
>  
> 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. 
>  
> 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?
>  
> transport_cost$1$ {
> e in export_ports,
> i in import_ports,
> s in seasons,
> g in grains,
> r in route_type: 
> 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];
> }
>  
> Would you also be able to explain why I get a syntax error if I divide in the following situation?:
>  
> tonnage_intervals$1$ {
> s in seasons,
> g in grains,
> i in approximation_intervals:
> 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.
> }
>  
> Thank you for your assistance.
>  
> Best,
> Bhrett Ogden
> _______________________________________________
> Cmpl mailing list
> Cmpl at list.coin-or.org <mailto:Cmpl at list.coin-or.org>
> https://list.coin-or.org/mailman/listinfo/cmpl <https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cmpl&d=DwMFaQ&c=NpiPIT1KNSO0vXgGk6ogJQ&r=lti1h6i9rU5mEC99NvhtD9QtmLoHcyEs5V5LTq78EsM&m=Ipk_fpGX-ipPspLHRSvw8Of85roj14XEkGRAdrLRxzk&s=OXIDDg_PfOBBBNbK8H2QlXQLeXVzo2Jfca2QV0xNwXg&e=><Seasonal.cdat><Seasonal.cmpl>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cmpl/attachments/20171120/9b83ab1a/attachment.html>


More information about the Cmpl mailing list