my objective function should return less than 10^-6.
2 views (last 30 days)
Show older comments
2 Comments
Steven Lord
on 24 Feb 2023
Do you know of a point at which your objective function returns a value that is less than the value ga returns as a minimum? If the answer is no, what leads you to believe that the minimum for the objective function is less than the one ga returned? Is there something about a physical system that the objective function is modeling that leads you to that belief?
Answers (1)
John D'Errico
on 24 Feb 2023
Edited: John D'Errico
on 24 Feb 2023
First, suppose your car had a problem. Would you take a picture of your car and send it to your local auto mechanic? Would they be able to help you? I suppose, if you had crashed your car into a tree, they would at least be able to tell you that you should not crash cars into trees.
Similarly, by taking a picture of code, you make it more difficult for someone to help you. If you paste in the text itself, we can use that code, putting it directly into MATLAB. Why do you want to make it more difficult to get some help?
Next, all you show is how you call GA and the options. But you never show the function itself. Again, how can someone help you if you give them nothing to use or test? Again, your car won't start. So, now all your auto mechanic is given is a picture of only one of the tires of your car, nothing more. Will that allow your friendly mechanic to know why it won't start?
If you want help, then make it possible for someone to help you.
Finally, now to your apparent question, or at least part of it.
GA returned a minimum value of 0.2988... However, you want it to return a value less than 1e-6. And you will be happy, as long as the minimum is less than 1e-6. But if the minimum is 0.2988, then why do you think GA will be able to help you at all? 0.2988 is greater than 1e-6. Nothing you will do will make 0.2988 less than 1e-6, at least within the laws of mathematics.
Said differently, GA has no simple option to tell GA that it can happily stop as long as it finds a point that low.
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!