Solver for LP (simplex method) - minimizing absolute value differences

Tiffa

New Member
Joined
Jan 26, 2016
Messages
1
Hi!
I am looking to solve a diet-optimization problem, whereby my objective function is to minimize the difference between the values (portion for each food variable) selected by the model (call them 'X') and the portion size in the mean population diet (call them 'M'). The objective function is therefore the sum of the absolute value difference (standardized by dividing each difference by M) for all the food variables. Because the absolute value yields a non linear function, and I really need a linear function so I can solve using the Simplex method, the objective function is transformed as follows...

So, I caret new non negative decision variables N and P (that represent the positive and negative deviation values)
If X < M, then N=(M-X)/M, and P= 0
If X > M, then N=0, and P= (X-M)/M
If X= M, then N=0, P=0
such that the new objective function 'Y' = sum (N + P) for all the food variables.

Trouble is... I am having a hard time getting back the final X value -- i.e. the portion size the model is selecting. Yet, I need to assign these to a column, so that I can take the sumproduct of these values with another array of nutrients to ensure the total diet nutrient about selected by the model, conforms to nutrient constraints I define.
Here's where I am at... I think there's probably some errors in my logic somewhere.
[Here's where I'm at](http://i.imgur.com/WRnCmfz.png)
Your help is appreciated... sorry if this seems convoluted.

 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,216,099
Messages
6,128,820
Members
449,469
Latest member
Kingwi11y

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top