1 / 27

Jim E. Jones

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. PDE. Boundary conditions. Initial conditions.

whouse
Télécharger la présentation

Jim E. Jones

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming assignment #2Solving 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 PDE Boundary conditions Initial conditions Reference: Burden and Faires, Numerical Analysis, Ch12

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

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

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

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

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

  9. Stability Approximations are generated by repeated application of T If the initial conditions are perturbed, the perturbed approximation is And their difference is

  10. 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 dk to be bounded for all k.

  11. 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 dk to be bounded for all k. What properties of the matrix T do we need to guarantee dk doesn’t grow without bound?

  12. 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 dk to be bounded for all k. We need the right analogue of absolute value which is what we had for the scalar case in the ODE slides.

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

  14. Review: Common Vector Norms

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

  16. Review: Natural 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

  17. Review: Common 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.

  18. Review: Spectral Radius and Two Norm The spectral radius r(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

  19. 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 need conditions to guarantee

  20. Stability of Forward Differences using infinity norm.

  21. Stability of Forward Differences using infinity norm. • 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. Assignment #2 PDE solution is: The Burden and Faires text contains results for this example

  27. 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+h2). Crank-Nicolson is O(k2+h2). 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.

More Related