The ill-conditioned Poisson matrixdeveloped for the five-point central finite difference approximation to the solution of Poisson’s equation is positive definite, so the preconditionedmethod applies. To usewe will need to construct the block tridiagonal matrix. Fortunately, MATLAB builds the sparse22matrix with the command
Modify the Poisson equation solver sorpoisson referenced in Section 20.5 to use the preconditionedmethod, whereThe function declaration should be function [x y u] = cgpoisson(n,f,g,numiter).
Test cgpoisson using the following problem withmaxiterand tol−10
The following Poisson problem describes the electrostatic potential field induced by charges in space, whereis a potential field andis a charge density function.
Assume that the electrostatic potential fields are induced by approximatelyrandomly placed point charges with strengthThe edges are grounded, soonNote that the right-hand side functionaffects only the points inside the boundary. Solve the problem usingand draw a surface plot and a contour plot of the resultshows sample plotsOne way of coding the right-hand side is
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here