Mathematica Mathematica Question: Finding local maximums

  • Thread starter Thread starter dreiter
  • Start date Start date
  • Tags Tags
    Local Mathematica
AI Thread Summary
To find multiple peaks in a graph generated by an interpolating function in Mathematica, the user is seeking a method to identify all 10 peaks instead of just one using FindMaximum. The proposed solution involves using the Union function combined with a Table to iterate over a range of initial values (xInit) within specified limits (xMin, xMax) and step size (xStep). This approach aims to capture all local maxima by starting the search from various initial points across the interval. The discussion emphasizes the need for an effective strategy to ensure that all peaks are detected in the sinusoidal-like graph.
dreiter
Messages
33
Reaction score
0
Hi all! This is a generic Mathematica question, which hopefully someone can help me with! :)

I have a set of data points.
I have an interpolating function from those points.
I have a graph of that interpolation function.

The graph goes like Sin^2, and has about 10 peaks. I want to have Mathematica find those 10 peaks. FindMaximum only finds 1 peak. How can I get it to find all 10?
 
Last edited:
Physics news on Phys.org
I would use:

Union[Table[FindMaximum[f[x], {x, xInit}], {xInit, xMin, xMax, xStep}]]
 

Similar threads

Replies
4
Views
1K
Replies
5
Views
3K
Replies
2
Views
2K
Replies
4
Views
2K
Replies
18
Views
4K
Replies
13
Views
2K
Replies
1
Views
2K
Back
Top