- Notifications
You must be signed in to change notification settings - Fork441
Closed
Labels
Description
Hi,
This is my first contribution on GitHub ;)
Problem
The methoddamp()
seems to return a wrong result for discrete systems with negative poles
import control as ctlH = ctl.tf([1],[1,0.2],1)H.damp()
Result : RuntimeWarning: invalid value encountered in log
Investigation
The problem seems to come from the type of thepoles
variable in thedamp
method of the LTI object
if isdtime(self, strict=True): splane_poles = np.log(poles)/self.dtelse: splane_poles = poleswn = absolute(splane_poles)Z = -real(splane_poles)/wnreturn wn, Z, poles
Solution
Thepoles
variable must be cast to a numpy complex type as follows
if isdtime(self, strict=True) splane_poles = np.log(poles.astype(complex))/self.dt...