Question: The Matlab script poisson.m by Randall LeVeque (from http: //faculty.washington.edu/rjl/fdmbook/matlab/poisson.m and Lecture 4) solves the Poisson problem on a square m times m grid with

The Matlab script poisson.m by Randall LeVeque (from http: //faculty.washington.edu/rjl/fdmbook/matlab/poisson.m and Lecture 4) solves the Poisson problem on a square m times m grid with Delta x = Delta y h, using the 5-point Laplacian. It is set up to solve a test problem for which the exact solution is u(x, y) = exp(x + y/2), using Dirichlet boundary conditions and the right hand side f(x, y) = 1.25exp(x + y/2). a) Modify the script so that it solves the Poisson problem u_xx + u_yy = -(x^4 + 4x^2y^2) sin(x^2y) using the actual solution, u(x, y) = sin(x^2y) + xy, to set the boundary conditions and to compute the error. Perform a grid refinement study on the square domain [0, 5] times [0, 5] to show that the method in the script is second order accurate. Submit the results of your grid refinement study i.e, the error for at least two different values of h, including confirmation that the method is second order accurate. Also, submit a contour plot of your computed solution for the finest grid level at which you run your program. (b) Modify the script further so that it works on a rectangular domain [a_x, b_x] times [a_y, b_y] and to allow the option of Delta x notequalto Delta y. ALSO, in addition to producing a contour plot of the approximate solution, modify the script so that it gives the user the option of producing a mesh plot or a surf plot of the approximate solution. Submit a copy of the modified script M-file as well as a surf plot of the approximate solution to the Poisson problem from part (a) solved on the domain [0, 5] times [0, 10] with Delta x notequalto delta y. (For the surf plot, due to the potentially very large size of the image file, it is not recommended that the smaller of delta x or delta y be less than 0.05)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
