calculating the time constant

53 ビュー (過去 30 日間)
Hassan
Hassan 2012 年 10 月 13 日
I have a vector represent a step change, and I want to calculate the time constant of it, "the time it takes to reach 63%". the vector that represent the step change is as below:
y = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0001 0.0006 0.0029 0.0108 0.0266 0.0583 0.1212 0.2361 0.3877 0.5089 0.6059 0.6833 0.7453 0.7948 0.8343 0.8660 0.8913 0.9115 0.9276 0.9405 0.9509 0.9591 0.9657 0.9710 0.9752 0.9786 0.9813 0.9834 0.9851 0.9865 0.9876 0.9885 0.9892 0.9898 0.9902 0.9906 0.9909 0.9911 0.9913 0.9914 0.9915 0.9916 0.9917 0.9918 0.9918 0.9918 0.9919 0.9919 0.9919 0.9919 0.9920 0.9920
if you made a plot to the Y vector in the matlab it will give you step function from 0 to 0.9405, I just want to calculate the time it takes to reach 0.63 from the step, which by eye can be detrmind at aprox. 27
I need a formula to calculate it automatically please advise
  2 件のコメント
Walter Roberson
Walter Roberson 2012 年 10 月 13 日
Please examine the guide to tags and retag this question; see http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 13 日
You mean 63% from the y(end)

サインインしてコメントする。

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 13 日
編集済み: Azzi Abdelmalek 2012 年 10 月 13 日
yi=y(end)
idx=max(find(abs(y-yi)>=0.37*yi))
% idx the corresponding index
  1 件のコメント
Hassan
Hassan 2012 年 10 月 14 日
Thanks alot Azzi, It really worked very well... Appreciating all your efforts.

サインインしてコメントする。

その他の回答 (1 件)

Ákos
Ákos 2013 年 2 月 18 日
Hi!
I have an input and an output vector, for example:
in=[0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1]
out=[0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 2; 12; 17; 20; 21; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22]
If you want to see it in a figure, type the following code to the Command Window:
in=[0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1];
out=[0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 2; 12; 17; 20; 21; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22; 22];
x=(1:1:30);
plot(x,in,'red')
hold
plot(x,out,'blue')
hold
I would like to determinate the delay and the time constant. I have System Identification Toolbox, and I can determinate the delay in GUI mode (Td=2.864), but I would like to determinate it in a matlab script. Which functions have to use, and how? Maybe I have to use the delayest function, but it doesn't works in this way:
DATA=iddata(out,in,0.1)
delayest(DATA)
The result is 0.
So I think this is not the right way. Can somebody write me an example to this two vector?
Thanks in advance!
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 18 日
Ákos, This is expected to be an answer. If you want to get more chance to have an answer, post a new question.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by