I hope this website will become a valuable resource for everyone learning and doing Computational Science and Engineering. Here are key links:
1.1 | sparseKTBCcode.m |
1.2 | freefixedcode.m |
Ch1Q19FiniteDiffs.m | |
output1.pdf | |
output2.pdf | |
output3.pdf | |
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 (i) v=D=1 (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) | |
1.3 | thomascode.m |
1.5 | harmoniccode.m |
1.7 | SVDcode.m |
2.2 | normalmodescode.m |
rosscode.m | |
trapcode.m | |
leapfrog.m | |
2.4 | gridresistcode.m |
gridlaplacian.m | |
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 ) |
trusscodenew | |
DistMesh codes | |
2.9 | fiedlercode.m |
fiedlerplotcode.m | |
highamkmeanscode.m | |
graphcutscode.m | |
kuliskmeanscodes | |
3.1 | FDcode.m |
FDMcode.m | |
3.2 | Bsplinecode.m |
3.4 | poissoncode.m |
3.5 | sinetransform.m |
3.6 | femcode.m |
4.6 | circdeconvcode.m |
4.7 | cascadecode.m |
DaubechiesWavelets.m DaubechiesWavelets.m, daubechieswavelets.eps, and scalingfunction.eps were generously contributed by Dr Yossi Farjoun. | |
daubechieswavelets.eps | |
scalingfunction.eps | |
5.1 | taylorcoeffcode.m |
5.3 | ilaplacecode.m |
inverselaplacecode.m | |
inversezcode.m | |
5.4 | rungecode.m |
interpolatecode.m | |
Gaussnodescode.m | |
CCintegrationcode.m | |
chebdiffcode.m | |
6.1 | waveheatairycode.m |
6.2 | ODEstabilitycode.m |
6.3 | onewaycode.m |
mit18086_fd_transport_growth.m (various finite difference methods for the one-way wave equation with von Neumann growth factor plot) | |
6.4 | PML notes |
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) | |
6.5 | convdiffcode.m |
mit18086_fd_heateqn.m (finite differences for the heat equation with various time stepping and b.c.) | |
Advection-Diffusion-Reaction codes | |
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) |
7.1 | nestedcode.m |
nestdisscode.m | |
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) |
7.4 | arnoldicode.m |
conjgradcode.m | |
mit18086_cg.m (conjugate gradient method for 2d Poisson problem) | |
8.2 | nullspacecode.m |
8.6 | simplexcode.m |
shortestpathcode.m | |
8.7 | LIBOR notes |
Automatic Differentiation notes |
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.