I have an messy expression and want to apply NMinimize to it, have no idea how to force NMinimize to ignore the singularities it complains about.
The code:
diff=973829./(Sqrt[1-E^(-NN^x2 x1)] NN)^(1/3)-2.35655*10^6 Sqrt[(1+(4.4289 (1-E^(-NN^x2 x1)) (-1+Log[(1+Sqrt[1-1. (1-E^(-NN^x2 x1))])/(1-Sqrt[1-1. (1-E^(-NN^x2 x1))])]/(2 Sqrt[1-1. (1-E^(-NN^x2 x1))])))/(1-1. (1-E^(-NN^x2 x1))))/NN]; objective = Sum[N[diff]^2, {NN, 1, 20}]; ParamNSQ=NMinimize[{objective,x1>0,x1<20,x2>0,x2<10},{x1,x2}]; It works for the restrictions {x1>0,x1<2,x2>0,x2<1}, but for {x1>0,x1<20,x2>0,x2<10} it returns errors.

