APMA 2580

Multiscale Computational Fluid Dynamics

Instructor: Professor George Karniadakis

Homework #2



1.
Consider a 3-point one dimensional stencil, consisting of the points (i), $(i \pm 1)$. Construct the highest-order difference formula of the second derivative at the point (i) which does not involve any other second-order derivatives. You may include first-order derivatives, however, as well as function values at the three points. Also, compute the truncation error.

What is the computational work to compute such a derivative on an N-point grid with periodic boundary conditions?

2.
Write a general computer program to compute first-order and second-order derivatives with high-accuracy (greater than two) using the implicit formulas. Consider both central as well as forward and backward stencils. Make sure you test your program by plugging in known analytical functions.