This method works somewhat like the stepinfo function in matlab for calculating the % overshoot, rise time, and settling time.
Pass in the output of the matlab.step() method.
def step_info(t,yout): print "OS: %f%s"%((yout.max()/yout[-1]-1)*100,'%') print "Tr: %fs"%(t[next(i for i in range(0,len(yout)-1) if yout[i]>yout[-1]*.90)]-t[0]) print "Ts: %fs"%(t[next(len(yout)-i for i in range(2,len(yout)-1) if abs(yout[-i]/yout[-1])>1.02)]-t[0])
Log in to post a comment.
This method works somewhat like the stepinfo function in matlab for calculating the % overshoot, rise time, and settling time.
Pass in the output of the matlab.step() method.