I have a FindMinimum task that I described in an earlier post. One of the suggestions to make the minimization algorithm work was to try to scale the input variables so they are closer. One of the options I have is to use a Log10 function to change distances into magnitudes. However, the combination of the two input variables leads to many values that are imaginary. The function
FindMinimum[{chiSquared[t1, a0]]}, {{t1, 1*^16}, {a0, 1*^-14}}]
fails with the message
The function value {7.98991 (8.29281 -2.17147 Log[-1.61233*10^-20 (-3005.38+Times[<<2>>])]),6.6395 (8.40948 -2.17147 Log[-1.61233*10^-20 (-3005.38+Times[<<2>>])]),6.93242 (8.47922 -2.17147 Log[-1.61153*10^-20 (-3306.73+Times[<<2>>])]),6.96657 (8.57934 -2.17147 Log[-1.61153*10^-20 (-3306.73+Times[<<2>>])]),<<44>>,7.28976 (10.1836 -2.17147 Log[-1.60197*10^-20 (-6934.41+Times[<<2>>])]),7.52241 (10.2498 -2.17147 Log[-1.60197*10^-20 (-6934.41+Times[<<2>>])]),<<426>>} is not a list of real numbers with dimensions {476} at {Subscript[t, 1],Subscript[a, [Placeholder]]} = {1.,1.}. >> >>
Is there a way to tell the FindMinimum function to ignore results that are imaginary?
Re[]
? $\endgroup$FindMinimum[{chiSquared[Subscript[t, 1], Subscript[a, 0]]}, {{Subscript[t, 1], 1*^16}, {Subscript[a, 0], 1*^-14}}]
works fine and produces the same result asFindMinimum[{chiSquared[t1, a0]}, {{t1, 1*^16}, {a0, 1*^-14}}]
for me. $\endgroup$