Hi. Im having a problem when using the EigenValue and SingularValueList functions, as a constraint for NMinimize. I have built a function that works fine and return a solution fast with now seemingly problems - actually I've tried many other ways of programming this simple function as well. The problem is that the NMinimize function evaluate the function in a way that causes Imaginary part of the polynomial - which is not supposed to happen if you first apply numerical values.
The code is in the attached file. Thanks for the help :)
Thank you very much!!
I figured it was the problem but could not find out how to overcome it.
It was a quick and very useful response :)
It would seem that some symbolic evaluation is taking place or at least being attempted. Not good when one is doing SVD and relying on the min singular value. You can avoid this by restricting the function [Gamma]t so that it only is defined when the second argument is explicitly a number,
\[Gamma]t[Kpt_, kpc_?NumberQ] := ...
is the way to do this (and don't forget to first clear the current definition).