Esempio n. 1
0
    def test_TrefethenCC_d3(self):
        """Test for Trefethen - Sausage Clenshaw Curtis and parameter d=3."""
        grid = TrefethenCC(10, 3)

        tmp = ClenshawCurtis(10)

        new_points = _g3(tmp.points)
        new_weights = _derg3(tmp.points) * tmp.weights

        assert_allclose(grid.points, new_points)
        assert_allclose(grid.weights, new_weights)
Esempio n. 2
0
    def test_TrefethenGC2_d3(self):
        """Test for Trefethen - Sausage GaussChebyshev2 and parameter d=3."""
        grid = TrefethenGC2(10, 3)

        tmp = GaussChebyshevType2(10)

        new_points = _g3(tmp.points)
        new_weights = _derg3(tmp.points) * tmp.weights

        assert_allclose(grid.points, new_points)
        assert_allclose(grid.weights, new_weights)
Esempio n. 3
0
    def test_AuxiliarTrefethenSausage(self):
        """Test for Auxiliary functions using in Trefethen Sausage."""
        xref = np.array([-1.0, 0.0, 1.0])
        d2ref = np.array([1.5100671140939597, 0.8053691275167785, 1.5100671140939597])
        d3ref = np.array([1.869031249411366, 0.7594793648401741, 1.869031249411366])
        newxg2 = _g2(xref)
        newxg3 = _g3(xref)
        newd2 = _derg2(xref)
        newd3 = _derg3(xref)

        assert_allclose(xref, newxg2)
        assert_allclose(xref, newxg3)
        assert_allclose(d2ref, newd2)
        assert_allclose(d3ref, newd3)