calculating the time constant

조회 수: 52 (최근 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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by