Wed Oct 8 07:30:43 2025 differ_test(): python version: 3.10.12 numpy version: 1.26.4 Test differ(). differ_matrix_test(): Demonstrate that the DIFFER matrix is "really" a Vandermonde matrix. Stencil matrix: [[ 2.500000e+00 3.300000e+00 -1.300000e+00 5.000000e-01] [ 6.250000e+00 1.089000e+01 1.690000e+00 2.500000e-01] [ 1.562500e+01 3.593700e+01 -2.197000e+00 1.250000e-01] [ 3.906250e+01 1.185921e+02 2.856100e+00 6.250000e-02]] Solution of DIFFER system: [1. 2. 3. 4.] Solution of VANDERMONDE system: [ 2.5 6.6 -3.9 2. ] Transformed solution of VANDERMONDE system: [1. 2. 3. 4.] differ_test02(): differ_inverse() returns the inverse of a DIFFER matrix N Inverse error 2 8.49796e-16 2 2.13392e-15 2 1.10801e-15 2 2.94396e-16 2 1.34176e-15 3 1.19898e-14 3 3.52668e-14 3 6.86052e-15 3 5.61856e-15 3 1.01366e-14 4 1.96756e-14 4 4.8562e-13 4 5.03529e-13 4 1.35989e-12 4 6.31402e-14 5 1.80205e-12 5 3.8984e-13 5 1.12761e-12 5 1.29857e-12 5 4.3093e-13 6 1.82635e-11 6 3.19652e-11 6 4.52401e-12 6 6.73225e-12 6 3.28172e-12 7 3.87241e-10 7 1.1393e-11 7 3.50193e-10 7 4.46956e-11 7 3.82397e-10 8 5.23231e-08 8 7.60333e-08 8 9.45107e-09 8 2.59683e-10 8 5.91971e-10 differ_test03(): Reproduce a specific example. Solution of DIFFER system: [-0.08333333 0.5 -1.5 0.25 ] DFDX = 3.669313568906812 d exp(x) /dx = 3.6692966676192444 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.0 for all examples. Forward difference coefficients, O = 3 , P = 1 [[ 0. -1.] [ 1. 3.] [ 2. -3.] [ 3. 1.]] Backward difference coefficients, O = 3 , P = 1 [[-3. -1.] [-2. 3.] [-1. -3.] [ 0. 1.]] Central difference coefficients, O = 3 , P = 2 [[-2. -0.5] [-1. 1. ] [ 0. 0. ] [ 1. -1. ] [ 2. 0.5]] Central difference coefficients, O = 3 , P = 4 [[-3.00000000e+00 1.25000000e-01] [-2.00000000e+00 -1.00000000e+00] [-1.00000000e+00 1.62500000e+00] [ 0.00000000e+00 2.12062252e-14] [ 1.00000000e+00 -1.62500000e+00] [ 2.00000000e+00 1.00000000e+00] [ 3.00000000e+00 -1.25000000e-01]] Forward difference coefficients, O = 4 , P = 1 [[ 0. 1.] [ 1. -4.] [ 2. 6.] [ 3. -4.] [ 4. 1.]] Backward difference coefficients, O = 4 , P = 1 [[-4. 1.] [-3. -4.] [-2. 6.] [-1. -4.] [ 0. 1.]] Central difference coefficients, O = 4 , P = 3 [[-3. -0.16666667] [-2. 2. ] [-1. -6.5 ] [ 0. 9.33333333] [ 1. -6.5 ] [ 2. 2. ] [ 3. -0.16666667]] 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.0 and use a uniformly spacing of 1.0 , so we can compare with previous forward, backward and central differences. Finite difference coefficients, O = 3 , P = 1 [[ 0. -1.] [ 1. 3.] [ 2. -3.] [ 3. 1.]] Backward difference coefficients, O = 3 , P = 1 [[-3. -1.] [-2. 3.] [-1. -3.] [ 0. 1.]] Central difference coefficients, O = 3 , P = 2 [[-2. -0.5] [-1. 1. ] [ 0. 0. ] [ 1. -1. ] [ 2. 0.5]] Central difference coefficients, O = 3 , P = 4 [[-3.00000000e+00 1.25000000e-01] [-2.00000000e+00 -1.00000000e+00] [-1.00000000e+00 1.62500000e+00] [ 0.00000000e+00 2.12062252e-14] [ 1.00000000e+00 -1.62500000e+00] [ 2.00000000e+00 1.00000000e+00] [ 3.00000000e+00 -1.25000000e-01]] Finite difference coefficients, O = 4 , P = 1 [[ 0. 1.] [ 1. -4.] [ 2. 6.] [ 3. -4.] [ 4. 1.]] Backward difference coefficients, O = 4 , P = 1 [[-4. 1.] [-3. -4.] [-2. 6.] [-1. -4.] [ 0. 1.]] Central difference coefficients, O = 4 , P = 3 [[-3. -0.16666667] [-2. 2. ] [-1. -6.5 ] [ 0. 9.33333333] [ 1. -6.5 ] [ 2. 2. ] [ 3. -0.16666667]] differ_test(): Normal end of execution. Wed Oct 8 07:30:43 2025