Tue May 20 21:18:41 2025 bernstein_polynomial_test(): python version: 3.10.12 numpy version: 1.26.4 Test bernstein_polynomial(). bernstein_poly_01_test(): Python version: 3.10.12 bernstein_poly_01() evaluates Bernstein polynomials. N K X F F tabulated computed 0 0 0.250000 1 1 1 0 0.250000 0.75 0.75 1 1 0.250000 0.25 0.25 2 0 0.250000 0.5625 0.5625 2 1 0.250000 0.375 0.375 2 2 0.250000 0.0625 0.0625 3 0 0.250000 0.421875 0.421875 3 1 0.250000 0.421875 0.421875 3 2 0.250000 0.140625 0.140625 3 3 0.250000 0.015625 0.015625 4 0 0.250000 0.31640625 0.31640625 4 1 0.250000 0.421875 0.421875 4 2 0.250000 0.2109375 0.2109375 4 3 0.250000 0.046875 0.046875 4 4 0.250000 0.00390625 0.00390625 bernstein_poly_01_test(): Normal end of execution. bernstein_poly_01_test2(): bernstein_poly_01() evaluates the Bernstein polynomials based on the interval [0,1]. Here we test the partition of unity property. N X Sum ( 0 <= K <= N ) BP01(N,K)(X) 0 0.0468 1 1 0.2896 1 2 0.3645 1 3 0.4531 1 4 0.0272 1 5 0.0588 1 6 0.1202 1 7 0.9644 1 8 0.8456 1 9 0.7788 1 10 0.7139 1 bernstein_poly_01_matrix_test(): Python version: 3.10.12 bernstein_poly_01_matrix() is given M data values X, and a degree N, and returns an Mx(N+1) matrix B such that B(i,j) is the j-th Bernstein polynomial evaluated at the i-th data value. B(5,1+1): Col: 0 1 Row 0 : 1 0 1 : 0.75 0.25 2 : 0.5 0.5 3 : 0.25 0.75 4 : 0 1 B(5,4+1): Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : 0.316406 0.421875 0.210938 0.046875 0.00390625 2 : 0.0625 0.25 0.375 0.25 0.0625 3 : 0.00390625 0.046875 0.210938 0.421875 0.316406 4 : 0 0 0 0 1 B(10,4+1): Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : 0.624295 0.312148 0.0585277 0.00487731 0.000152416 2 : 0.36595 0.418229 0.179241 0.0341411 0.00243865 3 : 0.197531 0.395062 0.296296 0.0987654 0.0123457 4 : 0.0952599 0.304832 0.365798 0.195092 0.0390184 5 : 0.0390184 0.195092 0.365798 0.304832 0.0952599 6 : 0.0123457 0.0987654 0.296296 0.395062 0.197531 7 : 0.00243865 0.0341411 0.179241 0.418229 0.36595 8 : 0.000152416 0.00487731 0.0585277 0.312148 0.624295 9 : 0 0 0 0 1 B(3,5+1): Col: 0 1 2 3 4 Row 0 : 1 0 0 0 0 1 : 0.03125 0.15625 0.3125 0.3125 0.15625 2 : 0 0 0 0 0 Col: 5 Row 0 : 0 1 : 0.03125 2 : 1 bernstein_poly_01_matrix_test(): Normal end of execution. bernstein_poly_01_values_test(): Python version: 3.10.12 bernstein_poly_01_values() stores values of Bernstein polynomials. N K X F 0 0 0.250000 1 1 0 0.250000 0.75 1 1 0.250000 0.25 2 0 0.250000 0.5625 2 1 0.250000 0.375 2 2 0.250000 0.0625 3 0 0.250000 0.421875 3 1 0.250000 0.421875 3 2 0.250000 0.140625 3 3 0.250000 0.015625 4 0 0.250000 0.31640625 4 1 0.250000 0.421875 4 2 0.250000 0.2109375 4 3 0.250000 0.046875 4 4 0.250000 0.00390625 bernstein_poly_01_values_test(): Normal end of execution. bernstein_poly_ab_test(): Python version: 3.10.12 bernstein_poly_ab() evaluates Bernstein polynomials over an arbitrary interval [A,B]. Here, we demonstrate that BPAB(N,K,A1,B1)(X1) = BPAB(N,K,A2,B2)(X2) provided only that (X1-A1)/(B1-A1) = (X2-A2)/(B2-A2). N K A B X BPAB(N,K,A,B)(X) 10 0 0.0000 1.0000 0.3000 0.0282475 10 1 0.0000 1.0000 0.3000 0.121061 10 2 0.0000 1.0000 0.3000 0.233474 10 3 0.0000 1.0000 0.3000 0.266828 10 4 0.0000 1.0000 0.3000 0.200121 10 5 0.0000 1.0000 0.3000 0.102919 10 6 0.0000 1.0000 0.3000 0.0367569 10 7 0.0000 1.0000 0.3000 0.00900169 10 8 0.0000 1.0000 0.3000 0.0014467 10 9 0.0000 1.0000 0.3000 0.000137781 10 10 0.0000 1.0000 0.3000 5.9049e-06 N K A B X BPAB(N,K,A,B)(X) 10 0 1.0000 2.0000 1.3000 0.0282475 10 1 1.0000 2.0000 1.3000 0.121061 10 2 1.0000 2.0000 1.3000 0.233474 10 3 1.0000 2.0000 1.3000 0.266828 10 4 1.0000 2.0000 1.3000 0.200121 10 5 1.0000 2.0000 1.3000 0.102919 10 6 1.0000 2.0000 1.3000 0.0367569 10 7 1.0000 2.0000 1.3000 0.00900169 10 8 1.0000 2.0000 1.3000 0.0014467 10 9 1.0000 2.0000 1.3000 0.000137781 10 10 1.0000 2.0000 1.3000 5.9049e-06 N K A B X BPAB(N,K,A,B)(X) 10 0 2.0000 4.0000 2.6000 0.0282475 10 1 2.0000 4.0000 2.6000 0.121061 10 2 2.0000 4.0000 2.6000 0.233474 10 3 2.0000 4.0000 2.6000 0.266828 10 4 2.0000 4.0000 2.6000 0.200121 10 5 2.0000 4.0000 2.6000 0.102919 10 6 2.0000 4.0000 2.6000 0.0367569 10 7 2.0000 4.0000 2.6000 0.00900169 10 8 2.0000 4.0000 2.6000 0.0014467 10 9 2.0000 4.0000 2.6000 0.000137781 10 10 2.0000 4.0000 2.6000 5.9049e-06 bernstein_poly_ab_test(): Normal end of execution. bernstein_poly_ab_approx_test(): Python version: 3.10.12 bernstein_poly_ab_approx() evaluates the Bernstein polynomial approximant to a function F(X) defined over [A,B]. N Max Error 0 0.768177 1 0.42037 2 0.213285 3 0.145598 4 0.110847 5 0.0895699 6 0.0751733 7 0.0647756 8 0.0569106 9 0.0507517 10 0.0457974 11 0.0417253 12 0.0383189 13 0.0354271 14 0.0329415 15 0.0307819 16 0.0288883 17 0.0272142 18 0.0257236 19 0.0243879 20 0.0231841 bernstein_to_legendre_matrix_test(): bernstein_to_legendre_matrix() returns the matrix A which maps polynomial coefficients from Bernstein to Legendre form.