MathGroup Archive 2004

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

Search the Archive

Newbie question about the behavior of NMaximize

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50955] Newbie question about the behavior of NMaximize
  • From: napofrog at hotmail.com (Roger Levy)
  • Date: Wed, 29 Sep 2004 03:15:28 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

I'm confused about the behavior of NMaximize.  It appears that some
inequality constraints I am stipulating are not being obeyed; a
stipulation that 0<p4<1 is still allowing a very small negative value
of p4.  Is there something wrong with the way I'm stating inequality
constraints below?  Any help much appreciated.

Best,

Roger Levy

In[11]:= y =  5*Log[p1*q]+10*Log[p4*q]+25*Log[(p1+p2+p3)*(1-q)+p3*q]+20*Log[(p4+p5+p6)*(1-q)+p6*q]

Out[11]= 5 Log[p1 q] + 10 Log[p4 q] + 25 Log[(p1 + p2 + p3) (1 - q) +
p3 q] +

>    20 Log[(p4 + p5 + p6) (1 - q) + p6 q]

In[13]:= NMaximize[{y,0<p1<1,0<p2<1,0<p3<1,0<p4<1,0<p5<1,0<p6<1,p1+p2+p3+p4+p5+p6==1,0<q<1},{p1,p2,p3,p4,p5,p6,q}]

NMaximize::nnum:
   The function value Indeterminate is not a number at
                                                          -16
    {p1, p2, p3, p4, p5, p6, q} = {0., 0., 0., -1.11022 10   , 0., 1.,
1.}.

Out[13]= NMaximize[{5 Log[p1 q] + 10 Log[p4 q] +

>      25 Log[(p1 + p2 + p3) (1 - q) + p3 q] +

>      20 Log[(p4 + p5 + p6) (1 - q) + p6 q], 0 < p1 < 1, 0 < p2 < 1,

>     0 < p3 < 1, 0 < p4 < 1, 0 < p5 < 1, 0 < p6 < 1,

>     p1 + p2 + p3 + p4 + p5 + p6 == 1, 0 < q < 1},

>    {p1, p2, p3, p4, p5, p6, q}]


  • Prev by Date: Re: Re: trimming a string
  • Next by Date: Implicit root structures in the Mandelbrot set
  • Previous by thread: "Evaluate from top down to specific cell" Command (interface suggestion to Wolfram)
  • Next by thread: Re: Newbie question about the behavior of NMaximize