Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

RE: FindMaximum doesn't work?

  • To: mathgroup at
  • Subject: [mg47814] RE: [mg47784] FindMaximum doesn't work?
  • From: "DrBob" <drbob at>
  • Date: Tue, 27 Apr 2004 04:48:10 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Show us the code you REALLY used, or we can't help you. If test[c] is
defined the way you say in the post, it (a) has no global maximum and (b)
has no local maximum at 1.4. Even if you define it as follows, to enforce
the limits you mention, it still has no maximum at 1.4, and it doesn't have
the values at 5 and 1.4 that you show in the post. Nor is it decreasing in
c, near 2 or 5.

test[c_] /; 1.4 ? c < 6.2 :=
   ((10 - 185c + ((5^0.5)(20 + 19660c + 6641c^2))^2)(-41 - 
            134c + (5^0.5)(20 + 19660c + 6641c^2)))/(530604c)
FindMaximum[test[c], {c, 5}]
(error message)
{7.77508372302857*^10, {c -> 5.}}

FindMaximum[test[c], {c, 2}]
(error message)
{3.009388196803684*^9, {c -> 2.}}


-----Original Message-----
From: Carol Ting [mailto:suomesta at] 
To: mathgroup at
Subject: [mg47814] [mg47784] FindMaximum doesn't work?

Hi List,

I have one function which is defined only for a certain range of its
independent variable:


This function is decreasing in c so the maximum should be at 1.4. 
However, when the initial guess I give is greater than 2.6,
FindMaximum only returns the values at that point.

For example,


But when I give 


Then it works.

My program uses a While loop to generate piecewise functions (I only
put the piece containting the global maximum here).  The maximum
condition is needed to decide whether to terminate the loop so I
cannot always stop the execution and keep throwing in different

Did I do anything wrong, or is this a bug?  Thanks a lot!


  • Prev by Date: Re: bug in IntegerPart ?
  • Next by Date: Re: addition of three angular momenta
  • Previous by thread: FindMaximum doesn't work?
  • Next by thread: The unstable LinearSolve