Numerical Methods for Natural Sciences IB Introduction
– 4 –
7.2.2 Linear equations ..........................................................................................................69
7.3 Other considerations
*
.......................................................................................................... 70
7.3.1 Truncation error
*
......................................................................................................... 71
7.3.2 Error and step control
*
................................................................................................ 71
8 Partial differential equations.................................................................................................. 72
8.1 Laplace equation................................................................................................................. 72
8.1.1 Direct solution ............................................................................................................. 73
8.1.2 Relaxation.................................................................................................................... 75
8.1.3 Multigrid
*
..................................................................................................................... 79
8.1.4 The mathematics of relaxation
*
................................................................................... 80
8.1.5 FFT
*
............................................................................................................................. 84
8.1.6 Boundary elements
*
..................................................................................................... 84
8.1.7 Finite elements
*
............................................................................................................ 84
8.2 Poisson equation ................................................................................................................. 84
8.3 Diffusion equation .............................................................................................................. 84
8.3.1 Semi-discretisation.......................................................................................................84
8.3.2 Euler method................................................................................................................ 85
8.3.3 Stability........................................................................................................................ 85
8.3.4 Model for general initial conditions............................................................................ 86
8.3.5 Crank-Nicholson.......................................................................................................... 86
8.3.6 ADI
*
............................................................................................................................. 87
8.4 Advection
*
........................................................................................................................... 87
8.4.1 Upwind differencing
*
................................................................................................... 87
8.4.2 Courant number
*
.......................................................................................................... 87
8.4.3 Numerical dispersion
*
.................................................................................................. 88
8.4.4 Shocks
*
......................................................................................................................... 88
8.4.5 Lax-Wendroff
*
.............................................................................................................. 88
8.4.6 Conservative schemes
*
................................................................................................. 88
9. Number representation
*
......................................................................................................... 89
9.1. Integers
*
............................................................................................................................. 89
9.2. Floating point
*
.................................................................................................................... 90
9.3. Rounding and truncation error
*
.......................................................................................... 91
9.4. Endians
*
............................................................................................................................. 91
10. Computer languages
*
............................................................................................................ 93
10.1. Procedural verses Object Oriented
*
................................................................................. 93
10.2. Fortran 90
*
....................................................................................................................... 93
10.2.1. Procedural oriented
*
................................................................................................. 94
10.2.2. Fortran enhancements
*
............................................................................................. 94
10.3. C++
*
................................................................................................................................. 95
10.3.1. C
*
.............................................................................................................................. 95
10.3.2. Object Oriented
*
....................................................................................................... 95
10.3.3. Weaknesses
*
.............................................................................................................. 96
10.4. Others
*
.............................................................................................................................. 97
10.4.1. Ada
*
........................................................................................................................... 97
10.4.2. Algol
*
........................................................................................................................ 97