1 / 26

Introduction to Numerical Methods I

Introduction to Numerical Methods I. Finite difference approximation to derivatives. Consider a smooth function g(x). Taylor’s theorem reads:. In particular:. Short course on: Numerical methods for hyperbolic equations and applications-Trento, Italia-June 7 th to 18 th , 2004.

chickoa
Download Presentation

Introduction to Numerical Methods I

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. Introduction to Numerical Methods I

  2. Finite difference approximation to derivatives

  3. Consider a smooth function g(x). Taylor’s theorem reads: In particular: Short course on: Numerical methods for hyperbolic equations and applications-Trento, Italia-June 7th to 18th, 2004

  4. Finite difference approximation of PDEs: FTCS Discretise the x-t domain into a finite number of M+1 points, I=0,…,M

  5. Now approximate partial derivatives. Use finite differences: Then the PDE is replaced by a finite difference approximate operator:

  6. Introduce the dimensionless number: The Courant-Friedrichs-Lewy number or CFL number, or Courant number Note that c is a dimensionless quantity, it is the ratio of two velocities: Finally, the FTCS scheme reads: Stencil This formula allows us to calculate explicitly the evolution in time of discrete approximate values of the solution at every point, except for i=0 and i=M.

  7. Convergence Our ultimate goal is to construct schemes that converge, that is schemes that approach the true solution of the PDE when the mesh size tends to zero. Lax’s Equivalence theoremsays that: the only schemes that are CONVERGENT are those that are CONSISTENT and STABLE We must therefore work on CONSISTENCY AND STABILITY.

  8. Local truncation error Consider a particular scheme: FTCS. The numerical analogue of the PDE is the approximate operator: We define the local truncation error:

  9. Assuming the solution is sufficiently smooth we Taylor expand and obtain: Noting that: The FTCS is a first-order scheme In general, if the local truncation error of a scheme is of the form: Then the scheme is said to be k-th order accurate in time and l-th order accurate in space.

  10. Consistency A numerical scheme is said to be consistent with the PDE being discretized if the local truncation error tends to zero as the mesh size tends to zero. For example, for the FTCS scheme we have Therefore FTCS is consistent wit the PDE

  11. Stability of a numerical method. If a method is consistent with the PDE, then all we need to bother is stability. One view of stability is that of unbounded growth of errors as the numerical scheme evolves the solution in time. Another view of stability is that of controlling spurious oscillations Stability in the sense on unbounded growth can be analysed by a variety of methods A popular method is the von Neumann method One performs a Fourier decomposition of the error. It is sufficient to consider a single component.

  12. Stability analysis of the FTCS Thus FTCS is unstable under all circumstances: UNCONDITIONALLY UNSTABLE (useless).

  13. Godunov’s first-order upwind scheme • Approximate derivatives in by then • The scheme reads Illustrate the stencil

  14. Local truncation error: The finite difference operator is: Substitution of the exact solution into the approximate opetaror gives: Assuming sufficient smoothness and Taylor expanding: The scheme is first-order accurate in space and time

  15. Stability analysis and the stability condition becomes The CFL condition of Courant condition Given wave speed and mesh spacing the time step is determined from the stability condition

  16. The stencil (upwind) t n+1 o n o o x True domain of dependency Numerical domain of dependency The exact solution is the value on the characteristic where is the foot of the characteristic at time

  17. For appropriate choices of the point lies between and • Assume a linear interpolation between and • Evaluation of gives which is the Godunov scheme

  18. The “downwind” scheme • Approximate derivatives in by then • The scheme reads Exercise: derive the local truncation error. Is the scheme consistent ? Exercise: show that this scheme is unconditionally unstable.

  19. General Form of the First-Order Upwind Scheme • For the upwind scheme is • For both and define: • The scheme reads: Exercise: show that the upwind scheme for negative speed is conditionally stable

  20. Fully discrete and semi-discrete schemes Fully discrete If the time derivative is left in its continuous form Semi-discrete The method of lines

  21. Explicit scheme and implicit schemes Explicit Implicit Exercise: construct the fully discrete implicit version of FTCS

  22. Monotone Schemes A monotone scheme satisfies: Monotone schemes for the linear advection equation with constant speed of propagation are those whose coefficients are non-negative. Example: The Godunov upwind scheme.

  23. More Schemes The Lax-Friedrichs scheme (LF) • Conditionally stable • Monotone • Modified equation has LF may also be seen as the FTCS scheme (unstable) with replaced by Note the shape of the stencil.

  24. The Godunov Centred Scheme Stencil • Conditionally stable • Monotone for • Oscillatory for This is an interesting example of a first-order scheme that is NOT MONOTONE.

  25. The Lax-Wendroff Scheme (LW) Stencil • Conditionally stable • Non-monotone (verify by inspection)

  26. The FORCE scheme stencil • Conditionally stable: • Monotone • Modified equation: © Toro 2004

More Related