예제 #1
0
 def test_case1_B22(self):
     result = isclose(B(case1_f_u_v, u=e2, v=e2),
                      -6 - 2 / 9,
                      abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #2
0
 def test_case1_E1E2(self):
     f = lambda x, u, v: -u(x) * v(x)
     result = isclose(B(f, u=e1, v=e2), -1 / 18, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #3
0
 def test_case1_B21(self):
     result = isclose(B(case1_f_u_v, u=e2, v=e1),
                      3 - 1 / 18,
                      abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #4
0
 def test_case4_l3(self):
     val = l(case4_f_x, e3, f_v=case4_f_v) - B(
         case4_f_u_v, u=case4_u_shift, v=e3)
     result = isclose(val, 1 / 6 + 1, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #5
0
 def test_case1_E1E2_primes(self):
     f = lambda x, u, v: -derivative(u, x, dx=1e-6, args=()) * derivative(
         v, x, dx=1e-6, args=())
     result = isclose(B(f, u=e1, v=e2), 3, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #6
0
 def test_case4_B33(self):
     val = B(case4_f_u_v, u=e3, v=e3, c_u_v=case4_c_u_v)
     result = isclose(val, -2 + 1 / 9, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #7
0
 def test_case4_l1(self):
     val = l(case4_f_x, e1, f_v=case4_f_v) - B(
         case4_f_u_v, u=case4_u_shift, v=e1)
     result = isclose(val, 1 / 3 - 6 - 1 / 9, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #8
0
 def test_case4_B22(self):
     result = isclose(B(case4_f_u_v, u=e2, v=e2, c_u_v=case4_c_u_v),
                      -6 + 2 / 9,
                      abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #9
0
 def test_case4_B32(self):
     result = isclose(B(case4_f_u_v, u=e3, v=e2, c_u_v=case4_c_u_v),
                      3 + 1 / 18,
                      abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #10
0
 def test_case3_B12(self):
     result = isclose(B(case3_f_u_v, u=e1, v=e2), -3, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #11
0
 def test_case4_B11(self):
     val = B(case4_f_u_v, u=e1, v=e1, c_u_v=case4_c_u_v)
     result = isclose(val, -6 + 2 / 9, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #12
0
 def test_case3_B20(self):
     result = isclose(B(case3_f_u_v, u=e2, v=e0), 0, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #13
0
 def test_case2_B10(self):
     val = B(case3_f_u_v, u=e1, v=e0)
     result = isclose(val, -3, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #14
0
 def test_case2_l2(self):
     val = l(case2_f_x, e2, f_v=lambda v: 0) - B(case2_f_u_v, u=e3, v=e2)
     result = isclose(val, 2 / 9 - 3.5, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #15
0
 def test_case2_l1(self):
     val = l(case2_f_x, e1, f_v=lambda v: 0) - B(case2_f_u_v, u=e3, v=e1)
     result = isclose(val, 1 / 9, abs_tol=EPSILON)
     self.assertIs(result, True)
예제 #16
0
 def test_case2_B11(self):
     result = isclose(B(case2_f_u_v, u=e1, v=e1), -6, abs_tol=EPSILON)
     self.assertIs(result, True)