66
4 Long Waves in a Channel
On the basis of this, another approximation of the firs derivative of a function is:
∂ f
∂ x
≈
f (x) − f (x − Δx)
Δx
(4.4)
The third option is to take the sum of both Taylor series, yielding:
∂ f
∂ x
≈
f (x + Δx) − f (x − Δx)
2Δx
(4.5)
There are three different options of expressing the f rst derivative of a function in
terms of a finit difference.
Fig. 4.1 Example of equidistant grid spacing. Distance is given by k · Δx, where k is the cell index
and Δx is grid spacing
4.1.2 Forward, Backward and Centred Differences
With the choice of equidistant grid spacing and index notation (Fig. 4.1), we can
formulate the different finite-di ference forms of the firs derivative of a function as:
∂ f
∂ x
≈
f k+1 − f k
Δx
(4.6)
called forward difference, or
∂ f
∂ x
≈
f k − f k−1
Δx
(4.7)
called backward difference, or
∂ f
∂ x
≈
f k+1 − f k−1
2Δx
(4.8)
called centred difference.
4.1.3 Scheme for the Second Derivative
The sum of the Taylor series (4.1) and (4.3) gives an approximation of the second
derivative of a function:
Précédent

- 79/185

Suivant