FindMaximum doesn't work?
- To: mathgroup at smc.vnet.net
- Subject: [mg47784] FindMaximum doesn't work?
- From: suomesta at yahoo.com (Carol Ting)
- Date: Mon, 26 Apr 2004 02:42:03 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hi List, I have one function which is defined only for a certain range of its independent variable: test[c_]:=((10-185c+((5^0.5)(20+19660c+6641c^2))^2)(-41-134c+(5^0.5)(20+19660c+6641c^2)))/(530604c) 1.4<=c<6.2 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, In[57]:=FindMaximum[test[c],{c,5}] Out[57]:={-0.895005,{c->5.}} But when I give In[58]:=FindMaximum[test[c],{c,2}] Out[58]:={2.09973,{c->1.4}} 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 guesses. Did I do anything wrong, or is this a bug? Thanks a lot! Carol