Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.

Slides:



Advertisements
Similar presentations
Partial Differential Equations
Advertisements

Computational Modeling for Engineering MECN 6040
Review of accuracy analysis Euler: Local error = O(h 2 ) Global error = O(h) Runge-Kutta Order 4: Local error = O(h 5 ) Global error = O(h 4 ) But there’s.
Geometric (Classical) MultiGrid. Hierarchy of graphs Apply grids in all scales: 2x2, 4x4, …, n 1/2 xn 1/2 Coarsening Interpolate and relax Solve the large.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Part Eight Partial Differential Equations.
1cs542g-term Notes  No extra class tomorrow.
Total Recall Math, Part 2 Ordinary diff. equations First order ODE, one boundary/initial condition: Second order ODE.
PART 7 Ordinary Differential Equations ODEs
ECE602 BME I Partial Differential Equations in Biomedical Engineering.
Chapter 19 Numerical Differentiation §Estimate the derivatives (slope, curvature, etc.) of a function by using the function values at only a set of discrete.
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.
PARTIAL DIFFERENTIAL EQUATIONS
Partial Differential Equations
Lecture 34 - Ordinary Differential Equations - BVP CVEN 302 November 28, 2001.
Introduction to Numerical Methods I
Parabolic PDEs Generally involve change of quantity in space and time Equivalent to our previous example - heat conduction.
PARTIAL DIFFERENTIAL EQUATIONS
1 Chapter 9 NUMERICAL SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS.
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
Types of Governing equations
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Part 81 Partial.
CISE301: Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures KFUPM (Term 101) Section 04 Read & CISE301_Topic9.
SE301: Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures KFUPM Read & CISE301_Topic9 KFUPM.
Numerical methods for PDEs PDEs are mathematical models for –Physical Phenomena Heat transfer Wave motion.
COMPUTATIONAL MODELING FOR ENGINEERING MECN 6040 Professor: Dr. Omar E. Meza Castillo Department.
1 Numerical Methods and Software for Partial Differential Equations Lecturer:Dr Yvonne Fryer Time:Mondays 10am-1pm Location:QA210 / KW116 (Black)
Hyperbolic PDEs Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Partial Differential Equations Introduction –Adam Zornes, Deng Li Discretization Methods –Chunfang Chen, Danny Thorne, Adam Zornes.
Scientific Computing Partial Differential Equations Poisson Equation.
Finite Element Method.
Partial Differential Equations Finite Difference Approximation.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
MA2213 Lecture 11 PDE. Topics Introduction p Poisson equation p Visualization of numerical results p Boundary conditions p.
Elliptic PDEs and the Finite Difference Method
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 8 - Chapter 29.
1 EEE 431 Computational Methods in Electrodynamics Lecture 3 By Dr. Rasime Uyguroglu.
Introduction Examples of differential equations and related problems Analytical versus numerical solutions Ideas of numerical representations of solutions.
Introduction to PDE classification Numerical Methods for PDEs Spring 2007 Jim E. Jones References: Partial Differential Equations of Applied Mathematics,
Engineering Analysis – Computational Fluid Dynamics –
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Engineering Analysis – Computational Fluid Dynamics –
Numerical methods 1 An Introduction to Numerical Methods For Weather Prediction by Mariano Hortal office 122.
Final Project Topics Numerical Methods for PDEs Spring 2007 Jim E. Jones.
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.
Partial Differential Equations Introduction – Deng Li Discretization Methods –Chunfang Chen, Danny Thorne, Adam Zornes CS521 Feb.,7, 2006.
Solving Partial Differential Equation Numerically Pertemuan 13 Matakuliah: S0262-Analisis Numerik Tahun: 2010.
Department of Mathematics Numerical Solutions to Partial Differential Equations Ch 12. Applied mathematics. Korea University.
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 28.
Example application – Finite Volume Discretization Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Relaxation Methods in the Solution of Partial Differential Equations
Part 8 - Chapter 29.
EEE 431 Computational Methods in Electrodynamics
Christopher Crawford PHY
Convergence in Computational Science
Introduction to Partial Differential Equations
PDEs and Examples of Phenomena Modeled
Partial Differential Equations
Christopher Crawford PHY
Finite Difference Method
ME/AE 339 Computational Fluid Dynamics K. M. Isaac Topic2_PDE
Linear Algebra Lecture 3.
CS6068 Applications: Numerical Methods
Brief introduction to Partial Differential Equations (PDEs)
Partial Differential Equations
Discrete Least Squares Approximation
PARTIAL DIFFERENTIAL EQUATIONS
Programming assignment #1 Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Presentation transcript:

Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones

Many physical processes can be modeled with Partial Differential Equations (PDEs) Poisson Equation modeling steady- state temperature in 2d plate Maxwell’s equations relating electric and magnetic fields Wave Equation modeling wave propagation at speed v

PDE classified by discriminant: b 2 -4ac. –Negative discriminant = Elliptic PDE. Example Laplace’s equation –Zero discriminant = Parabolic PDE. Example Heat equation –Positive discriminant = Hyperbolic PDE. Example Wave equation Partial Differential Equations (PDEs) : 2 nd order model problems

PDE classified by discriminant: b 2 -4ac. –Negative discriminant = Elliptic PDE. Example Laplace’s equation –Zero discriminant = Parabolic PDE. Example Heat equation –Positive discriminant = Hyperbolic PDE. Example Wave equation Partial Differential Equations (PDEs) : 2 nd order model problems

Solving PDEs on a computer typically involves discretizing on a grid Computers typically don’t understand continuous quantities, only discrete ones. Rather than asking for the temperature as a function u(x,y), we seek to find an approximation to the temperature at each point on a grid.

Discretization approximates the differential problem by an algebraic one

Finite differences - derived by interpolation x0x0 x1x1 x2x2 (x o,u 0 ) (x 1,u 1 ) (x 2,u 2 ) Construct polynomial interpolating data

Finite differences - derived by Lagrange interpolation x0x0 x1x1 x2x2 (x o,u 0 ) (x 1,u 1 ) (x 2,u 2 ) Approximate 2 nd derivative of u at x 1 by 2 nd derivative of p

Finite differences - derived by Lagrange interpolation x0x0 x1x1 x2x2 (x o,u 0 ) (x 1,u 1 ) (x 2,u 2 ) h

Finite differences - derived by Taylor’s Theorem [Taylor’s Theorem] Suppose f and its first n derivatives are continuous on [a,b], its n+1 derivative exists on [a,b], and x o is in [a,b]. Then for any x in [a,b] there is a c(x) between x and x 0 with:

Finite differences x0x0 x1x1 x2x2 (x o,u 0 ) (x 1,u 1 ) (x 2,u 2 )

Finite differences x0x0 x1x1 x2x2 (x o,u 0 ) (x 1,u 1 ) (x 2,u 2 )

Finite differences x0x0 x1x1 x2x2 (x o,u 0 ) (x 1,u 1 ) (x 2,u 2 ) If the 4 th derivative is continuous, then the average value of u at c o and c 2 is attained at some c between them. (Intermediate Value Theorem)

Finite differences x0x0 x1x1 x2x2 (x o,u 0 ) (x 1,u 1 ) (x 2,u 2 ) If the 4 th derivative is continuous, then the average value of u at c o and c 2 is attained at some c between them

Finite differences x0x0 x1x1 x2x2 (x o,u 0 ) (x 1,u 1 ) (x 2,u 2 ) Solving for u’’

Finite differences x0x0 x1x1 x2x2 (x o,u 0 ) (x 1,u 1 ) (x 2,u 2 ) Solving for u’’ Same approximation we got using interpolation

Finite difference discretization based on Taylor’s approximation.

Approximated derivative at a point by an algebraic equation involving function values at nearby points By Taylor’s Theorem, the error in this approximation (the truncation error) is O(h 2 )

Finite difference discretization based on Taylor’s approximation. Error in approximation is determined by the mesh size h. Difference between differential solution and algebraic solution goes to zero as h does. Equation for each grid point (x,y)

Simple Example on Partial Differential Equation Boundary Conditions (0,0) (1,1)

Simple Example Where are the discrete u values located?

Simple Example Where are the discrete u values located? At grid points

Simple Example Which u-values do we already know?

Simple Example Which u-values do we already know? The boundary values are =2

Simple Example Write down the 9x9 matrix problem for computing the unknown u-values.

Simple Example Write down the 9x9 matrix problem for computing the unknown u-values

Linear System

MATLAB

Debugging – does the solution “look correct” –Symmetry –Other checks, can we set it up so we know the solution?

MATLAB To think about on the MLK Holiday break (and to get ready for assignment 1) –How would you code up the simple example? –How could you allow general mesh size h? –How could you allow general rhs and bc’s? Perhaps even functions that depend on position: sin(xy)? –How would you verify your code is working properly?