Graphics Reference
In-Depth Information
The notation used here is that q n is the value of q computed at time step
n ,andΔ t is the amount of time between consecutive time steps. 1 What
we have done is split the equation up into two steps: after the first step
(2.1), we get an intermediate quantity q that includes the contribution of
the first term (= 1) but not the second (= 2), and then the second step
(2.2) goes from the intermediate value to the end by adding in the missing
term's contribution. In this example, obviously, we get exactly the right
answer, and splitting didn't buy us anything.
Let's upgrade our example to something more interesting:
dq
dt
= f ( q )+ g ( q ) .
(2.3)
Here f () and g () are some black box functions representing separate soft-
ware modules. We could do splitting with forward Euler again:
q = q n tf ( q n ) ,
(2.4)
q n +1 = q tg ( q ) .
(2.5)
A simple Taylor series analysis shows that this is still a first-order-accurate
algorithm if you're worried (if you're not, ignore this):
q n +1 =( q n tf ( q n )) + Δ tg ( q n tf ( q n ))
= q n tf ( q n )+Δ t ( g ( q n )+ O t ))
= q n t ( f ( q n )+ g ( q n )) + O t 2 )
= q n + dq
dt Δ t + O t 2 ) .
Wait, you say, that hasn't bought you anything beyond what simple old
forward Euler without splitting gives you. Aha! Here's where we get a little
more sophisticated. Let's assume that the reason we've split f () and g ()
into separate software modules is that we have special numerical methods
that are really good at solving the simpler equations
dr
dt
= f ( r ) ,
ds
dt
= g ( s ) .
1 In particular, do not get confused with raising q to the power of n or n +1: this
is an abuse of notation, but it is so convenient when we add in subscripts for grid
indices that it's consistently used in fluid simulation. On the rare occasion that we do
raise a quantity to some exponent, we'll very clearly state that: otherwise assume the
superscript indicates at what time step the quantity is.
Search WWH ::




Custom Search