Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


  • Prev by Date: Re: Listing the partitions of a set
  • Next by Date: Re: Listing the partitions of a set
  • Previous by thread: New fractal based on the Golden mean/ Fibonacci numbers
  • Next by thread: Another older one that is a treat : a triangular von Koch type fractal