You are on page 1of 4

www.kirkup.

info/opensource


Solution of Inverse Diffusion Problems by Operator-Splitting Methods
A practical demonstration using Microsoft Excel
by Stephen Kirkup
School of Computing, Engineering and Physical Sciences,
University of Central Lancashire, smkirkup@uclan.ac.uk

In this short note we show a simple demonstration of the solution of an inverse
problem. The method that is demonstrated is the operator-splitting method
1
, a very
simple inverse solution method that is able to solve the diffusion or heat conduction
equation backwards in time.
The equation that we will be focusing on is the one-dimensional simple diffusion
equation
2
2
) , ( ) , (
x
t x u
D
t
t x u

, (1)
with 0tT and u(x,T) = g(x) is the final condition and the goal is to find the solution for
0<tT and in particular the initial solution u(x,0)=f(x) . We also require information
about the solution at the edges of the region; x=0 and x=a. In this document we will
apply the operator splitting method which involves a repeated forward solution by the
simplest finite difference method for solving the diffusion equation (1). In this
document a finite difference method for solving the inverse diffusion equation
2
is
implemented on an Excel spreadsheet
3
.
Loosely speaking, the effect of diffusion if to smooth the data; the input data to the
spreadsheet must be sufficiently smooth to achieve a realistic outcome. The input data
may come from any source, but the best way to test the program is to use data from a
simulated diffusion. In this document data from the implementation of the forward
diffusion problem in the Excel spreadsheet
4
is used as input data for the backward
solution in the spreadsheet described in this document. The obvious test is that if we
apply the forward solution followed by the backward solution, then how close does in
compare with the original?
The spreadsheet is shown in the following image. The spreadsheet contains macros, so
the first step is to enable macros by pressing the button at the top of the
screen. To start a new simulation, the button can be used to clear the columns of
input and output.

1
Solution of Inverse Diffusion Problems by Operator-Splitting Methods by S.M.Kirkup and M.Wadsworth (2002)
2
Solution of the Diffusion Equation by the Finite Difference Method
3
Excel spreadsheet applying the FDM to the diffusion equation
4
Excel spreadsheet Inverse Diffusion by an Operator-Splitting Method
www.kirkup.info/opensource



The light blue boxes need to be completed. The spatial range of the partial differential
equation is defined by placing values for a and b. In the example below the domain
chosen in [0,1].

The spatial domain is subdivided in the finite difference method. In the next part of the
spreadsheet we set the length of each subdivision h. Note that the full length of the
domain b-a must be be an integer multiple of h. The number of spatial nodes is
computed and shown. For example if for a=0 and b=1 and with h=20 there must be 21
nodes.

The red box must be completed using an Excel function defining the rate of diffusion D.
D may be a function of x, t, and u in this example let D=0.5.

For the purposes of this spreadsheet the final function g(x) must take the value of zero
at the extremes of the domain; g(a)=g(b)=0.
In the example the total time is 0.1 and the time step is 0.0025. The larger the time step,
the faster the method, but also the less accurate. Critically, the time step for the method
used in this method needs to satisfy the Courant-Friedrichs-Louis condition. The
button can be used to select an appropriate value for the time step. However,
this can only be used when the and buttons have been pressed.
www.kirkup.info/opensource


The problem is now set up. To activate the solution, the first step is to set the finite
difference grid and the initial conditions. This can be activated by pressing the
and buttons. For the example this gives the following tables

The following graph shows the results from the first iteration, the data appears in the
middle column. After just one iteration, we can see the progress towards the emergence
of the original f(x).







www.kirkup.info/opensource


After five iterations, the results are within 1%, as shown in the following table.
x Original f(x) Recovered g(x) after 5 iterations
0 0 0
0.05 0.156434465 0.155877649
0.1 0.309016994 0.307917073
0.15 0.4539905 0.452374556
0.2 0.587785252 0.585693077
0.25 0.707106781 0.70458989
0.3 0.809016994 0.806137362
0.35 0.891006524 0.887835056
0.4 0.951056516 0.947671305
0.45 0.987688341 0.984172741
0.5 1 0.996440578

As a general rule, the smoother f(x), the more accurately it can be recovered. In the
following example, the result from the recovery of a saw tooth function is shown. The
recovered f(x) is obtained after about 20 iterations, after which the solution has
converged; there is no further progress towards the original f(x).

In the final example below f(x)=sin(x) and D=u, showing that the method seems to
work as well in the case of non-linear diffusion.

The method is applied to a realistic problem of atomic mixing in SIMS analysis.
5


5
The inverse solution of the atomic mixing equations by an operator-splitting method

You might also like