Title PDE Fourier Finite Diff Solving PDEs for Electrostatics Via Relaxation (Simple, Not Industrial Strength) Rubin H Landau Sally Haerer, Producer-Director Based on A Survey of Computational Physics by Landau, Páez, & Bordeianu with Support from the National Science Foundation Course: Computational Physics II 1 / 7
Title PDE Fourier Finite Diff Problem: V for Arbitrary Geometry & BCs V(x, y) y x v x y Solve Inside Charge-Free Square! Assume conductor @ V fixed = simulation region Closed boundary (insulate openings) ⇒ Neumann conditions on the boundary ⇒ unique & stable solution 2 / 7
Title PDE Fourier Finite Diff Laplace & Poisson Elliptic PDEs (Theory) Classical EM, static charges, Poisson’s Equation: ∇ 2 U ( x ) = − 4 πρ ( x ) Laplace’s equation if ρ ( x ) = 0: ∇ 2 U ( x ) = 0 Solve in 2-D rectangular coordinates: 0 , Laplace’s equation, ∂ 2 U ( x , y ) + ∂ 2 U ( x , y ) = ∂ x 2 ∂ y 2 − 4 πρ ( x ) , Poisson’s equation U ( x , y ) : two independent variables ⇒ PDE Laplace’s: charge indirectly generate BC 3 / 7
Title PDE Fourier Finite Diff Fourier Series Solution As Algorithm Standard Textbook Not Always Good � sinh ( n π y / L ) ∞ 400 � n π x � U ( x , y ) = n π sin L sinh ( n π ) n = 1 , 3 , 5 ,... Sum not separable: � = X ( x ) Y ( y ) Sum = infinite; not true analytic solution Algorithm: � ∞ ≃ � N Painfully slow convergence ⇒ round-off error sinh ( n ) overflow for large n : 40,000 terms Fourier vs 200 algorithm Converges in mean square , Gibbs overshoot N � = ∞ 4 / 7
Title PDE Fourier Finite Diff Fourier- Gibb’s Overshoot at Discontinuities V(x,y) V(x,y) 100 0 0 20 20 x y 20 20 40 40 0 5 / 7
Title PDE Fourier Finite Diff Finite-Difference Form of Poisson Equation 0 , Laplace’s equation, ∂ 2 U ( x , y ) + ∂ 2 U ( x , y ) = ∂ x 2 ∂ y 2 − 4 πρ ( x ) , Poisson’s equation x Form 2-D x − y lattice Solve U each lattice site Derivatives = finite-differences Finite-elements matches small i, j-1 y geometric elements i-1, j i, j i+1, j Elements; more efficient, harder i, j+1 setup 6 / 7
Title PDE Fourier Finite Diff Finite-Difference Form of Poisson Equation ∂ 2 U U ( x + ∆ x , y ) = U ( x , y ) + ∂ U ∂ x ∆ x + 1 ∂ x 2 (∆ x ) 2 + · · · 2 ∂ 2 U U ( x − ∆ x , y ) = U ( x , y ) − ∂ U ∂ x ∆ x + 1 ∂ x 2 (∆ x ) 2 − · · · 2 1. FD ∂/∂ x 3. Odd terms cancel: 2. Add R, L series: ∂ 2 U ( x , y ) ≃ U ( x + ∆ x , y ) + U ( x − ∆ x , y ) − 2 U ( x , y ) ∂ x 2 (∆ x ) 2 ⇒ Finite-difference Poisson PDE: U ( x + ∆ x , y ) + U ( x − ∆ x , y ) − 2 U ( x , y ) (∆ x ) 2 + U ( x , y + ∆ y ) + U ( x , y − ∆ y ) − 2 U ( x , y ) = − 4 πρ (∆ y ) 2 7 / 7
Title PDE Fourier Finite Diff Solve Poisson Equation on Lattice x = i ∆ , y = j ∆ After break 8 / 7
Title PDE Fourier Finite Diff Solve Discrete Poisson Equation on Lattice − 4 πρ ( x ) = ∂ 2 U ( x , y ) + ∂ 2 U ( x , y ) (1) ∂ x 2 ∂ y 2 − 4 πρ i , j = U i + 1 , j + U i − 1 , j + U i , j + 1 + U i , j − 1 − 4 U i , j (2) U i , j = 1 4 [ U i + 1 , j + U i − 1 , j + U i , j + 1 + U i , j − 1 ] + πρ i , j ∆ 2 (3) ⇒ x Solve (2) big matrix Correct solution = average 4 nearest neighbors i, j-1 y i+1, j i-1, j i, j Iteration: BC → solution i, j+1 Relax to solution Know if arrive or fail 9 / 7
Recommend
More recommend