How to find maximum function in linear programming?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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)?
0 commentaires
Réponses (1)
John D'Errico
le 10 Avr 2015
Modifié(e) : John D'Errico
le 10 Avr 2015
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Parallel Computing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!