08-Jan-2022 09:02:57 pwl_product_integral_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test pwl_product_integral(). pwl_PRODUCT_INTEGRAL_TEST01 Test pwl_PRODUCT_INTEGRAL on a very simple problem. F and G are both defined over a single common interval, so that F(X) = G(X) = X. A B Integral Exact 1.000000 1.000000 0.000000 0.000000 1.000000 2.000000 2.333333 2.333333 1.000000 3.000000 8.666667 8.666667 1.000000 4.000000 21.000000 21.000000 1.000000 5.000000 41.333333 41.333333 pwl_PRODUCT_INTEGRAL_TEST02 Test pwl_PRODUCT_INTEGRAL on a simple problem. F and G are both defined over separate, multiple intervals, but still true that F(X) = G(X) = X. A B Integral Exact 1.000000 1.000000 0.000000 0.000000 1.000000 2.000000 2.333333 2.333333 1.000000 3.000000 8.666667 8.666667 1.000000 4.000000 21.000000 21.000000 1.000000 5.000000 41.333333 41.333333 pwl_PRODUCT_INTEGRAL_TEST03 Test pwl_PRODUCT_INTEGRAL on a simple problem. F and G are defined over separate, multiple intervals. F(X) interpolates SIN(X), G(X) interpolates 2*COS(X). We compare: INTEGRAL, our value for the integral, QUAD, a quadrature estimate for the integral, and CLOSE, the value of the integral of 2*COS(X)*SIN(X) A B Integral Quad Close 0.000000 0.000000 0.000000 0.000000 -0.000000 0.000000 0.523599 0.247447 0.247447 0.250000 0.000000 1.047198 0.743259 0.743259 0.750000 0.000000 1.570796 0.990786 0.990786 1.000000 0.000000 2.094395 0.743259 0.743259 0.750000 0.000000 2.617994 0.247447 0.247447 0.250000 0.000000 3.141593 -0.000000 0.000000 -0.000000 pwl_PRODUCT_INTEGRAL_TEST04 Test pwl_PRODUCT_INTEGRAL. The nodes are at 0, 1, and 2. F(X) = ( 0, 1, 0 ). G(X) = ( 1, 0, 0 ). Integral F(X) * F(X) dx = 0.666667 Integral F(X) * G(X) dx = 0.166667 Integral G(X) * G(X) dx = 0.333333 pwl_product_integral_test(): Normal end of execution. 08-Jan-2022 09:02:57