06-Oct-2022 07:41:51 differ_test(): MATLAB/Octave version 4.2.2 Test differ(). differ_matrix_test(): Demonstrate that the DIFFER matrix is "really" a Vandermonde matrix. Stencil matrix: Col: 1 2 3 4 Row 1 : 2.5 3.3 -1.3 0.5 2 : 6.25 10.89 1.69 0.25 3 : 15.625 35.937 -2.197 0.125 4 : 39.0625 118.592 2.8561 0.0625 Solution of DIFFER system: 1: 1 2: 2 3: 3 4: 4 Solution of VANDERMONDE system: 1: 2.5 2: 6.6 3: -3.9 4: 2 Transformed solution of VANDERMONDE system: 1: 1 2: 2 3: 3 4: 4 differ_test02(): differ_inverse() returns the inverse of a DIFFER matrix; N Inverse error 2 5.34053e-16 2 4.00288e-16 2 8.5705e-16 2 2.03024e-15 2 4.97112e-15 3 8.02052e-15 3 4.65043e-15 3 5.9146e-14 3 4.36116e-14 3 9.26155e-14 4 6.56758e-14 4 5.63945e-11 4 3.01372e-14 4 4.57894e-14 4 7.19669e-14 5 6.65399e-13 5 1.19083e-12 5 3.79539e-13 5 1.33247e-11 5 3.87688e-12 6 1.10113e-09 6 9.66704e-11 6 1.21571e-12 6 3.87772e-11 6 4.32587e-12 7 4.44778e-08 7 1.01368e-09 7 1.66699e-11 7 2.66519e-10 7 1.08634e-10 8 1.91213e-08 8 4.05168e-08 8 4.75355e-10 8 1.42053e-09 8 3.24869e-09 differ_test03(): Reproduce a specific example. Solution of DIFFER system: 1: -0.0833333 2: 0.5 3: -1.5 4: 0.25 DFDX = 3.66931 d exp(x) /dx = 3.6693 differ_test04(): differ_forward(), differ_backward(), and differ_central() produce coefficients for difference approximations of the O-th derivative, with error of order H^P, for a uniform spacing of H. Use a spacing of H = 1 for all examples. Forward difference coefficients, O = 3, P = 1 1: 0 -1 2: 1 3 3: 2 -3 4: 3 1 Backward difference coefficients, O = 3, P = 1 1: -3 -1 2: -2 3 3: -1 -3 4: 0 1 Central difference coefficients, O = 3, P = 2 1: -2 -0.5 2: -1 1 3: 0 0 4: 1 -1 5: 2 0.5 Central difference coefficients, O = 3, P = 4 1: -3 0.125 2: -2 -1 3: -1 1.625 4: 0 2.12062e-14 5: 1 -1.625 6: 2 1 7: 3 -0.125 Forward difference coefficients, O = 4, P = 1 1: 0 1 2: 1 -4 3: 2 6 4: 3 -4 5: 4 1 Backward difference coefficients, O = 4, P = 1 1: -4 1 2: -3 -4 3: -2 6 4: -1 -4 5: 0 1 Central difference coefficients, O = 4, P = 3 1: -3 -0.166667 2: -2 2 3: -1 -6.5 4: 0 9.33333 5: 1 -6.5 6: 2 2 7: 3 -0.166667 differ_test05(): differ_stencil() produces coefficients for difference approximations of the O-th derivative, using arbitrarily spaced data, with maximum spacing H with error of order H^P. For all tests, let X0 = 0 and use a uniformly spacing of 1, so we can compare with previous forward, backward and central differences. Finite difference coefficients, O = 3, P = 1 1: 0 -1 2: 1 3 3: 2 -3 4: 3 1 Backward difference coefficients, O = 3, P = 1 1: -3 -1 2: -2 3 3: -1 -3 4: 0 1 Central difference coefficients, O = 3, P = 2 1: -2 -0.5 2: -1 1 3: 0 0 4: 1 -1 5: 2 0.5 Central difference coefficients, O = 3, P = 4 1: -3 0.125 2: -2 -1 3: -1 1.625 4: 0 2.12062e-14 5: 1 -1.625 6: 2 1 7: 3 -0.125 Finite difference coefficients, O = 4, P = 1 1: 0 1 2: 1 -4 3: 2 6 4: 3 -4 5: 4 1 Backward difference coefficients, O = 4, P = 1 1: -4 1 2: -3 -4 3: -2 6 4: -1 -4 5: 0 1 Central difference coefficients, O = 4, P = 3 1: -3 -0.166667 2: -2 2 3: -1 -6.5 4: 0 9.33333 5: 1 -6.5 6: 2 2 7: 3 -0.166667 differ_test(): Normal end of execution. 06-Oct-2022 07:41:51