示例#1
0
 def test_position_CD_out_type_value_error(self):
     Ka = 50
     with self.assertRaisesRegexp(
             ValueError,
             'out_type must be: open_loop, fb_approx, or fc_exact'
     ) as cd_err:
         b, a = ss.position_CD(Ka, 'value_error')
示例#2
0
 def test_position_CD_open_loop(self):
     Ka = 50
     b, a = ss.position_CD(Ka, 'open_loop')
     b_check = np.array([318309.88618379])
     a_check = np.array([1, 1275, 31250, 0])
     npt.assert_almost_equal(b, b_check)
     npt.assert_almost_equal(a, a_check)
示例#3
0
 def test_position_CD_fb_approx(self):
     Ka = 50
     b, a = ss.position_CD(Ka, 'fb_approx')
     b_check = np.array([254.64790895])
     a_check = np.array([1., 25., 254.64790895])
     npt.assert_almost_equal(b, b_check)
     npt.assert_almost_equal(a, a_check)
示例#4
0
 def test_position_CD_fb_exact(self):
     Ka = 50
     b, a = ss.position_CD(Ka, 'fb_exact')
     b_check = np.array([318309.88618379])
     a_check = np.array(
         [1.00000000e+00, 1.27500000e+03, 3.12500000e+04, 3.18309886e+05])
     npt.assert_almost_equal(b, b_check)
     npt.assert_almost_equal(a, a_check, decimal=3)