- Notifications
You must be signed in to change notification settings - Fork441
Description
Hi,
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.