Answered step by step
Verified Expert Solution
Question
1 Approved Answer
+ (10) Problem 4. Objective: To solve Poisson equation with no-flux (Neumann) boundary conditions, using finite differences and Gauss-Seidel. Consider the Poisson problem on [0,
+ (10) Problem 4. Objective: To solve Poisson equation with no-flux (Neumann) boundary conditions, using finite differences and Gauss-Seidel. Consider the Poisson problem on [0, 1] x [0, 1] with three no-flux BCs: azo 226 = f(x,y) (9) ar? ay? . ao (0,y) = (1,1) = (3,0) = 0 o(1, y) = 0 (11) (a) Modify your Gauss-Seidel code from problem 3 to handle these boundary conditions and the f(l, y). The best way to deal with the boundaries is to introduce fictitious "ghost points just outside the no-flux boundaries and then appropriately modify the equations for the boundary points so that the derivative across the boundary is held at zero. This means that the Gauss- Seidel update rules will look different along each boundary, and at each comer point. The Gauss-Seidel update rules for interior points will need to take account of f(x,y). (b) Test your code using f(x,y) = 1 and h = 0.1, and compare to the exact solution of c, y) = (1/2)(22-1). Produce three contour plots to show (i) the exact solution, (ii) the Gauss-Seidel results and (iii) the difference between the two. Also make a plot of the error evaluated at (r,y) = (0.5, 0.6) as a function of the number of iterations. (c) Now consider an input term on just a central square: -0.5 where 0.3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started