diff --git a/control/lti.py b/control/lti.py index ef5d5569a..b56c2bb44 100644 --- a/control/lti.py +++ b/control/lti.py @@ -159,7 +159,7 @@ def damp(self): poles = self.pole() if isdtime(self, strict=True): - splane_poles = np.log(poles)/self.dt + splane_poles = np.log(poles.astype(complex))/self.dt else: splane_poles = poles wn = absolute(splane_poles) diff --git a/control/tests/lti_test.py b/control/tests/lti_test.py index 9156ecb7e..7e4f0ddb4 100644 --- a/control/tests/lti_test.py +++ b/control/tests/lti_test.py @@ -70,6 +70,14 @@ def test_damp(self): np.testing.assert_almost_equal(sys_dt.damp(), expected_dt) np.testing.assert_almost_equal(damp(sys_dt), expected_dt) + #also check that for a discrete system with a negative real pole the damp function can extract wn and zeta. + p2_zplane = -0.2 + sys_dt2 = tf(1, [1, -p2_zplane], dt) + wn2, zeta2, p2 = sys_dt2.damp() + p2_splane = -wn2 * zeta2 + 1j * wn2 * np.sqrt(1 - zeta2**2) + p2_zplane = np.exp(p2_splane * dt) + np.testing.assert_almost_equal(p2, p2_zplane) + def test_dcgain(self): sys = tf(84, [1, 2]) np.testing.assert_allclose(sys.dcgain(), 42) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy