File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ def damp(self):
159
159
poles = self .pole ()
160
160
161
161
if isdtime (self , strict = True ):
162
+ poles = poles .astype (complex )
162
163
splane_poles = np .log (poles )/ self .dt
163
164
else :
164
165
splane_poles = poles
Original file line number Diff line number Diff line change @@ -70,6 +70,15 @@ def test_damp(self):
70
70
np .testing .assert_almost_equal (sys_dt .damp (), expected_dt )
71
71
np .testing .assert_almost_equal (damp (sys_dt ), expected_dt )
72
72
73
+ #also check that for a discrete system with a negative real pole the damp function can extract wn and theta.
74
+ p2_zplane = - 0.2
75
+ sys_dt2 = tf (1 ,[1 ,- p2_zplane ],dt )
76
+ wn2 , zeta2 , _ = sys_dt2 .damp ()
77
+ p2 = - wn2 * zeta2 + 1j * wn2 * np .sqrt (1 - zeta2 ** 2 )
78
+ p2_zplane = np .exp (p2 * dt )
79
+ np .testing .assert_almost_equal (sys_dt2 .pole (),p2_zplane )
80
+
81
+
73
82
def test_dcgain (self ):
74
83
sys = tf (84 , [1 , 2 ])
75
84
np .testing .assert_allclose (sys .dcgain (), 42 )
You can’t perform that action at this time.
0 commit comments