We describe the formulation of forward and inverse problems in heat transfer and illustrate several techniques applicable to their solution.
- heat transfer
- finite differences
- Fourier transforms
Heat flow is described by the heat (or diffusion) partial differential equation, which takes the form with representing the temperature at time and at spatial location (which may have one or more components). The constant is the ratio of the thermal conductivity in the material over the specific heat times the density of the material. Applying the conservation law principle to the heat flow across the rod yields the parabolic partial differential equation. If a heat source is present or the material is exothermic, a non-homogeneous version of the problem: with applies. The initial boundary value problem comes from assigning relevant initial and boundary conditions. For example, for a perfectly insulated rod as in Figure 1, the conditions could be . Given some initial profile of the temperature at time , , the analytical solution in 1D or 2D with a regular geometrical domain is given by separation of variables. Assuming , one obtains a system of two ODEs and from that, the series solution with the coefficients satisfying the initial condition and the eigenvalues . The coefficients are evaluated via the sin series integration: . For non-intregrable cases or more complicated geometries, numerical techniques for approximation are used .
1.1 Derivation of homogeneous and non-homogeneous equations
We now discuss two simple scenarios which can be used to derive homogeneous and non-homogeneous forms of the heat Equation . Heat is the flow of energy from a warmer to a cooler location. There are several types of heat transfer including conduction (flow of heat through stationary material), convection (flow of heat through fluids), and radiation (flow of heat through electromagnetic waves) . In this chapter we are concerned mainly with heat conduction for which the differential heat model applies. We take to represent the heat transfer rate in units of Watts. It is the rate at which heat is flowing through one of the slabs in Figure 2. When heat flows into and out of a mass, the temperature of the mass changes in accordance with the model: , where represents the temperature, the mass, and is the specific heat value of the material. It should be noted that in heat problems, and are ofter used interchangeably. We define (heat over area) as the heat flux, which by Fourier’s law is proportional to the temperature gradient: , where is the thermal conductivity of the material . Using and along with heat flux , we have . Applying Fourier’s law yields:
Next, using Taylor’s approximation and expressing in terms of slab density, area, and width, we obtain:
For the exothermic slab case exhibited in Figure 2 on the right, we obtain an inhomogeneous equation. We assume the slab is filled with a material which emits heat at a rate with units (energy per unit volume). In this case, the in and out energy balance gives , which with , Fourier’s law and Taylor’s expansion, gives . In the case of steady state, and a second order differential equation model results.
1.2 Numerical schemes
Discretization of the derivative operators yields the finite difference formulation. A number of different schemes are possible based on the difference schemes used to replace the derivatives in the equation resulting in either an explicit method (where the update for at the next time step is given by a direct calculation from the previous one) or an implicit method (where the update for is accomplished via a linear solve). For 2D heat transfer, the model becomes and again, the finite difference method can be used for discretization. The initial value problems are either forward or inverse, in the sense that they either predict the temperature profile at later time from the knowledge of the initial temperature distribution at time or in the inverse case, predict the temperature distribution at time from knowledge of the temperature at a future time. Sometimes, the initial boundary value problem may be prescribed extra conditions, such as Neumann or other derivate condition type and the inverse problem could instead seek the initial values for such expressions from future data . In general, the inverse problem is more challening than the forward problem due to being ill-posed. The discretized operator matrix which can be assembled from the difference formulation is not well conditioned and as a result the problem is overly sensitive to slight changes in input values. Regularization techniques need to be used for the solution .
2. Forward problem
The forward problem is concerned by the prediction of heat profile in future time from the initial condition. We first consider the heat equation initial boundary value problem in 1D:
with constant . Via a transformation, this problem can be extended to nonzero boundary conditions. For (3), separation of variables gives the solution as the superposition of solutions of the form:
A quick calculation shows that . In order to form the well-known explicit scheme, we use the forward in time and central in space difference operators:
which results in the explicit finite difference scheme:
This can be re-written as with , with the time step () and the spatial step size (). Von Neumann stability analysis yields the condition . For non-homogeneous cases the general model is and the finite difference analysis proceeds in a similar way, with an explicit scheme of the form: .
If we use the backward time finite difference approximation for , we get: , yielding the implicit scheme: which can be solved for time from the information at time using a linear system with a tridiagonal matrix with elements . The implicit scheme is numerically stable for any but is costlier than the explicit scheme. Another example, is the so called Crank–Nicolson scheme based on the time derivative approximation at the midpoint of the time stamp. It takes the form:
Again using , we arrive at the scheme:
Note that this takes the form of the linear system , where is a tridiagonal matrix of terms , as before, containing the heat distribution at time and containing the heat distribution information at time . A linear system solves then yields the new time information from previous data.
In 2D, the standard explicit scheme arises from the discretization:
Like in the 1D scheme, suitable finite difference approximations yield the implicit method.
and proceed to evaluate for . The standard fd scheme does not set this expression to zero, and hence this analytically valid solution does not satisfy the original partial differential equation. However, based on the calculations below, we can make a replacement for , which would force the equation to zero.
Setting , we obtain:
Hence, the nsfd scheme follows if we make the following replacement in (6):
When , the nsfd substitution coincides with the standard finite difference scheme. We use the small Taylor series approximations and to obtain:
By this it follows that for small , the stability constraint is satisfied in the nsfd scheme when just like in the original scheme. This also holds for large , as long as is chosen so that is not very small.
2.1 Numerical experiments
Below, we present some sample results for the case of constant in (3), where we found that the described nsfd scheme often outperforms the fd scheme at the same time step. In Figure 3, we illustrate the solutions with fd and nsfd methods with the initial condition, for problem 1, with boundary conditions and and with the initial condition and zero homogeneous boundary conditions for problem 2. For the second example, errors vs. step size are also compared. In general, we observe more accurate results with the use of the nsfd scheme.
An interesting case is that of heat transfer with an exothermic material, which can be modeled with a heat source distributed throughout . Considering an infinitesimal segment as in Figure 1 yields the energy balance equation: . It follows that the heat model takes the form . The steady state behavior does not depend on time so that and an ordinary differential equation model results. Upon a double integration, the general solution is , which with the boundary conditions becomes , a parabola. We can simulate this steady state example with a finite difference scheme for the time derivative, yielding the temperature profile shown in Figure 4.
3. Inverse problem
The inverse problem consists of predicting the initial condition from the observation of the heat profile at some later time . In general, the problem is ill-posed and regularization is necessary for its solution . Let us look at a simple example in 1-D. Starting from the initial boundary value problem on :
In this case, separation of variables can be used and after a well-known sequence of steps, the following series solution can be derived :
It follows that which is a sin series; that is, . It follows that the sin coefficients of the solution at are given by the sin coefficients at multiplied by . The values of at can then be computed via the inverse sin transform applied to the product. In a similar way, it follows that from the transform of the solution at , , we can in principle go backwards, to obtain with the representing component-wise operation . However, with the negative sign inside the exponential gone, there is potential for blow up of any large magnitude terms. The issue can be addressed by performing filtering on the large coefficients, setting the largest magnitude portion to zero or some maximum value. The magnitude cut off value can be selected based on quartile statistics of the nonzero absolute values.
A more general approach for inversion is to utilize the inverse problem formulations of the matrix heat propagation formulation. For example, for the standard implicit or Crank-Nicholson scheme, we have the system , where is a tridiagonal matrix of terms . This means that , . This then implies that the initial condition at time , can be recovered from the application of the inverse matrix raised to a power corresponding to the time point. As another example, if we discretize as:
with , for . Using , we obtain the relations:
This means that can in theory be obtained right from . The matrix needs not be formed explicitly, as the finite differencing scheme can be repeatedly applied to . However, as shown in Figure 5, raising the typical differencing matrix to a power results in non-linear singular value decay. Hence, the application of the inverse of matrix to the approximant for , the heat profile at time , would result in the blow-up of any numerical errors due to the ill-conditioning. We must instead consider the inverse formulation with and utilize a regularization scheme.
This can be accomplished by replacing the naive solution by the regularized formulation , which for large enough , alleviates the problem due to the fast decay of singular values. This well-known Tikhonov regularization formulation essentially acts to remove the influence of small singular values on the solution, which would otherwise blow up in value upon inversion. The regularization parameter should be chosen with care to provide regularization but not to move too far away from the naive inverse operator. For this reason, is usually selected based on an L-curve criterion , whereby the parameter is initially set at some fraction of and then iteratively lowered to a lower fraction (with the values either linearly or logarithmically spaced). At each value, the solution to is obtained (e.g. with a Conjugate Gradient scheme) using the solution at the previously used as the initial guess. Typically, the progression to lower stops once the value of reaches a plateau. It is possible to employ a predictor-corrector scheme to iteratively improve the solution. In this approach, the approximation to can be obtained as above, then the forward operator can be applied to propagate this approximated initial heat profile at to time and compare with observations . We can compare the residual at time and attempt some corrections to based on this residual such that the propagated solution at best matches observations. In the case of only a finite subset of observations, interpolation techniques can be utilized to complete the profile at across all values of  prior to regularization to obtain an approximate smooth and continuous heat profile.
3.1 Numerical experiments
As an example, consider the 1D cosine based initial heat profile with and zero boundary conditions. The profile and subsequent integration results are shown in Figure 6. It is clear that the temperature in the rod will approach zero at all locations with increasing time. The inverse problem consists of approximately recovering the initial profile , with support on . For this, we take the sin transform of the solution at and multiply by . In Octave, this can be accomplished with the code:
fuT=fft (u (:, n)); % temperature profile at time T
R=exp (k.*k ′*T);
init_cond_approx=real (ifft (fuT.*R));
The term may contain large entries, which will blow up when the inverse fft is performed. For this reason, the filtering of small entries is necessary. This can be accomplished simply by replacing all large entries of with either zero or some max value; e.g. taking the cutoff to be all values above and replacing them either with 0 or . The cutoff can be estimated with standard statistical outlier techniques, by taking the quartiles of the values, computing and filtering all entries of above with by setting them to the value. The process is illustrated in Figure 7, for the same example as above with filtering for absolute value of entries above . It can be observed that filtering only the entries of above in absolute value leads to a good approximation of the initial condition. Tikhonov regularization can be utilized when it is possible to build up the finite difference propagation operator (), either as an explicit matrix, or as a function. An example is shown to the right of Figure 7, with an initial triangular temperature profile that is approximately recovered by a simple continuation scheme. In the same Figure, we also show the profiles of both as observed and as propagated from the approximated initial values. The smoothing properties of the heat kernel  give rise to the observed transformation between and .
This article discusses numerical approaches for the heat equation, both for the forward and inverse problems with examples for homogeneous and non-homogeneous cases. For the forward heat propagation modeling problem, we have presented a simple non-standard finite difference formulation, which satisfies the differential model and appears to result in improved performance over the standard finite difference scheme with similar magnitude time and spatial step sizes. For the inverse problem, we have described approaches based on Fourier filtering and Tikhonov regularization.