Title: Scientific programming in Earth's Sciences Fortran90 and Matlab applications
1Scientific programming in Earth's
SciencesFortran90 and Matlab applications
J.W. Goethe University. Frankfurt
- Dr Guillaume RICHARD
- Institüt für Geowissenchaften 1.232
- richard_at_geophysik.uni-frankfurt.de
2Overview
- 12 x 45min Lectures / 45min training classes
(praktical) -
- Basics and introduction to the problem (Earth
Mantle Convection ). Historical Background, State
of the Art - Model (ODE, PDE)
- Discretizing the heat equation Finite
differencing
3The Heat equation
This is a inhomogeneous (C?0) linear second order
PDE of the form L(T)C. The order of a PDE is the
order of the highest derivative appearing. Note
that the choice of L and C is generally not
unique, but if an equation could be written in a
linear form it is called a linear equation. This
is also a parabolic equation of the form E(T)k
dT/dt0. Where E(T) is an elliptic operator.
4The Heat equation (2)
This is an initial value problem
5Overview of Finite differencing
- In numerical analysis, finite differences are the
simplest way of approximating a differential
operator. - This method is extensively used in solving
differential equations (ODE, PDE). - Mathematical background Taylor expansion
- Definition Finite Differences Approximate a
function at a point by a truncated Taylor Series
and combine the series of adjacent points to
approximate the governing equations.
6Some History
- Discovery of Calculus theory of fluxions
(Newton (1666) / Leibnitz) lead to differential
and integral calculus (1671) - Goal Integration of differential equation to
solve for balistic and celestial mechanics. - Methods Looking for a solution having the form
of a serie. - 18th-19th Clairault, Euler, dAlembert,
Lagrange develop the knowledge on the integral
calculus (order, linearity of PDEs) - Algebraic integration (Condorcet) vs numerical
integration (Liouville). In 1841, Liouville
demonstrated that some PDEs have no algebraic
solutions.
7Some History
- Taylor added to mathematics a new branch now
called the "calculus of finite differences",
invented integration by parts, and discovered the
celebrated series known as Taylor's expansion.
These ideas appear in his book Methodus
incrementorum directa et inversa of 1715. - The importance of Taylor's Theorem remained
unrecognized until 1772 when Lagrange proclaimed
it the basic principle of the differential
calculus. The term "Taylor's series" seems to
have used for the first time by Lhuilier in 1786.
Brook Taylor (1685-1731)
8Taylor series expansion
The Taylor series expansion of a function f (x)
is where f (k) is the kth derivative of the
function. Differing approximations to the
function are obtained from this series by
truncation. If the series is truncated at the nth
term, the maximum error in the approximation is
where the "max" subscript indicates the
maximum value of the derivative in the interval
from x to x0. The error is said to be of
order (x-x0) n1
The Taylor expansion must be used with some
caution because the series does not converge for
all values and sometimes converges very slowly.
9Finite-difference derivatives
Finite-difference formulas make it possible to
use arithmetic operations to determine
derivatives. They are based on the Taylor series
truncated at various orders in the expansion. The
first-order expansion gives the form Where
o(d) indicates that the error in this
approximation is of order d
10Finite-difference derivatives
is called the first forward difference
What is the first backward difference ?
11Discretization and Grid
- Size of the gridstep
- Cartesian geometry
- Regular spacing Uniform grid (mesh)
- Staggered grid
12High order derivatives
The second derivative is
13High order precision
The second order of precision first derivative is
14Central differencing
Why is the central difference second order
accurate ? Ex Write the third order operator of
the first derivative.
15Discrete Heat equation
162 Dimension
Alternating Direction Implicit (ADI) Scheme
17Implicit scheme
Alternating Direction Implicit (ADI) Scheme
18Bibliography
- Spiegel, Finite differences and Differences
equations, Schaums outline series, McGraw-Hill
book Compagny, 1971 - Richtmyer Morton, Difference Methods for
initial-value Problems, Interscience tracts in
Pure applied Mathematics. (Number 4), Wiley
Sons, 2d ed. 1967