13.07.2015 Views

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NUMERICAL METHODSOur final example is based upon the one-dimensional diffusion equation <strong>for</strong>the temperature φ of a system:∂φ∂t = φκ∂2 ∂x 2 . (27.90)If φ i,j st<strong>and</strong>s <strong>for</strong> φ(x 0 + i∆x, t 0 + j∆t) then a <strong>for</strong>ward difference representationof the time derivative <strong>and</strong> a central difference representation <strong>for</strong> the spatialderivative lead to the following relationship:φ i,j+1 − φ i,j∆t= κ φ i+1,j − 2φ i,j + φ i−1,j(∆x) 2 . (27.91)This allows the construction of an explicit scheme <strong>for</strong> generating the temperaturedistribution at later times, given that it is known at some earlier time:φ i,j+1 = α(φ i+1,j + φ i−1,j )+(1− 2α)φ i,j , (27.92)where α = κ∆t/(∆x) 2 .Although this scheme is explicit, it is not a good one because of the asymmetricway in which the differences are <strong>for</strong>med. However, the effect of this can beminimised if we study <strong>and</strong> correct <strong>for</strong> the errors introduced in the following way.Taylor’s series <strong>for</strong> the time variable givesφ i,j+1 = φ i,j +∆t ∂φ i,j+ (∆t)2 ∂ 2 φ i,j∂t 2! ∂t 2 + ··· , (27.93)using the same notation as previously. Thus the first correction term to the LHSof (27.91) is− ∆t ∂ 2 φ i,j2 ∂t 2 . (27.94)The first term omitted on the RHS of the same equation is, by a similar argument,−κ 2(∆x)2 ∂ 4 φ i,j4! ∂x 4 . (27.95)But, using the fact that φ satisfies (27.90), we obtain∂ 2 φ∂t 2= ∂ ∂t( ) ( )κ ∂2 φ∂x 2 = κ ∂2 ∂φ∂x 2 = κ 2 ∂4 φ∂t ∂x 4 , (27.96)<strong>and</strong> so, to this accuracy, the two errors (27.94) <strong>and</strong> (27.95) can be made to cancelif α is chosen such that− κ2 ∆t2= − 2κ(∆x)2 , i.e. α = 1 4!6 .1032

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!