I hope this website will become a valuable resource for everyone learning and doing Computational Science and Engineering. Here are key links:
|This is a code for Problem 1.2.19: Finite differences for the linear advection-diffusion equation |
- D * u_xx + v * u_x = 1 in Homework 1 [1.2.19]
You could test this code with different parameters D, v, h as suggested below.
The code solves and then plots the solutions. It compares the true analytic solution with the solution from finite differences, using (1) centered differences and (2) upwind differences. See sample outputs. It is easy to
* see the matrices K (diffusion) and Del0 or Del_+ (centered/forward) for small N
* see the boundary conditions u(0) = 0 and u(1) = 0
* see whether centered or upwind is more accurate
* make h smaller and see the approximations converge (increase the number of mesh points, N, to make h smaller)
* try different values of the parameters D, v
(ii) v << D (and see the numerical approximation is good, even with large h)
(iii) v >> D (and see a boundary layer because diffusion is so weak)
|2.6||Elastic Pendulum ( Trapezoidal Rule Trapezoidal backward difference split step )|
|Double Pendulum ( Trapezoidal Rule Trapezoidal backward difference split step )|
|Chaotic Pendulum ( Trapezoidal Rule Trapezoidal backward difference split step )|
|For the trapezoidal-backward difference split-step method, the text refers on page 179 to
this graph of stability regions from the paper
Optimal Stability for Trapezoidal-Backward Difference Split-Steps by Sohan Dharmaraja,
Yinghui Wang, and Gilbert Strang, IMA Journal of Numerical Analysis (2009).|
The method is stable outside the curve |growth factor| = 1 in the complex plane. The "magic" choice alpha = 2 - sqrt(2) gives optimal stability.
|2.7||trusscode.m ( needs data files inputs.txt bar.txt bar2.txt )|
|DaubechiesWavelets.m DaubechiesWavelets.m, daubechieswavelets.eps, and scalingfunction.eps were generously contributed by Dr Yossi Farjoun.|
|mit18086_fd_transport_growth.m (various finite difference methods for the one-way wave equation with von Neumann growth factor plot)|
|wave equation notes|
|adjoint method notes|
|adjoint method and recurrence notes|
|mit18086_fd_waveeqn.m (leapfrog method for the wave equation with fixed and loose end)|
|mit18086_fd_heateqn.m (finite differences for the heat equation with various time stepping and b.c.)|
|6.6||mit18086_fd_transport_limiter.m (finite difference and finite volume methods with flux limiters for the advection of discontinuous data)|
|6.7||mit18086_navierstokes.m (finite differences for the incompressible Navier-Stokes equations in a box) Documentation|
|mit18336_spectral_ns2d.m (2D Navier-Stokes pseudo-spectral solver on the torus)|
|6.8||mit18086_levelset_front.m (level set method for front propagation under a given front velocity field)|
|mit18086_poisson.m (solves the Poisson equation in 1d, 2d and 3d)|
|mit18086_fillin.m (computes the LU decomposition of a 2d Poisson matrix with different node ordering)|
|7.2||mit18086_smoothing.m (smoothing and convergence for Jacobi and Gauss-Seidel iteration)|
|mit18086_ilu.m (computes the incomplete LU factorization of a 2d Poisson matrix for different tolerances)|
|7.3||mit18086_multigrid.m (multigrid solver for a 1d Poisson problem, V- and W-cycle)|
|mit18086_cg.m (conjugate gradient method for 2d Poisson problem)|
|Automatic Differentiation notes|
Solution to Problem 1.2.8
Solution to Problem 2.3.3 by Dr. Persson
Solution to Problem 2.7.7 by Jesse Belden
Solution to Problems 2.4.11 and 3.1.11 and 3.1.17
Solutions to Fall 2007 Problem Sets can be found on OpenCourseWare.[top]
Each section of the book has a Problem Set.
The text also provides MATLAB codes to implement the key algorithms.
The website math.mit.edu/cse links to the course sites math.mit.edu/18085 and math.mit.edu/18086 (also ocw.mit.edu). All these sites have overview materials with codes to download, plus graphics and exams and video lectures for review.
This page has been accessed at least times since June 2007. Last updated 4/18/2008.