Systems that have a pole at the origin return inconsistent values:
import control as ct
sys_tf = ct.tf([1], [1, 0])
sys_ss = ct.tf2ss(sys_tf)
sys_tf(0) # returns (inf+0j) with divide by zero warning
sys_tf(0j) # returns (inf+nanj) with divide by zero warning
sys_ss(0) # LinAlgError: Singular matrix
sys_tf.dcgain() # returns array(inf)
sys_ss.dcgain() # returns array(nan)
I think all of these should return inf (or array(inf)).
If you have a pole and zero at the origin, you get nan or 1:
sys_tf = ct.tf([1, 0], [1, 0])
sys_ss = ct.tf2ss(sys_tf)
sys_tf(0) # returns (nan+0j) with invalid value warning
sys_ss(0) # returns (1+0j) [state space system is empty]
sys_tf.dcgain() # returns array(nan)
sys_ss.dcgain() # returns (1+0j) [state space system is empty]
I think all of these cases should produce nan.
I have a partial fix in a branch, but want to see what people think the "right" answer is before committing it.
Systems that have a pole at the origin return inconsistent values:
I think all of these should return
inf(orarray(inf)).If you have a pole and zero at the origin, you get
nanor 1:I think all of these cases should produce
nan.I have a partial fix in a branch, but want to see what people think the "right" answer is before committing it.