NMaximize woes

*To*: mathgroup at smc.vnet.net*Subject*: [mg51800] NMaximize woes*From*: "Nix N. Nix" <nix at shaw.ca>*Date*: Tue, 2 Nov 2004 02:05:51 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Hi! I have a function called FindQuality that takes two real parameters and outputs a real value. It is a very complicated set of loops, and it includes an integral which cannot be evaluated analytically (thus, NIntegrate is used). Unfortunately, when I try to call NMaximize[{FindQuality[x,y],GStart<=x<=GEnd,CStart<=y<=CEnd},{x,y}] I get - NIntegrate::inum: Integrand T1[Enr] T2[Enr,(0. y)/(x^2)] Log[(1+e^((U-Enr)/(k_b*T)))/(1+e^((U-Enr-e*V)/(k_b*T)))] is not numerical at {Enr} = {4.69691*10^-19} until the errors are forced to stop. I set the first line of FindQuality to print out its parameters, and, when calling it, the two values(?) printed are "x" and "y". Why doesn't NMaximize call FindQuality with floating point values ? Why does it pass symbols to the function ? As you can see, "x" and "y" eventually end up in the integrand, so it's no surprise that the integrand is not numerical, right ? If I call NMaximize and my function prints out its parameters, shouldn't it end up printing out real numbers rather than symbol names ?