How to find the settling time

Hi,
Below is my time series data, and I want to find the settling time of each variable, column1 is time, column2~4 are my variables.
Criterion is: if standard deviation >=0.05 then it is called a change, want to catch where the data change is >=0.05(Stdev) and keep stable, then it is called settling time.
For example: v2 change twice and settled at two time (5sec & 15sec), where as v1 only settled at 7sec.
My definition of change: change from 0 to a constant value. v1 changed from 0 to 1 at 7sec, and keep very stable near 1.
Time v1 v2 v3
1 0 0 0
2 0 0 0
3 0 0 0
4 0 0 0
5 0 1 1
6 0 1 1
7 1 1 1
8 0.989 1 1
9 0.979 1 1
10 0.988 1 1
11 0.999 0 0
12 1 0 0
13 1 0 0
14 1 0 0
15 1 1 0
16 1 1 0
17 1 1 0
18 1 1 0
19 1 1 1
20 1 1 1
21 1 1 1
22 1 1 1
23 1 1 1
24 1 1 1
25 1 1 1
26 1 1 1
27 1 1 1
28 1 1 1
29 1 1 1
I open to welcome if any other method to catch the settling time(s). Some variables change twice or thrice.
My desired output:
v1 7
v2 5 15
v3 5 19

Answers (1)

SetTimeV1=find(diff(v1)>0.05)+1
SetTimeV2=find(diff(v2)>0.05)+1
SetTimeV3=find(diff(v3)>0.05)+1

4 Comments

Sir,
It works, can I ask little more, Now, I only considered the data settling based on just one point. Suppose, the above result is changed point, and if the diff from change point & consecutive 3points is equal, then I say it is settled. In the below data, The data changed at 5seconds, but change is just one point, and it does not keep stable for 3 consecutive points(6,7,8) it again changed at 8seconds, then keep stable upto 12 (9,10,11), then I considered as settled.
1 0
2 0
3 0
4 0
5 1
6 0
7 0
8 1
9 1
10 1
11 1
12 1
13 0
14 0
15 0
16 0
17 0
18 0
19 1
20 1
21 1
22 1
23 1
24 1
25 1
26 1
27 1
28 1
29 1
Desired output:
8
13
19
Assume your second column is v:
ind=find(diff(v)~=0)+1;
ind(diff(ind)<3)=[]
Sir,
Its fine, one more thing I just seek your help, how do I know the order of variables settling time(meaning: The order of variables setting). Suppose variable3 (v3) settle first and variable1(v1) settled and then the last variable to settling is variable2 (v2).
Do you mean that, your desired output can come as
19 8 13
instead of
8 13 19
?

Sign in to comment.

Categories

Find more on Data Acquisition Toolbox in Help Center and File Exchange

Asked:

on 6 Dec 2017

Commented:

on 11 Dec 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!