# Adaptive Piecewise Poly-Sinc Methods for Ordinary Differential Equations
## 4 Adaptive Piecewise Poly-Sinc Algorithm
### Error Analysis
\[\max_{x\in[a,b]}|y(x)-y_{\mathrm{c}}^{(i)}(x)| =\|y(x)-y_{\mathrm{c}}^{(i)}(x)\|_{1}\] \[=\|y(x)-y_{\mathrm{c}}^{(i)}(x)+y_{h}^{(i)}(x)-y_{h}^{(i)}(x)\|_{ I}\] \[\leq\|y(x)-y_{h}^{(i)}(x)\|_{I}+\|y_{\mathrm{c}}^{(i)}(x)-y_{h}^{ (i)}(x)\|_{I}\] \[\leq\bigg{\|}y(x)-y_{h}^{(i)}(x)\bigg{\|}_{I}+\] \[\bigg{\|}\sum_{k=1}^{K_{i}}\,\mathbbm{1}_{x\in I_{k}^{(i)}}\sum_{ j=1}^{m_{k}^{(i)}}(c_{j,k}^{(i)}-y_{j,k}^{(i)})u_{j,k}^{(i)}(x)\bigg{\|}_{I}\] \[\leq K_{i}\,E_{i}+\sum_{k=1}^{K_{i}}\bigg{\|}\sum_{j=1}^{m_{k}^{( i)}}(c_{j,k}^{(i)}-y_{j,k}^{(i)})u_{j,k}^{(i)}(x)\bigg{\|}_{I_{k}^{(i)}}\] \[\max_{x\in[a,b]}\frac{1}{K_{i}}\left|y(x)-y_{h}^{(i)}(x)\right|\leq E_{i}.\]0 \[\max_{x\in[a,b]}\frac{1}{K_{i}}\left|y(x)-y_{h}^{(i)}(x)\right|\leq E_{i}.\]1 \[\max_{x\in[a,b]}\frac{1}{K_{i}}\left|y(x)-y_{h}^{(i)}(x)\right|\leq E_{i}.\]2 \[\max_{x\in[a,b]}\frac{1}{K_{i}}\left|y(x)-y_{h}^{(i)}(x)\right|\leq E_{i}.\]3 \[\max_{x\in[a,b]}\frac{1}{K_{i}}\left|y(x)-y_{h}^{(i)}(x)\right|\leq E_{i}.\]4

where \(\big{\|}\sum_{j=1}^{m_{k}^{(i)}}|u_{j,k}^{(i)}(x)|\big{\|}_{I_{k}^{(i)}}\approx \frac{1}{\pi}\ln\Big{(}m_{k}^{(i)}\Big{)}+1.07618\) is the Lebesgue constant for Poly-Sinc approximation [31, 33, 59]. On average, the term \(|c_{j,k}^{(i)}-y_{j,k}^{(i)}|<\frac{\delta}{n_{i}}<\frac{\delta}{K_{i}\,\min_{ k}\{m_{k}^{(i)}\}}<\frac{\delta}{K_{i}}\). For fitting purposes, we compute the mean value of the error estimate, i.e.,

\[\max_{x\in[a,b]}\frac{1}{K_{i}}\left|y(x)-y_{h}^{(i)}(x)\right|\leq E_{i}.\]5 \[\max_{x\in[a,b]}\frac{1}{K_{i}}\left|y(x)-y_{h}^{(i)}(x)\right|\leq E_{i}.\]6

## 5 Results

The results in this section were computed using _Mathematica_[60]. We tested our adaptive algorithm on regular and stiff ODEs. The Sinc spacing is \(h=\frac{\pi}{\sqrt{e}\,N}\). For all examples, we set \(e=1/2\) and the number of points per partition to be constant, i.e., \(m_{k}^{(i)}=m=2N+1\). A precision of 200 digits is used. ### Norms

The supremum norm has a theoretical advantage. However, its computation is slower than that of the \(L^{2}\) norm [25]. Hence, we use the \(L^{2}\) norm in our computations. ### Initial Value Problem

We test our adaptive piecewise Poly-Sinc algorithm on regular first-order and second-order IVPs. **Example 1** (Relaxation Problem). : _We start with the relaxation problem in Section 3.1. We set \(a=0\) and the exact solution becomes \(y(x)=\exp(-\alpha\,x)\). We set the exponential decay parameter \(\alpha=20\) and confine the domain of the solution to the interval \([0,1]\). The approximate solution \(y_{\mathrm{c}}(x)\) is computed as discussed in Section 3.1._

_We set the number of Sinc points to be inserted in all partitions as \(m=2N+1=5\). The stopping criterion \(\epsilon_{\mathrm{stop}}=10^{-6}\) was used. The algorithm terminates after \(\kappa=7\) iterations and the number of points \(|\mathsf{S}|=530\)._

_Figure 1a shows the approximate solution \(y_{\mathrm{c}}^{(7)}(x)\). A proper subset of the set of points \(\mathsf{S}\) is shown as red dots, which are projected onto the approximate solution \(y_{\mathrm{c}}^{(7)}(x)\). This proper subset is used to observe the approximate solution \(y_{\mathrm{c}}^{(7)}(x)\). We plot the statistic \(\omega_{i}\) as a function of the iteration index \(i\), \(i=2,3,\ldots,7\), in Figure 1b. The oscillations are decaying and the statistic \(\omega_{i}\) is converging to an asymptotic value. The mean value \(\overline{\omega_{i}}\approx 0.6\) is denoted by a horizontal line._

_We perform the least-squares fitting of the logarithm of the set \(\mathsf{R}\) to the logarithm of the upper bound (24). Figure 2a shows the least-squares fitted model (24) to the set \(\mathsf{R}\). The dots represent the set \(\mathsf{R}\) and the solid line represents the least-squares fitted model (24). Figure 2b shows the residual, absolute local approximation error, and the mean value for the last iteration. The mean value \(\overline{R_{7}}\) is below the threshold value \(10^{-6}\).