Hello, first off I don’t have a working example due to research privacy and I know that will make things much harder to debug. But I would like to see if anyone recognizes this problem by chance.
I have a function, which I minimize using NLopt and the algorithm PRAXIS. This goes smoothly, I take the minimizer (which I name minx) and copy the vector itself, and paste it into another cell and label it something to save it for later.
When I then go back to plug the vector back into the function later to get the results again, all I get returned from the function is NaN, and when I
@show various parts of the function, they are all NaN’s as well. I have not had any other problems with this function and it behaves normally otherwise.
When plugging minx (I have NLopt save the minimizer to minx immediately) back into the function immediately after the minimizing run, I have no problems, I get the results that I should and no NaN’s. Therefore the problem is in copying and saving the vector, and then restarting the kernel, losing the saved minx, and trying to plug back in the same vector (now saved as a different variable) back into the function. I don’t change anything about the function or the minx array between restarts.
Let me know if this rings any bells for anyone. If not, that’s okay. It is not holding me back too much it is just very strange and a bit frustrating.