Home Page > > Details

Final Project – Math 104B

 Final Project – Math 104B, Spring 20201

Instructor: Carlos J. García Cervera
1. (30 points) Consider the following partial differential equation for u on the square
and ∂D is the boundary of D:
∂D = {0, 1} × [0, 1] ∪ [0, 1] × {0, 1}. (3)
We construct a two-dimensional grid: Let h = 1/n, and set
xi = ih, i = 0, 1, . . . , n,
yj = jh, j = 0, 1, . . . , n. (4)
We discretize the equation in a similar way to what we did in lecture:
1All course materials (class lectures and discussions, handouts, homework assignments, examinations, web
materials, etc) and the intellectual content of the course itself are protected by United States Federal Copyright
Law, and the California Civil Code. The UC Policy 102.23 expressly prohibits students (and all other persons)
from recording lectures or discussions and from distributing or selling lecture notes and all other course
materials without the prior written permission of the instructor.
(a). (5 points) Construct the function f(x, y) so that u(x, y) = sin(16πx(1 1
x)y(1 1 y)) solves the equation (see Figure 1).
Figure 1: Solution to equation (1).
(b). (25 points) Solve system (7) using the Conjugate Gradient Method. Set the
tolerance to 10䛈8
, and use n = 10, 20, 40, 80, 160, 320. Plot the timings and
the number of iterations, and determine the scaling of each in terms of n. Verify
numerically that the approximation is second order accurate.
Implementaion Tips:
(a). for a simple implementation you can define the solution u (and all arrays in the
Conjugate Gradient Method) as two-dimensional arrays, just like it is defined
Figure 2: Indexing of the nodes in the two-dimensional grid.
(b). Do not construct the full matrix associated to system (7). Instead, there are
other things you can do, for example you can define the matrix using sparse
linear algebra, or simply define a function to evaluate the matrix/vector product
directly:
2. (30 points) A physical quantity P is known to depend on the temperature T. The
file ❉❛t❛✳❝s✈ contains the experimental results. You can read the data using
 
Contact Us - Email:99515681@qq.com    WeChat:codinghelp
Programming Assignment Help!