The problem could be related to a few things, such as numerical stability and the presence of multiple local minima.
For numerical stability, you didn't tell us the typical ranges of your variables. But for very large or small values, 1/x and -x behave very differently. I expect that your solution might be a large or small number.
For multiple local minima, the fmincon algorithm can take different paths dependinig on many problem inputs, and both results can be true local minima and yet differ.
Without more information, these general optimization characteristics are the best I can offer.
Alan Weiss
MATLAB mathematical toolbox documentation
2 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/699370-inverse-of-a-function-gives-different-results-than-the-negative-function-with-fmincon#comment_1220710
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/699370-inverse-of-a-function-gives-different-results-than-the-negative-function-with-fmincon#comment_1220710
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/699370-inverse-of-a-function-gives-different-results-than-the-negative-function-with-fmincon#comment_1221935
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/699370-inverse-of-a-function-gives-different-results-than-the-negative-function-with-fmincon#comment_1221935
Sign in to comment.