## Introduction

Inverse problems of partial differential equations have many applications in different sciences, e.g., physics, engineering, geoscience, finance, etc. In the last decades, the scientific research has begun to focus on inverse problems of heat conduction equation, e.g., for more details, see [1,2,3,4,5,6,7].

The heat conduction problems include two categories: direct and inverse problems. The direct problems are related to the determination of unknown temperature distribution at the domain in the presence of the known initial and boundary conditions and other physical properties. The inverse problems consist of not only determination of temperature distribution, but also an estimation of the diffusion coefficient or temperature/heat flux on the surface or other unknown parameters from the extra condition which is given usually by temperature measurements taken within the body.

The major difficulty of IHCPs is their instability, that is, the small error in input data causes the large change in output data according to Hadamard definition [1,2,3].

Due to the instability of the inverse problem, the computational treatment of such problems needs applying more accurate numerical methods to obtain a stable approximate solution. In recent years, IHCPs have been investigated from the analytical and numerical point of view, in the literature, e.g., [3,4,5,6, 8,9,10].

Some more relevant works are published regarding the estimation of boundary condition and heat flux in [9, 11,12,13,14].

We present in this paper a numerical algorithm based on collocation method for an IHCP, which does not require domain discretization. The solution is constructed from the linear combination of basis functions which are chosen in an appropriate way.

By using the solution of the direct problem, a numerical approach based on the collocation method is introduced. An ill-conditioned system is derived from discretization. The condition number of the resultant matrix increases with respect to the number of collocation points, and so by using standard algorithms, we cannot achieve good accuracy. Some kind of regularization is necessary for finding a stable solution.

The outline of this paper is organized as follows:

In Sect. 2, a mathematical model of our interest problem is introduced. In Sect. 3, the Tikhonov regularization method is applied to construct a stable solution of the ill-posed integral equation. Section 4 contains a numerical procedure based on the collocation method for solving the inverse problem. In Sect. 5, the regularization method for discrete ill-posed problem is applied to find a stable solution and introduced GCV and L-curve criteria for determining regularization parameter. In Sect. 6, a test problem is considered to investigate the validity and efficiency of the method. Section 7 contains the conclusions.

## Problem formulation

Here, we consider an inverse problem of the heat conduction in a quarter plane and the unknown boundary condition has to be determined from temperature measurements at a fixed point of the domain. Consider the following problem:

$$u_{t} = u_{xx},\quad 0 < x, \quad 0 < t < T,$$
(2.1)
$$u\left({x,0} \right) = f\left(x \right), \quad 0 < x,$$
(2.2)
$$u\left({0,t} \right) = g\left(t \right), \quad 0 < t < T,$$
(2.3)
$$\left| {u\left({x,0} \right)} \right| \le M,\quad 0 < x,\quad 0 < t < T,$$
(2.4)

where $$T$$ represents the final time and $$f(x)$$ and $$g(t)$$ are piecewise known continuous functions in direct problem and M is a positive constant.

The inverse problem consists of determining $$u\left({x,t} \right)$$ and boundary condition $$g(t)$$ subject to the condition (2.2), and overspecified condition $$p(t)$$, which is given by

$$u\left({1,t} \right) = p\left(t \right),\quad 0 < t < T.$$
(2.5)

This IHCP is ill-posed.

For the forward problem (2.1)–(2.4), the unique solution is given by [15],

\begin{aligned} & u\left( {x,t} \right) = \frac{x}{{\sqrt {4\pi } }}\mathop \int \nolimits_{0}^{t} \frac{g\left( \tau \right)}{{\sqrt {\left( {t - \tau } \right)^{3} } }}{\text{e}}^{{ - \frac{{x^{2} }}{{4\left( {t - \tau } \right)}}}} {\text{d}}\tau \\ & \quad + \frac{1}{{\sqrt {4\pi t} }}\mathop \int \nolimits_{0}^{ + \infty } \left( {{\text{e}}^{{ - \frac{{\left( {x - \xi } \right)^{2} }}{4t}}} - {\text{e}}^{{ - \frac{{\left( {x + \xi } \right)^{2} }}{4t}}} } \right)f\left( \xi \right){\text{d}}\xi . \\ \end{aligned}
(2.6)

By setting x = 1 and using (2.5), we obtain

\begin{aligned} & \frac{1}{\sqrt \pi }\mathop \int \nolimits_{0}^{t} \frac{g\left( \tau \right)}{{\sqrt {\left( {t - \tau } \right)^{3} } }}{\text{e}}^{{ - \frac{1}{{4\left( {t - \tau } \right)}}}} {\text{d}}\tau = 2p\left( t \right) \\ & \quad - \frac{1}{{\sqrt {\pi t} }}\mathop \int \nolimits_{0}^{ + \infty } \left( {{\text{e}}^{{ - \frac{{\left( {1 - \xi } \right)^{2} }}{4t}}} - {\text{e}}^{{ - \frac{{\left( {1 + \xi } \right)^{2} }}{4t}}} } \right)f\left( \xi \right){\text{d}}\xi . \\ \end{aligned}
(2.7)

When we set $$f\left( x \right) = 0$$, Eq. (2.7) has the form

$$\frac{1}{\sqrt \pi }\mathop \int \nolimits_{0}^{t} \frac{g\left( \tau \right)}{{\sqrt {\left( {t - \tau } \right)^{3} } }}{\text{e}}^{{ - \frac{1}{{4\left( {t - \tau } \right)}}}} \; {\text{d}}\tau = 2p\left( t \right).$$
(2.8)

Equation (2.7) can be rewritten in terms of an integral operator equation as follows:

$$\left( {Ag} \right)\left( t \right) = G\left( t \right), \quad 0 < t < T,$$
(2.9)

where the operator $$A$$ for $$0 < t < T$$ is defined by

$$\left( {Ag} \right)\left( t \right) = \mathop \int \nolimits_{0}^{t} \frac{g\left( \tau \right)}{{\sqrt {\left( {t - \tau } \right)^{3} } }}{\text{e}}^{{ - \frac{1}{{4\left( {t - \tau } \right)}}}} {\text{d}}\tau ,$$

and

$$G\left( t \right) = 2\sqrt \pi p\left( t \right), \quad < t < T,$$

and the operator $$A$$ is represented by

$$\left( {Ag} \right)\left( t \right) = \mathop \int \nolimits_{0}^{t} h\left( {t - \tau } \right)g\left( \tau \right){\text{d}}\tau .$$

The above first-kind integral Eq. (2.8) cannot be reduced into an integral equation of the second kind by differentiation, and so the problem is ill-posed. We can uniquely determine $$g\left( t \right)$$ subject to $$G\left( t \right)$$ belong to the range of $$A^{ - 1}$$. Since the $$A^{ - 1}$$ is unbounded, the noisy data of $$p\left( t \right)$$ lead to large errors in $$g\left( t \right)$$. In the next section, we show the existence stable solution of the operator integral Eq. (2.9) by Tikhonov regularization technique in continuous form.

## The regularization method for ill-posed integral equation

It this section, a popular regularization method is applied for solving an ill-posed integral equation of the form (2.9). Since in practical applications, the input data $$p\left( t \right)$$ are affected by noise, we apply Tikhonov regularization technique to an approximate solution in a stable way. Based on the main idea of the Tikhonov regularization approach, by introducing the smoothing functional $$M^{\lambda } \left[ {g,G} \right]$$ which is called Tikhonov functional and stabilizing functional $$\Omega \left( g \right)$$, an ill-posed problem is replaced by the following problem:

$$M^{\lambda } \left[ {g,G} \right] = \parallel Ag-G\parallel_{{L_{2} \left[ {0,T} \right]}}^{2} + \lambda\Omega \left( g \right),$$

where $$\lambda$$ is the regularization parameter and $$\Omega \left( g \right)$$ is a stabilizer of the first-order constant coefficient which is defined on a Sobolev space $$W_{2}^{1}$$ as:

$$\Omega (g) = \parallel g(t)\parallel_{{W_{2}^{1} }}^{2} = \int\nolimits_{0}^{T} \left( {g^{2} \left( s \right) + g^{\prime{2}} (s)} \right){\text{d}}s.$$

The regularized solution $$g_{\lambda }$$ for Eq. (2.9) is constructed by using the following minimization problem, which is stated by the following theorem:

### Theorem 1

For every function$$G \in L_{2} \left[ {0,T} \right]$$and any positive$$\lambda ,$$there exists an element$$g_{\lambda } \in W_{2}^{1} \left[ {0,T} \right]$$such that the functional$$M^{\lambda } \left[ {g,G} \right]$$attains its greatest lower bound.

$${\text{Inf}} M^{\lambda } \left[ {g,G} \right] = M^{\lambda } \left[ {g_{\lambda } ,G} \right].$$

### Proof

We have

$$M^{\lambda } \left[ {g,G} \right] = \mathop \int \nolimits_{0}^{T} \left[ {\mathop \int \nolimits_{0}^{t} h\left( {t - s} \right)g\left( s \right){\text{d}}s - G(t)} \right]^{2} {\text{d}}t + \lambda \mathop \int \nolimits_{0}^{T} \left( {g^{2} \left( s \right) + g^{{\prime}2} \left( s \right)} \right){\text{d}}s.$$

A condition for a minimum of this functional is vanishing of its first variation; this is written in the form

$$\frac{1}{2}\frac{\text{d}}{{{\text{d}}\epsilon}}M^{\lambda} \left[{g + \epsilon \eta,G} \right]_{\epsilon = 0} = 0,$$

by calculating the left-hand side of the above equation and setting $$\epsilon = 0$$, we have

\begin{aligned} & \mathop \int \nolimits_{0}^{T} \left( {\mathop \int \nolimits_{0}^{t} h\left( {t - s} \right)\eta \left( s \right){\text{d}}s} \right) \\ & \quad \left[ {\mathop \int \nolimits_{0}^{t} h\left( {t - s} \right)g\left( s \right){\text{d}}s - G(t)} \right]{\text{d}}t \\ & \quad + \lambda \mathop \int \nolimits_{0}^{T} \left( {g\left( s \right)\eta \left( s \right) + g^{\prime}\left( s \right)\eta^{\prime}\left( s \right)} \right){\text{d}}s = 0. \\ \end{aligned}

By using integration by part for the second term and by setting

$$K(t) = \mathop \int \nolimits_{0}^{t} h\left( {t - s} \right)g\left( s \right){\text{d}}s,$$

we have:

\begin{aligned} & \mathop \int \nolimits_{0}^{T} \left[ {\mathop \int \nolimits_{s}^{T} h\left( {t - s} \right)K(t){\text{d}}t - \mathop \int \nolimits_{s}^{T} h\left( {t - s} \right)G(t){\text{d}}t} \right. \\ & \quad \left. { + \lambda \left( {g\left( s \right) - g^{\prime\prime}\left( s \right)} \right)} \right]\eta \left( s \right){\text{d}}s + \lambda g^{\prime}\left( s \right)\eta \left( s \right)|_{0}^{T} = 0, \\ \end{aligned}
(3.1)

where $$\eta \left( s \right)$$ is an arbitrary variation of the function $$g\left( s \right)$$ such that both $$g\left( s \right)$$ and $$g\left(s \right) + \epsilon \eta \left(s \right)$$ belong to the class of admissible functions.

Condition (3.1) will be satisfied for every function $$\eta \left( s \right)$$ if

$$\mathop \int \nolimits_{s}^{T} h\left( {t - s} \right)K(t){\text{d}}t - \mathop \int \nolimits_{s}^{T} h\left( {t - s} \right)G(t){\text{d}}t = \lambda \left( {g^{\prime\prime}\left( s \right) - g\left( s \right)} \right),$$
(3.2)

and consistency conditions

$$g^{\prime}\left( 0 \right) = g^{\prime}\left( T \right) = 0.$$
(3.3)

Equation (3.2) is called the Euler–Lagrange equation, and the minimizer $$g_{\lambda }$$ of Tikhonov functional is determined by the solution of this equation. The solution of Eq. (3.2) with consistency conditions (3.3) is unique based on classical theorems in the ODE.

Now, the regularized solution of the above minimization problem, i.e.,$$g_{\lambda } ,$$ is assumed in the form $$g_{\lambda } = R\left( {G,\lambda } \right),$$ where $$\lambda = \lambda \left( {\delta ,G_{\lambda \left( \delta \right)} } \right)$$, $$R\left( {G,\lambda } \right)$$ is a regularizing operator, and $$\delta$$ is the error level of input data. The discrete form of Eq. (2.9) based on the proposed numerical algorithm is investigated in Sect. 4.

## The collocation method

In this section, we only consider the discrete form of Eq. (2.7) with $$f\left( x \right) = 0$$. Since in practical applications, the overspecified condition $$p\left( t \right)$$ is given only at mesh points $$t_{i}$$ for $$i \, = \, 0, \, 1, \ldots ,n,$$ the time interval $$\left[ {0,T} \right]$$ is divided into n time intervals by choosing $$t_{0} = 0$$, $$t_{n} = T$$, and $$t_{i} = i\Delta t,$$ where $$\Delta t = \frac{T}{n}$$ represents the step size. Now, the overspecified condition (2.5) will be replaced by

$$u\left( {1, t_{i} } \right) = p\left( {t_{i} } \right),\quad i = 0, 1, \ldots , n.$$

The type of discretization of Eq. (2.9) is based on the collocation method. That is an approximate solution $$g\left( t \right)$$ to the IHCP (2.1)–(2.5) is expressed as a linear combination of piecewise constant basis functions $$\phi_{i} \left( t \right)$$. The approximate solution $$g^{*} \left( t \right)$$ of $$g\left( t \right)$$ is represented regarding finitely many unknown as follows:

$$g^{*} \left( t \right) = \mathop \sum \limits_{i = 1}^{n} c_{i} \phi_{i} \left( t \right),$$
(4.1)

where the basis orthogonal functions $$\phi_{i} \left( t \right)$$ are given by

$$\phi_{i} (t) = \left\{ {\begin{array}{ll} {1,} & \quad {t_{i - 1} \le t < t_{i} , } \\ {0,} &\quad {\text{O}}.{\text{W}}. \\ \end{array} } \right.$$

and $$c_{i}$$ are unknown coefficients.

Collocating Eq. (4.1) in Eq. (2.9), we obtain

$$\left( {Ag^{*} } \right)\left( t \right) = G (t),$$

or

$$\mathop \sum \limits_{i = 1}^{n} c_{i} \left( {A\phi_{i} } \right)\left( t \right) = G\left( t \right).$$

Let $$\psi_{i} \left( t \right)$$ denote $$\left( {A\phi_{i} } \right)\left( t \right).$$ The equality is specified for many values of t; by using the collocation method at discrete points $$t_{j} ,$$ we have

$$\left( {Ag^{*} } \right)\left( {t_{j} } \right) = G\left( {t_{j} } \right), \quad j = 1, 2, \ldots , n.$$

or

$$\mathop \sum \limits_{i = 1}^{n} c_{i} \psi_{i} \left( {t_{j} } \right) = G\left( {t_{j} } \right),\quad j = 1,2, \ldots ,n.$$

By the definition of operator integral $$A$$ and the basis functions $$\phi_{i} \left( t \right)$$ and simple calculations, it is easy to show that

$$\psi_{i} \left( t \right) = \psi \left( {t - t_{i - 1} } \right) - \psi \left( {t - t_{i} } \right),$$

where

$$\psi \left( t \right) = 2\left( {1 - {\text{erf}}\left( {\frac{1}{{\sqrt {2t} }}} \right)} \right) H\left( t \right) ,$$

and the error function $${\text{erf}}\left( x \right)$$ is defined by $$\frac{2}{\sqrt \pi }\mathop \int \nolimits_{0}^{x} {\text{e}}^{{ - u^{2} }} {\text{d}}u$$ and $$H\left( t \right)$$ is Heaviside function. The ill-conditioned linear system for the determination of the unknown coefficients $$c_{i}$$ in Eq. (4.1) is produced by discretization as follows:

$$AC = G,$$
(4.2)

where $$A$$ is a $$n \times n$$ matrix, $$A = \left[ {a_{ij} } \right]$$ with entries $$a_{ij} = \psi_{j} \left( {t_{i} } \right)$$ for $$i, j = 1, 2, \ldots , n$$ and $$G$$, $$C$$ are $$n$$-dimensional vectors which are defined by:

$$G = \left( {\begin{array}{*{20}c} {G\left( {t_{1} } \right)} \\ {G\left( {t_{2} } \right)} \\ \vdots \\ {G\left( {t_{n} } \right)} \\ \end{array} } \right),\quad C = \left( {\begin{array}{*{20}c} {c_{1} } \\ {c_{2} } \\ \vdots \\ {c_{n} } \\ \end{array} } \right).$$

By the definition of $$\psi_{i} \left( t \right)$$, the matrix $$A$$ is lower triangular, because

$$a_{ij} = \psi_{j} \left( {t_{i} } \right) = 0, \quad j > i,$$

and so the linear system (4.2) can be solved directly. Since the matrix A is ill-conditioned, regularization approach needs to be employed. In Sect. 5, we apply regularization technique and the L-curve and GCV criteria to obtain a stable solution of the system (4.2). By substituting the unknown coefficients into Eq. (4.1), the solution of IHCP can be obtained.

## Regularization method for discrete ill-conditioned system

The ill-posedness of the operator integral Eq. (2.9) results in the ill-conditioned system (4.2) from the discretization by the proposed algorithm. Because of the ill-conditionary of matrix A in Eq. (4.2), some type of regularization must then be applied to get stable and accurate results [16,17,18]. For the linear system (4.2), we are faced with the same issues of Hadamard definition, and so we must investigate the sensitivity analysis of solution with respect to random noise in input data $$p\left( t \right)$$. In our computation, the zero-order Tikhonov regularization technique is applied to solve the matrix Eq. (4.2).

The regularization method for the discrete ill-posed problem of the form (4.2) is an extension of the least square method (LSM) to find a stable solution for $$AC = G$$. The definition of the regularization method is as the following:

Assume $$\lambda > 0$$ be a given constant. The Tikhonov regularized solution $$C_{\lambda }$$ is the minimizer of the following functional:

$$M_{\lambda } \left( C \right) = \left\{||{AC - G||^{2} + \lambda||C||^{2} } \right\},$$
(6.1)

provided that a minimizer exists, where $$\left\| . \right\|$$ denotes the Euclidean norm and $$\lambda$$ is called regularization parameter. (We discussed the existence of minimizer in Sect. 3.)

The choice of suitable value for $$\lambda$$ is crucial in this technique since it defined the amount of regularization. Many techniques have been investigated by many scientific researchers to determine a suitable regularization parameter $$\lambda$$. In this work, the most well-established techniques for the estimation of $$\lambda$$ in Eq. (6.1) are the L-curve and GCV criteria.

1. (I)

L-curve

The L-curve criterion is defined by the log–log plot regularized solution versus the norm of residual and is sketched in the following:

$$L = \left\{ {\left( {\log \left(||{C_{\lambda }||^{2} } \right),\quad \log \left( ||{AC_{\lambda } - G||^{2} } \right)} \right), \quad \lambda > 0} \right\}$$

The graph of the curve is as the L-shape and so is called L-curve, and the corner of curve is selected as a suitable regularization parameter $$\lambda$$ [18].

2. (II)

GCV

The GCV criterion is an approach for choosing the regularization parameter [18, 19]. The GCV criterion leads to minimization of the following GCV function with respect to $$\lambda$$:

$$G\left( \lambda \right) = \frac{||{AC_{\lambda }^{\delta } - G^{\delta}||^2 }}{{\left( {{\text{trace}}\left( {I - AA_{\lambda } } \right)} \right)^{2} }} ,$$

where $$A_{\lambda } = \left( {A^{\text{tr}} A + \lambda I} \right)^{ - 1} \cdot A^{\text{tr}}$$ is a matrix which produces the regularized solution $$C_{\lambda }^{\delta }$$ of Eq. (6.1) from the normal equation

$$\left( {A^{\text{tr}} A + \lambda I} \right)C_{\lambda }^{\delta } = A^{\text{tr}} G^{\delta } .$$

## Numerical results and discussion

In this section, to investigate the applicability of the method, a test example is considered. The root-mean-square error (RMSE) is introduced to measure the accuracy as follows:

\begin{aligned} {\text{RMSE}}\left( {u\left( {0,t} \right)} \right) & \text{ := }\frac{\left\|{u_{\text{exact}} \left( {0,t} \right) - u_{\text{appr}} \left( {0,t} \right) }\right\|_{2}}{n + 1} \\ & = \left( {\frac{{\mathop \sum \nolimits_{i = 0}^{n} \left( {u_{\text{exact}} \left( {0,t_{i} } \right) - u_{\text{appr}} \left( {0,t_{i} } \right)} \right)^{2} }}{{\left( {n + 1} \right)^{2} }}} \right)^{{\frac{1}{2}}} , \\ \end{aligned}

while $$n + 1$$ is the number of collocation points.

### Test problem

We consider the problem (2.1)–(2.5) with the following exact solution:

$$u\left( {x,t} \right) = \left\{ {\begin{array}{ll} {\frac{x + 1}{{t^{{\frac{3}{2}}} }}\exp \left\{ {\frac{{(x + 1)^{2} }}{ - 4t}} \right\};} &\quad {t > 0,0 \le x \le 1,} \\ {0;} &\quad { t \le 0,} \\ \end{array} } \right.$$

with data

$$u\left( {0,t} \right) = g(t) = \left\{ {\begin{array}{ll} {\frac{1}{{t^{{\frac{3}{2}}} }}\exp \left\{ {\frac{1}{ - 4t}} \right\};} &\quad {t > 0,} \\ {0;} &\quad {t \le 0,} \\ \end{array} } \right.$$

and

$$p(t) = u\left( {1,t} \right) = \left\{ {\begin{array}{ll} {\frac{2}{{t^{{\frac{3}{2}}} }}\exp \left\{ {\frac{ - 1}{t}} \right\};} &\quad {t > 0,} \\ {0;} &\quad { t \le 0,} \\ \end{array} } \right.$$

which is given by [14]. They have applied a Fourier regularization method for finding the surface heat flux distribution.

The obtained numerical results obtained for both exact and noisy data are reported.

The best regularization parameter by L-curve criteria is represented in Fig. 1. In Fig. 2, the exact solution and the solution obtained using the regularization method with L-curve criteria are plotted when data are exact. The absolute value of error for g(t) without regularization is plotted in Fig. 3.

Results of RMSE value and condition number of matrix A in Eq. (4.2) are reported in Table 1 as the collocation points increase.

The value of the regularization parameter by GCV criteria is shown in Fig. 4. Results of RMSE value and condition number of matrix A in Eq. (4.2) are given in Table 2 as the collocation points increase.

We compare the values of regularization parameters which are obtained by L-curve and GCV and the RMSE value in Table 3 as well.

The stability of the numerical solution with respect to the noisy data $$p_{\delta } \left( t \right)$$ is considered by:

$$p_{\delta } (t) = p(t) + {\text{random}}\left({\hbox{`}}{\text{Normal}}{\hbox{'}},0,\sigma ,1,N \right),$$

where the random('Normal', 0, $$\sigma ,1,N$$) command in MATLAB software generates the random variable from the normal distribution with zero mean and standard deviation $$\sigma$$ as the following:

$$\sigma = \delta \times \max_{{t \in \left[ {0,T} \right]}} \left| {p\left( t \right)} \right|,$$

and $$\delta$$ represents the percentage of noise.

Table 4 represents the RMSE values of approximation solution in the presence and absence of the regularization method for different values of $$\delta$$.

Figure 5 shows the numerical solution of $$g(t)$$ by regularization procedure when the input data (2.5) are contaminated by different values of $$\delta$$.

## Conclusions

In this paper, the spectral collocation method along with Tikhonov regularization technique was successfully applied to the solution of IHCP to determine the unknown heat temperature on the boundary by employing temperature reading at a fixed point. A test example involving different collocation point and measurement errors with noise was considered.

The results show that the approximate solution obtained by the proposed algorithm and using regularization techniques remain stable as the collocation points are increased even when noise is included in the input data.