# FindMinimum giving erroneous value?

Posted 4 months ago
741 Views
|
4 Replies
|
2 Total Likes
|
 Hello everyone,I have an ODE (y3) for which I am trying to find the minimum that occurs after the first maximum. To do this, I am hoping to use FindMaximum to find the time (T) at which the first maximum occurs and subsequently use FindMinimum to find the minimum that occurs after time T. When I try this, however, I receive a value that is far from the true value (as indicated by a plot of the ODE). Is there a way to fix this problem or should I resort to another method of finding the minimum--one not involving the function FindMinimum? I have seen other methods recommended on this forum but I am hoping to achieve this goal with FindMinimum if possible.If FindMinimum is not the optimal approach to this problem, what is?Any help or recommendations would be greatly appreciated!Alex Attachments: Answer
4 Replies
Sort By:
Posted 4 months ago
 Hi Alex,From the documentation FindMinimum[f,{x,Subscript[x, 0],Subscript[x, 1]}] searches for a local minimum in f using Subscript[x, 0] and Subscript[x, 1] as the first two values of x, avoiding the use of derivatives. Not sure why you are using {t, tMax, K*100}, K*100 = 100,000 which is way too large. This gives the right answer FindMinimum[y3, {t, tMax + 0.1}] (* {17.9542, {t -> 56.8603}} *) or FindMinimum[y3, {t, tMax, tMax + 1}] If the solution has high frequency oscillations it is possible that FindMinimum can miss the next minimum depending on the x0, x1 values used. Answer
Posted 4 months ago
 Ah I see now; I misread the documentation for FindMinimum. I thought x0 and x1 comprised the interval over which we wanted to find a minimum. Thank you for the help!Alex Answer
Posted 4 months ago
 Your method works really nicely for values of g that are sufficiently large, but, for low values of g, I only acquire the minimum if I use {t, tMax, K*100} for NDSolve (as seen in the attached notebook). Is there a way around this problem? I am hoping to eventually plot YMin[g] function, so if I can get it to run for any value of g that would be ideal. Any suggestions would be greatly appreciated!Alex Attachments: Answer
Posted 4 months ago
 The problem is that for g = 0.093 there is no gradient sign change in the domain of the y3 solution so the tMax returned by FindMaximum is 2.2518*10^15 which is way outside the domain. Plot[y3, {t, 0, 5000}]  Answer