12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

444 chapter 17All odd terms cancel when we add these equations, and we obtain a centraldifferenceapproximation for the second partial derivative good to order ∆ 4 :∂ 2 U(x, y) U(x +∆x, y)+U(x − ∆x, y) − 2U(x, y)∂x 2 ≃(∆x) 2 , (17.22)∂ 2 U(x, y) U(x, y +∆y)+U(x, y − ∆y) − 2U(x, y)∂y 2 ≃(∆y) 2 . (17.23)Substituting both these approximations in Poisson’s equation (17.5) leads to a finitedifferenceform of the PDE:U(x +∆x, y)+U(x − ∆x, y) − 2U(x, y)(∆x) 2+U(x, y +∆y)+U(x, y − ∆y) − 2U(x, y)(∆y) 2= −4πρ.We assume that the x and y grids are of equal spacings ∆x =∆y =∆, and so thealgorithm takes the simple formU(x +∆,y)+U(x − ∆,y)+U(x, y +∆)+U(x, y − ∆) − 4U(x, y)=−4πρ.(17.24)The reader will notice that this equation shows a relation among the solutions atfive points in space. When U(x, y) is evaluated for the N x x values on the latticeand for the N y y values, we obtain a set of N x × N y simultaneous linear algebraicequations for U[i][j] to solve. One approach is to solve these equations explicitly asa (big) matrix problem. This is attractive, as it is a direct solution, but it requiresa great deal of memory and accounting. The approach we follow here is based onthe algebraic solution of (17.24) for U(x, y):U(x, y) ≃ 1 [U(x +∆,y)+U(x − ∆,y)+U(x, y +∆)+U(x, y − ∆)]4+πρ(x, y)∆ 2 , (17.25)where we would omit the ρ(x) term for Laplace’s equation. In terms of discretelocations on our lattice, the x and y variables arex = x 0 + i∆, y = y 0 + j∆, i,j =0,...,N max-1 , (17.26)where we have placed our lattice in a square of side L. The finite-differencealgorithm (17.25) becomesU i,j = 1 4 [U i+1,j + U i−1,j + U i,j+1 + U i,j−1 ]+πρ(i∆,j∆)∆ 2 . (17.27)−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 444

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

Saved successfully!

Ooh no, something went wrong!