07-Jan-2022 21:54:01 interp_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test interp(). interp_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.0489 0.0384615 0.035079 0.0034 -1.0367 0.0384615 0.0358821 0.0026 -1.0245 0.0384615 0.0367127 0.0017 -1.0122 0.0384615 0.037572 0.00089 -1.0000 0.0384615 0.0384615 0 -0.9878 0.0384615 0.0393826 -0.00092 -0.9755 0.0384615 0.0403366 -0.0019 -0.9633 0.0423501 0.0413252 0.001 -0.9511 0.0423501 0.0423501 0 -0.9155 0.0423501 0.0455464 -0.0032 -0.8800 0.0575947 0.049112 0.0085 -0.8445 0.0575947 0.0531049 0.0045 -0.8090 0.0575947 0.0575947 0 -0.7537 0.0575947 0.0657811 -0.0082 -0.6984 0.103764 0.0757914 0.028 -0.6431 0.103764 0.0881895 0.016 -0.5878 0.103764 0.103764 0 -0.5181 0.103764 0.129693 -0.026 -0.4484 0.295221 0.165931 0.13 -0.3787 0.295221 0.218078 0.077 -0.3090 0.295221 0.295221 0 -0.2318 0.295221 0.426831 -0.13 -0.1545 1 0.626244 0.37 -0.0773 1 0.870166 0.13 0.0000 1 1 0 0.0773 1 0.870166 0.13 0.1545 0.295221 0.626244 -0.33 0.2318 0.295221 0.426831 -0.13 0.3090 0.295221 0.295221 0 0.3787 0.295221 0.218078 0.077 0.4484 0.103764 0.165931 -0.062 0.5181 0.103764 0.129693 -0.026 0.5878 0.103764 0.103764 0 0.6431 0.103764 0.0881895 0.016 0.6984 0.0575947 0.0757914 -0.018 0.7537 0.0575947 0.0657811 -0.0082 0.8090 0.0575947 0.0575947 0 0.8445 0.0575947 0.0531049 0.0045 0.8800 0.0423501 0.049112 -0.0068 0.9155 0.0423501 0.0455464 -0.0032 0.9511 0.0423501 0.0423501 0 0.9633 0.0423501 0.0413252 0.001 0.9755 0.0384615 0.0403366 -0.0019 0.9878 0.0384615 0.0393826 -0.00092 1.0000 0.0384615 0.0384615 0 1.0122 0.0384615 0.037572 0.00089 1.0245 0.0384615 0.0367127 0.0017 interp_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.2000 0.0180995 0.027027 -0.0089 -1.1500 0.02319 0.0293578 -0.0062 -1.1000 0.0282805 0.032 -0.0037 -1.0500 0.033371 0.0350109 -0.0016 -1.0000 0.0384615 0.0384615 0 -0.9500 0.043552 0.0424403 0.0011 -0.9000 0.0486425 0.0470588 0.0016 -0.8500 0.053733 0.052459 0.0013 -0.8000 0.0588235 0.0588235 0 -0.7500 0.0691176 0.06639 0.0027 -0.7000 0.0794118 0.0754717 0.0039 -0.6500 0.0897059 0.0864865 0.0032 -0.6000 0.1 0.1 0 -0.5500 0.125 0.116788 0.0082 -0.5000 0.15 0.137931 0.012 -0.4500 0.175 0.164948 0.01 -0.4000 0.2 0.2 0 -0.3500 0.275 0.246154 0.029 -0.3000 0.35 0.307692 0.042 -0.2500 0.425 0.390244 0.035 -0.2000 0.5 0.5 0 -0.1500 0.625 0.64 -0.015 -0.1000 0.75 0.8 -0.05 -0.0500 0.875 0.941176 -0.066 0.0000 1 1 0 0.0500 0.875 0.941176 -0.066 0.1000 0.75 0.8 -0.05 0.1500 0.625 0.64 -0.015 0.2000 0.5 0.5 0 0.2500 0.425 0.390244 0.035 0.3000 0.35 0.307692 0.042 0.3500 0.275 0.246154 0.029 0.4000 0.2 0.2 0 0.4500 0.175 0.164948 0.01 0.5000 0.15 0.137931 0.012 0.5500 0.125 0.116788 0.0082 0.6000 0.1 0.1 0 0.6500 0.0897059 0.0864865 0.0032 0.7000 0.0794118 0.0754717 0.0039 0.7500 0.0691176 0.06639 0.0027 0.8000 0.0588235 0.0588235 0 0.8500 0.053733 0.052459 0.0013 0.9000 0.0486425 0.0470588 0.0016 0.9500 0.043552 0.0424403 0.0011 1.0000 0.0384615 0.0384615 0 1.0500 0.033371 0.0350109 -0.0016 1.1000 0.0282805 0.032 -0.0037 interp_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.4000 1.79231 0.02 1.8 -1.3000 1.07512 0.0231214 1.1 -1.2000 0.567308 0.027027 0.54 -1.1000 0.232812 0.032 0.2 -1.0000 0.0384615 0.0384615 0 -0.9000 -0.0460337 0.0470588 -0.093 -0.8000 -0.0480769 0.0588235 -0.11 -0.7000 0.0078125 0.0754717 -0.068 -0.6000 0.1 0.1 0 -0.5000 0.209736 0.137931 0.072 -0.4000 0.321154 0.2 0.12 -0.3000 0.421274 0.307692 0.11 -0.2000 0.5 0.5 0 -0.1000 0.55012 0.8 -0.25 0.0000 0.567308 1 -0.43 0.1000 0.55012 0.8 -0.25 0.2000 0.5 0.5 0 0.3000 0.421274 0.307692 0.11 0.4000 0.321154 0.2 0.12 0.5000 0.209736 0.137931 0.072 0.6000 0.1 0.1 0 0.7000 0.0078125 0.0754717 -0.068 0.8000 -0.0480769 0.0588235 -0.11 0.9000 -0.0460337 0.0470588 -0.093 1.0000 0.0384615 0.0384615 0 1.1000 0.232813 0.032 0.2 1.2000 0.567308 0.027027 0.54 interp_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.2000 -146.421 0.027027 -1.5e+02 -1.1500 -67.7068 0.0293578 -68 -1.1000 -26.7006 0.032 -27 -1.0500 -7.48022 0.0350109 -7.5 -1.0000 0.0384615 0.0384615 0 -0.9500 1.92363 0.0424403 1.9 -0.9000 1.57872 0.0470588 1.5 -0.8500 0.719459 0.052459 0.67 -0.8000 0.0588235 0.0588235 0 -0.7500 -0.231462 0.06639 -0.3 -0.7000 -0.226196 0.0754717 -0.3 -0.6500 -0.0726042 0.0864865 -0.16 -0.6000 0.1 0.1 0 -0.5500 0.215592 0.116788 0.099 -0.5000 0.253755 0.137931 0.12 -0.4500 0.234969 0.164948 0.07 -0.4000 0.2 0.2 0 -0.3500 0.19058 0.246154 -0.056 -0.3000 0.235347 0.307692 -0.072 -0.2500 0.342641 0.390244 -0.048 -0.2000 0.5 0.5 0 -0.1500 0.67899 0.64 0.039 -0.1000 0.843407 0.8 0.043 -0.0500 0.958627 0.941176 0.017 0.0000 1 1 0 0.0500 0.958627 0.941176 0.017 0.1000 0.843407 0.8 0.043 0.1500 0.67899 0.64 0.039 0.2000 0.5 0.5 0 0.2500 0.342641 0.390244 -0.048 0.3000 0.235347 0.307692 -0.072 0.3500 0.19058 0.246154 -0.056 0.4000 0.2 0.2 0 0.4500 0.234969 0.164948 0.07 0.5000 0.253755 0.137931 0.12 0.5500 0.215592 0.116788 0.099 0.6000 0.1 0.1 0 0.6500 -0.0726042 0.0864865 -0.16 0.7000 -0.226196 0.0754717 -0.3 0.7500 -0.231462 0.06639 -0.3 0.8000 0.0588235 0.0588235 0 0.8500 0.719459 0.052459 0.67 0.9000 1.57872 0.0470588 1.5 0.9500 1.92363 0.0424403 1.9 1.0000 0.0384615 0.0384615 0 1.0500 -7.48022 0.0350109 -7.5 1.1000 -26.7006 0.032 -27 interp_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.1910 0.145943 0.0274266 0.12 -1.1432 0.103332 0.0296958 0.074 -1.0955 0.0720028 0.0322554 0.04 -1.0477 0.0507607 0.0351565 0.016 -1.0000 0.0384615 0.0384615 0 -0.9523 0.0340121 0.0422481 -0.0082 -0.9045 0.0363701 0.0466127 -0.01 -0.8568 0.0445444 0.0516768 -0.0071 -0.8090 0.0575947 0.0575947 0 -0.6840 0.108521 0.0787589 0.03 -0.5590 0.17264 0.113475 0.059 -0.4340 0.238045 0.175154 0.063 -0.3090 0.295221 0.295221 0 -0.1545 0.344126 0.626244 -0.28 0.0000 0.361359 1 -0.64 0.1545 0.344126 0.626244 -0.28 0.3090 0.295221 0.295221 0 0.4340 0.238045 0.175154 0.063 0.5590 0.17264 0.113475 0.059 0.6840 0.108521 0.0787589 0.03 0.8090 0.0575947 0.0575947 0 0.8568 0.0445444 0.0516768 -0.0071 0.9045 0.0363701 0.0466127 -0.01 0.9523 0.0340121 0.0422481 -0.0082 1.0000 0.0384615 0.0384615 0 1.0477 0.0507607 0.0351565 0.016 1.0955 0.0720028 0.0322554 0.04 interp_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.0489 -0.144661 0.035079 -0.18 -1.0367 -0.0674828 0.0358821 -0.1 -1.0245 -0.0148301 0.0367127 -0.052 -1.0122 0.0189172 0.037572 -0.019 -1.0000 0.0384615 0.0384615 0 -0.9878 0.047696 0.0393826 0.0083 -0.9755 0.0498032 0.0403366 0.0095 -0.9633 0.0473462 0.0413252 0.006 -0.9511 0.0423501 0.0423501 0 -0.9155 0.0262348 0.0455464 -0.019 -0.8800 0.0217659 0.049112 -0.027 -0.8445 0.0336614 0.0531049 -0.019 -0.8090 0.0575947 0.0575947 0 -0.7537 0.100419 0.0657811 0.035 -0.6984 0.127317 0.0757914 0.052 -0.6431 0.126626 0.0881895 0.038 -0.5878 0.103764 0.103764 0 -0.5181 0.071207 0.129693 -0.058 -0.4484 0.0749766 0.165931 -0.091 -0.3787 0.147264 0.218078 -0.071 -0.3090 0.295221 0.295221 0 -0.2318 0.521674 0.426831 0.095 -0.1545 0.75722 0.626244 0.13 -0.0773 0.93432 0.870166 0.064 0.0000 1 1 0 0.0773 0.93432 0.870166 0.064 0.1545 0.75722 0.626244 0.13 0.2318 0.521674 0.426831 0.095 0.3090 0.295221 0.295221 0 0.3787 0.147264 0.218078 -0.071 0.4484 0.0749766 0.165931 -0.091 0.5181 0.071207 0.129693 -0.058 0.5878 0.103764 0.103764 0 0.6431 0.126626 0.0881895 0.038 0.6984 0.127317 0.0757914 0.052 0.7537 0.100419 0.0657811 0.035 0.8090 0.0575947 0.0575947 0 0.8445 0.0336614 0.0531049 -0.019 0.8800 0.0217659 0.049112 -0.027 0.9155 0.0262348 0.0455464 -0.019 0.9511 0.0423501 0.0423501 0 0.9633 0.0473462 0.0413252 0.006 0.9755 0.0498032 0.0403366 0.0095 0.9878 0.047696 0.0393826 0.0083 1.0000 0.0384615 0.0384615 0 1.0122 0.0189172 0.037572 -0.019 1.0245 -0.0148301 0.0367127 -0.052 interp_test(): Normal end of execution. 07-Jan-2022 21:54:01