sparse_grid_composite_test 21-Mar-2019 09:35:43 sparse_grid_composite_test MATLAB version. Test sparse_grid_composite. SPARSE_GRID_COMPOSITE_TEST01 SPARSE_GRID_COMPOSITE_SIZE returns the number of distinct points in a composite sparse grid. Each sparse grid is of spatial dimension DIM, and is made up of all product grids of levels up to LEVEL_MAX. DIM: 1 2 3 4 5 6 LEVEL_MAX 0 1 1 1 1 1 1 1 3 5 7 9 11 13 2 5 13 25 41 61 85 3 9 29 69 137 241 389 4 17 65 177 401 801 1457 5 33 145 441 1105 2433 4865 SPARSE_GRID_COMPOSITE_TEST01 SPARSE_GRID_COMPOSITE_SIZE returns the number of distinct points in a composite sparse grid. Each sparse grid is of spatial dimension DIM, and is made up of all product grids of levels up to LEVEL_MAX. DIM: 6 7 8 9 10 LEVEL_MAX 0 1 1 1 1 1 1 13 15 17 19 21 2 85 113 145 181 221 3 389 589 849 1177 1581 4 1457 2465 3937 6001 8801 SPARSE_GRID_COMPOSITE_TEST01 SPARSE_GRID_COMPOSITE_SIZE returns the number of distinct points in a composite sparse grid. Each sparse grid is of spatial dimension DIM, and is made up of all product grids of levels up to LEVEL_MAX. DIM: 100 LEVEL_MAX 0 1 1 201 SPARSE_GRID_COMPOSITE_TEST02: SPARSE_GRID_COMPOSITE_INDEX returns all grid indexes whose level value satisfies 0 <= LEVEL <= LEVEL_MAX. Here, LEVEL is the sum of the levels of the 1D rules, and the order of the rule is 2**LEVEL + 1. LEVEL_MAX = 3 Spatial dimension DIM_NUM = 2 Number of unique points in the grid = 29 Grid index: 1 4 4 2 0 4 3 8 4 4 4 0 5 4 8 6 2 4 7 6 4 8 0 0 9 8 0 10 0 8 11 8 8 12 4 2 13 4 6 14 1 4 15 3 4 16 5 4 17 7 4 18 2 0 19 6 0 20 2 8 21 6 8 22 0 2 23 8 2 24 0 6 25 8 6 26 4 1 27 4 3 28 4 5 29 4 7 SPARSE_GRID_COMPOSITE_TEST02: SPARSE_GRID_COMPOSITE_INDEX returns all grid indexes whose level value satisfies 0 <= LEVEL <= LEVEL_MAX. Here, LEVEL is the sum of the levels of the 1D rules, and the order of the rule is 2**LEVEL + 1. LEVEL_MAX = 4 Spatial dimension DIM_NUM = 2 Number of unique points in the grid = 65 Grid index: 1 8 8 2 0 8 3 16 8 4 8 0 5 8 16 6 4 8 7 12 8 8 0 0 9 16 0 10 0 16 11 16 16 12 8 4 13 8 12 14 2 8 15 6 8 16 10 8 17 14 8 18 4 0 19 12 0 20 4 16 21 12 16 22 0 4 23 16 4 24 0 12 25 16 12 26 8 2 27 8 6 28 8 10 29 8 14 30 1 8 31 3 8 32 5 8 33 7 8 34 9 8 35 11 8 36 13 8 37 15 8 38 2 0 39 6 0 40 10 0 41 14 0 42 2 16 43 6 16 44 10 16 45 14 16 46 4 4 47 12 4 48 4 12 49 12 12 50 0 2 51 16 2 52 0 6 53 16 6 54 0 10 55 16 10 56 0 14 57 16 14 58 8 1 59 8 3 60 8 5 61 8 7 62 8 9 63 8 11 64 8 13 65 8 15 SPARSE_GRID_COMPOSITE_TEST02: SPARSE_GRID_COMPOSITE_INDEX returns all grid indexes whose level value satisfies 0 <= LEVEL <= LEVEL_MAX. Here, LEVEL is the sum of the levels of the 1D rules, and the order of the rule is 2**LEVEL + 1. LEVEL_MAX = 0 Spatial dimension DIM_NUM = 3 Number of unique points in the grid = 1 Grid index: 1 0 0 0 SPARSE_GRID_COMPOSITE_TEST02: SPARSE_GRID_COMPOSITE_INDEX returns all grid indexes whose level value satisfies 0 <= LEVEL <= LEVEL_MAX. Here, LEVEL is the sum of the levels of the 1D rules, and the order of the rule is 2**LEVEL + 1. LEVEL_MAX = 2 Spatial dimension DIM_NUM = 3 Number of unique points in the grid = 25 Grid index: 1 2 2 2 2 0 2 2 3 4 2 2 4 2 0 2 5 2 4 2 6 2 2 0 7 2 2 4 8 1 2 2 9 3 2 2 10 0 0 2 11 4 0 2 12 0 4 2 13 4 4 2 14 2 1 2 15 2 3 2 16 0 2 0 17 4 2 0 18 0 2 4 19 4 2 4 20 2 0 0 21 2 4 0 22 2 0 4 23 2 4 4 24 2 2 1 25 2 2 3 SPARSE_GRID_COMPOSITE_TEST02: SPARSE_GRID_COMPOSITE_INDEX returns all grid indexes whose level value satisfies 0 <= LEVEL <= LEVEL_MAX. Here, LEVEL is the sum of the levels of the 1D rules, and the order of the rule is 2**LEVEL + 1. LEVEL_MAX = 2 Spatial dimension DIM_NUM = 6 Number of unique points in the grid = 85 Grid index: 1 2 2 2 2 2 2 2 0 2 2 2 2 2 3 4 2 2 2 2 2 4 2 0 2 2 2 2 5 2 4 2 2 2 2 6 2 2 0 2 2 2 7 2 2 4 2 2 2 8 2 2 2 0 2 2 9 2 2 2 4 2 2 10 2 2 2 2 0 2 11 2 2 2 2 4 2 12 2 2 2 2 2 0 13 2 2 2 2 2 4 14 1 2 2 2 2 2 15 3 2 2 2 2 2 16 0 0 2 2 2 2 17 4 0 2 2 2 2 18 0 4 2 2 2 2 19 4 4 2 2 2 2 20 2 1 2 2 2 2 21 2 3 2 2 2 2 22 0 2 0 2 2 2 23 4 2 0 2 2 2 24 0 2 4 2 2 2 25 4 2 4 2 2 2 26 2 0 0 2 2 2 27 2 4 0 2 2 2 28 2 0 4 2 2 2 29 2 4 4 2 2 2 30 2 2 1 2 2 2 31 2 2 3 2 2 2 32 0 2 2 0 2 2 33 4 2 2 0 2 2 34 0 2 2 4 2 2 35 4 2 2 4 2 2 36 2 0 2 0 2 2 37 2 4 2 0 2 2 38 2 0 2 4 2 2 39 2 4 2 4 2 2 40 2 2 0 0 2 2 41 2 2 4 0 2 2 42 2 2 0 4 2 2 43 2 2 4 4 2 2 44 2 2 2 1 2 2 45 2 2 2 3 2 2 46 0 2 2 2 0 2 47 4 2 2 2 0 2 48 0 2 2 2 4 2 49 4 2 2 2 4 2 50 2 0 2 2 0 2 51 2 4 2 2 0 2 52 2 0 2 2 4 2 53 2 4 2 2 4 2 54 2 2 0 2 0 2 55 2 2 4 2 0 2 56 2 2 0 2 4 2 57 2 2 4 2 4 2 58 2 2 2 0 0 2 59 2 2 2 4 0 2 60 2 2 2 0 4 2 61 2 2 2 4 4 2 62 2 2 2 2 1 2 63 2 2 2 2 3 2 64 0 2 2 2 2 0 65 4 2 2 2 2 0 66 0 2 2 2 2 4 67 4 2 2 2 2 4 68 2 0 2 2 2 0 69 2 4 2 2 2 0 70 2 0 2 2 2 4 71 2 4 2 2 2 4 72 2 2 0 2 2 0 73 2 2 4 2 2 0 74 2 2 0 2 2 4 75 2 2 4 2 2 4 76 2 2 2 0 2 0 77 2 2 2 4 2 0 78 2 2 2 0 2 4 79 2 2 2 4 2 4 80 2 2 2 2 0 0 81 2 2 2 2 4 0 82 2 2 2 2 0 4 83 2 2 2 2 4 4 84 2 2 2 2 2 1 85 2 2 2 2 2 3 SPARSE_GRID_COMPOSITE_TEST03: SPARSE_GRID_COMPOSITE makes a sparse composite grid. LEVEL_MAX = 3 Spatial dimension DIM_NUM = 2 Number of unique points in the grid = 29 Grid weights: 1 -1.000000 2 -0.250000 3 -0.250000 4 -0.250000 5 -0.250000 6 0.000000 7 0.000000 8 0.000000 9 0.000000 10 0.000000 11 0.000000 12 0.000000 13 0.000000 14 0.500000 15 0.500000 16 0.500000 17 0.500000 18 0.250000 19 0.250000 20 0.250000 21 0.250000 22 0.250000 23 0.250000 24 0.250000 25 0.250000 26 0.500000 27 0.500000 28 0.500000 29 0.500000 Grid points: 1 0.000000 0.000000 2 -1.000000 0.000000 3 1.000000 0.000000 4 0.000000 -1.000000 5 0.000000 1.000000 6 -0.500000 0.000000 7 0.500000 0.000000 8 -1.000000 -1.000000 9 1.000000 -1.000000 10 -1.000000 1.000000 11 1.000000 1.000000 12 0.000000 -0.500000 13 0.000000 0.500000 14 -0.750000 0.000000 15 -0.250000 0.000000 16 0.250000 0.000000 17 0.750000 0.000000 18 -0.500000 -1.000000 19 0.500000 -1.000000 20 -0.500000 1.000000 21 0.500000 1.000000 22 -1.000000 -0.500000 23 1.000000 -0.500000 24 -1.000000 0.500000 25 1.000000 0.500000 26 0.000000 -0.750000 27 0.000000 -0.250000 28 0.000000 0.250000 29 0.000000 0.750000 SPARSE_GRID_COMPOSITE_TEST03: SPARSE_GRID_COMPOSITE makes a sparse composite grid. LEVEL_MAX = 0 Spatial dimension DIM_NUM = 3 Number of unique points in the grid = 1 Grid weights: 1 8.000000 Grid points: 1 0.000000 0.000000 0.000000 SPARSE_GRID_COMPOSITE_TEST03: SPARSE_GRID_COMPOSITE makes a sparse composite grid. LEVEL_MAX = 1 Spatial dimension DIM_NUM = 3 Number of unique points in the grid = 7 Grid weights: 1 -4.000000 2 2.000000 3 2.000000 4 2.000000 5 2.000000 6 2.000000 7 2.000000 Grid points: 1 0.000000 0.000000 0.000000 2 -1.000000 0.000000 0.000000 3 1.000000 0.000000 0.000000 4 0.000000 -1.000000 0.000000 5 0.000000 1.000000 0.000000 6 0.000000 0.000000 -1.000000 7 0.000000 0.000000 1.000000 SPARSE_GRID_COMPOSITE_TEST04: Compute the weights of a composite sparse grid . As a simple test, sum these weights. They should sum to exactly 2^DIM_NUM. LEVEL_MAX = 4 Spatial dimension DIM_NUM = 2 Number of unique points in the grid = 65 Weight sum Exact sum Difference 4.000000e+00 4.000000e+00 0.000000e+00 SPARSE_GRID_COMPOSITE_TEST04: Compute the weights of a composite sparse grid . As a simple test, sum these weights. They should sum to exactly 2^DIM_NUM. LEVEL_MAX = 0 Spatial dimension DIM_NUM = 3 Number of unique points in the grid = 1 Weight sum Exact sum Difference 8.000000e+00 8.000000e+00 0.000000e+00 SPARSE_GRID_COMPOSITE_TEST04: Compute the weights of a composite sparse grid . As a simple test, sum these weights. They should sum to exactly 2^DIM_NUM. LEVEL_MAX = 1 Spatial dimension DIM_NUM = 3 Number of unique points in the grid = 7 Weight sum Exact sum Difference 8.000000e+00 8.000000e+00 0.000000e+00 SPARSE_GRID_COMPOSITE_TEST04: Compute the weights of a composite sparse grid . As a simple test, sum these weights. They should sum to exactly 2^DIM_NUM. LEVEL_MAX = 6 Spatial dimension DIM_NUM = 3 Number of unique points in the grid = 1073 Weight sum Exact sum Difference 8.000000e+00 8.000000e+00 0.000000e+00 SPARSE_GRID_COMPOSITE_TEST04: Compute the weights of a composite sparse grid . As a simple test, sum these weights. They should sum to exactly 2^DIM_NUM. LEVEL_MAX = 3 Spatial dimension DIM_NUM = 10 Number of unique points in the grid = 1581 Weight sum Exact sum Difference 1.024000e+03 1.024000e+03 0.000000e+00 SPARSE_GRID_COMPOSITE_TEST05 Check the exactness of a composite sparse grid quadrature rule, applied to all monomials of orders 0 to DEGREE_MAX. LEVEL_MAX = 0 Spatial dimension DIM_NUM = 2 The maximum total degree to be checked is DEGREE_MAX = 2 We expect this rule to be accurate up to and including total degree 1 Number of unique points in the grid = 1 Error Total Monomial Degree Exponents 0.000000 0 0 0 0.000000 1 1 0 0.000000 1 0 1 0.250000 2 2 0 0.000000 2 1 1 0.250000 2 0 2 SPARSE_GRID_COMPOSITE_TEST05 Check the exactness of a composite sparse grid quadrature rule, applied to all monomials of orders 0 to DEGREE_MAX. LEVEL_MAX = 1 Spatial dimension DIM_NUM = 2 The maximum total degree to be checked is DEGREE_MAX = 2 We expect this rule to be accurate up to and including total degree 1 Number of unique points in the grid = 5 Error Total Monomial Degree Exponents 0.000000 0 0 0 0.000000 1 1 0 0.000000 1 0 1 0.125000 2 2 0 0.000000 2 1 1 0.125000 2 0 2 SPARSE_GRID_COMPOSITE_TEST05 Check the exactness of a composite sparse grid quadrature rule, applied to all monomials of orders 0 to DEGREE_MAX. LEVEL_MAX = 2 Spatial dimension DIM_NUM = 2 The maximum total degree to be checked is DEGREE_MAX = 2 We expect this rule to be accurate up to and including total degree 1 Number of unique points in the grid = 13 Error Total Monomial Degree Exponents 0.000000 0 0 0 0.000000 1 1 0 0.000000 1 0 1 0.031250 2 2 0 0.000000 2 1 1 0.031250 2 0 2 SPARSE_GRID_COMPOSITE_TEST05 Check the exactness of a composite sparse grid quadrature rule, applied to all monomials of orders 0 to DEGREE_MAX. LEVEL_MAX = 3 Spatial dimension DIM_NUM = 2 The maximum total degree to be checked is DEGREE_MAX = 2 We expect this rule to be accurate up to and including total degree 1 Number of unique points in the grid = 29 Error Total Monomial Degree Exponents 0.000000 0 0 0 0.000000 1 1 0 0.000000 1 0 1 0.007812 2 2 0 0.000000 2 1 1 0.007812 2 0 2 SPARSE_GRID_COMPOSITE_TEST05 Check the exactness of a composite sparse grid quadrature rule, applied to all monomials of orders 0 to DEGREE_MAX. LEVEL_MAX = 4 Spatial dimension DIM_NUM = 2 The maximum total degree to be checked is DEGREE_MAX = 2 We expect this rule to be accurate up to and including total degree 1 Number of unique points in the grid = 65 Error Total Monomial Degree Exponents 0.000000 0 0 0 0.000000 1 1 0 0.000000 1 0 1 0.001953 2 2 0 0.000000 2 1 1 0.001953 2 0 2 SPARSE_GRID_COMPOSITE_TEST05 Check the exactness of a composite sparse grid quadrature rule, applied to all monomials of orders 0 to DEGREE_MAX. LEVEL_MAX = 5 Spatial dimension DIM_NUM = 2 The maximum total degree to be checked is DEGREE_MAX = 2 We expect this rule to be accurate up to and including total degree 1 Number of unique points in the grid = 145 Error Total Monomial Degree Exponents 0.000000 0 0 0 0.000000 1 1 0 0.000000 1 0 1 0.000488 2 2 0 0.000000 2 1 1 0.000488 2 0 2 SPARSE_GRID_COMPOSITE_TEST05 Check the exactness of a composite sparse grid quadrature rule, applied to all monomials of orders 0 to DEGREE_MAX. LEVEL_MAX = 0 Spatial dimension DIM_NUM = 3 The maximum total degree to be checked is DEGREE_MAX = 2 We expect this rule to be accurate up to and including total degree 1 Number of unique points in the grid = 1 Error Total Monomial Degree Exponents 0.000000 0 0 0 0 0.000000 1 1 0 0 0.000000 1 0 1 0 0.000000 1 0 0 1 0.250000 2 2 0 0 0.000000 2 1 1 0 0.250000 2 0 2 0 0.000000 2 1 0 1 0.000000 2 0 1 1 0.250000 2 0 0 2 SPARSE_GRID_COMPOSITE_TEST05 Check the exactness of a composite sparse grid quadrature rule, applied to all monomials of orders 0 to DEGREE_MAX. LEVEL_MAX = 1 Spatial dimension DIM_NUM = 3 The maximum total degree to be checked is DEGREE_MAX = 2 We expect this rule to be accurate up to and including total degree 1 Number of unique points in the grid = 7 Error Total Monomial Degree Exponents 0.000000 0 0 0 0 0.000000 1 1 0 0 0.000000 1 0 1 0 0.000000 1 0 0 1 0.125000 2 2 0 0 0.000000 2 1 1 0 0.125000 2 0 2 0 0.000000 2 1 0 1 0.000000 2 0 1 1 0.125000 2 0 0 2 SPARSE_GRID_COMPOSITE_TEST05 Check the exactness of a composite sparse grid quadrature rule, applied to all monomials of orders 0 to DEGREE_MAX. LEVEL_MAX = 2 Spatial dimension DIM_NUM = 3 The maximum total degree to be checked is DEGREE_MAX = 2 We expect this rule to be accurate up to and including total degree 1 Number of unique points in the grid = 25 Error Total Monomial Degree Exponents 0.000000 0 0 0 0 0.000000 1 1 0 0 0.000000 1 0 1 0 0.000000 1 0 0 1 0.031250 2 2 0 0 0.000000 2 1 1 0 0.031250 2 0 2 0 0.000000 2 1 0 1 0.000000 2 0 1 1 0.031250 2 0 0 2 SPARSE_GRID_COMPOSITE_TEST05 Check the exactness of a composite sparse grid quadrature rule, applied to all monomials of orders 0 to DEGREE_MAX. LEVEL_MAX = 3 Spatial dimension DIM_NUM = 3 The maximum total degree to be checked is DEGREE_MAX = 2 We expect this rule to be accurate up to and including total degree 1 Number of unique points in the grid = 69 Error Total Monomial Degree Exponents 0.000000 0 0 0 0 0.000000 1 1 0 0 0.000000 1 0 1 0 0.000000 1 0 0 1 0.007812 2 2 0 0 0.000000 2 1 1 0 0.007812 2 0 2 0 0.000000 2 1 0 1 0.000000 2 0 1 1 0.007812 2 0 0 2 SPARSE_GRID_COMPOSITE_TEST06: SPARSE_GRID_COMPOSITE makes a sparse composite grid. Write the data to a set of quadrature files. LEVEL_MAX = 3 Spatial dimension DIM_NUM = 2 R data written to "composite_d2_level3_r.txt". W data written to "composite_d2_level3_w.txt". X data written to "composite_d2_level3_x.txt", sparse_grid_composite_test Normal end of execution. 21-Mar-2019 09:35:48 diary off