98
2. Basic Finite-Difference Methods
and the right side of (2.102) becornes
(2.107)
If the flow is two-dimensiona1, the adveetion problem beeomes
01/1
81/1
81/1
-+u-+v-=O,
ot
8x
8y
and if u and v are eonstant,
which must be approximated by a seeond-order spatial differenee . Finally, eonsider a general system of "conservation laws" of the form
8v
-
8
+ -F(v) = 0,
8t
8x
where v and F are eolumn veetors . Then
(2.108)
where J is the Jaeobian matrix whose ijth element is 8Fi/8vj. Onee again, this
matrix operator must be approximated by seeond-order spatial differenees .
In many applieations the Lax-Wcndroffmethod ean be implemented more easily and more efficiently using the two-step method (2.103)-(2.105), or the following variant of the two-step method suggested by MaeCormaek (1969):
These two-step methods generate numerieal approximations to the higher-order
spatial derivatives required to eaneel the O(L!it) truneation error in the forward
time differenee without requiring the user to explicitly evaluate eomplex expressions like (2.108). The MaeCormaek method is particularly useful, sinee it easily
generalizes to problems in two or more spatial dimensions.
In the classical Lax-Wendroff method, the spatial derivatives are approximated
using eentered differenees, but other approximations are also possible. If the spa-
2. Basic Finite-Difference Methods
and the right side of (2.102) becornes
(2.107)
If the flow is two-dimensiona1, the adveetion problem beeomes
01/1
81/1
81/1
-+u-+v-=O,
ot
8x
8y
and if u and v are eonstant,
which must be approximated by a seeond-order spatial differenee . Finally, eonsider a general system of "conservation laws" of the form
8v
-
8
+ -F(v) = 0,
8t
8x
where v and F are eolumn veetors . Then
(2.108)
where J is the Jaeobian matrix whose ijth element is 8Fi/8vj. Onee again, this
matrix operator must be approximated by seeond-order spatial differenees .
In many applieations the Lax-Wcndroffmethod ean be implemented more easily and more efficiently using the two-step method (2.103)-(2.105), or the following variant of the two-step method suggested by MaeCormaek (1969):
These two-step methods generate numerieal approximations to the higher-order
spatial derivatives required to eaneel the O(L!it) truneation error in the forward
time differenee without requiring the user to explicitly evaluate eomplex expressions like (2.108). The MaeCormaek method is particularly useful, sinee it easily
generalizes to problems in two or more spatial dimensions.
In the classical Lax-Wendroff method, the spatial derivatives are approximated
using eentered differenees, but other approximations are also possible. If the spa-
