cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

13-Aquamarine

## Maxima and Minima

I have a series of plots similar to the one below with multiple peaks and troughs. I want to get the values of the peaks and troughs and their x coordinate. The only way I can think to do it is to use max to find the value of the biggest peak, remove that section of data, find the next and so on. This is tedious and I have many to do. There must be a better way. Can someone show me what it is. Worksheet is attached.

1 ACCEPTED SOLUTION

Accepted Solutions
20-Turquoise
(To:JohnRudnicki)

HI,

If you do not have the data extension pack you can resolve the minimum and maximum.

Sheet is enclosed.

Regards

Terry

10 REPLIES 10
24-Ruby III
(To:JohnRudnicki)

13-Aquamarine
(To:ValeryOchkov)

Thanks for your reply, Valery. Probably my question was not clear. In addition to the value and position of the highest peak (and lowest trough), I want to get the maximum and minimum values of all the peaks and troughs (i.e., four of each in the example shown).

12-Amethyst
(To:JohnRudnicki)

The better way is to use the FindPeaks function in Maple or the findpeaks function in Matlab.

Well, the slope changes sign at each max or min.  So if you calculate local slopes or derivatives you could step through and look for sign changes.  This wouldn't work well with noisy data, but if your data is well behaved you might get ok results.

24-Ruby V
(To:JohnRudnicki)

13-Aquamarine
(To:Werner_E)

Nice. Unfortunately, I do not have the Data Analysis Extension Pack.

24-Ruby V
(To:JohnRudnicki)

@JohnRudnicki wrote:

Nice. Unfortunately, I do not have the Data Analysis Extension Pack.

As far as I know the DAEP is part of every Mathcad distribution since MC14, apart from some single user edu licences, where the pack and its help is also installed during installation but the license for it is missing. In Prime its integrated anyway. Did you give it a try?

But in case you are using an older version of MC (from the pic you posted it looked like MC14 or MC15 anyway) or have a version without a license for the DAEP, its not hard to recode those functions. You will find examples how to do here in the forum, as an example

or

24-Ruby II
(To:JohnRudnicki)

Some functions from this package:

20-Turquoise
(To:JohnRudnicki)

HI,

If you do not have the data extension pack you can resolve the minimum and maximum.

Sheet is enclosed.

Regards

Terry

13-Aquamarine
(To:terryhendicott)

Clever. Thanks.

Announcements