How to find maximum function in linear programming?
Show older comments
I have a programming form like f=Ab, here f and b are column vector and A matrix. Now constrains are like this, b(i)>0 and sum(b(i))=1 and prod(f(i)) need to be maximum. How to find the values of b(i)?
Answers (1)
John D'Errico
on 10 Apr 2015
Edited: John D'Errico
on 10 Apr 2015
0 votes
I'm confused. I could swear you said LINEAR programming. The last time I checked, prod(f) would be nonlinear. That new math changes all the time though, so I might be wrong. :)
Use fmincon instead, because the problem is nonlinear, i.e., NOT linear. It is a minimization tool, as are all of those tools. So minimize -prod(f) instead.
And, since that product will almost surely end up having numerical problems, you will find yourself needing to minimize -sum(log(f)), but a minimizer of one is a minimizer of the other.
Finally, expect that to have numerical problems too, since some of those elements might occasionally go slightly negative, whereby the log of a negative number will be a problem. It would be a problem in the product anyway, since a sign change in the product will still be a problem.
So, expect this to be difficult to solve.
Categories
Find more on Parallel Computing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!