Example #1
0
def test_quasi_singular2():
    sing_pt = 1.4
    g = lambda x: (sing_pt - x) ** -2
    exact = 1.78571
    x_nearest = 1.0
    D = sing_pt - 1.0
    N = 6
    qi = telles_quasi_singular(N, x_nearest, D)
    qx = np.array(qi.x)
    qw = np.array(qi.w)
    est = np.sum(g(qx) * qw)
    np.testing.assert_almost_equal(exact, est, 5)
Example #2
0
def test_quasi_singular():
    sing_pt = 1.004
    g = lambda x: (sing_pt - x) ** -2
    exact = 249.003984064
    x_nearest = 1.0
    D = sing_pt - 1.0
    N = 35
    qi = telles_quasi_singular(N, x_nearest, D)
    qx = np.array(qi.x)
    qw = np.array(qi.w)
    est = np.sum(g(qx) * qw)
    np.testing.assert_almost_equal(exact, est)