What is the easiest way to minimize (or maximize) a function of many variables, if each variable can only take on one of two known values (a miminum or a maximum)?
6 views (last 30 days)
Show older comments
The overall equation I'm trying to minimize (or maximize) is: V = (1+a/b)+a*c+d*(1/e + f + 1/g + h + 1/i + j - k - l - m) where all the variables can have one of two possible values (which are known). Is there an easy way to solve this problem? Would the optimization toolbox be useful or overkill since the constraints on each variable are pretty straightforward?
Edit: I also need to know which values for each variable produced the result.
1 Comment
dpb
on 19 Aug 2015
Can the sign change between the two states? If not it seems straightforward examination should solve it...
Answers (1)
Steven Lord
on 19 Aug 2015
For a problem this small (2^13 = 8192 combinations), brute force. Use NDGRID to generate all combinations of the values, evaluate the function for all the combinations, call MAX or MIN with two outputs.
2 Comments
See Also
Categories
Find more on Get Started with Optimization Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!