constraints and NMinimize
- To: mathgroup at smc.vnet.net
- Subject: [mg65312] constraints and NMinimize
- From: "Ruth Lazkoz" <ruth.lazkoz at ehu.es>
- Date: Sat, 25 Mar 2006 05:17:49 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi, Let's suppose I want to minimize this function numerically f[x_, om_] := 1/Sqrt[-(om^2 - 1)(x - 1)^2/4 + x] I do NMinimize[{f[x, om], om > 0 && x > (-1 + om)/(1 + om) && x < (1 + om)/(-1 + om)}, {x, om}] so I have included constraints so that the argument of the square root in the definition of the function is always positive. However I get this error: NMinimize::nrnum: The function value 15268.5- 342.001\[ImaginaryI] is not a real number at {ol, om} = {1.69091, 0.137466}. Is there any elegant way to avoid getting this message? (Apart from swithching off that kind of messages, of course). Thanks a lot, Ruth