07-Jan-2022 22:39:30 lagrange_nd_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test lagrange_nd(). LAGRANGE_ND_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 LAGRANGE_ND_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 LAGRANGE_ND_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 LAGRANGE_ND_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 LAGRANGE_ND_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: 1 Col 1: 0 2: 1 3: 2 4: 3 5: 4 Lagrange polynomials for XD data points: P(1)(x) = + 1 * x^(0) - 2.08333 * x^(1) + 1.45833 * x^(2) - 0.416667 * x^(3) + 0.0416667 * x^(4). P(2)(x) = + 4 * x^(1) - 4.33333 * x^(2) + 1.5 * x^(3) - 0.166667 * x^(4). P(3)(x) = - 3 * x^(1) + 4.75 * x^(2) - 2 * x^(3) + 0.25 * x^(4). P(4)(x) = + 1.33333 * x^(1) - 2.33333 * x^(2) + 1.16667 * x^(3) - 0.166667 * x^(4). P(5)(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 LAGRANGE_ND_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: 1 2 Col 1: 0 0 2: 1 0 3: 2 0 4: 0 1 5: 1 1 6: 0 2 Lagrange polynomials for XD data points: P(1)(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(2)(x) = + 2 * x^(1,0) - 1 * x^(1,1) - 1 * x^(2,0). P(3)(x) = - 0.5 * x^(1,0) + 0.5 * x^(2,0). P(4)(x) = + 2 * x^(0,1) - 1 * x^(0,2) - 1 * x^(1,1). P(5)(x) = + 1 * x^(1,1). P(6)(x) = - 0.5 * x^(0,1) + 0.5 * x^(0,2). Frobenius norm of Lagrange matrix error = 0 LAGRANGE_ND_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: 1 2 3 Col 1: 0 0 0 2: 1 0 0 3: 2 0 0 4: 0 1 0 5: 1 1 0 6: 0 2 0 7: 0 0 1 8: 1 0 1 9: 0 1 1 10: 0 0 2 Lagrange polynomials for XD data points: P(1)(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(2)(x) = + 2 * x^(1,0,0) - 1 * x^(1,0,1) - 1 * x^(1,1,0) - 1 * x^(2,0,0). P(3)(x) = - 0.5 * x^(1,0,0) + 0.5 * x^(2,0,0). P(4)(x) = + 2 * x^(0,1,0) - 1 * x^(0,1,1) - 1 * x^(0,2,0) - 1 * x^(1,1,0). P(5)(x) = + 1 * x^(1,1,0). P(6)(x) = - 0.5 * x^(0,1,0) + 0.5 * x^(0,2,0). P(7)(x) = + 2 * x^(0,0,1) - 1 * x^(0,0,2) - 1 * x^(0,1,1) - 1 * x^(1,0,1). P(8)(x) = + 1 * x^(1,0,1). P(9)(x) = + 1 * x^(0,1,1). P(10)(x) = - 0.5 * x^(0,0,1) + 0.5 * x^(0,0,2). Frobenius norm of Lagrange matrix error = 0 LAGRANGE_ND_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 5 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: 1 2 Col 1: 0 0 2: -1 0 3: 1 0 4: 0 -1 5: 0 1 Lagrange polynomials for XD data points: P(1)(x) = + 1 * x^(0,0) - 1 * x^(0,2) - 1 * x^(2,0). P(2)(x) = - 0.5 * x^(1,0) + 0.5 * x^(2,0). P(3)(x) = + 0.5 * x^(1,0) + 0.5 * x^(2,0). P(4)(x) = - 0.5 * x^(0,1) + 0.5 * x^(0,2). P(5)(x) = + 0.5 * x^(0,1) + 0.5 * x^(0,2). Frobenius norm of Lagrange matrix error = 0 LAGRANGE_ND_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: 1 2 3 Col 1: 0 0 0 2: -1 0 0 3: 1 0 0 4: 0 -1 0 5: 0 1 0 6: 0 0 -1 7: 0 0 1 8: -0.707107 0 0 9: 0.707107 0 0 10: -1 -1 0 11: 1 -1 0 12: -1 1 0 13: 1 1 0 14: 0 -0.707107 0 15: 0 0.707107 0 16: -1 0 -1 17: 1 0 -1 18: -1 0 1 19: 1 0 1 20: 0 -1 -1 21: 0 1 -1 22: 0 -1 1 23: 0 1 1 24: 0 0 -0.707107 25: 0 0 0.707107 Lagrange polynomials for XD data points: P(1)(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(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^(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(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,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(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) = - 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(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) = + 1.41421 * x^(1,0,0) + 2 * x^(2,0,0) - 1.41421 * x^(3,0,0) - 2 * x^(4,0,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) = + 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(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) = + 1.41421 * x^(0,1,0) + 2 * x^(0,2,0) - 1.41421 * x^(0,3,0) - 2 * x^(0,4,0). 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^(1,0,1) + 0.25 * x^(1,0,2) + 0.25 * x^(2,0,1) + 0.25 * x^(2,0,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) = + 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(24)(x) = - 1.41421 * x^(0,0,1) + 2 * x^(0,0,2) + 1.41421 * x^(0,0,3) - 2 * x^(0,0,4). P(25)(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 = 2.60489e-15 LAGRANGE_ND_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: 1 2 Col 1: 0 0 2: -1 0 3: 1 0 4: 0 -1 5: 0 1 6: -1 1 7: 1 1 8: -1 -1 9: 1 -1 10: -0.5 0 11: 0 -0.5 12: 0 0.5 13: 0.5 0 Lagrange polynomials for XD data points: P(1)(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(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^(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(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.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(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) = + 0.25 * x^(1,2) - 0.25 * x^(2,1) + 0.25 * x^(2,2) - 0.25 * x^(3,1). P(10)(x) = - 1.33333 * x^(1,0) + 2.66667 * x^(2,0) + 1.33333 * x^(3,0) - 2.66667 * x^(4,0). 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^(0,1) + 2.66667 * x^(0,2) - 1.33333 * x^(0,3) - 2.66667 * x^(0,4). P(13)(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 Saving plot file in "test10_interpolant.png" option = 0 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 monomials R = 66 Number of data points ND = 65 Monomial/Legendre option OPTION = 0 Data points XD: Row: 1 2 Col 1: 0 0 2: -1 0 3: 1 0 4: 0 -1 5: 0 1 6: -0.707107 0 7: 0.707107 0 8: -1 -1 9: 1 -1 10: -1 1 11: 1 1 12: 0 -0.707107 13: 0 0.707107 14: -0.92388 0 15: -0.382683 0 16: 0.382683 0 17: 0.92388 0 18: -0.707107 -1 19: 0.707107 -1 20: -0.707107 1 21: 0.707107 1 22: -1 -0.707107 23: 1 -0.707107 24: -1 0.707107 25: 1 0.707107 26: 0 -0.92388 27: 0 -0.382683 28: 0 0.382683 29: 0 0.92388 30: -0.980785 0 31: -0.83147 0 32: -0.55557 0 33: -0.19509 0 34: 0.19509 0 35: 0.55557 0 36: 0.83147 0 37: 0.980785 0 38: -0.92388 -1 39: -0.382683 -1 40: 0.382683 -1 41: 0.92388 -1 42: -0.92388 1 43: -0.382683 1 44: 0.382683 1 45: 0.92388 1 46: -0.707107 -0.707107 47: 0.707107 -0.707107 48: -0.707107 0.707107 49: 0.707107 0.707107 50: -1 -0.92388 51: 1 -0.92388 52: -1 -0.382683 53: 1 -0.382683 54: -1 0.382683 55: 1 0.382683 56: -1 0.92388 57: 1 0.92388 58: 0 -0.980785 59: 0 -0.83147 60: 0 -0.55557 61: 0 -0.19509 62: 0 0.19509 63: 0 0.55557 64: 0 0.83147 65: 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 (First 2) Lagrange polynomials for XD data points: P(1)(x) = + 1 * x^(0,0) - 43 * x^(0,2) - 43 * x^(2,0) + 1.64685e-08 * x^(1,2) + 3.08951e-08 * x^(2,1) + 546 * x^(0,4) + 13.6857 * x^(2,2) + 546 * x^(4,0) - 3144 * x^(0,6) + 3.41223e-08 * x^(1,5) - 24.4201 * x^(2,4) - 3144 * x^(6,0) + 2.3384e-08 * x^(0,7) - 1.5379e-07 * x^(2,5) - 8.4897e-08 * x^(5,2) + 2.3384e-08 * x^(7,0) + 9680 * x^(0,8) + 1.77003 * x^(6,2) + 9680 * x^(8,0) - 6.134e-08 * x^(0,9) - 1.28757e-07 * x^(1,8) + 7.02587e-08 * x^(8,1) - 6.134e-08 * x^(9,0) - 17024 * x^(0,10) + 23.9231 * x^(2,8) - 17024 * x^(10,0) + 8.52888e-08 * x^(0,11) + 3.19996e-08 * x^(3,8) + 1.78601e-07 * x^(7,4) + 8.52888e-08 * x^(11,0) + 17152 * x^(0,12) - 19.5902 * x^(4,8) - 1.99316e-08 * x^(5,7) + 17152 * x^(12,0) - 5.98739e-08 * x^(0,13) - 5.98739e-08 * x^(13,0) - 9216 * x^(0,14) + 14.584 * x^(8,6) - 9216 * x^(14,0) + 1.66983e-08 * x^(0,15) + 1.11558e-07 * x^(1,14) + 1.20647e-07 * x^(2,13) + 1.7057e-08 * x^(4,11) - 1.33223e-07 * x^(7,8) - 1.348e-07 * x^(8,7) + 1.96014e-07 * x^(12,3) - 1.27517e-07 * x^(14,1) + 1.66983e-08 * x^(15,0) + 2048 * x^(0,16) - 2.55994e-08 * x^(1,15) - 3.575 * x^(2,14) - 5.3774 * x^(14,2) + 2048 * x^(16,0). P(2)(x) = + 0.5 * x^(1,0) - 0.5 * x^(2,0) - 0.710799 * x^(1,2) - 21 * x^(3,0) - 3.60751 * x^(2,2) + 21 * x^(4,0) + 252 * x^(5,0) + 9.00765 * x^(2,4) - 252 * x^(6,0) + 3.32931 * x^(5,2) - 1320 * x^(7,0) + 0.494774 * x^(6,2) + 1320 * x^(8,0) + 3.57988 * x^(1,8) + 3520 * x^(9,0) - 8.29993 * x^(2,8) - 3520 * x^(10,0) - 0.777972 * x^(3,8) - 9.46154 * x^(7,4) - 4992 * x^(11,0) - 0.663415 * x^(4,8) + 4992 * x^(12,0) + 3584 * x^(13,0) + 1.20418 * x^(8,6) - 3584 * x^(14,0) - 2.81319 * x^(1,14) + 5.19809 * x^(7,8) + 2.15621 * x^(13,2) - 1024 * x^(15,0) + 2.98257 * x^(2,14) - 1.61832 * x^(14,2) + 1024 * x^(16,0). Saving plot file in "test11_interpolant.png" Relative error is 0.000277948 Maximum error is 0.00104211 option = 1 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 monomials R = 66 Number of data points ND = 65 Monomial/Legendre option OPTION = 1 Data points XD: Row: 1 2 Col 1: 0 0 2: -1 0 3: 1 0 4: 0 -1 5: 0 1 6: -0.707107 0 7: 0.707107 0 8: -1 -1 9: 1 -1 10: -1 1 11: 1 1 12: 0 -0.707107 13: 0 0.707107 14: -0.92388 0 15: -0.382683 0 16: 0.382683 0 17: 0.92388 0 18: -0.707107 -1 19: 0.707107 -1 20: -0.707107 1 21: 0.707107 1 22: -1 -0.707107 23: 1 -0.707107 24: -1 0.707107 25: 1 0.707107 26: 0 -0.92388 27: 0 -0.382683 28: 0 0.382683 29: 0 0.92388 30: -0.980785 0 31: -0.83147 0 32: -0.55557 0 33: -0.19509 0 34: 0.19509 0 35: 0.55557 0 36: 0.83147 0 37: 0.980785 0 38: -0.92388 -1 39: -0.382683 -1 40: 0.382683 -1 41: 0.92388 -1 42: -0.92388 1 43: -0.382683 1 44: 0.382683 1 45: 0.92388 1 46: -0.707107 -0.707107 47: 0.707107 -0.707107 48: -0.707107 0.707107 49: 0.707107 0.707107 50: -1 -0.92388 51: 1 -0.92388 52: -1 -0.382683 53: 1 -0.382683 54: -1 0.382683 55: 1 0.382683 56: -1 0.92388 57: 1 0.92388 58: 0 -0.980785 59: 0 -0.83147 60: 0 -0.55557 61: 0 -0.19509 62: 0 0.19509 63: 0 0.55557 64: 0 0.83147 65: 0 0.980785 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = 5.13282e-13 LAGRANGE_PARTIAL3 - Increase N to 11 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = 4.38179e-13 LAGRANGE_PARTIAL3 - Increase N to 12 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = 5.33063e-13 LAGRANGE_PARTIAL3 - Increase N to 13 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = 2.17874e-10 LAGRANGE_PARTIAL3 - Increase N to 14 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = -9.19796e-09 LAGRANGE_PARTIAL3 - Increase N to 15 LAGRANGE_PARTIAL4 - Unacceptable VALUE_MAX = -9.8875e-08 LAGRANGE_PARTIAL3 - Increase N to 16 LAGRANGE_PARTIAL3 increased N to 16 (First 2) Lagrange polynomials for XD data points: P(1)(x) = + 1 * x^(0,0) - 1.07139e-07 * x^(0,1) - 43 * x^(0,2) - 7.35014e-08 * x^(1,1) - 43 * x^(2,0) + 4.31762e-06 * x^(0,3) - 5.43769e-07 * x^(1,2) + 1.03456e-06 * x^(2,1) - 3.34901e-07 * x^(3,0) + 546 * x^(0,4) + 1.69843e-06 * x^(1,3) + 25 * x^(2,2) - 2.3593e-08 * x^(3,1) + 546 * x^(4,0) - 4.74083e-05 * x^(0,5) + 2.81376e-06 * x^(1,4) - 4.24343e-06 * x^(2,3) + 2.23933e-06 * x^(3,2) - 4.26164e-06 * x^(4,1) + 3.98705e-06 * x^(5,0) - 3144 * x^(0,6) - 6.49582e-06 * x^(1,5) - 38 * x^(2,4) - 1.32357e-05 * x^(3,3) - 38 * x^(4,2) + 2.00939e-06 * x^(5,1) - 3144 * x^(6,0) + 0.000228742 * x^(0,7) - 5.01803e-06 * x^(1,6) + 1.10446e-05 * x^(2,5) - 6.4546e-06 * x^(3,4) + 1.40741e-05 * x^(4,3) - 5.77822e-06 * x^(5,2) + 5.82313e-06 * x^(6,1) - 2.06306e-05 * x^(7,0) + 9680 * x^(0,8) + 9.1046e-06 * x^(1,7) + 40 * x^(2,6) + 5.77471e-05 * x^(3,5) + 4 * x^(4,4) + 2.55633e-05 * x^(5,3) + 40 * x^(6,2) - 4.75557e-06 * x^(7,1) + 9680 * x^(8,0) - 0.000564897 * x^(0,9) + 2.6411e-06 * x^(1,8) - 2.29398e-05 * x^(2,7) + 9.59894e-06 * x^(3,6) - 2.74389e-05 * x^(4,5) + 7.41329e-06 * x^(5,4) - 1.51723e-05 * x^(6,3) + 8.224e-06 * x^(7,2) - 2.53492e-06 * x^(8,1) + 5.41451e-05 * x^(9,0) - 17024 * x^(0,10) - 4.31703e-06 * x^(1,9) - 16 * x^(2,8) - 8.20745e-05 * x^(3,7) - 0.000126648 * x^(5,5) - 9.88553e-06 * x^(7,3) - 16 * x^(8,2) + 2.89485e-06 * x^(9,1) - 17024 * x^(10,0) + 0.000745636 * x^(0,11) + 2.83569e-05 * x^(2,9) - 4.38099e-06 * x^(3,8) + 3.71818e-05 * x^(4,7) - 5.43641e-06 * x^(5,6) + 2.27798e-05 * x^(6,5) - 1.05904e-05 * x^(7,4) + 4.2333e-06 * x^(8,3) - 3.88355e-06 * x^(9,2) - 7.53605e-05 * x^(11,0) + 17152 * x^(0,12) + 3.87574e-05 * x^(3,9) + 0.000180564 * x^(5,7) + 7.82443e-05 * x^(7,5) - 4.8194e-06 * x^(9,3) + 17152 * x^(12,0) - 0.000500541 * x^(0,13) - 2.00733e-05 * x^(2,11) - 1.75581e-05 * x^(4,9) - 3.16923e-05 * x^(6,7) + 7.7663e-06 * x^(7,6) + 5.00103e-06 * x^(9,4) + 5.29827e-05 * x^(13,0) - 9216 * x^(0,14) - 8.52663e-05 * x^(5,9) - 0.000111778 * x^(7,7) - 9216 * x^(14,0) + 0.000134277 * x^(0,15) + 6.43374e-06 * x^(2,13) + 1.49658e-05 * x^(6,9) - 3.66742e-06 * x^(9,6) - 1.48008e-05 * x^(15,0) + 2048 * x^(0,16) + 5.27839e-05 * x^(7,9) + 2048 * x^(16,0). P(2)(x) = - 8.22504e-08 * x^(0,1) + 0.5 * x^(1,0) - 2.53607e-07 * x^(0,2) - 3.49161e-08 * x^(1,1) - 0.5 * x^(2,0) + 4.34786e-06 * x^(0,3) + 2.00886 * x^(1,2) - 1.48838e-07 * x^(2,1) - 21 * x^(3,0) + 1.024e-05 * x^(0,4) + 6.80515e-07 * x^(1,3) - 2.5 * x^(2,2) + 2.70178e-07 * x^(3,1) + 21 * x^(4,0) - 4.79767e-05 * x^(0,5) - 3.26992 * x^(1,4) - 7.26803e-07 * x^(2,3) - 69.3941 * x^(3,2) + 8.11601e-07 * x^(4,1) + 252 * x^(5,0) - 0.000117455 * x^(0,6) - 2.62812e-06 * x^(1,5) + 15 * x^(2,4) - 6.18934e-06 * x^(3,3) - 7 * x^(4,2) - 9.26623e-08 * x^(5,1) - 252 * x^(6,0) + 0.000233602 * x^(0,7) - 9.93124 * x^(1,6) + 2.10831e-07 * x^(2,5) + 225.551 * x^(3,4) + 4.32632e-06 * x^(4,3) + 291.812 * x^(5,2) - 1.66313e-06 * x^(6,1) - 1320 * x^(7,0) + 0.000586013 * x^(0,8) + 3.70725e-06 * x^(1,7) - 20 * x^(2,6) + 2.38821e-05 * x^(3,5) + 2 * x^(4,4) + 1.22103e-05 * x^(5,3) + 12 * x^(6,2) - 7.03096e-07 * x^(7,1) + 1320 * x^(8,0) - 0.000582742 * x^(0,9) + 12 * x^(1,8) + 1.71663e-05 * x^(2,7) - 145.542 * x^(3,6) - 2.47286e-05 * x^(4,5) - 972.562 * x^(5,4) - 1.46715e-06 * x^(6,3) - 414.808 * x^(7,2) + 9.87453e-07 * x^(8,1) + 3520 * x^(9,0) - 0.00148627 * x^(0,10) - 1.75065e-06 * x^(1,9) + 8 * x^(2,8) - 3.33652e-05 * x^(3,7) - 5.18411e-05 * x^(5,5) - 6.05731e-06 * x^(7,3) - 8 * x^(8,2) + 5.82629e-07 * x^(9,1) - 3520 * x^(10,0) + 0.000776516 * x^(0,11) - 4.48633e-05 * x^(2,9) - 20 * x^(3,8) + 3.50751e-05 * x^(4,7) + 713.212 * x^(5,6) + 1.82442e-05 * x^(6,5) + 1389.37 * x^(7,4) - 1.64576e-06 * x^(8,3) + 195.881 * x^(9,2) - 4992 * x^(11,0) + 0.00200509 * x^(0,12) + 1.57558e-05 * x^(3,9) + 7.34035e-05 * x^(5,7) + 3.18082e-05 * x^(7,5) - 9.91024e-07 * x^(9,3) + 4992 * x^(12,0) - 0.00052573 * x^(0,13) + 4.2108e-05 * x^(2,11) - 1.65508e-05 * x^(4,9) - 2.58457e-05 * x^(6,7) - 1018.87 * x^(7,6) - 656.094 * x^(9,4) + 3584 * x^(13,0) - 0.00137077 * x^(0,14) - 3.46628e-05 * x^(5,9) - 4.54403e-05 * x^(7,7) - 3584 * x^(14,0) + 0.000142103 * x^(0,15) - 1.34961e-05 * x^(2,13) + 1.22049e-05 * x^(6,9) + 481.135 * x^(9,6) - 1024 * x^(15,0) + 0.000373446 * x^(0,16) + 2.14579e-05 * x^(7,9) + 1024 * x^(16,0). Saving plot file in "test11_interpolant.png" Relative error is 0.0150304 Maximum error is 0.0482092 lagrange_nd_test(): Normal end of execution. 07-Jan-2022 22:39:54