# FindPeaks finds Minima, but not all of them [closed]

I have 10 sets of data, which are the result of measuring the way of a mass falling down over time, bringing a wheel into rotation when the mass hits the ground and then the wheel lifts the mass up again and so on. I want to determine the friction out of the procentual height-loss.

So my idea was to Import the 10 lists of data and I named them Reihe1 - Reihe10.

Now I need to find the local minima (which are the points that I need to determine the height of the mass):

peaks1 = FindPeaks[Reihe1[[All, 2]]]
peaks2 = FindPeaks[Reihe2[[All, 2]]]
peaks3 = FindPeaks[Reihe3[[All, 2]]]
peaks4 = FindPeaks[Reihe4[[All, 2]]]
peaks5 = FindPeaks[Reihe5[[All, 2]]]
peaks6 = FindPeaks[Reihe6[[All, 2]]]
peaks7 = FindPeaks[Reihe7[[All, 2]]]
peaks8 = FindPeaks[Reihe8[[All, 2]]]
peaks9 = FindPeaks[Reihe9[[All, 2]]]
peaks10 = FindPeaks[Reihe10[[All, 2]]]
ListLinePlot[Reihe1[[All, 2]],
Epilog -> {Red, PointSize[0.04], Point[peaks1]}
]
ListLinePlot[Reihe2[[All, 2]],
Epilog -> {Red, PointSize[0.04], Point[peaks2]}
]
ListLinePlot[Reihe3[[All, 2]],
Epilog -> {Red, PointSize[0.04], Point[peaks3]}
]
ListLinePlot[Reihe4[[All, 2]],
Epilog -> {Red, PointSize[0.04], Point[peaks4]}
]
ListLinePlot[Reihe5[[All, 2]],
Epilog -> {Red, PointSize[0.04], Point[peaks5]}
]
ListLinePlot[Reihe6[[All, 2]],
Epilog -> {Red, PointSize[0.04], Point[peaks6]}
]
ListLinePlot[Reihe7[[All, 2]],
Epilog -> {Red, PointSize[0.04], Point[peaks7]}
]
ListLinePlot[Reihe8[[All, 2]],
Epilog -> {Red, PointSize[0.04], Point[peaks8]}
]
ListLinePlot[Reihe9[[All, 2]],
Epilog -> {Red, PointSize[0.04], Point[peaks9]}
]
ListLinePlot[Reihe10[[All, 2]],
Epilog -> {Red, PointSize[0.04], Point[peaks10]}
]


This sometimes works:

sometimes it works only for some peaks:

sometimes it finds maxima and minima:

What I don't understand is, although the 10 data-lists are almost the same, Mathematica seems to have trouble finding those peaks. Is there a better way to find the minima?

I also wonder why this function finds the minima, although the description says it finds maxima. I guess this is why I sometimes get maxima, too.

I would also like to get the x-values for the minimax, so I can plot them together with the original data. I have, on the x-axis, the number of the value, not its time because FindPeaks gives me the y-value, but not the x-value. But what I really need is a function that extracts the y-values of those local minima.

Any suggestions?

## closed as off-topic by Michael E2, Bob Hanlon, m_goldberg, Karsten 7., Dr. belisariusApr 27 '15 at 15:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Michael E2, Bob Hanlon, m_goldberg, Karsten 7., Dr. belisarius
If this question can be reworded to fit the rules in the help center, please edit the question.

• Could you provide a sample of the data you are using? I tries with something similar but I cannot reproduce your error. Also keep in mind that FindPeaks accepts a scale parameter thus some of the peaks may be suppressed. – Batracos Mar 20 '15 at 9:19
• @Batracos Thank you, here is a link to one of the datasets link – Rudolph Mar 20 '15 at 12:02
• @Rudolph: The dataset you linked has no data in. – Mahdi Mar 22 '15 at 22:08
• FindPeaks finds maxima, not minima. Are you sure you are showing the actual code you used? – bbgodfrey Apr 27 '15 at 3:10