Sei sulla pagina 1di 3

ME 282, Jan-April 2016

R. K. Shukla
Assignment 1, Due Thursday, Feb 16
1. Read sections from the following references on classification of PDEs
Ian N. Sneddon, Elements of partial differential equations Dover Publications, 2006 (Chapter
- 3, Section 5, pp. 105 - 115).
D. A. Anderson, J. C. Tannehill, and R. H. Pletcher, Computational Fluid Mechanics and Heat
Transfer, Hemisphere Publishing Corporation, 1984 (Chapter - 3).
2. Obtain the canonical form for the following partial differential equations
2u
2u
2u
+
2
+
3
= 0,
x2
xy
y 2
2u
2u
2u
+
+
= 0,
x2 xy
y 2
2 u u
2u
2u
+
9
exy = 1,

6
+
x2
xy
y 2
x

(1)
(2)
(3)

3. Let A be the (N 1) (N 1) matrix associated with a finite difference solution to the BVP:
u (x) = f (x), u(0) = u(1) = 0,

(4)

constructed using uniform grid points in [0,1] and the standard three-point, second order, discretization to approximate uxx (let xi = i/N, i = 0, 1, . . . , N ).
(a) Verify analytically that the N 1 eigenvectors of A are given by the discrete sine functions: i.e.
vectors whose elements consist of sin(kxi ) for a value of k in [1, N 1]. Specifically the jth
element of k is given by kj = sin(kxj )
(b) Give a formula for the eigenvalues of A.
(c) Give the analytical solution to Au = f , when f is the vector obtained by evaluating sin(x) at
the nodes xi = i/N, i = 1, 2, . . . , N 1. What do you observe when N ?
4. Extend the second-order finite difference and finite volume methods that we developed in the class
for (13) to approximate the BVP


d
du(x)
(x)
+ (x)u(x) = f (x), x (0, 1)
(5)
dx
dx
u(0) = a, u(1) = b.
(6)
Do the two methods lead to the same linear system of equations for the unknowns (ui , i = 1, 2, . . . , N
1)?

5. Using Taylor series expansion determine the unknown coefficients (a1 , a2 , b1 , b2 , c1 , c2 , d1 , d2 , e1 , and
e2 ) and the order of accuracy for the following finite difference approximations for the first and second
derivatives on a uniform grid with spacing h:
(a) a1 ui1 + ui + b1 ui+1 = c1 ui1 + d1 ui + e1 ui+1
(b) a2 ui1 + ui + b2 ui+1 = c2 ui1 + d2 ui + e2 ui+1
6. Consider the following fourth-order accurate finite difference approximation on a uniform grid:
ui =

1
(ui2 8ui1 + 8ui+1 ui+2 ) .
12h

(7)

(a) Derive this formula using lagrange polynomial interpolation.


(b) Use the above formula to give an expression for the approximate first derivative of u(x) = xn ,
where n is an integer, at x = xi . Give an expression for error in this approximation e =
uexact (xi ) ui . What is the value of e for n 4?
7. Write a computer code to solve the following BVP using the standard second-order finite difference
method on a uniform grid (xi = i/N , i = 0, 1, . . . , N )
u = sin(x),

x (0, 1)

u(0) = u(1) = 0.

(8)
(9)

Use Thomas algorithm to solve the resulting linear system of equations. Use your code to answer
following questions.
(a) Assume = 10. Plot the L2 error, defined as
v
u N
2
uX 
u
ucalculated
uexact
u
i
i
t i=1
,
e2 =
N

(10)

as a function of N by choosing N = 25, 50, 100, 200 and 400 (use a log-log scale). What rate of
convergence (slope of the graph) do you observe?
(b) Choose N = 50 and compute solutions for = 1, 10 and 100. Plot uexact and ucalculated as a
function of x for different values of mentioned above (show all these on the same graph using
different style/symbols, you may use Tecplot which is available at SERC or any other software
of your choice). What do you observe ?
8. Let A be the matrix associated with the standard second-order finite difference approximation to the
2D BVP on a unit square
uxx + uyy = f (x, y),

(x, y) (0, 1)2

(11)

u(0, y) = u(1, y) = 0,

y [0, 1]

(12)

u(x, 0) = u(x, 1) = 0,

x [0, 1].

(13)

Assume that h = x = y = 1/N so that xi = ih, i = 0, 1, . . . , N and yj = jh, j = 0, 1, . . . N .

(a) Verify analytically that the (N 1)2 eigenvectors of A are given by the discrete functions sp,q ,
whose (i, j)th entry is given by sin(pxi ) sin(qyj ) for a value of p in [1, N 1] and q in [1, N 1].
(b) Give a formula for the eigenvalues and condition number of A.
(c) Give the analytical solution to Au = f , when f is the vector obtained by evaluating sin(5x) sin(6y)
at the nodes xi = i/N, i = 1, 2, . . . , N 1, yj = j/N, j = 1, 2, . . . , N 1 (assuming N > 6).
What do you observe when N ?
9. Consider the following 2D Helmholtz equation with Dirichlet boundary conditions:
2 u + 1000u = (1000 200 2 ) sin(10x) cos(10y),
u(x, 0) = u(x, 1) = sin(10x)
u(0, y) = u(1, y) = 0.

(x, y) (0, 1)2


(14)

Write a computer program to compute an approximate solution to this problem using standard second
order central finite difference approximation on a uniform N N computational grid. Use the matrix
diagonalization method discussed in the class to solve the resulting linear system of equations (you
could use the formulas for eigenvalues and eigenvectors from the above problem of this Assignment).
Plot the L2 and L errors as a function of N . What rate of convergence do you observe?

Potrebbero piacerti anche