I have the following code:
g = tf([0 0 5000],[1 200 5000]);
step(g); grid on;
S = stepinfo(step(g),'RiseTimeLimits',[0 0.632])
the figure producued by step(g) is here:
from looking at this, it is obvious that the rise time to 63.2% of the steady state output is approximately 0.04. However, the stepinfo() command says the rise time is
RiseTime: 74.6661
This number makes no sense at all. Is there something I am missing? I have used stepinfo() before and got accurate results but this has me stumped.

 채택된 답변

Star Strider
Star Strider 2020년 12월 9일

0 개 추천

From the documentation for stepinfo:
  • RiseTime — Time it takes for the response to rise from 10% to 90% of the steady-state response.
If you want the time constant τ use step with this calling syntax:
then interpolate (if necessary) to get the time constant:
g = tf([0 0 5000],[1 200 5000]);
[y,tOut] = step(g);
tau = interp1(y, tOut, exp(-0.5))
producing:
tau =
0.038246779260296
.

댓글 수: 4

Evan Hine
Evan Hine 2020년 12월 9일
thanks this makes much more sense!
As always, my pleasure!
Note that this works because the system is overdamped (or appears to be, I didn’t do the maths to analyse that in detail). If it had overshoot, it would be necessary to find the time of the (first) peak, and then use only the time and amplitude values up to that point to interpolate the time constant.
Also, a small correction:
tau = interp1(y, tOut, 1-exp(-1))
producing:
tau =
0.040550205799629
.
Paul
Paul 2020년 12월 9일
편집: Paul 2020년 12월 9일
Note that this solution assumes that the final value of the response is unity. I think that the time constant is typically taken as 63% to the steady state, whatever that steady state value may be.
Star Strider
Star Strider 2020년 12월 10일
Only in this situation. I do not intend it to generalise to all such situations.
I quote from my Comment:
Note that this works because the system is overdamped (or appears to be, I didn’t do the maths to analyse that in detail). If it had overshoot, it would be necessary to find the time of the (first) peak, and then use only the time and amplitude values up to that point to interpolate the time constant.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Paul
Paul 2020년 12월 9일

0 개 추천

The first input to stepinfo is incorrect. It should just be g
>> S = stepinfo(g,'RiseTimeLimits',[0 0.632])
S =
struct with fields:
RiseTime: 4.0539e-02
SettlingTime: 1.3999e-01
SettlingMin: 6.3697e-01
SettlingMax: 9.9839e-01
Overshoot: 0
Undershoot: 0
Peak: 9.9839e-01
PeakTime: 2.2606e-01

제품

릴리스

R2020b

질문:

2020년 12월 9일

댓글:

2020년 12월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by