Find system rise time with matlab

AI Thread Summary
To find the rise time of a system in MATLAB, the initial code provided is incorrect as it assumes that 10% and 90% correspond to fixed values of 0.1 and 0.9, which may not apply to all systems. For systems with step responses that do not settle at 1, such as those with negative values, this approach fails. A suggested solution is to use MATLAB's built-in function "stepinfo()" which can accurately compute rise time regardless of the system's settling value. This function simplifies the process and ensures correct calculations for various system responses. Utilizing "stepinfo()" is recommended for reliable results in determining rise time.
erezb84
Messages
43
Reaction score
0

Homework Statement


I need to find a system rise time (from 10% to 90%) using matlab.
Is this code right?

The Attempt at a Solution



Code:
sys = tf(num, den);
y= step(sys, t);
tr1 = max(find(y<0.1));
tr2 = min(find(y>0.9));
rise_time = t(tr2) - t(tr2);

Is this seems to be right?
 
Physics news on Phys.org
No. What makes you think that 10% of the rise is always 0.1 and that 90% of the rise is always 0.9? Have you considered a system whose step response settles to a negative value such as
num = [1 0 -1];
den = [1 4 6 4];
?
What if it doesn't settle to 1?
 
Yes.. You are right...
Any ideas how can i do it?
 
erezb84 said:
Yes.. You are right...
Any ideas how can i do it?

Have you tried the built-in function "stepinfo()"?

http://www.mathworks.com/help/toolbox/ident/ref/stepinfo.html
 
Back
Top