Total Recall Math, Part 2 Ordinary diff. equations First order ODE, one boundary/initial condition: Second order ODE.

Slides:



Advertisements
Similar presentations
Courant and all that Consistency, Convergence Stability Numerical Dispersion Computational grids and numerical anisotropy The goal of this lecture is to.
Advertisements

Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
Chapter 8 Elliptic Equation.
Ordinary Differential Equations
Lecture 18 - Numerical Differentiation
PART 7 Ordinary Differential Equations ODEs
Computer-Aided Analysis on Energy and Thermofluid Sciences Y.C. Shih Fall 2011 Chapter 6: Basics of Finite Difference Chapter 6 Basics of Finite Difference.
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
PARTIAL DIFFERENTIAL EQUATIONS
Lecture 34 - Ordinary Differential Equations - BVP CVEN 302 November 28, 2001.
Introduction to Numerical Methods I
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Partial differential equations Function depends on two or more independent variables This is a very simple one - there are many more complicated ones.
Numerical Methods for Partial Differential Equations
Finite Difference Methods to Solve the Wave Equation To develop the governing equation, Sum the Forces The Wave Equation Equations of Motion.
Types of Governing equations
1 Chapter 9 Differential Equations: Classical Methods A differential equation (DE) may be defined as an equation involving one or more derivatives of an.
Ordinary Differential Equations (ODEs)
Differential Equations and Boundary Value Problems
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
CISE301: Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures KFUPM (Term 101) Section 04 Read & CISE301_Topic9.
Numerical Solution of Ordinary Differential Equation
MATH 685/ CSI 700/ OR 682 Lecture Notes Lecture 10. Ordinary differential equations. Initial value problems.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Explicit ODE Solvers Daniel Baur ETH Zurich, Institut.
Pseudospectral Methods
Numerical Integration Methods
Finite Differences Finite Difference Approximations  Simple geophysical partial differential equations  Finite differences - definitions  Finite-difference.
© Arturo S. Leon, BSU, Spring 2010
Hyperbolic PDEs Numerical Methods for PDEs Spring 2007 Jim E. Jones.
CIS V/EE894R/ME894V A Case Study in Computational Science & Engineering HW 5 Repeat the HW associated with the FD LBI except that you will now use.
Introduction to Numerical Methods for ODEs and PDEs Methods of Approximation Lecture 3: finite differences Lecture 4: finite elements.
Erin Catto Blizzard Entertainment Numerical Integration.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
CISE301_Topic11 CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4:
Scientific Computing Partial Differential Equations Poisson Equation.
Finite Element Method.
Lecture 3.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Finite Elements: 1D acoustic wave equation
Integration of 3-body encounter. Figure taken from
6. Introduction to Spectral method. Finite difference method – approximate a function locally using lower order interpolating polynomials. Spectral method.
To Dream the Impossible Scheme Part 1 Approximating Derivatives on Non-Uniform, Skewed and Random Grid Schemes Part 2 Applying Rectangular Finite Difference.
7. Introduction to the numerical integration of PDE. As an example, we consider the following PDE with one variable; Finite difference method is one of.
Elliptic PDEs and the Finite Difference Method
Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Engineering Analysis – Computational Fluid Dynamics –
Engineering Analysis – Computational Fluid Dynamics –
5. Integration method for Hamiltonian system. In many of formulas (e.g. the classical RK4), the errors in conserved quantities (energy, angular momentum)
Numerical Analysis – Differential Equation
Numerical methods 1 An Introduction to Numerical Methods For Weather Prediction by Mariano Hortal office 122.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 27.
Discretization Methods Chapter 2. Training Manual May 15, 2001 Inventory # Discretization Methods Topics Equations and The Goal Brief overview.
Discretization for PDEs Chunfang Chen,Danny Thorne Adam Zornes, Deng Li CS 521 Feb., 9,2006.
Partial Derivatives Example: Find If solution: Partial Derivatives Example: Find If solution: gradient grad(u) = gradient.
ESO 208A/ESO 218 COMPUTATIONAL METHODS IN ENGINEERING.
The story so far… ATM 562 Fovell Fall, Convergence We will deploy finite difference (FD) approximations to our model partial differential equations.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
Department of Mathematics Numerical Solutions to Partial Differential Equations Ch 12. Applied mathematics. Korea University.
1 LECTURE 6 Stability of Parabolic PDEs. 2 Aim of Lecture Last week we discussed Parabolic PDEs –Looked at Explicit and Implicit Methods –Advantages and.
Runge Kutta schemes Taylor series method Numeric solutions of ordinary differential equations.
Differential Equations
EEE 431 Computational Methods in Electrodynamics
Lecture 4: Numerical Stability
Introduction to Numerical Methods I
Chapter 30.
21th Lecture - Advection - Diffusion
topic4: Implicit method, Stability, ADI method
topic4: Implicit method, Stability, ADI method
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Presentation transcript:

Total Recall Math, Part 2

Ordinary diff. equations First order ODE, one boundary/initial condition: Second order ODE

ODEs contn’d 2 nd order ODE can be replaced with a system of 1 st order ODEs: Typical situation in RT involves two-point boundary conditions … or initial condition

Runge-Kutta For the 1st order ODE the Euler method gives: this also happens to be first order RK scheme 4th order RK: Note that RK is directly applicable to a system of ODE and therefore to any order ODE with initial conditions

Finite-differences For the 1st order ODE: For the 2nd order ODE:

2 nd order scheme For k =1 and k =N equations are given by boundary conditions. Home work 2a: Derive the value for coefficients in the numerical scheme above This particular form of the 2 nd order ODE can be approximated by the following simple FD scheme:

This numerical scheme results in 3-diagonal matrix: Solving a system of ODEs leads to a block-diagonal SLE!

RK versus Finite-diff. RK typically has homogeneous convergence, allows higher orders, has good round-off stability (because errors are controlled on every step). High accuracy my be very expensive, specially in multidimensions (fast increase of the number of steps). FD converges (if it does) much faster. More complex schemes (2nd order and higher) gain stability and convergence speed. Expensive and difficult to check maximum error. 4 Cook-book: to study solution locally when you have time use RK. When high accuracy must be combined with high performance use FD.

Partial Differential Equations PDEs come in three flavors: hyperbolic, parabolic, and elliptic A typical example of a hyperbolic equation is a wave equation: where v is the velocity of wave propagation

PDEs examples An example of parabolic equation is the diffusion equation: where D(>0) is the diffusion coefficient

PDEs examples Poisson equation is an example of elliptic type: where ρ is the source function (density of charges). If ρ is zero for the whole domain we get a special case of Laplace equation

Numerical schemes Numerically, the first two types are initial value problems (Cauchy problems): Initial values Boundary conditions

Numerical schemes An elliptic equation is a boundary condition problem: Boundary conditions

Numerical scheme for Poisson equation Assuming an equispaced rectangular grid in 2D with stepsize Δ: In matrix form the scheme looks like this: which is a 5-diagonal SLE

Boundaries and generalization The scheme on the previous slide only holds inside the domain. The points for i = 1, N x and j = 1, N y are described by the boundary conditions leading to a system of linear equation Au = b. In our case, elements on each diagonal of A are constant. In general case, matrix elements along diagonals change. In 3D more diagonals are present.

Convergence and stability Approximation – the accuracy of approximation of the analytical equation(s) by numerical scheme. Convergence - the property of the numerical scheme to get closer to the exact solution when the grid becomes denser in some regular way. Stability - the stability of numerical scheme characterizes the way errors (e.g. finite difference approximation of derivatives) are accumulated during the integration. Stability of the computer implementation of numerical scheme are the way round-off errors are accumulated.

Computational errors Floating point numbers are stored in 32- or 64-bit long words (IEEE): Multiplications/divisions do not loose much precision but subtraction/addition is a danger sign exponent mantissa

HOME WORK 2b: convergence

Diffusion equation Initial value problem: can be approximated as: i-1 i i+1 i-1 i i+1 Space j Time j+1 ExplicitImplicit

Stability analysis of numerical schemes We represent the approximation errors our solution u l m with Fourier components: Substituting individual components to the finite difference scheme we find the condition that results in corresponding to the unlimited error growth. For the diffusion equation this condition is: Courant condition

Explicit or implicit? New sense of stability: how dramatic will be the solution after many time steps if we change the initial conditions a little bit? Explicit schemes (α=1, β=0) tend to have better convergence Purely implicit schemes (α=0, β=1) tend to be more stable Combining the two (α>0, β>0) helps to get the optimal scheme

Integration: Gauss quadratures For any “reasonable” function f(x) the integral with kernel K(x) can be approximated as a sum of function values in nodes x i multiplied by weights. If f(x) can be represented with orthogonal polynomials exactly, the quadrature formula is also exact.

Non-linear equations For system of non-linear equations we often use Newton-Raphson scheme:

Home work 2: c. Write a simple program for 4x4 matrix inversion with Gauss-Jordan elimination and partial pivoting. Test round-off stability by doing many inversions of a random 4 by 4 matrix. d. Propose the scheme (flow chart) for solving SLE with 4x4 block-diagonal matrix e. Write (or use NR routine) 4th order RK and FD scheme for the equation: