2.2 Error Functions
27
Examples
Every measurement is uncertain to some degree. If there are no systematic errors,
the distribution of measurements follows a normal distribution. The probability
of an error of measurements is given by the Gaussian error integral
Φ(x) =
1
√
2π
x
−∞
exp
−
t 2
2
dt
(2.7)
or cumulative distribution function of a normal distribution. The relationship
between this function and the error function is given by
Φ(z) =
1
2
erf
z
√
2
+
1
2
.
(2.8)
An example for solving the heat equation with the error function can be found in
the MATLAB documentation. As an additional example, consider the problem of
diffusion in a semi-finite medium, x > 0, when the boundary is kept at a constant
concentration C 0 and the initial concentration is zero throughout the medium [2].
Therefore, we need a solution of
∂C
∂t
= D ·
∂ 2 C
∂x 2
(2.9)
with the boundary condition C = C 0 for x = 0, t > 0 and the initial condition
C = 0 for x > 0, t = 0. The concentration is then given by
C(x, t) = C 0 erfc
x
2
√
D t
.
(2.10)
The result is plotted in Fig. 2.2.
Figure 2.2 was computed by
x = linspace(0,1,50);
% x ccordinate
Dt = linspace(0,10,50);
% D scaled time
[X,DT] = meshgrid(x,Dt);
Z = X./sqrt(DT);
[obj, res] = erfComp(Z,’erfc’);
% concentration
res(1,:) = 0;
% initial condition
res(1,1) = 1;
% boundary condition
figure
% visualization
pcolor(X,DT,res), colorbar
shading interp, xlabel(’x’), ylabel(’Dt’),shg
Dawson Integral The Dawson integral or function is given by
F (z) = exp(−z
2 )
z
0
exp(t
2 )dt
(2.11)
27
Examples
Every measurement is uncertain to some degree. If there are no systematic errors,
the distribution of measurements follows a normal distribution. The probability
of an error of measurements is given by the Gaussian error integral
Φ(x) =
1
√
2π
x
−∞
exp
−
t 2
2
dt
(2.7)
or cumulative distribution function of a normal distribution. The relationship
between this function and the error function is given by
Φ(z) =
1
2
erf
z
√
2
+
1
2
.
(2.8)
An example for solving the heat equation with the error function can be found in
the MATLAB documentation. As an additional example, consider the problem of
diffusion in a semi-finite medium, x > 0, when the boundary is kept at a constant
concentration C 0 and the initial concentration is zero throughout the medium [2].
Therefore, we need a solution of
∂C
∂t
= D ·
∂ 2 C
∂x 2
(2.9)
with the boundary condition C = C 0 for x = 0, t > 0 and the initial condition
C = 0 for x > 0, t = 0. The concentration is then given by
C(x, t) = C 0 erfc
x
2
√
D t
.
(2.10)
The result is plotted in Fig. 2.2.
Figure 2.2 was computed by
x = linspace(0,1,50);
% x ccordinate
Dt = linspace(0,10,50);
% D scaled time
[X,DT] = meshgrid(x,Dt);
Z = X./sqrt(DT);
[obj, res] = erfComp(Z,’erfc’);
% concentration
res(1,:) = 0;
% initial condition
res(1,1) = 1;
% boundary condition
figure
% visualization
pcolor(X,DT,res), colorbar
shading interp, xlabel(’x’), ylabel(’Dt’),shg
Dawson Integral The Dawson integral or function is given by
F (z) = exp(−z
2 )
z
0
exp(t
2 )dt
(2.11)
