03 March 2022 05:19:30 PM LAGRANGE_ND_TEST C++ version Test the LAGRANGE_ND library. TEST01 MONO_BETWEEN_ENUM can enumerate the number of monomials in D variables, of total degree between N1 and N2. Using spatial dimension D = 3 N2: 0 1 2 3 4 5 6 7 8 N1 +------------------------------------------------------ 0 | 1 4 10 20 35 56 84 120 165 1 | 0 3 9 19 34 55 83 119 164 2 | 0 0 6 16 31 52 80 116 161 3 | 0 0 0 10 25 46 74 110 155 4 | 0 0 0 0 15 36 64 100 145 5 | 0 0 0 0 0 21 49 85 130 6 | 0 0 0 0 0 0 28 64 109 7 | 0 0 0 0 0 0 0 36 81 8 | 0 0 0 0 0 0 0 0 45 TEST02 MONO_TOTAL_ENUM can enumerate the number of monomials in D variables, of total degree N. N: 0 1 2 3 4 5 6 7 8 D +------------------------------------------------------ 1 | 1 1 1 1 1 1 1 1 1 2 | 1 2 3 4 5 6 7 8 9 3 | 1 3 6 10 15 21 28 36 45 4 | 1 4 10 20 35 56 84 120 165 5 | 1 5 15 35 70 126 210 330 495 6 | 1 6 21 56 126 252 462 792 1287 7 | 1 7 28 84 210 462 924 1716 3003 8 | 1 8 36 120 330 792 1716 3432 6435 TEST03 MONO_UPTO_ENUM can enumerate the number of monomials in D variables, of total degree 0 up to N. N: 0 1 2 3 4 5 6 7 8 D +------------------------------------------------------ 1 | 1 2 3 4 5 6 7 8 9 2 | 1 3 6 10 15 21 28 36 45 3 | 1 4 10 20 35 56 84 120 165 4 | 1 5 15 35 70 126 210 330 495 5 | 1 6 21 56 126 252 462 792 1287 6 | 1 7 28 84 210 462 924 1716 3003 7 | 1 8 36 120 330 792 1716 3432 6435 8 | 1 9 45 165 495 1287 3003 6435 12870 TEST04 MONO_BETWEEN_NEXT_GRLEX can list the monomials in D variables, of total degree N between N1 and N2, one at a time. We start the process with (0,0,...,0,N1). The process ends with (N2,0,...,0,0) Let D = 3 N1 = 2 N2 = 3 1: 0 0 2 2: 0 1 1 3: 0 2 0 4: 1 0 1 5: 1 1 0 6: 2 0 0 7: 0 0 3 8: 0 1 2 9: 0 2 1 10: 0 3 0 11: 1 0 2 12: 1 1 1 13: 1 2 0 14: 2 0 1 15: 2 1 0 16: 3 0 0 TEST05 LAGRANGE_COMPLETE determines the Lagrange interpolating polynomials L(x) for ND points in D dimensions, assuming that the number of points exactly coincides with R = Pi(D,N), the number of monomials of degree N or less As a special demonstration, this code runs in 1D Spatial dimension D = 1 Maximum degree N = 4 Number of monomials R = 5 Number of data points ND = 5 Data points XD: Row: 0 Col 0: 0 1: 1 2: 2 3: 3 4: 4 Lagrange polynomials for XD data points: P(0)(x) = + 1 * x^(0) - 2.08333 * x^(1) + 1.45833 * x^(2) - 0.416667 * x^(3) + 0.0416667 * x^(4). P(1)(x) = + 4 * x^(1) - 4.33333 * x^(2) + 1.5 * x^(3) - 0.166667 * x^(4). P(2)(x) = - 3 * x^(1) + 4.75 * x^(2) - 2 * x^(3) + 0.25 * x^(4). P(3)(x) = + 1.33333 * x^(1) - 2.33333 * x^(2) + 1.16667 * x^(3) - 0.166667 * x^(4). P(4)(x) = - 0.25 * x^(1) + 0.458333 * x^(2) - 0.25 * x^(3) + 0.0416667 * x^(4). Frobenius norm of Lagrange matrix error = 8.25619e-15 TEST06 LAGRANGE_COMPLETE determines the Lagrange interpolating polynomials L(x) for ND points in D dimensions, assuming that the number of points exactly coincides with R = Pi(D,N), the number of monomials of degree N or less The data points are the grid nodes of a triangle. Spatial dimension D = 2 Maximum degree N = 2 Number of monomials R = 6 Number of data points ND = 6 Data points XD: Row: 0 1 Col 0: 0 0 1: 1 0 2: 2 0 3: 0 1 4: 1 1 5: 0 2 Lagrange polynomials for XD data points: P(0)(x) = + 1 * x^(0,0) - 1.5 * x^(0,1) - 1.5 * x^(1,0) + 0.5 * x^(0,2) + 1 * x^(1,1) + 0.5 * x^(2,0). P(1)(x) = + 2 * x^(1,0) - 1 * x^(1,1) - 1 * x^(2,0). P(2)(x) = - 0.5 * x^(1,0) + 0.5 * x^(2,0). P(3)(x) = + 2 * x^(0,1) - 1 * x^(0,2) - 1 * x^(1,1). P(4)(x) = + 1 * x^(1,1). P(5)(x) = - 0.5 * x^(0,1) + 0.5 * x^(0,2). Frobenius norm of Lagrange matrix error = 0 TEST07 LAGRANGE_COMPLETE determines the Lagrange interpolating polynomials L(x) for ND points in D dimensions, assuming that the number of points exactly coincides with R = Pi(D,N), the number of monomials of degree N or less The data points are the grid nodes of a tetrahedron. Spatial dimension D = 3 Maximum degree N = 2 Number of monomials R = 10 Number of data points ND = 10 Data points XD: Row: 0 1 2 Col 0: 0 0 0 1: 1 0 0 2: 2 0 0 3: 0 1 0 4: 1 1 0 5: 0 2 0 6: 0 0 1 7: 1 0 1 8: 0 1 1 9: 0 0 2 Lagrange polynomials for XD data points: P(0)(x) = + 1 * x^(0,0,0) - 1.5 * x^(0,0,1) - 1.5 * x^(0,1,0) - 1.5 * x^(1,0,0) + 0.5 * x^(0,0,2) + 1 * x^(0,1,1) + 0.5 * x^(0,2,0) + 1 * x^(1,0,1) + 1 * x^(1,1,0) + 0.5 * x^(2,0,0). P(1)(x) = + 2 * x^(1,0,0) - 1 * x^(1,0,1) - 1 * x^(1,1,0) - 1 * x^(2,0,0). P(2)(x) = - 0.5 * x^(1,0,0) + 0.5 * x^(2,0,0). P(3)(x) = + 2 * x^(0,1,0) - 1 * x^(0,1,1) - 1 * x^(0,2,0) - 1 * x^(1,1,0). P(4)(x) = + 1 * x^(1,1,0). P(5)(x) = - 0.5 * x^(0,1,0) + 0.5 * x^(0,2,0). P(6)(x) = + 2 * x^(0,0,1) - 1 * x^(0,0,2) - 1 * x^(0,1,1) - 1 * x^(1,0,1). P(7)(x) = + 1 * x^(1,0,1). P(8)(x) = + 1 * x^(0,1,1). P(9)(x) = - 0.5 * x^(0,0,1) + 0.5 * x^(0,0,2). Frobenius norm of Lagrange matrix error = 0 TEST08 LAGRANGE_PARTIAL determines the Lagrange interpolating polynomials L(x) for ND points in D dimensions, assuming that the number of points is less than or equal to R = Pi(D,N), the number of monomials of degree N or less For this example, the data points are the same as those used by the level 1 Clenshaw Curtis sparse grid in 2D. Spatial dimension D = 2 Maximum degree N = 2 Number of monomials R = 6 Number of data points ND = 5 Data points XD: Row: 0 1 Col 0: 0 0 1: -1 0 2: 1 0 3: 0 -1 4: 0 1 Lagrange polynomials for XD data points: P(0)(x) = + 1 * x^(0,0) - 1 * x^(0,2) - 1 * x^(2,0). P(1)(x) = - 0.5 * x^(1,0) + 0.5 * x^(2,0). P(2)(x) = + 0.5 * x^(1,0) + 0.5 * x^(2,0). P(3)(x) = - 0.5 * x^(0,1) + 0.5 * x^(0,2). P(4)(x) = + 0.5 * x^(0,1) + 0.5 * x^(0,2). Frobenius norm of Lagrange matrix error = 0 TEST09 LAGRANGE_PARTIAL determines the Lagrange interpolating polynomials L(x) for ND points in D dimensions, assuming that the number of points is less than or equal to R = Pi(D,N), the number of monomials of degree N or less For this example, the data points are the same as those used by the level 2 Clenshaw Curtis sparse grid in 3D. Spatial dimension D = 3 Maximum degree N = 4 Number of monomials R = 35 Number of data points ND = 25 Data points XD: Row: 0 1 2 Col 0: 0 0 0 1: -1 0 0 2: 1 0 0 3: 0 -1 0 4: 0 1 0 5: 0 0 -1 6: 0 0 1 7: -0.707107 0 0 8: 0.707107 0 0 9: -1 -1 0 10: 1 -1 0 11: -1 1 0 12: 1 1 0 13: 0 -0.707107 0 14: 0 0.707107 0 15: -1 0 -1 16: 1 0 -1 17: -1 0 1 18: 1 0 1 19: 0 -1 -1 20: 0 1 -1 21: 0 -1 1 22: 0 1 1 23: 0 0 -0.707107 24: 0 0 0.707107 Lagrange polynomials for XD data points: P(0)(x) = + 1 * x^(0,0,0) - 3 * x^(0,0,2) - 3 * x^(0,2,0) - 3 * x^(2,0,0) + 2 * x^(0,0,4) + 1 * x^(0,2,2) + 2 * x^(0,4,0) + 1 * x^(2,0,2) + 1 * x^(2,2,0) + 2 * x^(4,0,0). P(1)(x) = + 0.5 * x^(1,0,0) - 0.5 * x^(2,0,0) + 0.5 * x^(1,0,2) + 0.5 * x^(1,2,0) - 1 * x^(3,0,0) - 0.5 * x^(2,0,2) - 0.5 * x^(2,2,0) + 1 * x^(4,0,0). P(2)(x) = - 0.5 * x^(1,0,0) - 0.5 * x^(2,0,0) - 0.5 * x^(1,0,2) - 0.5 * x^(1,2,0) + 1 * x^(3,0,0) - 0.5 * x^(2,0,2) - 0.5 * x^(2,2,0) + 1 * x^(4,0,0). P(3)(x) = + 0.5 * x^(0,1,0) - 0.5 * x^(0,2,0) + 0.5 * x^(0,1,2) - 1 * x^(0,3,0) + 0.5 * x^(2,1,0) - 0.5 * x^(0,2,2) + 1 * x^(0,4,0) - 0.5 * x^(2,2,0). P(4)(x) = - 0.5 * x^(0,1,0) - 0.5 * x^(0,2,0) - 0.5 * x^(0,1,2) + 1 * x^(0,3,0) - 0.5 * x^(2,1,0) - 0.5 * x^(0,2,2) + 1 * x^(0,4,0) - 0.5 * x^(2,2,0). P(5)(x) = + 0.5 * x^(0,0,1) - 0.5 * x^(0,0,2) - 1 * x^(0,0,3) + 0.5 * x^(0,2,1) + 0.5 * x^(2,0,1) + 1 * x^(0,0,4) - 0.5 * x^(0,2,2) - 0.5 * x^(2,0,2). P(6)(x) = - 0.5 * x^(0,0,1) - 0.5 * x^(0,0,2) + 1 * x^(0,0,3) - 0.5 * x^(0,2,1) - 0.5 * x^(2,0,1) + 1 * x^(0,0,4) - 0.5 * x^(0,2,2) - 0.5 * x^(2,0,2). P(7)(x) = - 1.41421 * x^(1,0,0) + 2 * x^(2,0,0) + 1.41421 * x^(3,0,0) - 2 * x^(4,0,0). P(8)(x) = + 1.41421 * x^(1,0,0) + 2 * x^(2,0,0) - 1.41421 * x^(3,0,0) - 2 * x^(4,0,0). P(9)(x) = + 0.25 * x^(1,1,0) - 0.25 * x^(1,2,0) - 0.25 * x^(2,1,0) + 0.25 * x^(2,2,0). P(10)(x) = - 0.25 * x^(1,1,0) + 0.25 * x^(1,2,0) - 0.25 * x^(2,1,0) + 0.25 * x^(2,2,0). P(11)(x) = - 0.25 * x^(1,1,0) - 0.25 * x^(1,2,0) + 0.25 * x^(2,1,0) + 0.25 * x^(2,2,0). P(12)(x) = + 0.25 * x^(1,1,0) + 0.25 * x^(1,2,0) + 0.25 * x^(2,1,0) + 0.25 * x^(2,2,0). P(13)(x) = - 1.41421 * x^(0,1,0) + 2 * x^(0,2,0) + 1.41421 * x^(0,3,0) - 2 * x^(0,4,0). P(14)(x) = + 1.41421 * x^(0,1,0) + 2 * x^(0,2,0) - 1.41421 * x^(0,3,0) - 2 * x^(0,4,0). P(15)(x) = + 0.25 * x^(1,0,1) - 0.25 * x^(1,0,2) - 0.25 * x^(2,0,1) + 0.25 * x^(2,0,2). P(16)(x) = - 0.25 * x^(1,0,1) + 0.25 * x^(1,0,2) - 0.25 * x^(2,0,1) + 0.25 * x^(2,0,2). P(17)(x) = - 0.25 * x^(1,0,1) - 0.25 * x^(1,0,2) + 0.25 * x^(2,0,1) + 0.25 * x^(2,0,2). P(18)(x) = + 0.25 * x^(1,0,1) + 0.25 * x^(1,0,2) + 0.25 * x^(2,0,1) + 0.25 * x^(2,0,2). P(19)(x) = + 0.25 * x^(0,1,1) - 0.25 * x^(0,1,2) - 0.25 * x^(0,2,1) + 0.25 * x^(0,2,2). P(20)(x) = - 0.25 * x^(0,1,1) + 0.25 * x^(0,1,2) - 0.25 * x^(0,2,1) + 0.25 * x^(0,2,2). P(21)(x) = - 0.25 * x^(0,1,1) - 0.25 * x^(0,1,2) + 0.25 * x^(0,2,1) + 0.25 * x^(0,2,2). P(22)(x) = + 0.25 * x^(0,1,1) + 0.25 * x^(0,1,2) + 0.25 * x^(0,2,1) + 0.25 * x^(0,2,2). P(23)(x) = - 1.41421 * x^(0,0,1) + 2 * x^(0,0,2) + 1.41421 * x^(0,0,3) - 2 * x^(0,0,4). P(24)(x) = + 1.41421 * x^(0,0,1) + 2 * x^(0,0,2) - 1.41421 * x^(0,0,3) - 2 * x^(0,0,4). Frobenius norm of Lagrange matrix error = 1.67088e-15 TEST10 LAGRANGE_PARTIAL2 determines the Lagrange interpolating polynomials L(x) for ND points in D dimensions, assuming that the number of points is less than or equal to R = Pi(D,N), the number of monomials of degree N or less For this example, the data points are the same as those used by the level 2 Clenshaw Curtis sparse grid in 2D. Spatial dimension D = 2 Maximum degree N = 4 Number of monomials R = 15 Number of data points ND = 13 Data points XD: Row: 0 1 Col 0: 0 0 1: -1 0 2: 1 0 3: 0 -1 4: 0 1 5: -1 1 6: 1 1 7: -1 -1 8: 1 -1 9: -0.5 0 10: 0 -0.5 11: 0 0.5 12: 0.5 0 Lagrange polynomials for XD data points: P(0)(x) = + 1 * x^(0,0) - 5 * x^(0,2) - 5 * x^(2,0) + 4 * x^(0,4) + 1 * x^(2,2) + 4 * x^(4,0). P(1)(x) = + 0.166667 * x^(1,0) - 0.166667 * x^(2,0) + 0.5 * x^(1,2) - 0.666667 * x^(3,0) - 0.5 * x^(2,2) + 0.666667 * x^(4,0). P(2)(x) = - 0.166667 * x^(1,0) - 0.166667 * x^(2,0) - 0.5 * x^(1,2) + 0.666667 * x^(3,0) - 0.5 * x^(2,2) + 0.666667 * x^(4,0). P(3)(x) = + 0.166667 * x^(0,1) - 0.166667 * x^(0,2) - 0.666667 * x^(0,3) + 0.5 * x^(2,1) + 0.666667 * x^(0,4) - 0.5 * x^(2,2). P(4)(x) = - 0.166667 * x^(0,1) - 0.166667 * x^(0,2) + 0.666667 * x^(0,3) - 0.5 * x^(2,1) + 0.666667 * x^(0,4) - 0.5 * x^(2,2). P(5)(x) = - 0.25 * x^(1,2) + 0.25 * x^(2,1) + 0.25 * x^(2,2) - 0.25 * x^(3,1). P(6)(x) = + 0.25 * x^(1,2) + 0.25 * x^(2,1) + 0.25 * x^(2,2) + 0.25 * x^(3,1). P(7)(x) = - 0.25 * x^(1,2) - 0.25 * x^(2,1) + 0.25 * x^(2,2) + 0.25 * x^(3,1). P(8)(x) = + 0.25 * x^(1,2) - 0.25 * x^(2,1) + 0.25 * x^(2,2) - 0.25 * x^(3,1). P(9)(x) = - 1.33333 * x^(1,0) + 2.66667 * x^(2,0) + 1.33333 * x^(3,0) - 2.66667 * x^(4,0). P(10)(x) = - 1.33333 * x^(0,1) + 2.66667 * x^(0,2) + 1.33333 * x^(0,3) - 2.66667 * x^(0,4). P(11)(x) = + 1.33333 * x^(0,1) + 2.66667 * x^(0,2) - 1.33333 * x^(0,3) - 2.66667 * x^(0,4). P(12)(x) = + 1.33333 * x^(1,0) + 2.66667 * x^(2,0) - 1.33333 * x^(3,0) - 2.66667 * x^(4,0). Frobenius norm of Lagrange matrix error = 1.60917e-15 Maximum absolute interpolant error on 11x11 grid = 0.0278102 LAGRANGE_ND_TEST11 LAGRANGE_PARTIAL3 determines the Lagrange interpolating polynomials L(x) for ND points in D dimensions, assuming that the number of points is less than or equal to R = Pi(D,N), the number of monomials of degree N or less If LAGRANGE_PARTIAL3 determines that the problem is not well-posed for the given value of N, it increases N until a suitable value is found. For this example, the data points are the same as those used by the level 2 Clenshaw Curtis sparse grid in 2D. Spatial dimension D = 2 Maximum degree N = 10 Number of data points ND = 65 Monomial/Legendre option OPTION = 0 Data points XD: Row: 0 1 Col 0: 0 0 1: -1 0 2: 1 0 3: 0 -1 4: 0 1 5: -0.707107 0 6: 0.707107 0 7: -1 -1 8: 1 -1 9: -1 1 10: 1 1 11: 0 -0.707107 12: 0 0.707107 13: -0.92388 0 14: -0.382683 0 15: 0.382683 0 16: 0.92388 0 17: -0.707107 -1 18: 0.707107 -1 19: -0.707107 1 20: 0.707107 1 21: -1 -0.707107 22: 1 -0.707107 23: -1 0.707107 24: 1 0.707107 25: 0 -0.92388 26: 0 -0.382683 27: 0 0.382683 28: 0 0.92388 29: -0.980785 0 30: -0.83147 0 31: -0.55557 0 32: -0.19509 0 33: 0.19509 0 34: 0.55557 0 35: 0.83147 0 36: 0.980785 0 37: -0.92388 -1 38: -0.382683 -1 39: 0.382683 -1 40: 0.92388 -1 41: -0.92388 1 42: -0.382683 1 43: 0.382683 1 44: 0.92388 1 45: -0.707107 -0.707107 46: 0.707107 -0.707107 47: -0.707107 0.707107 48: 0.707107 0.707107 49: -1 -0.92388 50: 1 -0.92388 51: -1 -0.382683 52: 1 -0.382683 53: -1 0.382683 54: 1 0.382683 55: -1 0.92388 56: 1 0.92388 57: 0 -0.980785 58: 0 -0.83147 59: 0 -0.55557 60: 0 -0.19509 61: 0 0.19509 62: 0 0.55557 63: 0 0.83147 64: 0 0.980785 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = 0 LAGRANGE_PARTIAL3 - Increase N to 11 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = 0 LAGRANGE_PARTIAL3 - Increase N to 12 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = 0 LAGRANGE_PARTIAL3 - Increase N to 13 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = 0 LAGRANGE_PARTIAL3 - Increase N to 14 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = 0 LAGRANGE_PARTIAL3 - Increase N to 15 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = 0 LAGRANGE_PARTIAL3 - Increase N to 16 LAGRANGE_PARTIAL3 increased N to 16 Number of monomials R = 153 (First 2) Lagrange polynomials for XD data points: P(0)(x) = + 1 * x^(0,0) - 43 * x^(0,2) - 43 * x^(2,0) - 5.45193e-08 * x^(1,2) - 1.61471e-08 * x^(2,1) + 546 * x^(0,4) + 5.7719 * x^(2,2) + 1.40666e-07 * x^(3,1) + 546 * x^(4,0) - 3144 * x^(0,6) - 2.04017e-07 * x^(1,5) - 3144 * x^(6,0) + 1.9768e-07 * x^(1,6) + 1.21874e-07 * x^(2,5) - 7.87502e-08 * x^(4,3) + 1.72852e-07 * x^(5,2) - 1.84482e-08 * x^(6,1) + 9680 * x^(0,8) - 19.1727 * x^(4,4) + 8.27313 * x^(6,2) + 5.48242e-08 * x^(7,1) + 9680 * x^(8,0) - 1.95178e-08 * x^(0,9) - 1.95178e-08 * x^(9,0) - 17024 * x^(0,10) + 7.83771 * x^(2,8) - 17024 * x^(10,0) + 2.54549e-08 * x^(0,11) - 4.15731e-07 * x^(7,4) + 2.54549e-08 * x^(11,0) + 17152 * x^(0,12) - 2.44041e-07 * x^(5,7) + 17152 * x^(12,0) - 1.67711e-08 * x^(0,13) - 4.65066e-08 * x^(3,10) - 4.9839e-08 * x^(8,5) - 1.67711e-08 * x^(13,0) - 9216 * x^(0,14) - 9216 * x^(14,0) - 1.40862e-07 * x^(1,14) - 1.48444e-07 * x^(2,13) + 1.28347e-07 * x^(4,11) + 2.7745e-07 * x^(7,8) + 2.43132e-08 * x^(13,2) + 4.45742e-08 * x^(14,1) + 2048 * x^(0,16) + 2.30009e-07 * x^(1,15) - 3.76014 * x^(2,14) - 2.8687 * x^(4,12) + 9.38149 * x^(8,8) + 3.04513e-07 * x^(13,3) - 4.46268 * x^(14,2) - 2.24854e-07 * x^(15,1) + 2048 * x^(16,0). P(1)(x) = + 0.5 * x^(1,0) - 0.5 * x^(2,0) - 1.18661 * x^(1,2) - 21 * x^(3,0) - 0.764713 * x^(2,2) + 21 * x^(4,0) + 252 * x^(5,0) - 252 * x^(6,0) + 3.31587 * x^(1,6) + 3.86437 * x^(5,2) - 1320 * x^(7,0) + 8.72479 * x^(4,4) - 1.95062 * x^(6,2) + 1320 * x^(8,0) + 3520 * x^(9,0) - 7.56224 * x^(2,8) - 3520 * x^(10,0) - 10.8225 * x^(7,4) - 4992 * x^(11,0) + 4992 * x^(12,0) - 0.979649 * x^(3,10) + 3584 * x^(13,0) - 3584 * x^(14,0) - 2.05396 * x^(1,14) + 6.13102 * x^(7,8) + 2.23147 * x^(13,2) - 1024 * x^(15,0) + 8.32105 * x^(2,14) - 8.46648 * x^(4,12) + 3.1605 * x^(8,8) - 1.96228 * x^(14,2) + 1024 * x^(16,0). Frobenius norm of Lagrange matrix error = 2.09018e-07 Maximum absolute interpolant error on 11x11 grid = 0.0112333 LAGRANGE_ND_TEST11 LAGRANGE_PARTIAL3 determines the Lagrange interpolating polynomials L(x) for ND points in D dimensions, assuming that the number of points is less than or equal to R = Pi(D,N), the number of monomials of degree N or less If LAGRANGE_PARTIAL3 determines that the problem is not well-posed for the given value of N, it increases N until a suitable value is found. For this example, the data points are the same as those used by the level 2 Clenshaw Curtis sparse grid in 2D. Spatial dimension D = 2 Maximum degree N = 10 Number of data points ND = 65 Monomial/Legendre option OPTION = 1 Data points XD: Row: 0 1 Col 0: 0 0 1: -1 0 2: 1 0 3: 0 -1 4: 0 1 5: -0.707107 0 6: 0.707107 0 7: -1 -1 8: 1 -1 9: -1 1 10: 1 1 11: 0 -0.707107 12: 0 0.707107 13: -0.92388 0 14: -0.382683 0 15: 0.382683 0 16: 0.92388 0 17: -0.707107 -1 18: 0.707107 -1 19: -0.707107 1 20: 0.707107 1 21: -1 -0.707107 22: 1 -0.707107 23: -1 0.707107 24: 1 0.707107 25: 0 -0.92388 26: 0 -0.382683 27: 0 0.382683 28: 0 0.92388 29: -0.980785 0 30: -0.83147 0 31: -0.55557 0 32: -0.19509 0 33: 0.19509 0 34: 0.55557 0 35: 0.83147 0 36: 0.980785 0 37: -0.92388 -1 38: -0.382683 -1 39: 0.382683 -1 40: 0.92388 -1 41: -0.92388 1 42: -0.382683 1 43: 0.382683 1 44: 0.92388 1 45: -0.707107 -0.707107 46: 0.707107 -0.707107 47: -0.707107 0.707107 48: 0.707107 0.707107 49: -1 -0.92388 50: 1 -0.92388 51: -1 -0.382683 52: 1 -0.382683 53: -1 0.382683 54: 1 0.382683 55: -1 0.92388 56: 1 0.92388 57: 0 -0.980785 58: 0 -0.83147 59: 0 -0.55557 60: 0 -0.19509 61: 0 0.19509 62: 0 0.55557 63: 0 0.83147 64: 0 0.980785 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = -1.83798e-13 LAGRANGE_PARTIAL3 - Increase N to 11 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = -2.08991e-12 LAGRANGE_PARTIAL3 - Increase N to 12 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = -4.41889e-12 LAGRANGE_PARTIAL3 - Increase N to 13 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = -5.30991e-11 LAGRANGE_PARTIAL3 - Increase N to 14 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = -1.56922e-09 LAGRANGE_PARTIAL3 - Increase N to 15 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = -1.15493e-07 LAGRANGE_PARTIAL3 - Increase N to 16 LAGRANGE_PARTIAL3 increased N to 16 Number of monomials R = 153 (First 2) Lagrange polynomials for XD data points: P(0)(x) = + 1 * x^(0,0) + 3.35658e-08 * x^(0,1) - 43 * x^(0,2) - 5.73107e-08 * x^(1,1) - 43 * x^(2,0) - 1.33637e-06 * x^(0,3) - 2.93391e-07 * x^(1,2) + 3.52008e-08 * x^(2,1) + 1.82931e-07 * x^(3,0) + 546 * x^(0,4) + 1.79553e-06 * x^(1,3) + 25 * x^(2,2) - 1.16512e-06 * x^(3,1) + 546 * x^(4,0) + 1.42579e-05 * x^(0,5) + 2.52921e-06 * x^(1,4) + 1.42036e-06 * x^(2,3) - 1.48451e-06 * x^(3,2) - 2.26313e-07 * x^(4,1) - 2.04895e-06 * x^(5,0) - 3144 * x^(0,6) - 9.1578e-06 * x^(1,5) - 38 * x^(2,4) - 1.01189e-05 * x^(3,3) - 38 * x^(4,2) + 1.32218e-05 * x^(5,1) - 3144 * x^(6,0) - 6.66683e-05 * x^(0,7) - 4.7557e-06 * x^(1,6) - 1.18647e-05 * x^(2,5) + 1.38615e-06 * x^(3,4) - 3.55182e-07 * x^(4,3) + 3.79756e-06 * x^(5,2) + 1.81655e-07 * x^(6,1) + 1.03281e-05 * x^(7,0) + 9680 * x^(0,8) + 1.83127e-05 * x^(1,7) + 40 * x^(2,6) + 6.05352e-05 * x^(3,5) + 4 * x^(4,4) - 1.71522e-06 * x^(5,3) + 40 * x^(6,2) - 4.6637e-05 * x^(7,1) + 9680 * x^(8,0) + 0.000159305 * x^(0,9) + 2.63074e-06 * x^(1,8) + 3.93428e-05 * x^(2,7) - 7.33433e-07 * x^(3,6) + 5.14583e-06 * x^(4,5) - 1.24754e-06 * x^(5,4) + 1.10977e-07 * x^(6,3) - 4.77246e-06 * x^(7,2) - 2.91456e-08 * x^(8,1) - 2.64602e-05 * x^(9,0) - 17024 * x^(0,10) - 1.91106e-05 * x^(1,9) - 16 * x^(2,8) - 9.097e-05 * x^(3,7) - 0.000126925 * x^(5,5) + 8.24391e-05 * x^(7,3) - 16 * x^(8,2) + 7.32401e-05 * x^(9,1) - 17024 * x^(10,0) - 0.000203581 * x^(0,11) - 6.5079e-05 * x^(2,9) - 8.85364e-06 * x^(4,7) + 6.6009e-07 * x^(5,6) - 3.63911e-06 * x^(6,5) + 2.57205e-06 * x^(9,2) + 3.60305e-05 * x^(11,0) + 17152 * x^(0,12) + 1.19913e-05 * x^(1,11) + 4.29581e-05 * x^(3,9) + 0.000200134 * x^(5,7) + 6.74686e-05 * x^(7,5) - 0.000155844 * x^(9,3) - 5.08134e-05 * x^(11,1) + 17152 * x^(12,0) + 0.000132596 * x^(0,13) + 5.32641e-05 * x^(2,11) + 4.18088e-06 * x^(4,9) + 6.49267e-06 * x^(6,7) - 2.15714e-07 * x^(11,2) - 2.48366e-05 * x^(13,0) - 9216 * x^(0,14) - 3.85662e-06 * x^(1,13) - 9.45077e-05 * x^(5,9) - 0.000123892 * x^(7,7) + 9.09317e-06 * x^(9,5) + 0.000121892 * x^(11,3) + 7.98711e-06 * x^(13,1) - 9216 * x^(14,0) - 3.4611e-05 * x^(0,15) - 1.70718e-05 * x^(2,13) - 3.06598e-06 * x^(6,9) + 6.8156e-06 * x^(15,0) + 2048 * x^(0,16) + 5.85048e-05 * x^(7,9) - 3.90681e-05 * x^(13,3) + 4.26453e-06 * x^(15,1) + 2048 * x^(16,0). P(1)(x) = + 7.28793e-08 * x^(0,1) + 0.5 * x^(1,0) - 8.26949e-08 * x^(0,2) + 4.97638e-08 * x^(1,1) - 0.5 * x^(2,0) - 3.0037e-06 * x^(0,3) + 9.25511 * x^(1,2) - 3.92918e-08 * x^(2,1) - 21 * x^(3,0) + 4.62749e-06 * x^(0,4) - 2.42421e-06 * x^(1,3) - 2.5 * x^(2,2) + 1.10163e-06 * x^(3,1) + 21 * x^(4,0) + 2.98997e-05 * x^(0,5) - 24.2214 * x^(1,4) + 2.17038e-06 * x^(2,3) - 46.9397 * x^(3,2) - 1.6296e-07 * x^(4,1) + 252 * x^(5,0) - 5.67786e-05 * x^(0,6) + 1.45408e-05 * x^(1,5) + 15 * x^(2,4) + 1.16477e-05 * x^(3,3) - 7 * x^(4,2) - 1.44601e-05 * x^(5,1) - 252 * x^(6,0) - 0.000133795 * x^(0,7) + 24.4333 * x^(1,6) - 1.08491e-05 * x^(2,5) + 72.2143 * x^(3,4) - 5.96102e-06 * x^(4,3) + 106.609 * x^(5,2) + 5.34847e-07 * x^(6,1) - 1320 * x^(7,0) + 0.000300699 * x^(0,8) - 3.74017e-05 * x^(1,7) - 20 * x^(2,6) - 6.32179e-05 * x^(3,5) + 2 * x^(4,4) - 1.08733e-05 * x^(5,3) + 12 * x^(6,2) + 6.24591e-05 * x^(7,1) + 1320 * x^(8,0) + 0.000312242 * x^(0,9) - 8 * x^(1,8) + 1.94598e-05 * x^(2,7) - 44.3333 * x^(3,6) + 2.81632e-05 * x^(4,5) - 64.9929 * x^(5,4) + 4.38329e-06 * x^(6,3) - 153.015 * x^(7,2) - 3.53655e-07 * x^(8,1) + 3520 * x^(9,0) - 0.000801995 * x^(0,10) + 5.1766e-05 * x^(1,9) + 8 * x^(2,8) + 9.62771e-05 * x^(3,7) + 0.000131449 * x^(5,5) - 3.42424e-05 * x^(7,3) - 8 * x^(8,2) - 0.000136795 * x^(9,1) - 3520 * x^(10,0) - 0.000394027 * x^(0,11) - 1.59541e-05 * x^(2,9) - 4.24969e-05 * x^(4,7) + 39.9 * x^(5,6) - 2.06637e-05 * x^(6,5) + 128.336 * x^(9,2) - 4992 * x^(11,0) + 0.00112928 * x^(0,12) - 3.90684e-05 * x^(1,11) - 4.54642e-05 * x^(3,9) - 0.00021181 * x^(5,7) - 6.73508e-05 * x^(7,5) + 6.642e-05 * x^(9,3) + 0.000165835 * x^(11,1) + 4992 * x^(12,0) + 0.000254592 * x^(0,13) + 7.74869e-06 * x^(2,11) + 2.0068e-05 * x^(4,9) + 3.11644e-05 * x^(6,7) - 38.7454 * x^(11,2) + 3584 * x^(13,0) - 0.000800944 * x^(0,14) + 1.25334e-05 * x^(1,13) + 0.000100021 * x^(5,9) + 0.00013112 * x^(7,7) - 1.1538e-05 * x^(9,5) - 4.48291e-05 * x^(11,3) - 0.000104809 * x^(13,1) - 3584 * x^(14,0) - 6.60021e-05 * x^(0,15) - 2.49401e-06 * x^(2,13) - 1.47165e-05 * x^(6,9) - 1024 * x^(15,0) + 0.000225277 * x^(0,16) - 6.19179e-05 * x^(7,9) + 1.43683e-05 * x^(13,3) + 2.65661e-05 * x^(15,1) + 1024 * x^(16,0). Frobenius norm of Lagrange matrix error = 2.49924e-06 Maximum absolute interpolant error on 11x11 grid = 0.0319859 LAGRANGE_ND_TEST Normal end of execution. 03 March 2022 05:19:31 PM