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

Maxima and Minima

SOLVED
Highlighted

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. 

 

JohnRudnicki_0-1591814111040.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Maxima and Minima

HI,

 

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

 

Sheet is enclosed.

 

Regards

Terry

View solution in original post

10 REPLIES 10
Highlighted

Re: Maxima and Minima

mn.png

mx.png

Highlighted

Re: Maxima and Minima

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). 

Highlighted

Re: Maxima and Minima

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

Nothing in Mathcad will help you do that easily.

Highlighted

Re: Maxima and Minima

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.

Highlighted

Re: Maxima and Minima

 How about using Mathcads "localmax" function (from Data Analysis Extension Pack)?

Werner_E_3-1591841362898.png

 

 

 

 

Highlighted

Re: Maxima and Minima

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

Highlighted

Re: Maxima and Minima


@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

https://community.ptc.com/t5/PTC-Mathcad/Improve-localmax-results/m-p/546078/highlight/true#M179863

or

https://community.ptc.com/t5/PTC-Mathcad/Gaussian-fit-to-several-peaks/m-p/147888/highlight/true#M58...

 

Highlighted

Re: Maxima and Minima

Some functions from this package:

 

Pic_1.png

Highlighted

Re: Maxima and Minima

HI,

 

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

 

Sheet is enclosed.

 

Regards

Terry

View solution in original post

Highlighted

Re: Maxima and Minima

Clever. Thanks.

Announcements