Step Response and step_info accuracy issue
See original GitHub issueHi,
I found an accuracy issue related to control.step_response and control.step_info. To be specific, the issue is in _default_response_times() function.
I have two system transfer function sys1 and sys2.They both have exactly the same frequency response.
sys1:
num1 = [1.067e+05, 5.791e+04], den1 = [10.67, 1.067e+05, 5.791e+04]
OR
k = 10000, zeros = [-0.5426], poles = [-1e+04, -0.5426 ]
sys2: num2 = [1.881e+06], den2 = [188.1, 1.881e+06] OR k = 10000, zeros = [], poles = [-1e+04, ]
As you notice, sys1 has extra pole and zero where both have the same value.
The issue
When I plot the step responses for both systems, the plots are not matched. Also when I used step_info() to get the characteristics of the systems, I got a different results.
The code:
here is the code
num1 = [1.067e+05, 5.791e+04]
den1 = [10.67, 1.067e+05, 5.791e+04]
num2 = [1.881e+06]
den2 = [188.1, 1.881e+06]
sys_1 = control.TransferFunction(num1, den1)
sys_2 = control.TransferFunction(num2, den2)
t1, y1 = control.step_response(sys_1)
t2, y2 = control.step_response(sys_2)
print(control.step_info(sys_1))
print(control.step_info(sys_2))
plt.plot(t1, y1, t2, y2)
plt.grid()
plt.show()
Test on Matlab;
I tested the two systems in Matlab. The step() function gives the same step response plot for both systems, and stepinfo() results exactly the same values for both systems.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)

Top Related StackOverflow Question
PR #454 , which incorporates @ilayn’s code seems to fix this (both step responses are perfectly overlaid):
code output:
I’ve tested for the given systems and indeed the responses are the same. The only remaining issue is when a system has Jordan blocks of significant poles but I think that is an open problem in the literature too. So with some reservation I would say it is robust but not fail-proof for every system.
Since we don’t have the commercial ODE solvers I think that would be all we can do for now via utilizing only pole-zero information.