1 Introduction

In this work we focus on the solution of a class of linear differential problems of the form

$$\begin{aligned} \frac{dv}{dt}=Av,\quad 0<t<T, \end{aligned}$$
(1.1)

set in a Banach space, with the nonlocal integral condition

$$\frac{1}{T}\int _0^Tv(t)\;dt=f,$$

where the function f and the linear, closed, possibly unbounded operator A are given.

Recall that, given Banach spaces X and Y equipped with norms \(\Vert \cdot \Vert _X\) and \(\Vert \cdot \Vert _Y\), respectively, the norm of a bounded linear operator \(A:D(A)\subset X\rightarrow Y\) is defined as

$$ \Vert A\Vert =\sup _{x\in D(A), x\ne 0}\frac{\Vert Ax\Vert _Y}{\Vert x\Vert _X}. $$

Here D(A) denotes the domain of A, which is a linear subspace of X. Saying that A is closed means that whenever \(x_k\rightarrow x\) in D(A) and \(Tx_k\rightarrow y\) in Y, we have \(T x=y\).

The hypothesis that A is (possibly) unbounded with respect to the operator norm allows us to choose A as a differential operator. For instance, A could be taken as a second derivative w.r.t. a space variable, yielding the familiar form of the homogeneous heat equation, albeit with less common boundary conditions. The study of the heat equation with integral boundary conditions goes back to Cannon [5]; the existence and properties of the solution are investigated in [15, 17]. See also [11] and references therein. Another example of application, this time to system identification, is found in Bellman [1]. In the same vein, note that the evolution problem (1.1) fits into a more general framework of differential problems where the boundary conditions are expressed through the application of linear operators to the unknown function [13]; this includes integral conditions, but also periodic conditions, multipoint conditions and so on.

Let us recall that the theory of operator methods for differential problems provides a setting for the solution of problems such as (1.1): for a general presentation see for instance [7, 14] and references therein.

In a finite-dimensional setting, A is a linear operator acting on a finite-dimensional space, that is, a matrix. The solution to our differential problem can then be expressed as the action of a function of A on f, namely, \(v(t)=\psi _t(A)f\), where \(\psi _t(z)=\frac{Tze^{zt}}{e^{zT}-1}\). Note in passing that this function is closely related to the reciprocal of the \(\varphi _1\) function, which is of interest in the development of exponential integrators: see e.g., [3, 4, 9, 10] and references therein.

A discussion of the finite-dimensional problem was proposed in [2] and [3]. More precisely, Boito et al. [2] introduced an expression for v(t) based on a partial fraction decomposition of the function \(\psi _t(z)\), thus motivating the development of a structured algorithm for the solution of shifted quasiseparable linear systems. It also presented an acceleration technique for this rational decomposition, which introduced a cubic polynomial term. In [3], generalization of this idea led to a family of mixed polynomial-rational approximations of v(t), where the polynomial part is in fact a Bernoulli polynomial of arbitrary degree. In addition to its theoretical interest, this approximation formula allows for the design of effective numerical methods for the computation of v(t), particularly when A is a structured matrix. Let us also mention that the approach based on Bernoulli polynomials for the solution of differential problems with nonlocal conditions was suggested for the first time in Eidelman et al. [6].

For the more general case where the differential problem is set in a Banach space, we prove the existence and uniqueness of the solution v(t) and characterize it via a family of mixed polynomial-rational expansions w.r.t. the operator A. Each expansion contains a purely polynomial term of arbitrary degree, which is related to the Bernoulli polynomials, followed by a series of rational terms. The evaluation of each rational term involves the inversion of A plus a multiple of the identity operator.

From this result we derive a general numerical procedure for computing an approximation of v(t) up to a given tolerance (Algorithm 1). An interesting feature of this approach is the fact that successive rational terms can be computed independently: this allows us to fine-tune the accuracy of the approximation by adding further terms as needed, without the need to recompute the whole approximation. Moreover, in order to improve the efficiency of the implementation, one may also employ parallelization and/or structured methods for the inversion of families of shifted operators; a finite-dimensional example in presence of quasiseparable structure is found in Boito et al. [2].

Numerical tests highlight the effectiveness of this approach and suggest strategies for a good choice of the degree of the polynomial term and of the number of rational terms. After providing results for the matrix case, we focus on a model problem of parabolic equation. For this problem we investigate the behavior of the mixed approximation in combination with two different approaches: the classical method of lines, based on a finite-difference semi-discretization in space, and a “functional” approach where the expansion is applied directly to the infinite-dimensional operator. Each rational term is then computed as the solution of a boundary value problem. Among the proposed tests, this functional approach is the most innovative and promising application of our mixed approximation formula. While more computationally demanding, it circumvents the numerical obstacles encountered in the finite-dimensional discretization and proves to be more robust and flexible.

The paper is organized as follows. Section 2 recalls the problem under study and contains the main theoretical result of the paper, namely, the statement and proof for the mixed polynomial-rational expansion of the solution (Theorem 1). This is followed by Algorithm 1, which computes an approximation of v(t). Sections 3 and 4 are devoted to numerical tests for the matrix case and for the parabolic model equation, respectively. Section 5 summarizes our contributions and sets out ideas for future work, particularly for further investigation and improvement of the functional approach.

2 The abstract nonlocal differential problem

Let X be a Banach space. Consider the linear homogeneous differential equation

$$\begin{aligned} \frac{dv}{dt}=Av,\quad 0<t<T, \end{aligned}$$
(2.1)

with the boundary conditions

$$\begin{aligned} \frac{1}{T}\int _0^Tv(t)\;dt=f. \end{aligned}$$
(2.2)

Here \(A :D(A)\rightarrow X\) is a linear unbounded closed operator with domain \(D(A)\subset X\), and \(f\in D(A)\). By solution of the problem (2.1), (2.2) we mean a continuous function \(v :[0,T]\rightarrow X\) on [0, T] with values in X and with \(v(t)\in D(A),\;0<t<T\), such that \(v\in \mathcal C^1((0,T);X)\), that is, v is a continuously differentiable function, \(Av\in \mathcal C((0,T);X)\), and (2.1), (2.2) hold. Without loss of generality one can assume that \(T =2\pi \).

We say that \(\lambda \in \mathbb C\) is a regular point of A if \(A-\lambda I\), \(I=I_X\), is bijective and \((A-\lambda I_X)^{-1}\) is a bounded operator, i.e.,

$$ \parallel (A-\lambda I)^{-1} \parallel = \sup \{\frac{\parallel (A-\lambda I)^{-1} y \parallel }{\parallel y\parallel }:y\ne 0\}<+\infty . $$

The following result establishes the basis for the design of numerical schemes for computing a numerical approximation of the solution v(t). A preliminary version of this result in the finite dimensional case has first appeared in [2, 3].

Theorem 1

Assume that all the complex numbers

$$ \mu _k=\textrm{i}k,\quad k=\pm 1,\pm 2,\dots $$

are regular points of the operator A and there is a constant \(C>0\) such that

$$\begin{aligned} \Vert (A-\mu _kI)^{-1}\Vert \le \frac{C}{|k|},\quad k=\pm 1,\pm 2,\dots . \end{aligned}$$
(2.3)

Also, suppose that \(f\in D(A^2)\). Then the problem (2.1), (2.2) has a unique solution which is given by the formula

$$\begin{aligned} v(t)=f+(t-\pi ) Af + 2\left( \sum _{k=1}^{\infty }\Sigma _k(Af)\cos kt + \sum _{k=1}^{\infty }\Upsilon _k(Af)\sin kt\right) \end{aligned}$$
(2.4)

with

$$\begin{aligned} \left\{ \begin{array}{ll} \Sigma _k=A(A+\textrm{i}k I )^{-1}(A-\textrm{i}k I )^{-1},\\ \Upsilon _k=k^{-1} A^2 (A+\textrm{i}k I )^{-1}(A-\textrm{i}k I )^{-1}, \end{array}\right. \quad k=1,2,\dots \end{aligned}$$
(2.5)

Moreover for any \(n\ge 0\) under the additional assumption \(f\in D(A^{2n+2})\) the solution v(t) satisfies the formula

$$\begin{aligned} v(t)=p_n(t)+s_n(t) \end{aligned}$$
(2.6)

with

$$\begin{aligned} p_n(t)=\sum _{k=0}^{2n+1} \frac{(2\pi )^k}{k!} B_k(\frac{t}{2\pi })A^kf, \end{aligned}$$
(2.7)

and

$$\begin{aligned} s_n(t)=(-1)^{n}2\sum _{k=1}^{\infty }\frac{1}{k^{2n}} (\Sigma _k(A^{2n+1}f)\cos kt+ \Upsilon _k(A^{2n+1}f)\sin kt), \end{aligned}$$
(2.8)

where \(B_m(t)\) are the well-known Bernoulli polynomials:

$$ B_m(t)=\sum _{j=0}^m\frac{1}{j+1}\sum _{k=0}^j(-1)^k \left( \begin{array}{c}j\\ k\end{array}\right) (t+k)^m. $$

Proof

For any \(f\in D(A^2)\) we consider the sequence of partial sums

$$\begin{aligned} v_n(t)=f+(t-\pi ) Af + 2\left( \sum _{k=1}^{n}\Sigma _k(Af)\cos kt + \sum _{k=1}^{n}\Upsilon _k(Af)\sin kt\right) ,\;n=0,1,2,\dots . \end{aligned}$$
(2.9)

At first we prove that the sequence \(v_n(t)\) in (2.9) converges uniformly in t on \([0,2\pi ]\). Indeed using the first formula in (2.5) we have

$$ \Vert \Sigma _k(Af)\cos (kt)\Vert \le \Vert (A+\textrm{i}k I )^{-1}\Vert \Vert (A-\textrm{i}k I )^{-1}\Vert \Vert A^2f\Vert ,\;k=0,1,2,\dots \; 0\le t\le 2\pi $$

and from (2.3) follows the uniform convergence in \(t\in [0,2\pi ]\) for the first series in (2.9). Using the second formula in (2.5) we get

$$ \Upsilon _k(Af)\sin kt=k^{-1} A(A+\textrm{i}k I )^{-1}(A-\textrm{i}k I )^{-1}\sin kt (A^2f),\;k=1,2,\dots \;0\le t\le 2\pi . $$

Using the equality \(k^{-1}A=k^{-1}(A-\textrm{i}k I )+\textrm{i}I\) we get

$$\begin{aligned}\begin{gathered} \Upsilon _k(Af)\sin kt=k^{-1} (A+\textrm{i}k I )^{-1}(A^2f)\sin kt+ \textrm{i}(A^2+k^2I)^{-1}(A^2f)\sin kt,\;0\le t\le 2\pi ,\\ k=1,2,\dots \; \end{gathered}\end{aligned}$$

which implies the uniform convergence in \(t\in [0,2\pi ]\) for the second series in (2.9). Thus there is a continuous function v(t) on \([0,2\pi ]\) which is a uniform limit of the sequence \(v_n(t)\) on \([0,2\pi ]\). Moreover using the equalities

$$ \int _0^{2\pi }\cos kt\;dt=\int _0^{2\pi }\sin kt\;dt=0,\;k=1,2,\dots ,\quad \int _0^{2\pi }(t-\pi )\;dt=0 $$

we get

$$ \int _0^{2\pi }v_n(t)\;dt=2\pi f,\;n=0,1,2,\dots $$

and passing to the limit as \(n\rightarrow \infty \) we obtain the condition (2.2).

Now consider the sequences

$$\begin{aligned} Av_n(t)\!=\!Af\!+\!(t-\pi ) A^2f \!+\! 2\left( \sum _{k\!=\!1}^{n}\Sigma _k(A^2f)\cos kt \!+\! \sum _{k\!=\!1}^{n}\Upsilon _k(A^2f)\sin kt\right) ,\;n\!=\!0,1,2,\dots \end{aligned}$$
(2.10)

and

$$\begin{aligned} \frac{dv_n}{dt}=Af + 2\left( \sum _{k=1}^{n}\Sigma _k(Af)(-k)\sin kt + \sum _{k=1}^{n}\Upsilon _k(Af)k\cos kt\right) ,\;n=0,1,2,\dots \end{aligned}$$
(2.11)

Comparing (2.10) with (2.11) and using (2.5) we get

$$ \frac{dv_n}{dt}+\phi (t)A^2f=Av_n(t)+\phi _n(t)A^2f $$

with

$$ \phi (t)=t-\pi ,\quad \phi _n(t)=-\sum _{k=1}\frac{2}{k}\sin kt $$

One can easily see that \(\phi _n(t),\;n=1,2,\dots \) is the sequence of the partial sums of the Fourier series of the function \(\phi (t)\) on the segment \([0,2\pi ]\). Hence it follows that \(\phi _n(t)\) converges to \(\phi (t)\) as \(n\rightarrow \infty \) uniformly in t on \([\delta ,\gamma ]\) for any \(\delta ,\gamma \) with \(0<\delta<\gamma <2\pi \). One should prove that the sequences \(Av_n(t)\) in (2.10) and \(\frac{dv_n}{dt}\) in (2.11) converge uniformly in t on \([\delta ,\gamma ]\). To this end one can check the uniform convergence in t on \([\delta ,\gamma ]\) of the sums

$$\begin{aligned} \sum _{k=1}^{n}\Sigma _k\cos kt,\;\sum _{k=1}^{n}\Upsilon _k\sin kt. \end{aligned}$$
(2.12)

We apply the Abel transformation to these sums. We have

$$ \sum _{k=1}^n\Sigma _k\cos kt= \sum _{k=1}^{n-1}(\Sigma _k-\Sigma _{k+1})\sum _{j=1}^k\cos jt+ \Sigma _n\sum _{j=1}^n\cos jt. $$

Using the formula

$$ \sum _{j=1}^k \cos jt=-\frac{1}{2}+\frac{1}{2}\frac{\sin \frac{2k+1}{2}t}{\sin \frac{t}{2}} $$

we get

$$\begin{aligned} \sum _{k=1}^n\Sigma _k \cos kt=&-\frac{1}{2}\sum _{k=1}^{n-1}(\Sigma _k-\Sigma _{k+1}) + \frac{1}{2}\sum _{k=1}^{n-1}(\Sigma _k-\Sigma _{k+1}) \frac{\sin \frac{2k+1}{2}t}{\sin \frac{t}{2}}\\ &-\frac{1}{2}\Sigma _n+\frac{1}{2}\Sigma _n \frac{\sin \frac{2n+1}{2}t}{\sin \frac{t}{2}} \end{aligned}$$

which implies

$$ \sum _{k=1}^n\Sigma _k \cos kt=-\frac{1}{2}\Sigma _1+\frac{1}{2}\Sigma _n \frac{\sin \frac{2n+1}{2}t}{\sin \frac{t}{2}}+ \frac{1}{2}\sum _{k=1}^{n-1}(\Sigma _k-\Sigma _{k+1}) \frac{\sin \frac{2k+1}{2}t}{\sin \frac{t}{2}}. $$

Similarly for the second series we have

$$ \sum _{k=1}^n\Upsilon _k\sin kt= \sum _{k=1}^{n-1}(\Upsilon _k-\Upsilon _{k+1})\sum _{j=1}^k\sin jt+ \Upsilon _n\sum _{j=1}^n\sin jt. $$

Using the formula

$$ \sum _{j=1}^k \sin jt=\frac{1}{2}\cot \frac{t}{2}- \frac{1}{2}\frac{\cos \frac{2k+1}{2}t}{\sin \frac{t}{2}} $$

we get

$$ \sum _{k=1}^n\Upsilon _k \sin kt= \frac{1}{2}\cot \frac{t}{2}\sum _{k=1}^{n-1}(\Upsilon _k-\Upsilon _{k+1})- \frac{1}{2}\sum _{k=1}^{n-1}(\Upsilon _k-\Upsilon _{k+1}) \frac{\cos \frac{2k+1}{2}t}{\sin \frac{t}{2}}+ $$
$$ \frac{1}{2}\cot \frac{t}{2}\Upsilon _n- \frac{1}{2}\Upsilon _n\frac{\cos \frac{2n+1}{2}t}{\sin \frac{t}{2}} $$

which implies

$$ \sum _{k=1}^n\Upsilon _k \sin kt=\frac{1}{2}\cot \frac{t}{2}\Upsilon _1- \frac{1}{2}\Upsilon _n \frac{\cos \frac{2n+1}{2}t}{\sin \frac{t}{2}}- \frac{1}{2}\sum _{k=1}^{n-1}(\Upsilon _k-\Upsilon _{k+1}) \frac{\cos \frac{2k+1}{2}t}{\sin \frac{t}{2}}. $$

In order to prove convergence of (2.12), we need to study the behavior of \(\Sigma _k\), \(\Upsilon _k\), \(\Sigma _k-\Sigma _{k+1}\) and \(\Upsilon _k-\Upsilon _{k+1}\) as \(k\rightarrow \infty \). Using (2.5) we have

$$\begin{aligned} & \Sigma _k-\Sigma _{k+1}=A(A^2+k^2I)^{-1}-A(A^2+(k+1)^2I)^{-1}\\ & = A(A^2+k^2I)^{-1}(A^2+(k+1)^2I)^{-1}[(A^2+(k+1)^2I)-(A^2+k^2I)]\\ & =A(2k+1)(A^2+k^2I)^{-1}(A^2+(k+1)^2I)^{-1} \end{aligned}$$

and analogously

$$ \Upsilon _k-\Upsilon _{k+1}= \frac{1}{k(k+1)}(A^2+(3k^2+3k+1)I)(A^2+k^2I)^{-1}(A^2+(k+1)^2I)^{-1}. $$

Now observe that from the identity

$$ \frac{A}{k}= \frac{1}{k}(A-ikI)+i\,I $$

it follows

$$\begin{aligned} \frac{A}{k}(A-ikI)^{-1}=\frac{1}{k}+i(A-ikI)^{-1}. \end{aligned}$$
(2.13)

Using the inequalities (2.3) together with (2.13) we get

$$\begin{aligned} \Vert \Sigma _k-\Sigma _{k+1}\Vert , \Vert \Upsilon _k-\Upsilon _{k+1}\Vert \le \frac{K}{k^2},\quad k=1,2,\dots , \end{aligned}$$
(2.14)

where K is a constant. Moreover using (2.5) we have

$$ \Sigma _k=(A+ikI)^{-1}+\textrm{i}k(A^2+k^2I)^{-1},\; \Upsilon _k=\frac{1}{k}-k(A^2+k^2I)^{-1}. $$

This by virtue of (2.3) implies

$$\begin{aligned} \lim _{n\rightarrow \infty }\Sigma _n=\lim _{n\rightarrow \infty }\Upsilon _n=0. \end{aligned}$$
(2.15)

Finally for any \(\delta ,\gamma \) with \(0<\delta<\gamma <2\pi \) we have

$$\begin{aligned} \left| \sin \frac{t}{2}\right| \ge c>0,\;0<\delta \le t\le \gamma <2\pi . \end{aligned}$$
(2.16)

Thus combining the relations (2.14), (2.15), (2.16) together we conclude that the sums (2.12) converge uniformly in t on \([\delta ,\gamma ]\). Hence the same is true for the sequences (2.10), (2.11). Since A is a closed operator, we obtain that \(Av_n(t)\rightarrow A v(t)\). Analogously, the uniform convergence of the derivatives implies that the derivative of the limit is the limit of the derivatives, and, hence, \(\displaystyle \frac{dv_n}{dt} \rightarrow \displaystyle \frac{dv}{dt}\). Therefore, we conclude that v(t) is a solution of the equation (2.1).

Proceeding in the same way as in [2, 3] with the assumption \(f\in D(A^{2n+2})\) we obtain the formulas (2.6), (2.7), (2.8) for the solution v(t).

Let us now prove the uniqueness of the solution. Let v(t) be a solution of the linear homogeneous differential problem

$$\begin{aligned} \frac{dv}{dt}=Av,\; 0<t<T, \end{aligned}$$
(2.17)
$$\begin{aligned} \frac{1}{2\pi }\int _0^{2\pi }v(t)\;dt=0. \end{aligned}$$
(2.18)

Note that by integrating (2.17) from 0 to \(2\pi \) and applying (2.18) we obtain

$$\begin{aligned} v(2\pi )-v(0)=\int _0^{2\pi }\frac{dv}{dt}dt=A\int _0^{2\pi }v(t) dt=0. \end{aligned}$$
(2.19)

The function v(t) is continuous on \([0,2\pi ]\) and has Fourier coefficients \(c_k,\;k=0,\pm 1,\pm 2,\dots \) given by

$$ c_k=\frac{1}{2\pi }\int _0^{2\pi }v(t)e^{-\mu _kt}\;dt,\quad k=\pm 1,\pm 2,\pm $$

and

$$\begin{aligned} c_0=\frac{1}{2\pi }\int _0^{2\pi }v(t)\;dt=0. \end{aligned}$$
(2.20)

Multiplying the equation (2.17) by \(\frac{1}{2\pi }e^{-\mu _kt}\) and integrating from 0 to \(2\pi \) we get

$$ \frac{1}{2\pi }\int _0^{2\pi }\frac{dv}{dt} e^{-\mu _kt}\;dt= A\frac{1}{2\pi }\int _0^{2\pi }v(t)e^{-\mu _kt}\;dt,\quad k=\pm 1,\pm 2,\dots . $$

Integrating by parts in the left hand side and applying (2.19) we get

$$ \mu _kc_k=Ac_k,\;k=\pm 1,\pm 2,\dots . $$

which implies

$$\begin{aligned} c_k=0,\;k=\pm 1,\pm 2,\dots \end{aligned}$$
(2.21)

Thus from (2.21), (2.20) it follows that all the Fourier coefficients of the continuous function v(t) are zeros. Hence \(v(t)=0,\;0\le t\le 2\pi \). \(\square \)

Based on this theorem, we get a family of polynomial/rational approximations of the solution of (2.1), (2.2) of the form:

$$\begin{aligned} v(t)\simeq v_{n,\ell }(t)=p_n(t)+s_{n,\ell }(t) \end{aligned}$$
(2.22)

where \(s_{n,\ell }(t)\) is a partial sum of the series (2.8), i.e.

$$ s_{n, \ell }(t)=(-1)^{n}2\sum _{k=1}^{\ell }\frac{1}{k^{2n}} (\Sigma _k(A^{2n+1}f)\cos kt+ \Upsilon _k(A^{2n+1}f)\sin kt) $$

and

$$ v(t)=v_{n,\ell }(t) + r_{n, \ell }(t) $$

with residual

$$ r_{n, \ell }(t)=(-1)^{n}2\sum _{k=\ell +1}^{+\infty }\frac{1}{k^{2n}} (\Sigma _k(A^{2n+1}f)\cos kt+ \Upsilon _k(A^{2n+1}f)\sin kt). $$

The bulk of the paper deals with theoretical and computational issues associated with the computation of \(v_{n,\ell }(t)\). The results of a preliminary numerical experience reported in [2, 3] and [8] upon the finite dimensional case promote some considerations concerning the selection of the parameters n and \(\ell \).

  1. 1.

    In the finite dimensional case it is shown that the larger the degree of \(p_n(t)\) is, the better the convergence of the series of v(t) is. However, in finite precision arithmetic large values of n generally lead to stability issues in the computation of the approximant (2.22). Moreover, in view of Theorem 1 large values of n imply additional smoothness requirements upon the function f(t) in (2.2). Therefore, in our numerical experience the better strategy is to set the value of n as small as possible, typically \(n\in \{0,1,2,3,4\}\), and then determine the value of \(\ell \) so as to obtain the desired accuracy.

  2. 2.

    An adaptive technique for the selection of the value of \(\ell \) in the finite dimensional case is presented in Gemignani [8]. For a fixed \(t\in [0,T]\) once the value of n and a threshold tolerance \(\epsilon >0\) are given, then we can determine the value of \(\ell =\ell (t)\) by imposing the condition

    $$ \parallel v_{n, \ell -1}(t)-v_{n, \ell }(t)\parallel /\parallel v_{n, \ell }(t)\parallel \le \epsilon . $$

    In this way the approximation \(v_{n, \ell }(t)\) is constructed incrementally by adding one term at a time until a fixed tolerance is reached.

According to these facts, we consider the following general procedure for computing an approximation \(v_{n, \ell }(t)\) of v(t) for \(t\in [0,T]\).

Algorithm 1
figure a

 .

The computational effort of Algorithm 1 at step 3 basically amounts to determine \(\Sigma _k(Af)\) and \(\Upsilon _k(Af)\) for \(k=1, \ldots , \widehat{\ell }\). The accuracy of the approximation \(v_{n,\widehat{\ell }}(t)\) returned as output by Algorithm 1 is measured by introducing a finer grid of points \(\mathcal I_L\subset [0,T]\) and then setting

$$\begin{aligned} err=\max _{t_i\in \mathcal I_L} \parallel v(t_i)-v_{n, \widehat{\ell }}(t_i)\parallel _\infty /\parallel v(t_i)\parallel _\infty . \end{aligned}$$
(2.24)

The selection of grid points can be problem dependent or related to specific properties of the solution function. For testing purposes we generally make use of equispaced grid of points. Theoretical estimates of the norm of the residual \(r_{n,\ell }(t)\) in terms of the quantities () are currently unavailable. The feasibility and robustness of Algorithm 1 is validated by numerical simulations shown in the next sections.

3 The matrix case: Numerical tests

Here it is assumed that \(X={\mathbb C}^N\), A is an \(N\times N\) matrix with spectrum disjoint from the set \(\{\pm ik\in \mathbb {C}: k=1,2,\ldots \}\), f is an N-dimensional column and \(v(t)=\textrm{col}(v_i(t))_{i=1}^N\) is a vector function. For testing purposes let us suppose that A is diagonalizable by a unitary congruence, that is, \(A= Q^H D Q\) with \(Q^H Q=I_N\) and \(D={{\,\textrm{diag}\,}}[\lambda _1, \ldots , \lambda _N]\). Then it can be proved by direct calculations that the solution of (2.1),(2.2) can be expressed as

$$\begin{aligned} v(t)=Q^H {{\,\textrm{diag}\,}}[e^{\lambda _1t} \psi _1(\lambda _1 2 \pi ), \ldots , e^{\lambda _N t} \psi _1(\lambda _N 2 \pi )] Q f, \end{aligned}$$
(3.1)

where \(\psi _1(z)=z/(e^z-1)\) is a meromorphic function with poles \(z_k=2 \pi \mu _k= 2 \pi \textrm{i}k,\quad k=\pm 1,\pm 2,\dots \). It is tacitly assumed that the computation of v(t) by means of (3.1) gives the "exact" solution of (2.1),(2.2). Thus, such solution can be used in our numerical simulations to provide error estimates according to (2.24).

We have implemented the computation of the approximation \(v_{n, \ell }(t)\) of v(t) as described in (2.22) and Algorithm 1. The implementation is done in MATLAB and it always works in double precision, unless otherwise noted.

The coarse and fine grid of points are formed by equispaced nodes in the interval [0, T]. The input parameters are \(m, n\in \mathbb N\) and \(tol\in \mathbb R\). Set \(\mathcal I_S=\{t_i=2\pi (i-1)/(m-1):1\le i\le m\}\) the set of m uniformly spaced points in the interval \([0, T]=[0, 2 \pi ]\). The finer grid of points is determined so that \(\mathcal I_L=\{t_i=2\pi (i-1)/(m-1)^2:1\le i\le (m-1)^2+1\}\) includes \(\mathcal I_s\).

Our test suite consists of the following set of rank-structured matrices:

  1. 1.

    textttRandom unitary Hessenberg matrices. Test problems with known eigenvalues are generated as follows. A unitary diagonal matrix D is generated and its eigenvalues noted. A unitary matrix Q, random with respect to Haar measure, is generated, and the random unitary matrix \(B = Q^H D Q\) formed. Then B is transformed to upper Hessenberg form by unitary congruence, that is, \(P^H B P=H \), to yield an upper Hessenberg unitary matrix H with known eigenvalues, which is then factored into the form \(H= (QP)^H D (QP)\). The matrix \(V=(QP)^H\) is the unitary eigenvector matrix. One could also choose other ways of generating an upper Hessenberg unitary matrix, such as applying a sequence of \(N-1\) Givens transformations to the diagonal matrix D containing the eigenvalues.

  2. 2.

    Banded circulant matrices. We consider banded circulant matrices of the form

    $$ C=\left[ \begin{array}{ccccc} a_0 & & & a_2 & a_1\\ a_1& \ddots & & & a_2\\ a_2& \ddots & \ddots \\ & \ddots & \ddots & \ddots \\ & & a_2 & a_1 & a_0 \end{array}\right] \in \mathbb C^{N\times N}. $$

    We recall that C can be diagonalized by a Discrete Fourier Transform. Specifically, if \(F=(f_{j,\ell })\), \(f_{j, \ell }=\displaystyle \frac{e^{\textrm{i}2 \pi (j-1)(\ell -1)/N}}{\sqrt{N}}\), \(1\le j, \ell \le N\), is the Fourier matrix of order N then \(F^H C F={{\,\textrm{diag}\,}}[\lambda _1, \ldots , \lambda _N]\) with

    $$ \lambda _k=\sum _{j=0}^2 a_j e^{-\textrm{i}2 \pi (k-1) j/N}, \quad 1\le k\le N. $$
  3. 3.

    Shifted and scaled 1D Laplacian matrices. We consider \(N\times N\) tridiagonal Toeplitz matrices generated via the MATLAB command gallery as

    $$\begin{aligned} A=\sigma \ \texttt {gallery('tridiag'}, N, 1, -2, 1) -\gamma \ \texttt {eye(N)} \end{aligned}$$
    (3.2)

    with \(\sigma , \gamma \in \mathbb R^+\). These matrices can be diagonalized by means of a discrete sine transform \(E=(\sqrt{2/(N+1)} \sin \displaystyle \frac{\pi i j}{N+1})_{i,j=1}^N\).

The figures and tables below show the results of our numerical experiments.

Random unitary Hessenberg matrices provide an easy test class. The eigenvalues are located on the unit circle in the complex plane, the norm of A is bounded by 1 and the solution of the shifted linear systems associated with the computation of \(\Sigma _k(Af)\) and \(\Upsilon _k(Af)\) in (2.4), (2.5) is generally well conditioned. Therefore, our proposed schemes perform quite well in this case. In Fig. 1 we illustrate the plots of the measured error over the grid \(\mathcal I_L\) for \(N=1024\), \(tol=1.0e\!-12\) and different values of \(n\in \{1,2,3,4\}\). Notice that the error is flattened out as n increases and, moreover, the stopping tolerance gives a quite precise measure of the norm of the residual. We guess that the error behaviour is determined by the decreasing of the algorithmic error in the computation of the mixed polynomial/rational approximation of the differential problem.

To experiment with more difficult tests we consider banded circulant matrices. For \(a_0=a_1=a_2=1\) and even values of N, the matrix C has one eigenvalue equal to \(\textrm{i}\). In view of Theorem 1 the solution of (2.1),(2.2) does not exist or is not unique. The implementation of our code reports "ill-conditioning" warnings in MATLAB’s backslash command used to solve the shifted linear systems involved in the computation of the rational approximant \(s_n(t)\).

Fig. 1
figure 1

Illustration of the measured error (2.24) for Test 1 with \(tol=1.0e\!-12\) and \(m=10\) for different values of \(n\in \{1,2,3,4\}\)

Fig. 2
figure 2

Illustration of the measured error (2.24) for Test 2 with \(tol=1.0e\!-12\), \(m=10\), \(n=1\), \(a_0=a_1=1, a_2=1+1.0e\!-4\) in (a) and \(a_0=a_1=1, a_2=1+1.0e\!-6\) in (b)

Perturbed values of the coefficients make it possible to tune the conditioning of the shifted linear systems. In Fig. 2 we show the plots of the computed error for \(N=1024\), \(tol=1.0e\!-12\), \(n=1\) and \(a_0=a_1=1, a_2=1+1.0e\!-4\) and \(a_0=a_1=1, a_2=1+1.0e\!-6\), respectively. This figure clearly indicates the impact of the conditioning of the shifted linear systems on the overall accuracy of the computed approximation.

Differently, when N is odd, the proposed scheme performs quite satisfactorily. In Fig. 3 we show the measured error for Test 2 with \(N=1023\), \(a_0=a_1=a_2=1\), \(tol=1.0e\!-12\) and \(m=10\). Also, the acceleration of the convergence due to the increasing value of n is dramatic. For \(n=0\) the stopping criterion () is not fulfilled within 50000 iterations. Differently, for \(n=4\) we find \(\widehat{\ell }=22\).

Fig. 3
figure 3

Illustration of the measured error (2.24) for Test 2 with \(a_0=a_1=a_2=1\), \(tol=1.0e\!-12\) and \(m=10\) for different values of \(n\in \{1,2,3,4\}\)

It is worth mentioning that (3.1) can be rewritten as \(v(t)=\texttt {expm}(A t) v(0)\) where \(\texttt {expm}(A)\) is the matrix exponential of A. This relation provides an easy way based on the power method to give approximations of the solution vectors \(v(t_i)\), \(t_i\in \mathcal I_L\). Assume that \(B=\texttt {expm}(A t_1)\) and v(0) are available. Then we can determine the remaining vectors \(v(t_i)\) by setting \(v(t_{i+1})=B v(t_i)\), \(i\ge 0\). In Fig. 4 we compare the accuracy of this power-based method with our algorithm applied for solving Test 2 with \(a_0=a_1=a_2=1\), \(tol=1.0e\!-12\), \(n=2\) and \(m=30\). The matrix B is computed by means of the MATLAB function expm.

Fig. 4
figure 4

Error plots generated by the power-based method and our algorithm applied or solving Test 2 with \(a_0=a_1=a_2=1\), \(tol=1.0e\!-12\), \(n=2\) and \(m=30\)

Matrices \(A\in \mathbb R^{N\times N}\) of the form (3.2) are useful to check the dependence of the convergence rate and the accuracy w.r.t. the distribution of the eigenvalues and the norm of A. This set has already been considered for testing purposes in [2, 3]. For \(\sigma =1\) and \(\gamma =0\) all the proposed schemes with \(n\in \{0,1,2,3,4\}\) perform well in terms of accuracy confirming the results in Boito et al. [2]. For \(N=1024\) and \(tol=1.0e\!-12\) the scheme with \(n=0\) is unpractical since it requires more than 50000 terms to satisfy the stopping criterion. For \(n=1, 4\) we find \(\widehat{l}=1714\) and \(\widehat{l}=21\), respectively, showing again the efficiency of the convergence acceleration introduced by the Bernoulli polynomials.

Increasing the value of \(\sigma \) or \(\gamma \) introduces some numerical difficulties. For \(\sigma =1\) and \(\gamma =100\) the shifted linear systems are still well-conditioned but both the magnitude of eigenvalues and the norm of A increase. As a side effect we observe a deterioration of the convergence and the accuracy of our algorithm. For \(n=1, 2\) we find \(\widehat{l}=8896\) and \(\widehat{l}=457\), respectively. In Fig. 5 we show the plots of the computed error for shifted 1D Laplacian matrices with \(N=1024\), \(tol=1.0e\!-12\), and \(n=1, 2\). The schemes with \(n=3,4\) return inaccurate results. Similar behaviors for the error are found for \(\sigma =100\) and \(\gamma =0\).

Fig. 5
figure 5

Illustration of the measured error (2.24) for Test 3 with \(\sigma =1\), \(\gamma =100\), \(tol=1.0e\!-12\), \(m=10\), \(n=1\) in (a) and \(n=2\) in (b)

In conclusion, numerical experiments with the finite dimensional case reveal that the computation of the approximant \(v_{n, \ell }(t)\) given in (2.22) can be prone to numerical inaccuracies essentially due to:

  1. 1.

    a possibly large norm of the matrix A which makes unreliable the use of acceleration schemes based on Bernoulli polynomials;

  2. 2.

    the effects of a potential ill-conditioning of the shifted linear systems involved in the computation of the trigonometric expansion.

Moreover, the occurrence of large eigenvalues in magnitude determines two additional effects:

  1. 1.

    the convergence generally deteriorates as more and more terms are needed into the expansion to evaluate the function at the eigenvalues;

  2. 2.

    since the convergence is slow, the stopping criterion can be satisfied even if the approximation is far from the "exact" value.

The analysis of these weak points motivates the extension of the results in [2, 3] to the functional setting given in Theorem 1. In particular, in the next section we will show that the extension makes it possible to apply our approach for solving certain differential problems with nonlocal boundary conditions.

4 The model one-dimensional problem for parabolic equation

Consider the differential problem

$$\begin{aligned} \left\{ \begin{array}{ll} u_t=\sigma u_{xx}+c(x)u,& 0<x<1,\;0<t< T,\\ u(0,t)=u(1,t)=0,& 0<t< T.\end{array} \right. \end{aligned}$$
(4.1)

with the nonlocal condition

$$\begin{aligned} \frac{1}{T}\int _0^Tu(x,t)\;dt=f(x),\quad f\in D(A). \end{aligned}$$
(4.2)

In principle, several numerical schemes for computing the solution of (4.1), (4.2) can be devised based on Theorem 1. Specifically, we treat the problem (4.1) as a problem for an ordinary differential equation in the Banach space \(X=L^2(0,1)\) of the form

$$\begin{aligned} \frac{dv}{dt}=Av,\quad 0<t<T, \end{aligned}$$
(4.3)

Here \(A=\sigma \displaystyle \frac{d^2}{dx^2}+c(x)\), where the domain D(A) consists of the functions w(x) with first derivative \(w'\) absolutely continuous on [0, 1] such that \(w''\in L^2(0,1)\), and satisfying the boundary conditions \(w(0)=w(1)=0\). It is worth noting that expansion (2.4) requires \(f\in D(A^2)\), where \(D(A^2)\) is the set of functions w(x) on [0, 1] such that \(w'''(x)\) is absolutely continuous, \(w^{(4)}(x)\in L^2(0,1)\), and \(w(0)=w(1)=w''(0)=w''(1)=0\).

Notice that if we take \(c(x)=0\) for simplicity, then for any \(f\in D(A^k)\) the values \(A^kf\) are in fact the even-order derivatives of the given function f, namely \(A^kf=f^{(2k)}\). Similarly, if c(x) is constant, then \(A^kf\) can be expressed as linear combinations of the even-order derivatives of the given function f(x). So we can assume that the elements \(g_j=A^jf,\;j=0,\dots ,k\) are given as well. Using Theorem 1, with the assumption \(f\in D(A^{2n+3})\) , we have that the solution v(t) satisfies the formula

$$\begin{aligned} v(t)=v_{n, \ell }(t) +r_{n,\ell }(t)=p_n(t)+s_{n,l}(t) + r_{n,\ell }(t) \end{aligned}$$
(4.4)

with

$$\begin{aligned} p_n(t)=\sum _{k=0}^{2n+1} \frac{(2\pi )^k}{k!} B_k\left( \frac{t}{2\pi }\right) g_k, \end{aligned}$$
(4.5)

and

$$\begin{aligned} s_{n,l}(t)=(-1)^{n}2\sum _{k=1}^{l}\frac{1}{k^{2n}} \left( \Sigma _k A^2g_{2n-1}\cos kt+ \Upsilon _k A^2g_{2n-1}\sin kt\right) . \end{aligned}$$
(4.6)

We transform the formula (4.6) to an equivalent form. We define the operators

$$\begin{aligned} V_k=(A^2+k^2I)^{-1},\quad k=1,2,\dots . \end{aligned}$$
(4.7)

Using (2.5) we have that (4.6) takes the form

$$\begin{aligned} s_{n,l}(t)=(-1)^{n}2\sum _{k=1}^{l}\frac{1}{k^{2n}}\left( V_kg_{2n+2}\cos kt+\frac{1}{k}V_kg_{2n+3}\sin kt\right) . \end{aligned}$$
(4.8)

So the core of the algorithm is the evaluation of the quantities

$$ V_kg=(A^2+k^2I)^{-1}g,\; k=1,2,\dots ,\quad g\in X. $$

The computation of these values may be done as follows.

  1. 1.

    Compute the solution \(p^{(k)}\) of the equation

    $$\begin{aligned} (A-(ki)I)p^{(k)}=g. \end{aligned}$$
    (4.9)
  2. 2.

    Compute the solution \(w^{(k)}\) of the equation

    $$\begin{aligned} (A+(ki)I)w^{(k)}=p^{(k)}. \end{aligned}$$
    (4.10)

For any \(g\in X\) we have obviously \(p^{(k)}\in D(A),\;w^{(k)}\in D(A^2)\).

In our concrete case the evaluation of (4.9) and (4.10) is equivalent to the solution of two boundary value problems

$$\begin{aligned} \sigma \frac{d^2 p^{(k)}(x)}{dx^2}- \textrm{i}k p^{(k)}(x) + c(x) p^{(k)}(x)= g(x), \quad p^{(k)}(0)=p^{(k)}(1)=0,\quad k=1, 2, \ldots , \end{aligned}$$
(4.11)
$$\begin{aligned} \sigma \frac{d^2 w^{(k)}(x)}{dx^2}+\textrm{i}k w^{(k)}(x) +c(x)w^{(k)}(x)= p^{(k)}(x), \quad w^{(k)}(0)=w^{(k)}(1)=0,\quad k=1, 2, \ldots . \end{aligned}$$
(4.12)

The procedure stated above for computing the approximation \(v_{n, \ell }(t)\) of v(t) allows us to explore different discretization methods. In particular, we have considered two schemes. The first scheme is purely numerical, whereas the second one uses a combination of symbolic and numerical computations.

  1. (I)

    The first, simplest approach is to discretize the operator A using finite differences methods. By using finite differences in space with equispaced points \(x_i=ih=i/(N+1)\), \(0\le i\le N+1\), \(h=1/(N+1)\), for the discretization of the second derivative we obtain the discrete analogue \(\widehat{A}\) of the operator A,

    $$ \widehat{A}=\left( {{\,\textrm{diag}\,}}[c(x_1) , \ldots , c(x_N)] + \frac{\sigma }{h^2} \left[ \begin{array}{cccc}-2 & 1\\ 1& \ddots & \ddots \\ & \ddots & \ddots & 1\\ & & 1& -2\end{array}\right] \right) \in \mathbb R^{N\times N}. $$

    Replacing A with \(\widehat{A}\) in the procedure for computing \(v_{n, \ell }(t)\) is formally equivalent to applying our method for the solution of the first order system

    $$\begin{aligned} \frac{\text {d}u}{\text {d}t}= \widehat{A}u(t), \end{aligned}$$
    (4.13)

    with conditions

    $$\begin{aligned} \frac{1}{T}\int _0^Tu(t)dt= f, \end{aligned}$$
    (4.14)

    where \( f=\left[ f(x_1), \ldots , f(x_N)\right] ^T\). The computational problem is of the form given in (2.1),(2.2) with \(\widehat{A}\in \mathbb R^{N\times N}\). This finite dimensional first order system (4.13), (4.14) can also be obtained by exploiting the classical method of lines [16] for solving (4.1), (4.2).

  2. (II)

    The second approach combines symbolical and numerical methods. The evaluation of the derivatives of the function f is performed symbolically. The computation of (4.5) is also carried out symbolically. The solution of (4.11) and (4.12) can be found by means of existing software for the solution of BVP’s. In our implementation we used the MATLAB function bvp4c derived from Kierzenka and Shampine [12] for solving these two-point boundary value problems. The code is a finite difference algorithm that implements the three-stage Lobatto IIIa formula. This is a collocation formula and the collocation polynomial provides a \(\mathcal C^1\)-continuous solution that is fourth order accurate uniformly in [ab]. Mesh selection and error control are adaptively based on the residual of the continuous solution.

4.1 Numerical tests for the parabolic equation

Synthetic computational problems have been designed to test the two approaches outlined above. Our test suite consists of the following two problems:

  1. 1.

    The first model example is

    $$\begin{aligned} \left\{ \begin{array}{ll} u_t= \sigma u_{xx} ,& 0<x<1,\;0<t< 2\pi ,\\ u(0,t)=u(1,t)=0,& 0<t< 2\pi .\end{array} \right. \end{aligned}$$
    (4.15)
    $$\begin{aligned} \frac{1}{2\pi }\int _0^{2\pi }u(x,t)\;dt=f(x) \end{aligned}$$
    (4.16)

    with the data

    $$ f(x)=12\frac{1-\displaystyle e^{-2\pi \sigma (3 \pi )^2}}{2 \pi \sigma (3 \pi )^2}\sin (3\pi x) - 7\frac{1-\displaystyle e^{-2\pi \sigma (2 \pi )^2}}{2 \pi \sigma (2 \pi )^2}\sin (2\pi x). $$

    Here the exact solution is

    $$ u(x,t)=12 \displaystyle e^{-\sigma (3 \pi )^2 t}\sin (3\pi x) -7 \displaystyle e^{-\sigma (2 \pi )^2 t}\sin (2\pi x) . $$
  2. 2.

    The second test is concerned with the differential problem of the form

    $$\begin{aligned} \left\{ \begin{array}{ll} u_t=u_{xx} + (4 \pi ^2 -1)u(x),& 0<x<1,\;0<t< 2\pi ,\\ u(0,t)=u(1,t)=0,& 0<t< 2\pi .\end{array} \right. \end{aligned}$$
    (4.17)
    $$\begin{aligned} \frac{1}{2\pi }\int _0^{2\pi }u(x,t)\;dt=f(x) \end{aligned}$$
    (4.18)

    with the data

    $$ f(x)=\frac{1-e^{-2\pi }}{2 \pi }\sin (2\pi x). $$

    Here the exact solution is

    $$ u(x,t)=\displaystyle e^{-t}\sin (2\pi x). $$

In this section we present the results of numerical tests where approaches (I) and (II) are applied to model problems 1 and 2 above.

Tests for Approach (I). Let us start by testing the accuracy of approach (I), which is based on semidiscretization in space. Here the error of the computed approximation \(v_{n, \widehat{\ell }}(t)\) is measured with respect to the exact values of the solution function u(xt) by

$$ err=\max _{t_i\in \mathcal I_L} \parallel \widehat{u}(t_i)-v_{n, \widehat{\ell }}(t_i)\parallel _\infty /\parallel \widehat{u}(t_i)\parallel _\infty , $$

where \(\widehat{u}(t)=\left[ \widehat{u}_1(t), \ldots , \widehat{u}_N(t)\right] ^T\), \(\widehat{u}_i(t)=u(x_i,t)\), \(1\le i\le N\). The coarse and fine grid of points are defined by \(\mathcal I_S=\{t_i=2\pi (i-1)/(m-1):1\le i\le m\}\) and \(\mathcal I_L=\{t_i=2\pi (i-1)/(4(m-1)):1\le i\le 4(m-1)+1\}\), respectively.

In Table 1 we show the results obtained for the first model problem with \(\sigma =1.0e\!-6\), \(N=1000\) and \(m=100\). The results are generated by Algorithm 1 with \(tol=1.0e\!-7\) for different values of n. We report the value of err and the minimum and the maximum values of the length \(\ell _i\) of the rational approximation over \(t_i\in \mathcal I_s\) as functions of the degree n.

Table 1 Computed error and the minimum and the maximum values of the length \(\ell _i\) of the rational approximation over \(t_i\in \mathcal I_s\) as function of the degree n for the first model problem with \(\sigma =1.0e\!-6\), \(N=1000\) and \(m=100\)

The discretization error is of order \(\sigma h^2 \max |u_{xxxx}|/12\) \(\simeq 1.0e\!-8\). The shifted linear systems (2.5) are well conditioned. Increasing the value of tol does not improve the computed error, which is in accordance with a priori error bounds.

In Table 2 we repeat the same test with \(\sigma =0.01\). The discretization error is now of order \(1.0e\!-4\). The error estimates change significantly since the scaling factor \(\sigma (N+1)^2\) highlights the pathologies observed in the previous section (compare with the results of Test 3). In particular, the use of fast expansions with increasing n becomes unreliable. For \(n=2\) Algorithm 1 stops but the returned error is larger than 1.

Table 2 Computed error and the minimum and the maximum values of the length \(\ell _i\) of the rational approximation over \(t_i\in \mathcal I_s\) as function of the degree n for the first model problem with \(\sigma =1.0e\!-2\), \(N=1000\) and \(m=100\). For \(n=2\) the computed error is larger than 1

Tests for Approach (II). Approach (II), on the other hand, is based on computing the expansion of v(t) as given in Theorem 1 for the infinite dimensional operator \(A=\sigma \frac{d^2}{dx^2}+c(x)\). Recall that in our implementation we used the MATLAB function bvp4c for solving the two-point boundary value problems (4.11), (4.12). The number of boundary value problems to be solved depends on the value of \(\ell \) in (2.22), which is fixed a priori. The output is an interpolating function \(v_{n, \ell }(x,t)\). For the sake of graphical illustration the computed error is shown by plotting the function \(err(x,t)=|v_{n, \ell }(x,t)-u(x,t)|\) over the domain \([0,1]\times [0,2 \pi ]\).

In Figs. 6, 7 and 8 we show the plots generated by solving the first model problem with \(\sigma =0.01\) for different values of n and \(\ell \).

Fig. 6
figure 6

Plot of err(xt) generated by solving the first model problem with \(\sigma =0.01\) for \(n=0\) with \(\ell =200\) in (a) and \(\ell =400\) in (b)

Fig. 7
figure 7

Plot of err(xt) generated by solving the first model problem with \(\sigma =0.01\) for \(n=1\) with \(\ell =10\) in (a) and \(\ell =100\) in (b)

Fig. 8
figure 8

Plot of err(xt) generated by solving the first model problem with \(\sigma =0.01\) for \(n=2\) with \(\ell =10\) in (a) and \(\ell =20\) in (b)

In Fig. 9 we describe our results for the second model problem with \(n=1\) and \(\ell =20\) and \(\ell =40\).

Fig. 9
figure 9

Plot of err(xt) generated by solving the second model problem for \(n=1\) with \(\ell =20\) in (a) and \(\ell =40\) in (b)

In summary, our preliminary experience with the infinite dimensional (functional) approach indicates that, when applicable, expansions with increasing n allow the computation of quite accurate approximations of u(xt) already for small or moderate values of the truncation level \(\ell \).

5 Conclusion and future work

In this paper we have devised a mixed polynomial/rational expansion for the solution of an abstract first-order differential problem with nonlocal conditions. We have proposed an algorithm that exploits this expansion to approximate numerically the solution and tested it on several examples, both in finite- and infinite-dimensional settings. Of particular interest are implementations where the expansion is directly applied to an infinite-dimensional operator and discretization only intervenes in the solution of the resulting family of shifted boundary value problems.

There are still many points for future developments. Specifically:

  1. 1.

    The derivation of precise residual estimates for this expansion also related with the design of efficient stopping criteria.

  2. 2.

    The study of alternative acceleration schemes not involving high-degree Bernoulli polynomials in order to to relax the regularity assumptions.

  3. 3.

    The design of efficient numerical methods for solving the sequence of shifted boundary value problems (4.11), (4.12).

  4. 4.

    The application of our proposed method to more general differential problems such as the two-dimensional parabolic equation and the biharmonic equation.

We also point out that, for suitable classes of problems, one may apply the mixed polynomial/rational expansion presented here to devise hybrid approaches that combine symbolic/functional and purely numerical techniques. As an example, consider Problem 1 in Section 3, i.e., (4.15), (4.16). Starting from the finite-dimensional approach based on semi-discretization in space, we may incorporate more and more symbolic elements to circumvent potential sources of instability and improve the quality of the results. For instance, since the function f(x) for (4.15), (4.16) is known analytically and the action of matrix A corresponds to a second derivative, one may pre-compute symbolically \(f''(x)\) and \(f^{(4)}(x)\), evaluate them on the points of the space grid, and use the resulting vectors in place of Af and \(A^2f\) in the polynomial/rational expansion. Moreover, we may also try evaluating the polynomial part of the expansion symbolically, if the polynomial degree is small (but high enough to be numerically troublesome). Preliminary experiments show that, with these modifications, the test presented in Table 2 for \(n=2\) yields an error that is no longer larger than 1, but comparable to case \(n=1\), with a smaller number of rational terms.