Exemplo n.º 1
0
    def test_integrate_backwards4(self):
        # Create more of a curve

        x = scipy.array([0, 1, 3, 7])
        y = scipy.array([5, 3, 1, 0])
        area = ca.integrate_backwards(x, y)
        self.failUnlessEqual(list(area), list([10., 9., 5., 0.]))
Exemplo n.º 2
0
 def test_integrate_backwards_more(self):
     # square, 2 high, 2 long.
     # area of 4
     x = scipy.array([2, 2, 2])
     y = scipy.array([2, 1, 0])
     area = ca.integrate_backwards(x, y)
     self.failUnless(scipy.allclose(area[0], 4.0))
Exemplo n.º 3
0
 def test_integrate_backwards_more(self):
     # square, 2 high, 2 long.
     # area of 4
     x = scipy.array([2,2,2])
     y = scipy.array([2,1,0])
     area = ca.integrate_backwards(x, y)
     self.failUnless(scipy.allclose(area[0], 4.0))
Exemplo n.º 4
0
 def test_integrate_backwardsIII(self):
     # triangle, 2 high, 2 long.
     # on top of a square, 2 high and 2 long
     # area of 2
     x = scipy.array([2, 4])
     y = scipy.array([2, 0])
     area = ca.integrate_backwards(x, y)
     self.failUnlessEqual(area[0], 6.0)
Exemplo n.º 5
0
 def test_integrate_backwards4(self):
     # Create more of a curve
     
     x = scipy.array([0,1,3,7])
     y = scipy.array([5, 3, 1, 0])
     area = ca.integrate_backwards(x, y)
     self.failUnlessEqual(list(area),
                          list([10., 9., 5., 0.]))
Exemplo n.º 6
0
 def test_integrate_backwardsIII(self):
     # triangle, 2 high, 2 long.
     # on top of a square, 2 high and 2 long
     # area of 2
     x = scipy.array([2,4])
     y = scipy.array([2,0])
     area = ca.integrate_backwards(x, y)
     self.failUnlessEqual(area[0], 6.0)