Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to computing page for the fourth course APMA0360
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to Mathematica tutorial for the fourth course APMA0360
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340
Return to the main page for the fourth course APMA0360
Return to Part VI of the course APMA0360
Introduction to Linear Algebra with Mathematica
contains second derivative, we need
we look for a finite difference
approximation to the second derivative, \( f ′′(x_0 ). Using Taylor's series, we have
\[
\begin{split}
f \left( x_0 + \Delta x \right) &= f \left( x_0 \right) + f' \left( x_0 \right) \Delta x + \frac{1}{2}\, f'' \left( x_0 \right) \left( \Delta x \right)^2 + R_2^{+} ,
\\
f \left( x_0 - \Delta x \right) &= f \left( x_0 \right) - f' \left( x_0 \right) \Delta x + \frac{1}{2}\, f'' \left( x_0 \right) \left( \Delta x \right)^2 + R_2^{-} ,
\end{split}
\]
where \( R_2^{\pm} . \) denote appropriate remainder terms. If we add both equations, divide by (∆x)² and ignore
the remainder terms, we obtain the following finite difference approximation,
\[
f'' \left( x_0 \right) = \frac{f \left( x_0 - \Delta x \right) -2 f \left( x_0 \right) + f \left( x_0 + \Delta x \right) }{\left( \Delta x \right)^2} .
\]
Because it involves x00 along with the points x0 ± ∆x on either side of it, this approximation is a
centered difference approximation.
,/P.
We are going to demonstrate application of finite difference method to solve sme simple heat transfer equation, Namely, we consider homogeneous heat equation with no sources,
The finite difference scheme will be concerned with the values of
u(x, t) on these grid points, i.e., the
values u(xn, tk): For each n ≥ 0, the N + 1 set of values u(xn, tk), 0 ≤ n ≤ N , form a “snapshot” of
the temperature function u on the spatial grid points xn.
or notational convenience, we use double scripts, with superscript for time variable:
\[
u_n^{(k)} = u( x_n , t_k )
\]
For time derivative, we employ the forward difference:
An important scheme, invented by John Crank and Phyllis Nicholson, is based on numerical approximations for solutions of heat equation at the point (n, t + ½(δ t) that lies between between the rows in the grid. Specifically, the approximation used for time derivative is obtained from the central difference formula,
\[
u_t \left( x, t + \frac{1}{2} \left( \Delta t \right) \right) = \frac{u(x, t + \Delta t) - u(x,t)}{\Delta t} + O \left( (\Delta t)^2 \right) .
\]
a2i
Return to Mathematica page)
Return to the main page (APMA0360)
Return to the Part 1 Basic Concepts
Return to the Part 2 Fourier Series
Return to the Part 3 Integral Transforms
Return to the Part 4 Parabolic Differential Equations
Return to the Part 5 Hyperbolic Differential Equations
Return to the Part 6 Elliptic Equations
Return to the Part 7 Numerical Methods