optimization technique problem with different outputs
1 view (last 30 days)
Show older comments
i am doing one optimization technique as there is a randomness in the technique i getting new value as a output every time some times repeated value if i run for 20 times i getting 20values some may be same now which value i need to choose correct value. is there any tool in matlab or any code to justify my problem?
5 Comments
Ameer Hamza
on 7 Mar 2020
Walter's answer explains the computational aspect of this issue. However, this might be the case that the system is underdetermined, and there are potentially infinite solutions to your optimization problem, each giving exactly the same optimal value. If this is the case, then you can consider adding some more constraint considering the underlying problem you are trying to solve. Anyway, the justification of a solution will depend on the problem you are trying to solve. If you just want to get a unique solution every time you run the code, you can just add
rng(0)
at the beginning of your code to seed the random number generator with the same value. You will get the same solution every time.
Walter Roberson
on 7 Mar 2020
If you do find multiple solutions that are bit-for-bit identical in optimal function value, then in some cases you just pick one arbitrarily for illustration purposes; and in other cases you need to find the entire set of solutions or a formula to generate the entire set. In other cases for illustration you want to find the first few solutions for plotting purposes, where "first" typically refers to those with smallest positive independent variable to make it easier to plot. But if you are faced with something like sinc wave with infinite oscillations near 0 then your only "justification" for picking some has to do with giving nice separation in a low resolution diagram.
Answers (1)
Walter Roberson
on 7 Mar 2020
About the only test that can justify one optimization result compared to another, is to compare the value of the objective function, and choose the configuration that leads to the minimum or maximum as appropriate.
2 Comments
Walter Roberson
on 7 Mar 2020
By the way, if the question is which optimization technique is the best, then you need to define carefully what "best" means. If you have an optimization technique that produces a solution to (say) 45 bits accuracy in (say) 3 seconds, and you have a different technique that produces a solution to 48 bits accuracy (roughly one more decimal place) in (say) 3 hours, then which is best? How much extra time are you prepared to spend for each extra bit of accuracy?
See Also
Categories
Find more on Direct Search 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!