Skip to main content
留学咨询

辅导案例-CSC 428

By May 15, 2020No Comments

MA/CSC 428 Project 1 Due February 4, 2020 The Dirichlet problem is extremely important in mathematical physics. It has been studied initially for deter- mining the equilibrium temperature distribution on a disk from measurements taken along the boundary. Over regular domains such as a disk or a rectangle, a classical (and textbook) approach is to employ the so called Green’s function. Over irregular domains, this analytic approach becomes infeasible, if not entirely impossible. However, the idea of computing a numerical solution still prevails. To practice this idea, this project asks you to imagine the following domain Ω as a zoom-in corner of a much larger, much more irregular domain. It requires you to convert the differential equation into an algebraic equation. The challenge is at the setup. Once you figure out how this can be done by hand over the coarse grids shown below, write a generic code that can automatically generating grids to any prescribed precision so long as your computer can handle it. Consider the Dirichlet boundary value problem (Poisson’s Equation) −uxx − uyy = f(x, y) (1) u(x, y) = 0 for (x, y) ∈ ∂Ω (2) over the domain Ω below. 0 5 4 x y Figure 1: Domain Ω. 1. Suppose that the solution at the grid point (xi, yj) is approximated by u(xi, yj) ≈ uij , where i, j run through appropriate ranges of integers. The differential operator −uxx− uyy at the point (xi, yj) ∈ Ω is to be approximated by the central difference formula: −uxx − uyy ≈ 4uij − ui−1,j − ui+1,j − ui,j−1 − ui,j+1 h2 where h is the grid size in either x and y direction. In this way, the differential equation is discretized into a system of equations Au = b which can be solved by using the Gaussian elimination method. (a) (10 pts) As a practice, take h = 1. Display the 7× 7 matrix A explicitly. (b) (10 pts) Redo the above problem by halving the grid size. Show the entries of the 43× 43 matrix A on a graph paper.(Hint: What determines this size 43? How to do this in general? There is a pattern in building this structured matrix.) (c) (30 pts) After building your experience, write a general “grid generator” that allows you to redo the above problem with any specified grid size. You may assume that h = 1 2p . Include the code of your generator in the report. Carefully explain how you generate the grid. (Hint: You need to build an automatic mechanism (a code) that can map 2-D indices into a linear array. Likewise, the 1-D solution u need be mapped back to the 2-D solution over the domain Ω.) (d) (10 pts) Experiment your generator with much finer grid size to “smooth” the solution surface. Try to use up the maximal memory capacity that your computer allows. The smaller the grid size, the smoother the solution surfaces. Report the structure of the resulting A matrix by means of the Matlab command “spy”. 2. (20 pts each test function) Use your code to set up the linear systems if the right-hand sides are given by f(x, y) = xe−x 2 −y2 , f(x, y) = x(2x− y)3. Solve the corresponding linear systems with the highest resolution your system allows. Report your (discrete) solutions, including the boundaries at which the solution should be zero, by 3-D surfaces over the domain Ω. (a) Make certain that the window of your domain Ω is marked with proper ticks. (b) Make certain that your 3-D graphs are using the left-hand rule. (c) The numerical solution is only a set of discrete points in R3, but most appropriate graphical tools, such as Matlab, can connect (interpolate) the dots and form a surface. Each project report should consist of four sections • Introduction – Include a brief literature review of the Dirichlet boundary value problem such as its origin, importance, and applications. Also justify why numerical methods are useful. • Mathematical Theory – Explain the mathematics behind your grid generator. This part serves as the document of your code. • Computational Details – Comment on any computational concerns that you have experienced such as how the overhead grows as a function of the step size h. • Conclusion – Report anything you have learned from this project. This could include your thought of generalizing this code to arbitrary domain and other types of partial differential equations. All reports are to be typed. All figures are to be machine generated. All codes are to be attached.

admin

Author admin

More posts by admin