11.08.2013 Views

II. FINITE DIFFERENCE METHOD 1 Difference formulae

II. FINITE DIFFERENCE METHOD 1 Difference formulae

II. FINITE DIFFERENCE METHOD 1 Difference formulae

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

above consistence and stability, and using the fact that the nonlinear term<br />

f(x, y) is monotonic.<br />

Ex.<strong>II</strong>.3E (The difference method applied to a partial differential equation<br />

) We already showed the solution of the heat equation on the line ¡1 <<br />

x < +1 by using the convolution properties of the Fourier transform. Let<br />

us show how to solve numerically the heat equation for x in some bouded<br />

interval: the mixed problem (initial value and boundary value problem)<br />

⎧<br />

⎪⎨<br />

⎪⎩<br />

ut ¡ D uxx = 0<br />

u(x, 0) = f(x)<br />

u(0, t) = g1(t), u(0, t) = g2(t), 0 < t < T<br />

(13)<br />

where D is the diffusion coefficient, and f(x), g1(t), g2(t) are given functions.<br />

Let us consider a discretization with nodes (xj, tn) , with xj = jh, tn = nk<br />

and h = L/J, k = T/N. Let us denote by ūj,n the numeric solution in the<br />

node (xj, tn). By the above initial condition<br />

while the boundary conditions imply<br />

ūj,0 = f(xj), j = 0, 1, ..., J<br />

ū0,n = g1(tn), ūJ,n = g2(tn).<br />

For 0 < j < J, n > 0 a possible discretization of (13) in the point (xj, tn) is<br />

got by means of a forward difference for the derivative ut and by a central<br />

difference for the second derivative uxx:<br />

ut » ūj,n+1 ¡ ūj,n<br />

, uxx »<br />

k<br />

ūj+1,n ¡ 2ūj,n + ūj−1,n<br />

h2 By substituting in (13), we obtain the following relation for j = 1, ..., J ¡ 1,<br />

and n = 0, ..., N ¡ 1<br />

where<br />

ūj,n+1 = (1 ¡ 2r)ūj,n + r(ūj+1,n + ūj−1,n<br />

(14)<br />

r = Dk/h 2 . (15)<br />

The method is explicit: in xj the numerical solution ū at time tn+1 is<br />

obtained from ū in the three points xj−1, xj, xj+1 at time tn, by an explicit<br />

formula and not by solving a system. Hence in this case the existence of the<br />

18

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

Saved successfully!

Ooh no, something went wrong!