1 Introduction

In many practical contexts, the sources in diffusion or heat transfer processes are not known and required to be determined from several additional conditions, say, observations or measurements [1, 2, 6, 9, 15, 16]. These are inverse problems of determining a term in the right-hand side of parabolic equations. Due to their importance in practice, a great number of researchers took part in studying them and a lot of theoretical and numerical methods for them have been developed [35, 1113, 1719, 2528]. As there is a vast literature on these inverse problems, we do not attempt to give a review on them, but refer to the excellent survey by Prilepko and Tkachenko [26] and the recent paper by Hasanov [12] and the references therein, as well as in the above cited references.

In this paper, we concentrate ourselves on a particular case: determine a time-dependent term from an integral observation in the right-hand side of parabolic equations in the time direction. We note that the problem of determining a time-dependent term in the right-hand side of parabolic equations has been mainly investigated for one-dimensional case (see above cited references) with pointwise observations, except for [19, 24] where some multidimensional problems with integral observations are studied. Our motivation for such a formulation of this problem is that in practice any instrument has a width, and so any measurement is average. Therefore, integral observations are more reasonable than pointwise ones. Following this viewpoint, the pointwise observations can be regarded as an average process or the limit of average processes. However, when solutions of multidimensional direct problems are understood in the weak sense, in general, pointwise observations do not make sense since the solutions are not continuous. We will reformulate the inverse problem in our setting to a variational problem and prove that the functional to be minimized is Fréchet differentiable and we derive a formula for it. To solve the variational problem numerically, one can use the standard finite element method and prove some convergence as in [14]. However, in this paper, we use the finite difference method instead. The reason for such an approach is that one can use the splitting method for the discretized problems by the finite difference method and thus reduce high-dimensional problems to smaller ones [10]. We will derive the gradient of the discretized functional to be minimized and then use the conjugate gradient (CG) method [23] for solving the problem and test the algorithm on a computer.

This paper is organized as follows. In the next section, we will formulate the inverse problem and its variational formulation. In Section 3, we will discretize the variational problem by the splitting method and derive the gradient for it. In the last section, we will present some numerical experiments for showing the efficiency of the algorithms.

2 Problem Setting and Its Variational Formulation

Let Ω be an open bounded domain in \(\mathbb {R}^{n}\). Denote by Ω the boundary of Ω, Q := Ω × (0, T], and S := Ω×(0, T]. Consider the following problem

$$ \left\{\begin{array}{l} \frac{\partial u}{\partial t}-\sum\limits_{i=1}^{n}\frac{\partial} {\partial x_{i}}\left( a_{i}(x,t)\frac{\partial u}{\partial x_{i}}\right)+ b(x,t)u =f(t)\varphi(x,t)+g(x,t), \quad (x,t)\in Q,\\ u(x,t) =0, \quad (x,t)\in S,\\ u(x,0) =u_{0}(x), \quad x\in {\Omega}. \end{array}\right. $$
(2.1)

Here, a i , i = 1,…, n, b and φ are in L (Q), gL 2(Q), fL 2(0, T) and u 0L 2(Ω). It is assumed that \(a_{i} \geq \underline {a} > 0\) with \(\underline {a}\) being a given constant and b≥0. Furthermore,

$$ \varphi \geq \underline{\varphi} > 0, $$
(2.2)

with \(\underline {\varphi }\) being a given constant.

To introduce the concept of weak solution, we use the standard Sobolev spaces H 1(Ω), \({H^{1}_{0}}({\Omega })\), H 1,0(Q) and H 1,1(Q) [20, 29, 31]. Further, for a Banach space B, we define

$$L^{2}(0,T;B) = \{u: u(t) \in B \text{ a.e. } t \in (0,T) \, \text{and } \|u\|_{L^{2}(0,T;B)} < \infty\}, $$

with the norm

$$\|u\|^{2}_{L^{2}(0,T;B)} = {{\int}_{0}^{T}}\|u(t)\|_{B}^{2}dt. $$

In the sequel, we shall use the space W(0, T) defined as

$$W(0,T) = \{u: u \in L^{2}(0,T;{H^{1}_{0}}({\Omega})), u_{t} \in L^{2}(0,T;({H^{1}_{0}}({\Omega}))')\}, $$

equipped with the norm

$$\|u\|^{2}_{W(0,T)} = \|u\|^{2}_{L^{2}(0,T;{H^{1}_{0}}({\Omega}))} + \|u_{t}\|^{2}_{L^{2}(0,T;({H^{1}_{0}}({\Omega}))^{\prime})}. $$

We note here that \(({H^{1}_{0}}({\Omega }))^{\prime } = H^{-1}({\Omega })\).

The solution of the problem (2.1) is understood in the weak sense as follows: A weak solution in W(0, T) of the problem (2.1) is a function u(x, t) ∈ W(0, T) satisfying the identity

$$\begin{array}{@{}rcl@{}} &&{{\int}_{0}^{T}}(u_{t},\eta)_{H^{-1}({\Omega}),{H^{1}_{0}}({\Omega})}dt+{\int}_{Q}\left( \sum\limits_{i=1}^{n}a_{i}(x,t)\frac{\partial u}{\partial x_{i}}\frac{\partial \eta} {\partial x_{i}}+b(x,t)u\eta\right){d}x{{d}}t \\ &&={{\int}_{0}^{T}}{\int}_{\Omega}\left( f(t)\varphi(x,t)\eta+g(x,t)\eta\right){{d}}x{{d}}t, \quad \forall \eta\in L^{2}(0,T;{H^{1}_{0}}({\Omega})) \end{array} $$

and

$$ u(x,0)=u_{0} (x), \quad x\in {\Omega}. $$
(2.3)

Following [31, Chapter IV] and [29, p. 141–152] we can prove that there exists a unique solution in W(0, T) of the problem (2.1). Furthermore, there is a positive constant c d independent of a i , b, f, φ, g and u 0 such that

$$ \|u\|_{W(0,T)} \leq c_{d} \left( \|f\varphi\|_{L^{2}(Q)} + \|g\|_{L^{2}(Q)} + \|u_{0}\|_{L^{2}({\Omega})}\right). $$
(2.4)

In this paper, we will consider the inverse problem of determining the time-dependent term f(t) from an integral observation of the solution u. Namely, we try to reconstruct f(t) from the observation

$$ lu(x,t)={\int}_{\Omega}\omega(x)u(x,t)dx=h(t),\ t\in (0,T), $$
(2.5)

where ω(x) is a weight function. We suppose that ωL (Ω), nonnegative almost everywhere in Ω and \({\int }_{\Omega }\omega (x) dx > 0\). The observation data h is supposed to be in L 2(0, T).

Before going further, let us discuss about the kind of observation. Suppose that x 0∈Ω is the point where we want to observe the heat transfer (or diffusion) process, i.e., the solution u, and Ω1 is a neighborhood of it. Let ω be of the form

$$ \omega(x)= \left\{\begin{array}{ll} \frac 1 {|{\Omega}_{1}|}\ \ \ \ \ &\ \text{if} \ x\in {\Omega}_{1},\\ 0 \ \ \ \ \ &\ \text{otherwise}, \end{array}\right. $$
(2.6)

with |Ω1| being the volume of Ω1. Then , lu shows the result of the measurement and can be understood as an average of u(x 0, t) if it exists. If we let |Ω1| tend to zero, it will converge to u(x 0, t). However, since the solution u is understood in the weak sense, u(x 0, t) does not always make sense. Thus, it is more reasonable to formulate the inverse problem of determining f(t) in the form of (2.1), (2.5), rather than the form (2.1) and

$$ u(x_{0},t) = h(t), \quad t \in (0,T). $$
(2.7)

We note that the solvability of the inverse problem (2.1), (2.7) has been proved by Prilepko and Solov’ev by the Rothé method [25]. The solvability of the inverse problem (2.1), (2.5) has been proved in [24]. However, the numerical methods for the last have not been developed. Our aim is to suggest a stable numerical method for it as follows.

We denote the solution u(x, t) of (2.1) by u(x, t, f) (or u(f) if there is no confusion) to emphazise its dependence on the unknown function f(t). Following the least-squares approach [7, 8], we estimate the unknown function f(t) by minimizing the objective functional

$$ J_{0}(f)= \frac 1 2 \parallel lu(f)-h\parallel^{2}_{L^{2}(0,T)} $$
(2.8)

over L 2(0, T).

To stabilize this variational problem, we minimize the Tikhonov functional

$$ J_{\gamma}(f)= \frac 1 2 \|lu(f)-h\|^{2}_{L^{2}(0,T)} + \frac{\gamma}{2} \|f - f^{\ast}\|^{2}_{L^{2}(0,T)} $$
(2.9)

with γ being a regularization parameter which has to be properly chosen and f an estimation of f which is supposed in L 2(0, T). If γ > 0, it is easily proved that there exists a unique solution to the minimization problem (2.9) over L 2(0, T). Now, we prove that J γ is Fréchet differentiable and derive a formula for its gradient.

Theorem 1

The functional J γ is Fréchet differentiable and its gradient ∇J γ (f) at f has the form

$$ \nabla J_{\gamma}(f) = {\int}_{\Omega}p(x,t)\varphi(x,t){ d}x + \gamma (f(t) - f^{\ast}(t)) , $$
(2.10)

where p(x,t) satisfies the adjoint problem

$$\begin{array}{@{}rcl@{}} \left\{\begin{array}{l} -\frac{\partial p}{\partial t}-\sum\limits_{i=1}^{n}\frac{\partial} {\partial x_{i}}\left( a_{i}(x,t)\frac{\partial p}{\partial x_{i}}\right)+ b(x,t)p =\omega(x)\left( lu(t)-h(t)\right), (x,t)\in Q,\\ p(x,t)=0, (x,t)\in S,\\ p(x,T)=0, x\in{\Omega}. \end{array}\right. \end{array} $$
(2.11)

Proof

We note that if we change the time direction in the adjoint problem (2.11), then we get a problem of the same type of the direct problem (2.1). Therefore, if the solution of the sadjoint problem is understood in the weak sense as u, there exists a unique weak solution in W(0, T) of it.

Denote the scalar product in L 2(0, T) by 〈⋅,⋅〉. For an infinitesimally small variation δ f of f, we have

$$\begin{array}{@{}rcl@{}} J_{0}(f+\delta f)-J_{0}(f)&=&\frac 1 2 \|lu(f+\delta f)-h\|^{2}_{L^{2}(0,T)}-\frac 1 2 \|lu(f)-h\|^{2}_{L^{2}(0,T)}\\ &=&\langle l\delta u(f), lu(f)-h\rangle + \frac 1 2 \|l\delta u(f)\|^{2}_{L^{2}(0,T)}, \end{array} $$

where δ u(f) is the solution to the problem

$$ \left\{\begin{array}{ll} \frac{\partial\delta u}{\partial t}-\sum\limits_{i=1}^{n}\frac{\partial} {\partial x_{i}}\left( a_{i}(x,t)\frac{\partial \delta u}{\partial x_{i}}\right)+ b(x,t)\delta u =\delta f(t)\varphi(x,t),\ \quad (x,t)\in Q,\\ \delta u(x,t)=0,\ \quad (x,t)\in S,\\ \delta u(x,0)=0,\ \quad x\in {\Omega}. \end{array}\right. $$
(2.12)

Due to the estimate (2.4), \(\|l\delta u(f)\|^{2}_{L^{2}(0,T)} = o(\|\delta f\|_{L^{2}(0,T)})\) as \(\|\delta f\|_{L^{2}(0,T)} \rightarrow 0\).

We have

$$\begin{array}{@{}rcl@{}} J_{0}(f+\delta f)-J_{0}(f)&=&\langle l\delta u, lu-h\rangle+o(\|\delta f\|_{L^{2}(0,T)})\\ &=&{{\int}_{0}^{T}}\left( {\int}_{\Omega}\omega\delta u{ d}x\right)\big(lu-h\big){ d}t+o(\|\delta f\|_{L^{2}(0,T)})\\ &=&{{\int}_{0}^{T}}\left( {\int}_{\Omega}\omega\delta u(lu-h){d}x\right){d}t+o(\|\delta f\|_{L^{2}(0,T)})\\ &=&{{\int}_{0}^{T}}{\int}_{\Omega}\omega\delta u(lu-h){ d}x{ d}t+o(\|\delta f\|_{L^{2}(0,T)}). \end{array} $$

Using Green’s formula (see [29, Theorem 3.18]) for (2.12) and (2.11), we have

$${{\int}_{0}^{T}}{\int}_{\Omega}\omega\delta u(lu-h){ d}x{ d}t={{\int}_{0}^{T}}{\int}_{\Omega}\delta f\varphi p{ d}x{ d}t. $$

Hence,

$$\begin{array}{@{}rcl@{}} J_{0}(f+\delta f)-J_{0}(f)&=&{{\int}_{0}^{T}}{\int}_{\Omega}\delta f\varphi p{ d}x{d}t+o(\| \delta f\|_{L^{2}(0,T)})\\ &=&\left\langle{\int}_{\Omega}\varphi(x,t) p(x,t){ d}x,\delta f\right\rangle +o(\|\delta f\|_{L^{2}(0,T)}). \end{array} $$

Consequently, J 0 is Fréchet differentiable and its gradient has the form

$$\nabla J_{0}(f)={\int}_{\Omega}\varphi(x,t) p(x,t)dx. $$

From this equality, we immediately arrive at (2.10). The proof is complete. □

As the gradient of J γ is estimated, we use the CG to find the minimizers of the objective functional (2.8). It goes as follows:

$$ f^{k+1}=f^{k}+\alpha^{k}d^{k}, \quad d^{k}= \left\{\begin{array}{ll} -\nabla J_{\gamma}(f^{k})\ &\text{if} \ k=0,\\ -\nabla J_{\gamma}(f^{k}) +\beta^{k}d^{k-1}\ &\text{if} \ k>0, \end{array}\right. $$
(2.13)

where

$$ \beta^{k}=\frac{\parallel\nabla J_{\gamma}(f^{k})\parallel^{2}}{\parallel\nabla J_{\gamma}(f^{k-1})\parallel^{2}},\quad \alpha^{k}=\text{argmin}_{\alpha\geq 0}J_{\gamma}(f^{k}+\alpha d^{k}). $$
(2.14)

To determine α k, we proceed as follows. We denote by \(\tilde {u}[f]\) the solution of the problem

$$ \left\{\begin{array}{ll} \frac{\partial u}{\partial t}-\sum\limits_{i=1}^{n}\frac{\partial} {\partial x_{i}}\left( a_{i}(x,t)\frac{\partial u}{\partial x_{i}}\right)+ b(x,t)u =f(t)\varphi(x,t), \quad (x,t)\in Q,\\ u(x,t) =0, \quad (x,t)\in S,\\ u(x,0) =0, \quad x\in {\Omega}, \end{array}\right. $$
(2.15)

and \(\overline {u}[u_{0},g]\) the solution of the problem

$$ \left\{\begin{array}{ll} \frac{\partial u}{\partial t}-\sum\limits_{i=1}^{n}\frac{\partial} {\partial x_{i}}\left( a_{i}(x,t)\frac{\partial u}{\partial x_{i}}\right)+ b(x,t)u =g(x,t), \quad (x,t)\in Q,\\ u(x,t) =0, \quad (x,t)\in S,\\ u(x,0) =u_{0}(x), \quad x\in {\Omega}. \end{array}\right. $$
(2.16)

Then,

$$lu(f)=l\tilde{u}[f]+l\overline{u}[u_{0},g]:=Af+l\overline{u}[u_{0},g], $$

where \(Af := l\tilde {u}[f] \) is a bounded linear operator from L 2(0, T) into itself. We now evaluate α k which is the solution of the minimization problem

$$\alpha^{k}=\text{argmin}_{\alpha\geq 0}J_{\gamma}(f^{k}+\alpha d^{k}).$$

We have

$$\begin{array}{@{}rcl@{}} J_{\gamma}(f^{k}+\alpha d^{k})&=&\frac 1 2 \|lu(f^{k}+\alpha d^{k})-h\|^{2}_{L^{2}(0,T)}+\frac{\gamma} 2\| f^{k}+\alpha d^{k}-f^{\ast}\|^{2}_{L^{2}(0,T)}\\ &=&\frac 1 2 \| A(f^{k}+\alpha d^{k})+l\overline{u}[u_{0},g]-h\|^{2}_{L^{2}(0,T)}+\frac{\gamma} 2\| \alpha d^{k}+f^{k}-f^{\ast}\|^{2}_{L^{2}(0,T)}\\ &=&\frac 1 2 \|\alpha Ad^{k}+lu(f^{k})-h\|^{2}_{L^{2}(0,T)}+\frac{\gamma} 2 \|\alpha d^{k}+f^{k}-f^{\ast}\|^{2}_{L^{2}(0,T)}. \end{array} $$

The derivative of J γ (f k + α d k) with respect to α thus has the form

$$\begin{array}{@{}rcl@{}} \frac{d J_{\gamma}(f^{k}+\alpha d^{k})}{d\alpha}&=&\alpha\| Ad^{k}\|^{2}_{L^{2}(0,T)}+\langle Ad^{k},lu(f^{k})-h\rangle_{L^{2}(0,T)}\\ &+&\gamma\alpha\|d^{k}\|^{2}_{L^{2}(0,T)}+\gamma\langle d^{k},f^{k}-f^{\ast}\rangle_{L^{2}(0,T)}. \end{array} $$

Letting \(\frac {d J_{\gamma }(f^{k}+\alpha d^{k})}{d\alpha }=0\), we have

$$\begin{array}{@{}rcl@{}} \alpha^{k}&=&-\frac{\langle Ad^{k},lu(f^{k})-h\rangle_{L^{2}(0,T)}+\gamma\langle d^{k},f^{k}-f^{\ast}\rangle_{L^{2}(0,T)}}{\| Ad^{k}\|^{2}_{L^{2}(0,T)}+\gamma\| d^{k}\|^{2}_{L^{2}(0,T)}}\\ &=&-\frac{\langle d^{k},A^{\ast}(lu(f^{k})-h)\rangle_{L^{2}(0,T)}+\gamma\langle d^{k},f^{k}-f^{\ast}\rangle_{L^{2}(0,T)}}{\| Ad^{k}\|^{2}_{L^{2}(0,T)}+\gamma\| d^{k}\|^{2}_{L^{2}(0,T)}}\\ &=&-\frac{\langle d^{k},A^{\ast}(lu(f^{k})-h)+\gamma(f^{k}-f^{\ast})\rangle_{L^{2}(0,T)}}{\|Ad^{k}\|^{2}_{L^{2}(0,T)}+\gamma\| d^{k}\|^{2}_{L^{2}(0,T)}}\\ &=&-\frac{\langle d^{k},\nabla J_{\gamma}(f^{k})\rangle_{L^{2}(0,T)}}{{\|Ad^{k}\|^{2}_{L^{2}(0,T)}}+\gamma\| d^{k}\|^{2}_{L^{2}(0,T)}}. \end{array} $$
(2.17)

From (2.13), α k can be rewritten as

$$ \alpha^{k}= \left\{\begin{array}{ll} -\frac{\langle-\nabla J_{\gamma}(f^{k}),\nabla J_{\gamma}(f^{k})\rangle_{L^{2}(0,T)}}{{\| Ad^{k}\|^{2}_{L^{2}(0,T)}}+\gamma\| d^{k}\|^{2}_{L^{2}(0,T)}}\ &\text{if} \ k=0,\\ -\frac{\langle-\nabla J_{\gamma}(f^{k})+\beta^{k}d^{k-1},\nabla J_{\gamma}(f^{k})\rangle_{L^{2}(0,T)}}{{\| Ad^{k}\|^{2}_{L^{2}(0,T)}}+\gamma\| d^{k}\|^{2}_{L^{2}(0,T)}}\ &\text{if} \ k>0. \end{array}\right. $$
(2.18)

Therefore,

$$ \alpha^{k}= \frac{\|\nabla J_{\gamma}(f^{k})\|^{2}_{L^{2}(0,T)}}{{\| Ad^{k}\|^{2}_{L^{2}(0,T)}}+\gamma\|d^{k}\|^{2}_{L^{2}(0,T)}},\quad k=0, 1, 2,\ldots $$
(2.19)

The above iteration process is written for the continuous problem. To find the minimizers of J γ (f), we have to discretize the direct and adjoint problems (2.1) and (2.7), as well as the functional J γ . We can, of course, use the solutions to the discretized direct and adjoint problems to approximate the gradient of J γ via the formula (2.10). However, from practice, we see that such an approach yields a good approximation to the gradient only for the first iteration. We therefore first discretize the direct problem (2.1) and form a discretization of J γ and then based on this to introduce the discretized adjoint problem to find the gradient of the discretized functional. We will do it by the finite difference method, as this is easy and advantageous in reducing the dimension of the minimization problem by the splitting method.

3 Discretization of the Variational Problem

Suppose that Ω := (0, L 1) × (0, L 2) × ⋯ × (0, L n ) in \( \mathbb {R}^{n} \), where L i , i = 1,…, n are given positive numbers. In the first part of this section, we will present the splitting finite difference scheme for the multidimensional problems. Next, we will discretize the variational problem and derive a formula for the gradient of the discretized functional and then describe the CG method for it. In the next section, we will present our numerical examples for illustrating the efficiency of the algorithms.

3.1 Splitting Finite Difference Scheme for the Direct Problem

Following [21, 22, 32] (see also [10, 30]), we subdivide the domain Ω into small cells by the rectangular uniform grid specified by

$$0 = x^{0} < {x_{i}^{1}} = h_{i} < {\cdots} < x_{i}^{N_{i}} = L_{i}, \ i = 1, \dots,n $$

with h i = L i /N i being the grid size in the x i -direction, i = 1,…, n. To simplify the notation, we denote \(x^{k} := (x_{1}^{k_{1}}, \dots , x_{n}^{k_{n}}) \), where k := (k 1,…, k n ), 0≤k i N i . We also denote by h := (h 1,…, h n ) the vector of spatial grid sizes and Δh := h 1h n . Let e i be the unit vector in the x i -direction, i = 1,…, n, i.e. e 1 = (1,0,…,0) and so on. Denote

$$ \omega(k) = \{x\in{\Omega}: (k_{i}-0.5)h\le x_{i}\le(k_{i}+0.5)h\ \forall i = 1,\dots, n\}. $$
(3.1)

In the following, Ω h denotes the set of the indices of all interior grid points belonging to Ω. We also denote the set of the indices of all grid points belonging to \(\bar {\Omega }\) by \(\bar {\Omega }_{h}\). That is,

$$\begin{array}{@{}rcl@{}} {\Omega}_{h} &=& \{k = (k_{1},\dots,k_{n}): 1\le k_{i} \le N_{i}-1, \ \forall i = 1,\dots, n\},\\ \bar{\Omega}_{h} &=& \{k = (k_{1},\dots,k_{n}): 0\le k_{i} \le N_{i}, \ \forall i = 1,\dots, n\}. \end{array} $$
(3.2)

We also make use of the following sets

$$ {{\Omega}_{h}^{i}} = \{k = (k_{1},\dots,k_{n}): 0\le k_{i} \le N_{i}-1, 0\le k_{j} \le N_{j}, \forall j \neq i\} $$
(3.3)

for i = 1,…, n. For a function u(x, t) defined in Q, we denote by u k(t) its approximate value at (x k, t). We define the following forward finite difference quotient with respect to x i

$$u_{x_{i}}^{k} := \frac{u^{k+e_{i}}-u^{k}}{h_{i}}. $$

Now, taking into account the homogeneous boundary condition, we approximate the integrals in (2.3) as follows

$$\begin{array}{@{}rcl@{}} {\int}_{Q}\frac{\partial u}{\partial t} \eta{{d}}x{{d}}t &\approx & {\Delta} h{{\int}_{0}^{T}}\sum\limits_{k\in {\Omega}_{h}} \frac{d u^{k}(t)}{d t}\eta^{k}(t) {{d}}t, \end{array} $$
(3.4)
$$\begin{array}{@{}rcl@{}} {\int}_{Q}a_{i}(x,t)\frac{\partial u}{\partial x_{i}} \frac{\partial \eta}{\partial {x_{i}}}{{d}}x {{d}}t &\approx &{\Delta} h{{\int}_{0}^{T}} \sum\limits_{k\in {\Omega}_{h}^{i}}a_{i}^{k+\frac{e_{i}}{2}}(t)u_{x_{i}}^{k}(t)\eta_{x_{i}}^{k}(t) {{d}}t, \end{array} $$
(3.5)
$$\begin{array}{@{}rcl@{}} {\int}_{Q}b(x,t)u\eta{\text{d}}x{{d}}t &\approx& {\Delta} h{{\int}_{0}^{T}} \sum\limits_{k\in {\Omega}_{h}}b^{k}(t)u^{k}(t)\eta^{k}(t) {{d}}t, \end{array} $$
(3.6)
$$\begin{array}{@{}rcl@{}} {\int}_{Q}f(t)\varphi(x,t)\eta{{d}}x{{d}}t &\approx &{\Delta} h{{\int}_{0}^{T}} \sum\limits_{k\in{\Omega}_{h}} f(t)\varphi^{k}(t)\eta^{k}(t) {{d}}t, \end{array} $$
(3.7)
$$\begin{array}{@{}rcl@{}} {\int}_{Q}g(x,t)\eta{{d}}x{{d}}t &\approx &{\Delta} h{{\int}_{0}^{T}} \sum\limits_{k\in{\Omega}_{h}} g^{k}(t)\eta^{k}(t) {{d}}t. \end{array} $$
(3.8)

Here, φ k(t), g k(t) and \(a_{i}^{k+\frac {e_{i}}{2}}(t)\) respectively are an approximation to the functions φ(x, t), g(x, t) and a i (x, t) at the grid point x k. We take the following convention: if φ(x, t) or/and g(x, t) is continuous, then we take φ k(t) or/and g k(t) by their value at x k, and if a i (x, t) is continuous, we take \(a_{i}^{k+\frac {e_{i}}{2}}(t) := a_{i}(x^{k + \frac {h_{i} e_{i}}{2}},t)\). Otherwise, take

$$ \varphi^{k}(t):=\frac 1 {|\omega(k)|}{\int}_{\omega(k)}\varphi(x,t){d}x,\quad g^{k}(t):=\frac 1 {|\omega(k)|}{\int}_{\omega(k)}g(x,t){d}x, $$
(3.9)

and

$$ a_{i}^{k+\frac{e_{i}}{2}}(t) = \frac 1 {|\omega(k)|}{\int}_{\omega(k)}a_{i}(x,t){d}x. $$
(3.10)

With the approximations (3.4)–(3.8), we have the following discrete analog of the Eq. (2.3)

$$ {{\int}_{0}^{T}}\Big[\sum\limits_{k\in {\Omega}_{h}}\left( \frac{d u^{k}}{d t} + b^{k} u^{k} - f\varphi^{k}-g^{k}\right)\eta^{k} +\sum\limits_{i=1}^{n}{\sum}_{k{\in{\Omega}_{h}^{i}}}a_{i}^{k+\frac{e_{i}}{2}} u_{x_{i}}^{k}\eta_{x_{i}}^{k} \Big]{ d}t=0. $$
(3.11)

We note that, using the discrete analog of the integration by parts and the homogeneous boundary condition u k = 0, η k = 0 for k i = 0, we obtain

$$ {\sum}_{k{\in{\Omega}_{h}^{i}}}a_{i}^{k+\frac{e_{i}}{2}} u_{x_{i}}^{k}\eta_{x_{i}}^{k} = \sum\limits_{k\in{\Omega}_{h}} \left( a_{i}^{k-\frac{e_{i}}{2}}\frac{u^{k}-u^{k-e_{i}}}{{h_{i}^{2}}}- a_{i}^{k+\frac{e_{i}}{2}} \frac{u^{k+e_{i}}-u^{k}}{{h_{i}^{2}}}\right)\eta^{k}. $$
(3.12)

Hence, replacing this equality into (3.11), we obtain the following system which approximates the original problem (2.1)

$$ \left\{\begin{array}{l} \frac{d \bar u}{d t} +({\Lambda}_{1}+\cdots+{\Lambda}_{n})\bar u - F = 0,\\ \bar u(0) = \bar u_{0} \end{array}\right. $$
(3.13)

with \(\bar u = \{u^{k}, k\in {\Omega }_{h}\}\) being the grid function. The function \(\bar u_{0}\) is the grid function approximating the initial condition u 0(x):

$$ {u_{0}^{k}} = \frac 1 {|\omega(k)|}{\int}_{\omega(k)}u_{0}(x) dx $$
(3.14)

and

$$\begin{array}{@{}rcl@{}} ({\Lambda}_{i} \bar u)^{k}=\frac {b^{k} u^{k}}{n}+ \left\{\begin{array}{l} \frac{a_{i}^{k-\frac{e_{i}}2}} {{h_{i}^{2}}}\left( u^{k}-u^{k-e_{i}}\right) - \frac {a_{i}^{k+\frac{e_{i}}2}} {{h_{i}^{2}}}\left( u^{k+e_{i}}-u^{k}\right), 2\leq k_{i}\leq N_{i}-2,\\ \frac{a_{i}^{k-\frac{e_{i}}2}} {{h_{i}^{2}}} u^{k} - \frac {a_{i}^{k+\frac{e_{i}}2}} {{h_{i}^{2}}}\left( u^{k+e_{i}}-u^{k}\right), k_{i}=1,\\ \frac{a_{i}^{k-\frac{e_{i}}2}} {{h_{i}^{2}}}\left( u^{k}-u^{k-e_{i}}\right)+\frac {a_{i}^{k+\frac{e_{i}}2}} {{h_{i}^{2}}} u^{k}, k_{i}=N_{i}-1 \end{array}\right. \end{array} $$
(3.15)

for k ∈ Ω h . Moreover,

$$ F =\{f\varphi^{k}+g^{k}, k\in {\Omega}_{h}\}. $$
(3.16)

We note that the coefficient matrices Λ i are positive semi-definite (see, e.g., [30]). In order to obtain a splitting scheme for the Cauchy problem (3.13), we discretize it in time. We divide the time interval [0, T] into M subintervals by

$$0= t_{0} < t_{1} = {\Delta} t< {\cdots} < t_{M} = T, $$

with Δt = T/M. We denote \(u^{m+\delta } :=\bar u(t_{m}+\delta {\Delta } t),{{\Lambda }_{i}^{m}} :={\Lambda }_{i}(t_{m}+{\Delta } t/2).\) We introduce the following implicit two-circle component-by-component splitting scheme [21]

$$\begin{array}{@{}rcl@{}} &&\frac{u^{m+\frac{i}{2n}}-u^{m+\frac{i-1}{2n}}}{\Delta t} +{{\Lambda}_{i}^{m}} \frac{u^{m+\frac{i}{2n}}+u^{m+\frac{i-1}{2n}}}{4}=0,\quad i = 1, 2,\dots, n-1,\\ &&\frac{u^{m+\frac 1 2}-u^{m+\frac{n-1}{2n}}}{\Delta t} +{{\Lambda}_{n}^{m}} \frac{u^{m+\frac 1 2}+u^{m+\frac{n-1}{2n}}}{4}= \frac{F^{m}} 2+\frac{\Delta t} 8{{\Lambda}^{m}_{n}}F^{m},\\ &&\frac{u^{m+\frac{n+1}{2n}}-u^{m+\frac 1 2}}{\Delta t}+ {{\Lambda}_{n}^{m}} \frac{u^{m+\frac{n+1}{2n}}+u^{m+\frac 1 2}}{4}= \frac{F^{m}} 2-\frac{\Delta t}8{{\Lambda}^{m}_{n}}F^{m},\\ &&\frac{u^{m+1-\frac{i-1}{2n}}-u^{m+1-\frac{i}{2n}}}{\Delta t}+ {{\Lambda}_{i}^{m}} \frac{u^{m+1-\frac{i-1}{2n}}+u^{m+1-\frac{i}{2n}}}{4}=0, \quad i = n-1, n-2, \dots, 1,\\ &&u^{0}=\bar u_{0}. \end{array} $$
(3.17)

Equivalently,

$$\begin{array}{@{}rcl@{}} &&\left( E_{i}+\frac{\Delta t}4{{\Lambda}_{i}^{m}}\right)u^{m+\frac{i}{2n}}= \left( E_{i}-\frac{\Delta t}4{{\Lambda}_{i}^{m}}\right)u^{m+\frac{i-1}{2n}}, \quad i = 1, 2,\dots, n-1,\\ &&\left( E_{n}+\frac{\Delta t}4{{\Lambda}^{m}_{n}}\right)\left( u^{m+\frac 1 2}- \frac {\Delta t} 2F^{m}\right)=\left( E_{n}-\frac{\Delta t}4{{\Lambda}^{m}_{n}}\right)u^{m+\frac{n-1}{2n}},\\ &&\left( E_{n}+\frac{\Delta t}4{{\Lambda}^{m}_{n}}\right)u^{m+\frac{n+1}{2n}}= \left( E_{n}-\frac{\Delta t}4{{\Lambda}^{m}_{n}}\right)\left( u^{m+\frac 1 2}+\frac {\Delta t} 2F^{m}\right),\\ &&\left( E_{i}+\frac{\Delta t}4{{\Lambda}_{i}^{m}}\right)u^{m+1-\frac{i-1}{2n}}= \left( E_{i}-\frac{\Delta t}4{{\Lambda}_{i}^{m}}\right)u^{m+1-\frac{i}{2n}},\quad i = n-1, n-2, \dots, 1,\\ &&u^{0}=\bar u_{0}, \end{array} $$
(3.18)

where E i is the identity matrix corresponding to Λ i , i = 1,…, n. The splitting scheme (3.18) can be rewritten in the following compact form

$$ \left\{\begin{array}{ll} u^{m+1}=A^{m} u^{m}+{\Delta} tB^{m}(f^{m}\varphi^{m}+g^{m}),\quad m =0,...,M-1,\\ u^{0}=\bar u_{0}, \end{array}\right. $$
(3.19)

with

$$\begin{array}{@{}rcl@{}} A^{m}&=&{A_{1}^{m}}{\cdots} {A_{n}^{m}} {A_{n}^{m}}{\cdots} {A_{1}^{m}},\\ B^{m}&=&{A_{1}^{m}} {\cdots} {A_{n}^{m}}, \end{array} $$
(3.20)

where \({A_{i}^{m}} := \left (E_{i}+\frac {\Delta t} 4{{\Lambda }_{i}^{m}}\right )^{-1}\left (E_{i}-\frac {\Delta t} 4{{\Lambda }_{i}^{m}}\right ), i=1,\dots , n.\)

It can be proved that [10, 30] the scheme (3.17) is stable and there exists a positive constant c d d independent of the coefficient a i , i = 1,…, n and b such that

$$\begin{array}{@{}rcl@{}} &&\left( \sum\limits_{m=0}^{M}\sum\limits_{k\in {\Omega}_{h}}|u^{k,m}|^{2}\right)^{1/2} \\ &&\leq c_{dd} \left( \left( \sum\limits_{k\in {\Omega}_{h}}|{u_{0}^{k}}|^{2}\right)^{1/2} + \left( \sum\limits_{m=0}^{M}\sum\limits_{k\in {\Omega}_{h}}|f^{m} \varphi^{k,m} + g^{k,m}|^{2})^{1/2}\right)\right). \end{array} $$
(3.21)

When the space dimension is one, we approximate (3.13) by Crank-Nicholson’s method and the solution of the discretized problem is reduced to the form (3.18).

3.2 Discretization of the Variational Problem

We discretize the objective functional J 0(f) as follows:

$$ J_{0}^{h,{\Delta} t}(f):=\frac {\Delta t} 2\sum\limits_{m=1}^{M}|{\Delta} h\sum\limits_{k\in{\Omega}_{h}}\omega^{k}u^{k,m}(f)-h^{m}|^{2}, $$
(3.22)

where u k, m(f) shows its dependence on the right-hand side term f, and m is the index of grid points on the time axis. The notation ω k = ω(x k) means an approximation of the function ω(x) in Ω at points x k, for example, we take

$$ \omega^{k} = \frac 1 {|\omega(k)|}{\int}_{\omega(k)}\omega(x) dx. $$
(3.23)

In this subsection, for simplicity of notations, by writing f, we mean the grid function defined on the grid {0,Δt,…, MΔt} with the norm \(\|f\| = ({\Delta } t{\sum }_{m=1}^{M}| f^{m}|^{2})^{1/2}\). By this notations, we thus discretized the functional l u(f) by

$$l_{h}u(f) = ({l_{h}^{1}}u(f),{l_{h}^{2}}u(f),\ldots, {l_{h}^{M}}u(f)) $$

with

$$ {l_{h}^{m}} u(f) = {\Delta} h\sum\limits_{k\in{\Omega}_{h}}\omega^{k}u^{k,m}(f), \quad m =0, 1, \ldots, M. $$
(3.24)

For minimizing the problem (3.22) by the conjugate gradient method, we first calculate the gradient of the objective function \(J_{0}^{h,{\Delta } t}(f)\) as follows.

Theorem 2

The gradient \(\nabla J_{0}^{h,{\Delta } t}(f)\) of the objective function \(J_{0}^{h,{\Delta } t}\) at f is given by

$$ \nabla J_{0}^{h,{\Delta} t}(f) = \sum\limits_{m=0}^{M-1}{\Delta} t(B^{m})^{\ast}\varphi^{m}\eta^{m}, $$
(3.25)

where η satisfies the adjoint problem

$$ \left\{\begin{array}{ll} \eta^{m}=(A^{m+1})^{\ast}\eta^{m+1}+ \psi^{m+1},\quad m=M-2, \dots, 0,\\ \eta^{M-1}= \psi^{M},\\ \eta^{M}=0, \end{array}\right. $$
(3.26)

with

$$ \psi^{m} = \left\{\psi^{k,m}=\omega^{k}\left( {\Delta} h\sum\limits_{k\in{\Omega}_{h}}\omega^{k} u^{k,m}(f)-h^{m}\right), \quad k \in {\Omega}_{h} \right\}, \quad m =0, 1, \ldots, M $$
(3.27)

and the matrices (A m ) and (B m ) being given by

$$\begin{array}{@{}rcl@{}} (A^{m})^{\ast} &=&\left( E_{1}-\frac {\Delta t} 4{{\Lambda}_{1}^{m}}\right)\left( E_{1}+\frac {\Delta t} 4{{\Lambda}_{1}^{m}}\right)^{-1}...\left( E_{n}-\frac {\Delta t} 4{{\Lambda}_{n}^{m}}\right)\left( E_{n}+\frac {\Delta t} 4{{\Lambda}_{n}^{m}}\right)^{-1}\\ &&\times \left( E_{n}-\frac {\Delta t} 4{{\Lambda}_{n}^{m}}\right)\left( E_{n}+\frac {\Delta t} 4{{\Lambda}_{n}^{m}}\right)^{-1}...\left( E_{1}-\frac {\Delta t} 4{{\Lambda}_{1}^{m}}\right)\left( E_{1}+\frac {\Delta t} 4{{\Lambda}_{1}^{m}}\right)^{-1},\\ (B^{m})^{\ast} &=&\left( E_{n}-\frac {\Delta t} 4{{\Lambda}_{n}^{m}}\right)\left( E_{n}+\frac {\Delta t} 4{{\Lambda}_{n}^{m}}\right)^{-1}...\left( E_{1}-\frac {\Delta t} 4{{\Lambda}_{1}^{m}}\right)\left( E_{1}+\frac {\Delta t}4{{\Lambda}_{1}^{m}}\right)^{-1}. \end{array} $$
(3.28)

Proof

For an infinitesimally small variation δ f of f, we have from (3.22) that

$$\begin{array}{@{}rcl@{}} &&J_{0}^{h,{\Delta} t}(f+\delta f)-J_{0}^{h,{\Delta} t}(f)\\ &&=\frac {\Delta t} 2\sum\limits_{m=1}^{M}\left( {l_{h}^{m}} u(f+\delta f)-h^{m}\right)^{2}-\frac {\Delta t} 2\sum\limits_{m=1}^{M}\left( {l_{h}^{m}} u(f)-h^{m}\right)^{2}\\ &&=\frac {\Delta t} 2\sum\limits_{m=1}^{M}\sum\limits_{k\in{\Omega}_{h}}\left( {\Delta} h\omega^{k}v^{k,m}\right)^{2}+ {\Delta} t\sum\limits_{m=1}^{M}{\Delta} h\sum\limits_{k\in{\Omega}_{h}}v^{k,m}\omega^{k} ({l_{h}^{m}} u(f)-h^{m})\\ &&=\frac {\Delta t} 2\sum\limits_{m=1}^{M}\sum\limits_{k\in{\Omega}_{h}}\left( {\Delta} h\omega^{k}v^{k,m}\right)^{2}+{\Delta} t\sum\limits_{m=1}^{M}{\Delta} h \sum\limits_{k\in{\Omega}_{h}} v^{k,m} \psi^{k,m}\\ &&=\frac{\Delta t}{2}\sum\limits_{m=1}^{M}\sum\limits_{k\in{\Omega}_{h}}\left( {\Delta} h\omega^{k}v^{k,m}\right)^{2}+{\Delta} t\sum\limits_{m=1}^{M}\langle v^{m},\psi^{m}\rangle, \end{array} $$
(3.29)

where v m = {v k, m:=u k, m(f + δ f)−u k, m(f)}.

It follows from (3.19) that v is the solution to the problem

$$ \left\{\begin{array}{ll} v^{m+1}=A^{m}v^{m}+{\Delta} tB^{m}\delta f\varphi^{m},\quad m=0,\ldots,M-1,\\ v^{0}=0. \end{array}\right. $$
(3.30)

Taking the inner product of both sides of the mth equation of (3.30) with an arbitrary vector \(\eta ^{m}\in \mathbb {R}^{N_{1}\times \ldots \times N_{n}}\) and then summing the results over m = 0,…, M−1, we obtain

$$\begin{array}{@{}rcl@{}} \sum\limits_{m=0}^{M-1}\langle v^{m+1},\eta^{m}\rangle&=&\sum\limits_{m=0}^{M-1}\langle A^{m}v^{m},\eta^{m}\rangle+{\Delta} t\sum\limits_{m=0}^{M-1}\langle B^{m}\delta f\varphi^{m},\eta^{m}\rangle\\ &=&\sum\limits_{m=0}^{M-1}\langle v^{m},\left( A^{m}\right)^{\ast}\eta^{m} \rangle+{\Delta} t\sum\limits_{m=0}^{M-1}\langle B^{m}\delta f\varphi^{m},\eta^{m} \rangle. \end{array} $$
(3.31)

Here, 〈⋅,⋅〉 is the inner product in \(\mathbb {R}^{N_{1}\times \ldots \times N_{n}}\) and \(\left (A^{m}\right )^{\ast }\) is the adjoint matrix of A m. Taking the inner product of both sides of the first equation of (3.26) with an arbitrary vector v m+1, summing the results over m = 0,…, M−2, we obtain

$$\begin{array}{@{}rcl@{}} \sum\limits_{m=0}^{M-2}\langle v^{m+1},\eta^{m}\rangle&=& \sum\limits_{m=0}^{M-2}\langle v^{m+1},(A^{m+1})^{\ast}\eta^{m+1}\rangle +\sum\limits_{m=0}^{M-2}\langle v^{m+1},\psi^{m+1}\rangle\\ &=&\sum\limits_{m=1}^{M-1}\langle v^{m},(A^{m})^{\ast}\eta^{m}\rangle+\sum\limits_{m=1}^{M-1}\langle v^{m},\psi^{m}\rangle. \end{array} $$
(3.32)

Taking the inner product of both sides of the second equation of (3.26) with an arbitrary vector v M, we have

$$ \langle v^{M},\eta^{M-1}\rangle =\langle v^{M},\psi^{M}\rangle. $$
(3.33)

From (3.32) and (3.33), we have

$$ \sum\limits_{m=0}^{M-2}\langle v^{m+1},\eta^{m}\rangle+\langle v^{M},\eta^{M-1}\rangle =\sum\limits_{m=1}^{M-1}\langle v^{m},(A^{m})^{\ast}\eta^{m}\rangle+\sum\limits_{m=1}^{M-1}\langle v^{m},\psi^{m}\rangle+\langle v^{M},\psi^{M}\rangle. $$
(3.34)

From (3.31), (3.34), we obtain

$$\langle v^{0},\left( A^{0}\right)^{\ast}\eta^{0}\rangle +{\Delta} t\sum\limits_{m=0}^{M-1}\langle B^{m}\delta f\varphi^{m},\eta^{m}\rangle =\sum\limits_{m=1}^{M-1}\langle v^{m},\psi^{m}\rangle +\langle v^{M},\psi^{M}\rangle. $$

Because v 0 = 0, we have

$$ {\Delta} t\sum\limits_{m=0}^{M-1}\langle B^{m}\delta f\varphi^{m},\eta^{m}\rangle=\sum\limits_{m=1}^{M-1}\langle v^{m},\psi^{m}\rangle+\langle v^{M},\psi^{M}\rangle=\sum\limits_{m=1}^{M}\langle v^{m},\psi^{m}\rangle. $$
(3.35)

On the other hand, from (3.21), we have \({\sum }_{m=1}^{M}{\sum }_{k\in {\Omega }_{h}}\left (\omega ^{k}v^{k,m}\right )^{2}=o(\|f\|)\). Hence, it follows form (3.29) and (3.35) that

$$ J_{0}^{h,{\Delta} t}(f+\delta f)-J_{0}^{h,{\Delta} t}(f)={\Delta} t\sum\limits_{m=0}^{M-1}\langle\delta f,(B^{m})^{\ast}\varphi^{m}\eta^{m}\rangle+o(\|f\|). $$
(3.36)

Consequently, \(J_{0}^{h,{\Delta } t}\) is differentiable and its gradient has the form (3.25). □

Remark 1

Since the matrices Λ i , i = 1,…, n are symmetric, we have for m = 0,…, M−1

$$\begin{array}{@{}rcl@{}} (A^{m})^{\ast} \!\!&=&\!\!\left( E_{1}-\frac{\Delta t}{4}{\Lambda}_{1}^{m}\right)\left( E_{1}+\frac{\Delta t}{4} {\Lambda}_{1}^{m}\right)^{-1}\!\!...\left( E_{n}-\frac{\Delta t}{4}{\Lambda}_{n}^{m}\right)\left( E_{n}+\frac{\Delta t} {4}{\Lambda}_{n}^{m}\right)^{-1}\\ \!\!&\times&\!\! \left( E_{n}-\frac{\Delta t}{4}{\Lambda}_{n}^{m}\right)\left( E_{n}+\frac{\Delta t} {4}{\Lambda}_{n}^{m}\right)^{-1}\!...\left( E_{1}-\frac{\Delta t}{4}{\Lambda}_{1}^{m}\right)\!\left( E_{1}+\frac{\Delta t}{4}{\Lambda}_{1}^{m}\right)^{-1}.\\ \end{array} $$
(3.37)

Similarly,

$$\begin{array}{@{}rcl@{}} \!\!\!\!(B^{m})^{\ast} \,=\,\left( E_{n}-\frac{\Delta t}{4}{\Lambda}_{n}^{m}\right)\!\left( E_{n}+\frac{\Delta t}{4} {\Lambda}_{n}^{m}\right)^{-1}\!...\left( E_{1}-\!\frac{\Delta t}{4}{\Lambda}_{1}^{m}\right)\!\left( E_{1}+\!\frac{\Delta t}{4}{\Lambda}_{1}^{m}\right)^{-1}. \end{array} $$
(3.38)

3.3 Conjugate Gradient Method

The conjugate gradient method applied to the discretized functional (3.22) has now the form:

Step 1 Given an initial approximation \(f^{0} \in \mathbb {R}^{M+1}\) and calculate the residual \(\hat r^{0}=({l_{h}^{1}}u(f^{0})-h^{1},{l_{h}^{2}}u(f^{0})-h^{2},\ldots , {l_{h}^{M}}u(f^{0})-h^{M})\) by solving the splitting (3.17) with f being replaced by the initial approximation f 0 and set k = 0.

Step 2 Calculate the gradient r 0 = −∇J γ (f 0) given in (3.25) by solving the adjoint problem (3.26). Then, we set d 0 = r 0.

Step 3 Calculate

$$\alpha^{0}=\frac{\| r^{0}\|^{2}}{\| l_{h}d^{0}\|^{2}+\gamma\| d^{0}\|^{2}}, $$

where l h d 0 are calculated from the splitting scheme (3.17) with f being replaced by d 0 and g(x, t) = 0, u 0 = 0. Then, set

$$f^{1}=f^{0}+\alpha^{0}d^{0}. $$

Step 4 For k = 1, 2, ⋯, calculate r k = −∇J γ (f k), d k = r k + β k d k−1, where

$$\beta^{k}=\frac{\| r^{k}\|^{2}}{\| r^{k-1}\|^{2}}. $$

Step 5 Calculate α k

$$\alpha^{k}=\frac{\| r^{k}\|^{2}}{\| l_{h}d^{k}\|^{2}+\gamma\| d^{k}\|^{2}}, $$

where l h d k are calculated from the splitting scheme (3.17) with f being replaced by d k and g(x, t) = 0, u 0 = 0. Then, set

$$f^{k+1}=f^{k}+\alpha^{k} d^{k}.$$

4 Numerical Simulation

In this section, we present some numerical examples showing that our algorithm is efficient. Let T = 1, we test our algorithm for reconstructing the following functions

  • Example 1: f(t) = sin(π t),

  • Example 2: \( f(t) = \left \{\begin {array}{ll} 2 t &\text { if } 0 \leq t \leq 0.5\\ 2(1-t) &\text { if } 0.5 \leq t \leq 1 \end {array}\right ., \)

  • Example 3: \( f(t) = \left \{\begin {array}{ll} 1 &\text { if } 0.25 \leq t \leq 0.75\\ 0 &\text { otherwise} \end {array}\right .. \)

The reason for choosing these functions is that the first one is very smooth, the second one is not differentiable at t = 0.5, and the last one is discontinuous. Thus, these examples have different degree of difficulty.

From these test functions, we will take some explicit solutions u to the (2.1), the explicit functions φ and f and then calculate the remained term g in the right-hand side of (2.1). From u, we calculate l u = h and then put some random noise in h. The numerical simulation takes the noisy data h and reconstructs f from it by our algorithm. We stop the algorithm when ∥f k+1f k∥ is small enough, say 10−3. We then compare the numerical solution with the exact one to show the efficiency of our approach.

We note that in our examples, we took the functions f(t) with f(0)=f(T) = 0. However, we also tested our algorithm for other functions f with f(0)≠0 or/and f(T)≠0 and got the same good numerical results. Hence, for saving the space of the paper, we do not present them here.

4.1 One-Dimensional Problems

Let Ω=(0,1). We reconstruct the function f from the system

$$\left\{\begin{array}{ll} u_{t} -u_{xx} = f(t) \varphi(x,t) + g(x,t), \quad 0< x < 1, 0< t < 1,\\ u(0, t) = u(1,t) = 0, \quad 0< t <1,\\ u(x, 0) = u_{0}(x), \quad 0 < x <1. \end{array}\right. $$

We take u(x, t) = sin(π x)(1−t), u 0(x) = sin(π x), φ(x, t) = (x 2+5)(t 2+5) and then put one of the above functions f into the system to get g(x, t). In the observation lu(2.16), we take the following weight functions, either

$$ \omega(x) =x^{2}+1 $$
(4.1)

or

$$ \omega(x) = \left\{\begin{array}{lll} \frac{1}{2\epsilon} &\text{if} x \in (x_{0} - \epsilon, x_{0}+ \epsilon)\\ 0 &\text{ otherwise} \end{array}\right. \quad \text{with } \epsilon = 0.01. $$
(4.2)

We note that the observation operator with the second weight function can be regarded as a pointwise observation.

The numerical results for these tests are presented in Figs. 1, 2, 3, 4, 5, and 6. From these results, we see that the numerical results in the one-dimensional cases are very good, although the noise level is 10 %. In Tables 1 and 2, we present the regularization parameters, L 2−errors, iterations where we stop the algorithm and the values of the objective function. From these tables, we see that our algorithm is very accurate.

Fig. 1
figure 1

1D Problem, Example 1: The exact solution in comparison with the numerical solution with noise level = 0.1 (left) and noise level = 0.01 (right). The weight function ω is given by (4.1)

Fig. 2
figure 2

1D Problem, Example 2: The exact solution in comparison with the numerical solution with noise level =0.1 (left) and noise level = 0.01 (right). The weight function ω is given by (4.1)

Fig. 3
figure 3

1D Problem, Example 3: The exact solution in comparison with the numerical solution with noise level =0.1 (left) and noise level = 0.01 (right). The weight function ω is given by (4.1)

Fig. 4
figure 4

1D Problem, Example 2: The exact solution in comparison with the numerical solution with noise level =0.1 (left) and noise level = 0.01 (right). The weight function ω is given by (4.2)

Fig. 5
figure 5

1D Problem, Example 2: The exact solution in comparison with the numerical solution with noise level =0.1(left) and noise level = 0.01 (right). The weight function ω is given by (4.2)

Fig. 6
figure 6

1D Problem, Example 3: The exact solution in comparison with the numerical solution with noise level =0.1 (left) and noise level = 0.01 (right). The weight function ω is given by (4.2)

Table 1 1D Problem: The regularization parameter γ, the stopping iteration number n , L 2(0, T)−errors \(\protect \|f - f_{n^{\ast }}\|_{L^{2}(0,T)}\), and values of \(\protect J_{\gamma } (f_{n^{\ast }})\) (the weight function ω is given by (4.1))
Table 2 1D Problem: The regularization parameter γ, the stopping iteration number n , L 2(0, T)−errors \(\protect \|f - f_{n^{\ast }}\|_{L^{2}(0,T)}\), and values of \(\protect J_{\gamma } (f_{n^{\ast }})\) (the weight function ω is given by (4.2))

4.2 Two-Dimensional Problems

In this subsection, we present our numerical simulation for various problems. We take Ω=(0,1)×(0,1). In this case, (2.1) has the form

$$ u_{t}- (\left( a_{1}(x,t)u_{x_{1}}\right)_{x_{1}}- (\left( a_{2}(x,t)u_{x_{1}}\right)_{x_{1}} + b(x,t)u =f(t)\varphi(x,t)+g(x,t). $$
(4.3)

In the all tests, we take the noise level by 10−1 and 10−2, the weight function

$$ \omega(x) = \left\{\begin{array}{lll} \frac{1}{4\epsilon^{2}} &\text{ if } {x_{1}^{0}} - \epsilon < x_{1} < {x_{1}^{0}}+ \epsilon \text{ and } {x_{2}^{0}} - \epsilon < x_{2} < {x_{2}^{0}}+ \epsilon \\ 0 &\text{ otherwise} \end{array}\right. \quad \text{with } \epsilon = 0.01. $$
(4.4)

The regularization parameter γ is taken by 10−3. However, the numerical results for the case with noise level 10−2 are not much different from that of the case with noise level 10−1; therefore, we present our results for the last case only.

As in the one-dimensional cases, we put the given the data a 1, a 2, b, f, φ and u into the (4.3) to get g. After that, we put some noise in lu to get the noisy data h, and from it, we apply our algorithm to reconstruct f.

Test 1. Example 1: (Fig. 7)

$$f(t)=\sin(\pi t) $$
$$\begin{array}{@{}rcl@{}} &&a_{1}(x,t)=a_{2}(x,t)=0.5\left( 1-0.5(1-t)\cos(3\pi x_{1})\cos(3\pi x_{2})\right),\\ &&b(x,t)={x_{1}^{2}}+{x_{2}^{2}}+2x_{1}t+1,\\ &&u_{0}(x)=\sin(\pi x_{1})\sin(\pi x_{2}),\\ &&u(x,t) = u_{0}(x) \times (1-t),\\ &&\varphi(x,t)=({x_{1}^{2}}+5)\left( {x_{2}^{2}}+3\right)\left( t^{2}+2\right). \end{array} $$
Fig. 7
figure 7

2D Problem, Example 1, Test 1: The exact solution (left) and the approximate solution (right) with noise level = 0.1. The weight function ω is given by (4.4)

From our various tests, we realized that our algorithm is more stable when the function φ is “big.” If φ is small, then the numerical are not as good as for the case “big” φ as the following test shows (Fig. 8).

Fig. 8
figure 8

2D Problem, Example 1, Test 1: The exact solution in comparison with the numerical solution for noise level =0.1 (left) and the error (right). The weight function ω is given by (4.1)

Test 2. Example 1:

$$f(t)=\sin(\pi t). $$

We take the same equation as in Test 1 however with \(\varphi (x,t)=\left ({x_{1}^{2}}+1\right )\left ({x_{2}^{2}}+1\right )\left (t^{2}+1\right )\). We note that the norm of this function φ is less than that in Test 1.

The numerical results in this case are slightly worse than that in Test 1 as Figs. 9 and 10 show.

Fig. 9
figure 9

2D Problem, Example 1, Test 2: The exact solution (left) and the approximate solution (right) with noise level = 0.1. The weight function ω is given by (4.4)

Fig. 10
figure 10

2D Problem, Example 1, Test 2: The exact solution in comparison with the numerical solution for noise level =0.1 (left) and the error (right). The weight function ω is given by (4.4)

Test 3. Example 2:

$$f(t)= \left\{\begin{array}{ll} 2t& \text{if} t\le 0.5,\\ 2(1-t)& \text{ otherwise} \end{array}\right. $$
$$\begin{array}{@{}rcl@{}} &&a_{1}(x,t)=a_{2}(x,t)=0.5(1-0.5(1-t)\cos(3\pi x_{1})\cos(3\pi x_{2})),\\ &&u_{0}(x)=\sin(\pi x_{1})\sin(\pi x_{2}),\\ &&b(x,t)={x_{1}^{2}}+{x_{2}^{2}}+2x_{1}t+1,\\ &&\varphi(x,t)=\left( {x_{1}^{2}}+5\right)\left( {x_{2}^{2}}+3\right)\left( t^{2}+3\right). \end{array} $$

Numerical results for this test are presented in Figs. 11 and 12.

Fig. 11
figure 11

2D Problem, Example 2, Test 3: The exact solution (left) and the approximate solution (right) with noise level =0.1 (left). The weight function ω is given by (4.4)

Fig. 12
figure 12

2D Problem, Example 2, Test 3: The exact solution in comparison with the numerical solution for noise level = 0.1 (left) and the error (right). The weight function ω is given by (4.4)

Test 4. Example 3:

$$f(t)= \left\{\begin{array}{ll} 1 &\text{ if } 0.25\le t\le 0.75,\\ 0 &\text{ otherwise} \end{array}\right. $$
$$\begin{array}{@{}rcl@{}} &&a_{1}(x,t)=a_{2}(x,t)=0.5(1-0.5(1-t)\cos(3\pi x_{1})\cos(3\pi x_{2})),\\ &&b(x,t)={x_{1}^{2}}+{x_{2}^{2}}+2x_{1}t+1,\\ &&u_{0}(x)=\sin(\pi x_{1})\sin(\pi x_{2}),\\ &&\varphi(x,t)=\left( {x_{1}^{2}}+5\right)\left( {x_{2}^{2}}+3\right)(t^{2}+3). \end{array} $$

The numerical results for this test are presented in Figs. 13 and 14.

Fig. 13
figure 13

2D Problem, Example 3, Test 4: The exact solution (left) and the approximate solution (right) with noise level =0.1 (left). The weight function ω is given by (4.4)

Fig. 14
figure 14

2D Problem, Example 3, Test 4: The exact solution in comparison with the numerical solution for noise level = 0.1 (left) and the error (right). The weight function ω is given by (4.4)

In Table 3, we present errors in the L 2−norm, the values of the objective function with respect to the noise levels. From this table, we see that our algorithm is very accurate.

Table 3 Errors in the L 2−norm, the values of the objective function with respect to the noise levels

5 Conclusions

In this paper, we investigate the inverse problem of determining a time-dependent term from integral observations in the right-hand side of parabolic equations. We reformulate it as a variational problem and prove that the functional to be minimized is Fréchet differentiable and we derive a formula for its gradient via an adjoint problem. The variational problem is then discretized by the splitting finite difference method. The discretized functional to be minimized is proved to be differentiable and its gradient is given via the discretized adjoint problem. The conjugate gradient method in coupling with Tikhonov regularization is suggested for numerically solving the problem. Several numerical tests are carried out which show that our algorithm is efficient.