How to find maximum function in linear programming?
显示 更早的评论
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)?
回答(1 个)
John D'Errico
2015-4-10
编辑:John D'Errico
2015-4-10
0 个投票
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Parallel Computing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!