| Author |
Comment/Response |
Forum Moderator
email me
 |
07/14/12 1:27pm
Maximize is designed for smooth, polynomial expressions. I tried NMaximize with the same arguments and it found the same local maximum.
Often a different Method works better.
In[44]:= NMaximize[{int[\[Kappa]02], 0 < \[Kappa]02 < 1.5}, \[Kappa]02,
Method -> "SimulatedAnnealing"]
Out[44]= {0.126127, {\[Kappa]02 -> 0.203592}}
In[43]:= NMaximize[{int[\[Kappa]02], 0 < \[Kappa]02 < 1.5}, \[Kappa]02,
Method -> "RandomSearch"]
Out[43]= {0.126127, {\[Kappa]02 -> 0.203592}}
A simple way to find a maximum in a list (or good starting point for NMaximize or FindMaximum) is to find the location of largest value in the list.
In[37]:= maxY = Max[ ptdata[[All, 2]] ]
Out[37]= 0.126127
In[40]:= Position[ptdata, maxY]
Out[40]= {{205, 2}}
In[41]:= Extract[ptdata, 205]
Out[41]= {0.204, 0.126127}
Attachment: 25032aMaximum.nb, URL: , |
|