예제 #1
0
 def test_1(self):
     for n in [64,100,125,4000]:
         x = arange(n)*2*pi/n
         for m in range(5,15):
             assert_array_almost_equal(diff(sin(x),m=m),cos(x))
예제 #2
0
 def test_3(self):
     for n in [64,100,125,4000]:
         x = arange(n)*2*pi/n
         for m in range(7,15):
             assert_array_almost_equal(diff(sin(x),k=3,m=m)/n,-cos(x)/n)
예제 #3
0
 def test_4(self):
     for n in [64,100,125,200,2000]:
         x = arange(n)*2*pi/n
         for m in range(10,15):
             assert_array_almost_equal(diff(sin(x),k=4,m=m)/n,sin(x)/n)
예제 #4
0
 def test_2(self):
     for n in [64,100,125,4000]:
         x = arange(n)*2*pi/n
         for m in range(8,15)+[6]:
             assert_array_almost_equal(diff(sin(x),k=2,m=m),-sin(x))