Skip to main content
Best answer by Werner_E

So it seems the sheet does what you demand, isn't it?

I think I forgot to attach the worksheets themselves last time - here they are.

2 replies

25-Diamond I
January 21, 2013

Could you elaborate more precise what you try (cycling) between Plot 2 and Plot 3? How do you define amplitude and minimal amplitude in case of your data? The minimum delta you calculate is only from the difference max_i - min_i, but max_i-min_i+1 (going from a local max down to the next local min) could yield an even smaller result - not relevant?

And what should the resulting vectors Number/Min/Max represent?

Number seems to be a simple sequence, Max consists is the sorted vector Maximum with NaN replaced by the smallest number 12?

Anmd Min - no clue.

Connells1-VisitorAuthor
1-Visitor
January 21, 2013

Thank you for your reply, Werner.

Werner Exinger wrote:

Could you elaborate more precise what you try (cycling) between Plot 2 and Plot 3?...

I hope the following screenshot could help:

Step 1:

Step+1.JPG

Step 2:

Step+2.JPG

Step 2 with the table:

Step+2+%282%29.JPG

Step 3:

Step+3.JPG

Werner Exinger wrote:

How do you define amplitude and minimal amplitude in case of your data? The minimum delta you calculate is only from the difference max_i - min_i, but max_i-min_i+1 (going from a local max down to the next local min) could yield an even smaller result - not relevant?

Amplitude = Max - Min;

min(Amplitude) = Minimum from all set of "Amplitude".

25-Diamond I
January 21, 2013

It seems to me that at the end everytime you would arrive at two values which could have been calculated simply by max(maximum) and min(minimum) from the very beginning. Or what am I missing.

Or are you utilizing those intermediate data (the values you cut out of the graph in every step). Yes, that seems to be the point, otherwise it would be too easy.

Some more questions:

1) The cycling ends when ... see later

2) Is guaranteed that the second datapoint is greater than the first? In your file you assumed that as you assumed that the number of maxima is equal or one less than the number of minima.

3) One thing I still don't understand is, why you are interested in the difference (amplitude) of the ascending part of the graph only and not the desvending one.

As far as I understood your algorithm: You look for the ascending line segment with the smallest (vertcal) difference, put the two values in your numbered exit-table and then delete those points from the data set. If there are more than one segments with the same minimal diff you take the first. Sometimes you will have to remove the very first linesegment that way. So every time you remove one minimum and one maximum.

You iterate this until only two minima and one maximum (plus NaN) is left.!? But what, if the number of min and max is equal. When do you stop now?

You are only interested in the minimum of the ascending segment even if a descending segment would have a smaller difference (as in the following example).

Lets see if I got it right. With the data I have chosen, would the following be right or what would be the disired outcome (your routine fails on that data set, probably because the minimum is the very first segment):

example.png

Your exit table would end after line 3, does it?

I think a recursive function would do the job, but first I have to be absolutely sure what you want to achieve. On second thought - as we know the number of iterations it could be easier.

25-Diamond I
January 23, 2013

OK, the new specifications with the splitting and rearranging of the data at the first absolute extrema was easy to implement as was the adressing of the problem with sequences of equal valued data (http://communities.ptc.com/message/195434#195434). Theorde was important, first splt and rearrange, then eliminate the duplicates in series.

Have modified the routine to return for every step the rearranged and processed data and the linesegment to be discarded. Can be used for step by step graphing or making an animation (see attached).

Data_processing_5.png

1-Visitor
January 23, 2013

Nice animation, especially the way you make the blue line blink. Thanks for the screenshot which reveals how you did it - cute!

But what are we expected to see here? What's shown by that elimination process?

The outcome seems to be clear from the very beginning (highest and lowes points).

25-Diamond I
January 24, 2013

Nice animation, especially the way you make the blue line blink. Thanks for the screenshot which reveals how you did it - cute!

But what are we expected to see here? What's shown by that elimination process?

The outcome seems to be clear from the very beginning (highest and lowes points).

Thanks, never did that blinking thing before but its not that hard to come by. Find attached a slightly modified ani.

According to what the deeper sense of all that is: The animation was not part of the original posers question, just a playing around which shows the process of elimination step by step. I guess the real data this process is intended for would be far to large for an animation to make sense, but then I may be wrong. The thing the poster was after is the table created by my program which basically includes for each elimination step the values of the two removed data points.IIf you read the whole thread you will see that I myself had asked the question after the sense before. The poster was not around for a while but maybe he will reveal the secret sometime.