comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » How can I find Max and Mins of array by seeing which point's derivative is closest to 0
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
How can I find Max and Mins of array by seeing which point's derivative is closest to 0 [message #61602] Tue, 22 July 2008 11:27
lukedimperio is currently offline  lukedimperio
Messages: 1
Registered: July 2008
Junior Member
Fellow programmers,

I have produce several ~ shaped plots in IDL and would like to
find the Max and Min of the crest and trough respectively. Yet, the
points of the ~ reach above and below the tops and bottoms of the
curves trough and crest. So I thought I would locate them by find
where the derivative of the curve equalled zero, right? Yet, it was an
array so the wasn't an exact 0. So, I figured I would attempt to find
the minimum of all the positive array slopes(derivatives) and this
would be a point right after a minimum or before a maximum. Or you
could do it by finding the maximum of all the negative array slopes
and that would correspond to a point just before a minimum or right
after a maximum. It didn't really matter if I was off by one point
because there were so many points in the array. Here's the fun part
though; I tried several different lines of codes mostly include where
commands finding each time the max and min would be at the end and NOT
at the top of the crest or bottom of the trough like I wanted them to
be!

In case the squiggles aren't visible enough the plot is a fit by a 3rd
order polynomial, sort of like a sideways s. Not really this S though
because doesn't really look like a function.

Anyway, please help and please feel free to email me
lukedimperio@yahoo.com

Luke D'Imperio
SUNY Oneonta

P.S. I'm getting suspicious of a invisible zero at the beginning of
the curve. Don't let it bother you too much though.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: protect our programs from others
Next Topic: Re: How can I find Max and Mins of array by seeing which point's derivative is closest to 0

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 19:07:40 PDT 2025

Total time taken to generate the page: 1.35935 seconds