Ejemplo n.º 1
0
 def setUp(self):
     num = np.poly([3, 0.3, 1])
     den = np.poly([2, 0.5, .25])
     H = (num, den)
     tstr1 = empty()
     (tstr1.form, tstr1.num, tstr1.den) = ('coeff', num, den)
     tstr2 = empty()
     tstr2.form = 'zp'
     (tstr2.zeros, tstr2.poles, tstr2.gain) = tf2zpk(num, den)
     z = np.exp(1j * np.linspace(0, 2*np.pi, num=129, endpoint=True))
     self.h1 = ds.evalTF(tstr1, z)
     self.h2 = ds.evalTF(tstr2, z)
     self.h3 = ds.evalTF(H, z)
     self.h4 = ds.evalTF(lti(tstr2.zeros, tstr2.poles, tstr2.gain), z)
     h5tf = lti(tstr2.zeros, tstr2.poles, tstr2.gain).to_ss()
     self.h5 = ds.evalTF((h5tf.A, h5tf.B, h5tf.C, h5tf.D), z)
     h6tf = np.vstack((np.hstack((h5tf.A, h5tf.B)),
                       np.hstack((h5tf.C, np.atleast_2d(h5tf.D)))))
     self.h6 = ds.evalTF(h6tf, z)
Ejemplo n.º 2
0
 def setUp(self):
     num = np.poly([3, 0.3, 1])
     den = np.poly([2, 0.5, .25])
     H = (num, den)
     tstr1 = empty()
     (tstr1.form, tstr1.num, tstr1.den) = ('coeff', num, den)
     tstr2 = empty()
     tstr2.form = 'zp'
     (tstr2.zeros, tstr2.poles, tstr2.gain) = tf2zpk(num, den)
     z = np.exp(1j * np.linspace(0, 2*np.pi, num=129, endpoint=True))
     self.h1 = ds.evalTF(tstr1, z)
     self.h2 = ds.evalTF(tstr2, z)
     self.h3 = ds.evalTF(H, z)
     self.h4 = ds.evalTF(lti(tstr2.zeros, tstr2.poles, tstr2.gain), z)
     h5tf = lti(tstr2.zeros, tstr2.poles, tstr2.gain)
     self.h5 = ds.evalTF((h5tf.A, h5tf.B, h5tf.C, h5tf.D), z)
     h6tf = np.vstack((np.hstack((h5tf.A, h5tf.B)),
                       np.hstack((h5tf.C, np.atleast_2d(h5tf.D)))))
     self.h6 = ds.evalTF(h6tf, z)
Ejemplo n.º 3
0
 def test_evalTF_sixth(self):
     """Test unknown forms error"""
     with self.assertRaises(TypeError):
         ds.evalTF(empty(), [1, 2, 3])
Ejemplo n.º 4
0
 def test_evalTF_sixth(self):
     """Test unknown forms error"""
     ds.evalTF(empty(), [1, 2, 3])
Ejemplo n.º 5
0
 def test_evalTF_sixth(self):
     """Test unknown forms error"""
     ds.evalTF(empty(), [1, 2, 3])