0

I have a vector, sigma=[s1, s2, s3, s4, s5, s6, s7], which is plotted in a cycle loading:

cycle load
Fig. Cycle Load

I've seen few methods solving this problem but unfortunately not for MATLAB yet.

How do I identify turning points?
How do I identify non-turning points? (s2,s6)

Sardar Usama
  • 19,536
  • 9
  • 36
  • 58
jdoubleu
  • 73
  • 5
  • Ok so my cycle loading is now transformed and i'll always get a vector with the following style: `sigma=[0,0,0,k,-k,k,0,k,-k]`. As you can see it has only zeros in it and the same parameter positiv and negativ. Is there a new way/better way to define turningpoints? – jdoubleu Nov 12 '16 at 17:02

1 Answers1

2

I am assuming some sigma values which will look similar to what you have plotted. Notice the extra zero in the beginning, that is not labelled in your plot but from the plot it looks like it is a data point:

>> sigma = [0 3 -1 -3 1 -2 0.5 3.5]
>> sign(diff(sigma))

ans =

     1    -1    -1     1    -1     1     1

This tells me where sigma is increasing and where it is decreasing, if we take a diff once more where the diff values will be zero will be non turning points and non zero would be turning points

>> diff(sign(diff(sigma)))

ans =

    -2     0     2    -2     2     0

The 1st element corresponds to the 1st point in your plot (not the 1st value of sigma in my array). -ve values indicate concave and +ve indicate convex turning points. Notice how this result only has six elements for seven points, that is because the seventh point is indeterminate.

>>turning = find(diff(sign(diff(sigma)))) 
>>nonTurningIdx = find(diff(sign(diff(sigma))) == 0)

turning =

     1     3     4     5


nonTurningIdx =

     2     6
Some Guy
  • 1,787
  • 11
  • 15
  • Thanks alot some Guy!! Is it right that every cycle loading starts with a zero? – jdoubleu Nov 12 '16 at 14:39
  • Do I have to check that my array always starts with a zero? in case its not because of the imput form, do I have to add a zero at the beginning of the array so that your code works? – jdoubleu Nov 12 '16 at 16:42
  • Like what if i put a vector `sigma=[0,0,1]`. sigma(1) is not a turning point but sigma(2) – jdoubleu Nov 12 '16 at 16:44
  • I added a zero just because from your plot it looked like zero was a data point. In fact if the zero is not in data the point labeled 1 in your plot will be indeterminate, meaning one cannot say if it is turning or non turning (since there is no point before it). To add zero or not is totally on you as only you know if it is logical to do it. For sigma = [0, 0, 1] sigma(2) is a turning point and that is what the algorithm indicates when you execute it. – Some Guy Nov 13 '16 at 02:19