Global minimisation of multivariable constrained function with mixed integers
2 views (last 30 days)
Show older comments
Hello, I was minimising a function with 2 variables and non-linear constraints with fmincon because it does exactly what I need, and it worked perfectly. Then, I introduced 2 additional variables and changed the constraints accordingly and still worked. The issue I am facing is that, while the first 2 variables could be any number (integer or decimal), the last 2 can only have a certain value: x(3) can only be [4,6,8,10] while x(4) [6:1:30] (for a total of 100 combinations), and fmincon obviusly returns decimal numbers.
I cannot round the results because I need the right combination of all 4 variables. I also know that ga() can work with integers limitations, however ga() doesn't minimise the function, but the variables. How could I model the problem?
Many thanks
5 Comments
Walter Roberson
on 1 Sep 2021
There are some classes of functions for which it is possible to guaranteed that a minima can be found, but if you have non-linear constraints, then chances are that your function is not one of those varieties.
Answers (1)
Matt J
on 1 Sep 2021
Since there are only 100 combinations, I would just run fmincon 100 times.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!