Programming assignment #2 Solving a parabolic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones
The Problem Reference: Burden and Faires, Numerical Analysis, Ch12
The Problem Reference: Burden and Faires, Numerical Analysis, Ch12 PDE Boundary conditions Initial conditions
Last lecture we will looked at three methods Forward Difference method (explicit) Backward difference method (implicit) Crank-Nicolson method (implicit)
Time stepping formula Forward Difference method i j h k Let
Time stepping formula Backward Difference Method i j h k Let
Time stepping formula Crank-Nicolson Method i j h k
Time stepping formula All Methods Time stepping corresponds to matrix multiplication Approximations are generated by repeated application of T
If the initial conditions are perturbed, the perturbed approximation is And their difference is Stability
Following the material from ODEs we will say that a numerical method is stable if perturbations in the initial conditions give rise to perturbations in the computed solution that do not grow without bound. We want d k to be bounded for all k. Stability
Following the material from ODEs we will say that a numerical method is stable if perturbations in the initial conditions give rise to perturbations in the computed solution that do not grow without bound. We want d k to be bounded for all k. Stability What properties of the matrix T do we need to guarantee d k doesn’t grow without bound?
Following the material from ODEs we will say that a numerical method is stable if perturbations in the initial conditions give rise to perturbations in the computed solution that do not grow without bound. We want d k to be bounded for all k. Stability We need the right analogue of absolute value which is what we had for the scalar case in the ODE slides.
A vector norm is a function ||x|| from R n to R with the following properties: Review: Vector Norms
Review: Common Vector Norms
A matrix norm is a function ||A|| from the set of n x n matrices to R with the following properties: Review: Matrix Norms
Any vector norm ||x|| defines a corresponding matrix norm via: And for this natural, matrix norm and its corresponding vector norm we have the following inequality Review: Natural Matrix Norms
The infinity norm of a matrix is the maximum row sum of the absolute values of its entries. The one norm of a matrix is the maximum column sum of the absolute values of its entries. Review: Common Natural Matrix Norms
The spectral radius (A) of a matrix is the largest eigenvalue in absolute value The two norm of a matrix is related to the spectral radius and if A is symmetric Review: Spectral Radius and Two Norm
Following the material from ODEs we will say that a numerical method is stable if perturbations in the initial conditions give rise to perturbations in the computed solution that do not grow without bound. Stability We need conditions to guarantee
Stability of Forward Differences using infinity norm.
If r > ½ Unstable Else Stable
Stability of Forward Differences using two norm.
Eigenvalues and Eigenvectors on nxn matrix T
Stability requires spectral radius bounded by one If r > ½ Unstable Else Stable Same result as infinity norm
Assignment #2 Forward Difference method (explicit) Backward difference method (implicit) Crank-Nicolson method (implicit) Assignment #2 will is due Wednesday Feb 21. You will code up these three methods for a particular problem and look at accuracy and stability issues.
PDE solution is: The Burden and Faires text contains results for this example Assignment #2
Your job is to experiment with different values of h and k. Do your best to investigate numerically some of the issues we’ve talked about in the lecture. Stability: Run at least two problems with forward differences. One that satisfies the stability condition and one that does not. Comment on your observations. We’ve not seen it yet, but the other two methods are unconditionally stable. Convergence: Backward and Forward differencing has truncation error O(k+h 2 ). Crank-Nicolson is O(k 2 +h 2 ). Calculate the errors you see and comment on how they agree, or not, with these truncation error results. Comparison: Comment on the relative strengths and weaknesses of the three methods. Assignment #2