19 March 2020 09:30:02 AM INTERP_TEST C++ version: Test the INTERP library. TEST01 INTERP_NEAREST evaluates a nearest-neighbor interpolant. In this example, the function we are interpolating is Runge's function, with Chebyshev knots. The data to be interpolated: Spatial dimension = 1 Number of data values = 11 T_data P_data -1 0.0384615 -0.951057 0.0423501 -0.809017 0.0575947 -0.587785 0.103764 -0.309017 0.295221 6.12323e-17 1 0.309017 0.295221 0.587785 0.103764 0.809017 0.0575947 0.951057 0.0423501 1 0.0384615 Interpolation: T_interp P_interp P_exact Error -1.04894 0.0384615 0.035079 0.00338251 -1.03671 0.0384615 0.0358821 0.00257946 -1.02447 0.0384615 0.0367127 0.00174888 -1.01224 0.0384615 0.037572 0.000889498 -1 0.0384615 0.0384615 0 -0.987764 0.0384615 0.0393826 -0.000921023 -0.975528 0.0384615 0.0403366 -0.00187505 -0.963292 0.0423501 0.0413252 0.00102486 -1 0.0384615 0.0384615 0 -0.915547 0.0423501 0.0455464 -0.00319631 -0.880037 0.0575947 0.049112 0.00848268 -0.844527 0.0575947 0.0531049 0.00448975 -1 0.0384615 0.0384615 0 -0.753709 0.0575947 0.0657811 -0.00818642 -0.698401 0.103764 0.0757914 0.0279722 -0.643093 0.103764 0.0881895 0.0155742 -1 0.0384615 0.0384615 0 -0.518093 0.103764 0.129693 -0.0259294 -0.448401 0.295221 0.165931 0.12929 -0.378709 0.295221 0.218078 0.0771434 -1 0.0384615 0.0384615 0 -0.231763 0.295221 0.426831 -0.131609 -0.154508 1 0.626244 0.373756 -0.0772542 1 0.870166 0.129834 -1 0.0384615 0.0384615 0 0.0772542 1 0.870166 0.129834 0.154508 0.295221 0.626244 -0.331022 0.231763 0.295221 0.426831 -0.131609 -1 0.0384615 0.0384615 0 0.378709 0.295221 0.218078 0.0771434 0.448401 0.103764 0.165931 -0.0621677 0.518093 0.103764 0.129693 -0.0259294 -1 0.0384615 0.0384615 0 0.643093 0.103764 0.0881895 0.0155742 0.698401 0.0575947 0.0757914 -0.0181967 0.753709 0.0575947 0.0657811 -0.00818642 -1 0.0384615 0.0384615 0 0.844527 0.0575947 0.0531049 0.00448975 0.880037 0.0423501 0.049112 -0.00676194 0.915547 0.0423501 0.0455464 -0.00319631 -1 0.0384615 0.0384615 0 0.963292 0.0423501 0.0413252 0.00102486 0.975528 0.0384615 0.0403366 -0.00187505 0.987764 0.0384615 0.0393826 -0.000921023 1 0.0384615 0.0384615 0 1.01224 0.0384615 0.037572 0.000889498 1.02447 0.0384615 0.0367127 0.00174888 TEST02 INTERP_LINEAR evaluates a piecewise linear spline. In this example, the function we are interpolating is Runge's function, with evenly spaced knots. The data to be interpolated: Spatial dimension = 1 Number of data values = 11 T_data P_data -1 0.0384615 -0.8 0.0588235 -0.6 0.1 -0.4 0.2 -0.2 0.5 0 1 0.2 0.5 0.4 0.2 0.6 0.1 0.8 0.0588235 1 0.0384615 Interpolation: T_interp P_interp P_exact Error -1.2 0.0180995 0.027027 -0.00892748 -1.15 0.02319 0.0293578 -0.00616775 -1.1 0.0282805 0.032 -0.00371946 -1.05 0.033371 0.0350109 -0.0016399 -1 0.0384615 0.0384615 0 -0.95 0.043552 0.0424403 0.00111172 -0.9 0.0486425 0.0470588 0.00158371 -0.85 0.053733 0.052459 0.00127402 -1 0.0384615 0.0384615 0 -0.75 0.0691176 0.06639 0.00272761 -0.7 0.0794118 0.0754717 0.00394007 -0.65 0.0897059 0.0864865 0.0032194 -1 0.0384615 0.0384615 0 -0.55 0.125 0.116788 0.00821168 -0.5 0.15 0.137931 0.012069 -0.45 0.175 0.164948 0.0100515 -1 0.0384615 0.0384615 0 -0.35 0.275 0.246154 0.0288462 -0.3 0.35 0.307692 0.0423077 -0.25 0.425 0.390244 0.0347561 -1 0.0384615 0.0384615 0 -0.15 0.625 0.64 -0.015 -0.1 0.75 0.8 -0.05 -0.05 0.875 0.941176 -0.0661765 -1 0.0384615 0.0384615 0 0.05 0.875 0.941176 -0.0661765 0.1 0.75 0.8 -0.05 0.15 0.625 0.64 -0.015 -1 0.0384615 0.0384615 0 0.25 0.425 0.390244 0.0347561 0.3 0.35 0.307692 0.0423077 0.35 0.275 0.246154 0.0288462 -1 0.0384615 0.0384615 0 0.45 0.175 0.164948 0.0100515 0.5 0.15 0.137931 0.012069 0.55 0.125 0.116788 0.00821168 -1 0.0384615 0.0384615 0 0.65 0.0897059 0.0864865 0.0032194 0.7 0.0794118 0.0754717 0.00394007 0.75 0.0691176 0.06639 0.00272761 -1 0.0384615 0.0384615 0 0.85 0.053733 0.052459 0.00127402 0.9 0.0486425 0.0470588 0.00158371 0.95 0.043552 0.0424403 0.00111172 1 0.0384615 0.0384615 0 1.05 0.033371 0.0350109 -0.0016399 1.1 0.0282805 0.032 -0.00371946 TEST03 INTERP_LAGRANGE evaluates a polynomial interpolant. In this example, the function we are interpolating is Runge's function, with evenly spaced knots. The data to be interpolated: Spatial dimension = 1 Number of data values = 6 T_data P_data -1 0.0384615 -0.6 0.1 -0.2 0.5 0.2 0.5 0.6 0.1 1 0.0384615 Interpolation: T_interp P_interp P_exact Error -1.4 1.79231 0.02 1.77231 -1.3 1.07512 0.0231214 1.052 -1.2 0.567308 0.027027 0.540281 -1.1 0.232812 0.032 0.200812 -1 0.0384615 0.0384615 0 -0.9 -0.0460337 0.0470588 -0.0930925 -0.8 -0.0480769 0.0588235 -0.1069 -0.7 0.0078125 0.0754717 -0.0676592 -1 0.0384615 0.0384615 0 -0.5 0.209736 0.137931 0.0718045 -0.4 0.321154 0.2 0.121154 -0.3 0.421274 0.307692 0.113582 -1 0.0384615 0.0384615 0 -0.1 0.55012 0.8 -0.24988 0 0.567308 1 -0.432692 0.1 0.55012 0.8 -0.24988 -1 0.0384615 0.0384615 0 0.3 0.421274 0.307692 0.113582 0.4 0.321154 0.2 0.121154 0.5 0.209736 0.137931 0.0718045 -1 0.0384615 0.0384615 0 0.7 0.0078125 0.0754717 -0.0676592 0.8 -0.0480769 0.0588235 -0.1069 0.9 -0.0460337 0.0470588 -0.0930925 1 0.0384615 0.0384615 0 1.1 0.232813 0.032 0.200813 1.2 0.567308 0.027027 0.540281 TEST03 INTERP_LAGRANGE evaluates a polynomial interpolant. In this example, the function we are interpolating is Runge's function, with evenly spaced knots. The data to be interpolated: Spatial dimension = 1 Number of data values = 11 T_data P_data -1 0.0384615 -0.8 0.0588235 -0.6 0.1 -0.4 0.2 -0.2 0.5 0 1 0.2 0.5 0.4 0.2 0.6 0.1 0.8 0.0588235 1 0.0384615 Interpolation: T_interp P_interp P_exact Error -1.2 -146.421 0.027027 -146.448 -1.15 -67.7068 0.0293578 -67.7361 -1.1 -26.7006 0.032 -26.7326 -1.05 -7.48022 0.0350109 -7.51523 -1 0.0384615 0.0384615 0 -0.95 1.92363 0.0424403 1.88119 -0.9 1.57872 0.0470588 1.53166 -0.85 0.719459 0.052459 0.667 -1 0.0384615 0.0384615 0 -0.75 -0.231462 0.06639 -0.297852 -0.7 -0.226196 0.0754717 -0.301668 -0.65 -0.0726042 0.0864865 -0.159091 -1 0.0384615 0.0384615 0 -0.55 0.215592 0.116788 0.0988036 -0.5 0.253755 0.137931 0.115824 -0.45 0.234969 0.164948 0.0700201 -1 0.0384615 0.0384615 0 -0.35 0.19058 0.246154 -0.0555734 -0.3 0.235347 0.307692 -0.0723457 -0.25 0.342641 0.390244 -0.0476027 -1 0.0384615 0.0384615 0 -0.15 0.67899 0.64 0.0389896 -0.1 0.843407 0.8 0.0434074 -0.05 0.958627 0.941176 0.0174506 -1 0.0384615 0.0384615 0 0.05 0.958627 0.941176 0.0174506 0.1 0.843407 0.8 0.0434074 0.15 0.67899 0.64 0.0389896 -1 0.0384615 0.0384615 0 0.25 0.342641 0.390244 -0.0476027 0.3 0.235347 0.307692 -0.0723457 0.35 0.19058 0.246154 -0.0555734 -1 0.0384615 0.0384615 0 0.45 0.234969 0.164948 0.0700201 0.5 0.253755 0.137931 0.115824 0.55 0.215592 0.116788 0.0988036 -1 0.0384615 0.0384615 0 0.65 -0.0726042 0.0864865 -0.159091 0.7 -0.226196 0.0754717 -0.301668 0.75 -0.231462 0.06639 -0.297852 -1 0.0384615 0.0384615 0 0.85 0.719459 0.052459 0.667 0.9 1.57872 0.0470588 1.53166 0.95 1.92363 0.0424403 1.88119 1 0.0384615 0.0384615 0 1.05 -7.48022 0.0350109 -7.51523 1.1 -26.7006 0.032 -26.7326 TEST04 INTERP_LAGRANGE evaluates a polynomial interpolant. In this example, the function we are interpolating is Runge's function, with Clenshaw Curtis knots. The data to be interpolated: Spatial dimension = 1 Number of data values = 6 T_data P_data -1 0.0384615 -0.809017 0.0575947 -0.309017 0.295221 0.309017 0.295221 0.809017 0.0575947 1 0.0384615 Interpolation: T_interp P_interp P_exact Error -1.19098 0.145943 0.0274266 0.118517 -1.14324 0.103332 0.0296958 0.0736361 -1.09549 0.0720028 0.0322554 0.0397474 -1.04775 0.0507607 0.0351565 0.0156043 -1 0.0384615 0.0384615 0 -0.952254 0.0340121 0.0422481 -0.00823602 -0.904508 0.0363701 0.0466127 -0.0102426 -0.856763 0.0445444 0.0516768 -0.00713235 -1 0.0384615 0.0384615 0 -0.684017 0.108521 0.0787589 0.029762 -0.559017 0.17264 0.113475 0.0591649 -0.434017 0.238045 0.175154 0.0628908 -1 0.0384615 0.0384615 0 -0.154508 0.344126 0.626244 -0.282118 5.55112e-17 0.361359 1 -0.638641 0.154508 0.344126 0.626244 -0.282118 -1 0.0384615 0.0384615 0 0.434017 0.238045 0.175154 0.0628908 0.559017 0.17264 0.113475 0.0591649 0.684017 0.108521 0.0787589 0.029762 -1 0.0384615 0.0384615 0 0.856763 0.0445444 0.0516768 -0.00713235 0.904508 0.0363701 0.0466127 -0.0102426 0.952254 0.0340121 0.0422481 -0.00823602 1 0.0384615 0.0384615 0 1.04775 0.0507607 0.0351565 0.0156043 1.09549 0.0720028 0.0322554 0.0397474 TEST04 INTERP_LAGRANGE evaluates a polynomial interpolant. In this example, the function we are interpolating is Runge's function, with Clenshaw Curtis knots. The data to be interpolated: Spatial dimension = 1 Number of data values = 11 T_data P_data -1 0.0384615 -0.951057 0.0423501 -0.809017 0.0575947 -0.587785 0.103764 -0.309017 0.295221 6.12323e-17 1 0.309017 0.295221 0.587785 0.103764 0.809017 0.0575947 0.951057 0.0423501 1 0.0384615 Interpolation: T_interp P_interp P_exact Error -1.04894 -0.144661 0.035079 -0.17974 -1.03671 -0.0674828 0.0358821 -0.103365 -1.02447 -0.0148301 0.0367127 -0.0515428 -1.01224 0.0189172 0.037572 -0.0186549 -1 0.0384615 0.0384615 0 -0.987764 0.047696 0.0393826 0.00831339 -0.975528 0.0498032 0.0403366 0.00946661 -0.963292 0.0473462 0.0413252 0.00602096 -1 0.0384615 0.0384615 0 -0.915547 0.0262348 0.0455464 -0.0193116 -0.880037 0.0217659 0.049112 -0.0273461 -0.844527 0.0336614 0.0531049 -0.0194435 -1 0.0384615 0.0384615 0 -0.753709 0.100419 0.0657811 0.0346382 -0.698401 0.127317 0.0757914 0.051526 -0.643093 0.126626 0.0881895 0.038437 -1 0.0384615 0.0384615 0 -0.518093 0.071207 0.129693 -0.0584861 -0.448401 0.0749766 0.165931 -0.0909547 -0.378709 0.147264 0.218078 -0.0708142 -1 0.0384615 0.0384615 0 -0.231763 0.521674 0.426831 0.0948434 -0.154508 0.75722 0.626244 0.130976 -0.0772542 0.93432 0.870166 0.064154 -1 0.0384615 0.0384615 0 0.0772542 0.93432 0.870166 0.064154 0.154508 0.75722 0.626244 0.130976 0.231763 0.521674 0.426831 0.0948434 -1 0.0384615 0.0384615 0 0.378709 0.147264 0.218078 -0.0708142 0.448401 0.0749766 0.165931 -0.0909547 0.518093 0.071207 0.129693 -0.0584861 -1 0.0384615 0.0384615 0 0.643093 0.126626 0.0881895 0.038437 0.698401 0.127317 0.0757914 0.051526 0.753709 0.100419 0.0657811 0.0346382 -1 0.0384615 0.0384615 0 0.844527 0.0336614 0.0531049 -0.0194435 0.880037 0.0217659 0.049112 -0.0273461 0.915547 0.0262348 0.0455464 -0.0193116 -1 0.0384615 0.0384615 0 0.963292 0.0473462 0.0413252 0.00602096 0.975528 0.0498032 0.0403366 0.00946661 0.987764 0.047696 0.0393826 0.00831339 1 0.0384615 0.0384615 0 1.01224 0.0189172 0.037572 -0.0186549 1.02447 -0.0148301 0.0367127 -0.0515428 INTERP_TEST Normal end of execution. 19 March 2020 09:30:02 AM