14-May-2025 15:34:08 differ_test(): MATLAB/Octave version 6.4.0 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 9.10541e-16 2 2.13833e-15 2 1.44499e-15 2 4.53416e-16 2 8.87127e-16 3 8.53731e-15 3 2.23816e-14 3 6.32449e-15 3 8.13284e-15 3 1.45532e-14 4 2.01457e-13 4 7.49596e-14 4 6.96046e-14 4 2.00847e-13 4 8.62196e-14 5 1.92312e-12 5 9.1259e-12 5 1.67557e-12 5 5.03689e-13 5 1.07953e-12 6 1.86619e-12 6 4.24788e-11 6 1.15493e-09 6 7.50998e-12 6 2.70716e-08 7 1.60335e-10 7 2.38459e-11 7 6.13131e-11 7 1.69443e-10 7 3.42454e-11 8 2.04136e-08 8 5.10494e-08 8 2.67264e-10 8 8.71071e-10 8 2.78207e-10 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. 14-May-2025 15:34:08