Title: Introduction to scientific programming in Earth's Sciences
1Introduction to scientific programming in Earth's
Sciences
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 (Hardware, OS, editor, etc.. )
- Basics 2 (Linux commands, Compile,Visualize )
- Languages Fortran (FORmula TRANslation)
- Languages Fortran (2)
- Languages Fortran (3)
- Languages Fortran (4)
- Languages C/C
- Languages Matlab (1)
- Languages Matlab (2)
- Languages Maple
- Introduction to Finite difference / Finite Volume
method - Introduction to Finite difference / Finite Volume
method (2)
3L. 11 Introduction to Finite difference method
4Overview
- 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). - Historical landmark
- Mathematical background Taylor expansion
5Some 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.
6Some 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)
7Taylor 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.
8Finite-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
9Finite-difference derivatives
is called the first forward difference
What is the first backward difference ?
10Discretization and Grid
- Size of the gridstep
- Cartesian geometry
- Regular spacing Uniform grid (mesh)
- Staggered grid
11High order precision
The second order derivative is
12High order derivatives
The second (backward) derivative is
13Central differencing
Why is the central difference second order
accurate ? Ex Write the third order
operator of the first derivative.