Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming assignment #2 Solving a parabolic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.

Similar presentations


Presentation on theme: "Programming assignment #2 Solving a parabolic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones."— Presentation transcript:

1 Programming assignment #2 Solving a parabolic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones

2 The Problem Reference: Burden and Faires, Numerical Analysis, Ch12

3 The Problem Reference: Burden and Faires, Numerical Analysis, Ch12 PDE Boundary conditions Initial conditions

4 Last lecture we will looked at three methods Forward Difference method (explicit) Backward difference method (implicit) Crank-Nicolson method (implicit)

5 Time stepping formula Forward Difference method i j h k Let

6 Time stepping formula Backward Difference Method i j h k Let

7 Time stepping formula Crank-Nicolson Method i j h k

8 Time stepping formula All Methods Time stepping corresponds to matrix multiplication Approximations are generated by repeated application of T

9 If the initial conditions are perturbed, the perturbed approximation is And their difference is Stability

10 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

11 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?

12 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.

13 A vector norm is a function ||x|| from R n to R with the following properties: Review: Vector Norms

14 Review: Common Vector Norms

15 A matrix norm is a function ||A|| from the set of n x n matrices to R with the following properties: Review: Matrix Norms

16 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

17 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

18 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

19 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

20 Stability of Forward Differences using infinity norm.

21 If r > ½ Unstable Else Stable

22 Stability of Forward Differences using two norm.

23 Eigenvalues and Eigenvectors on nxn matrix T

24 Stability requires spectral radius bounded by one If r > ½ Unstable Else Stable Same result as infinity norm

25 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.

26 PDE solution is: The Burden and Faires text contains results for this example Assignment #2

27 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


Download ppt "Programming assignment #2 Solving a parabolic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones."

Similar presentations


Ads by Google