Scientific Computing Partial Differential Equations Poisson Equation.

Slides:



Advertisements
Similar presentations
Partial Differential Equations
Advertisements

Computational Modeling for Engineering MECN 6040
Chapter 8 Elliptic Equation.
Parabolic Partial Differential Equations
Linear Systems of Equations
Chapter 3 Steady-State Conduction Multiple Dimensions
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
CS 584. Review n Systems of equations and finite element methods are related.
Math for CSLecture 121 Partial Differential Equations Boundary Value Problems.
CHE/ME 109 Heat Transfer in Electronics LECTURE 12 – MULTI- DIMENSIONAL NUMERICAL MODELS.
PARTIAL DIFFERENTIAL EQUATIONS
Chapter 7 – Poisson’s and Laplace Equations
Parabolic PDEs Generally involve change of quantity in space and time Equivalent to our previous example - heat conduction.
Thomas algorithm to solve tridiagonal matrices
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW II.
1 Model 6:Electric potentials We will determine the distribution of electrical potential (V) in a structure. x y z x y V=0 V=To be specified Insulation.
Math for CSTutorial 121 Heat Equation. Laplace Equation.
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.
Differential Equations and Boundary Value Problems
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.
Scientific Computing Matrix Norms, Convergence, and Matrix Condition Numbers.
Scientific Computing Partial Differential Equations Explicit Solution of Wave Equation.
COMPUTATIONAL MODELING FOR ENGINEERING MECN 6040 Professor: Dr. Omar E. Meza Castillo Department.
Lecture 4: Boundary Value Problems
Systems of Linear Equations Iterative Methods
Scientific Computing Partial Differential Equations Introduction and
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Copyright © Cengage Learning. All rights reserved. 16 Vector Calculus.
Section 2: Finite Element Analysis Theory
CS 219: Sparse Matrix Algorithms
Linear Systems Iterative Solutions CSE 541 Roger Crawfis.
Scientific Computing Partial Differential Equations Implicit Solution of Heat Equation.
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
Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
CSE 245: Computer Aided Circuit Simulation and Verification Matrix Computations: Iterative Methods I Chung-Kuan Cheng.
Engineering Analysis – Computational Fluid Dynamics –
Engineering Analysis – Computational Fluid Dynamics –
HEAT TRANSFER FINITE ELEMENT FORMULATION
Linear Systems – Iterative methods
Engineering Analysis – Computational Fluid Dynamics –
Introduction to Scientific Computing II Overview Michael Bader.
Discretization Methods Chapter 2. Training Manual May 15, 2001 Inventory # Discretization Methods Topics Equations and The Goal Brief overview.
Partial Derivatives Example: Find If solution: Partial Derivatives Example: Find If solution: gradient grad(u) = gradient.
Copyright © Cengage Learning. All rights reserved.
9 Nov B - Introduction to Scientific Computing1 Sparse Systems and Iterative Methods Paul Heckbert Computer Science Department Carnegie Mellon.
Linear Systems Numerical Methods. 2 Jacobi Iterative Method Choose an initial guess (i.e. all zeros) and Iterate until the equality is satisfied. No guarantee.
Solving Partial Differential Equation Numerically Pertemuan 13 Matakuliah: S0262-Analisis Numerik Tahun: 2010.
Programming assignment # 3 Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Laplace and Earnshaw1 Laplace Potential Distribution and Earnshaw’s Theorem © Frits F.M. de Mul.
Ch. 12 Partial Differential Equations
1 Variational and Weighted Residual Methods. 2 Introduction The Finite Element method can be used to solve various problems, including: Steady-state field.
2. Maxwell's Equations and Light Waves
Math for CS Heat Equation. Laplace Equation.
Solving Linear Systems Ax=b
Numerical Analysis Lecture12.
Finite Element Method To be added later 9/18/2018 ELEN 689.
Vanishing Potential from Two Point Charges
Scientific Computing Partial Differential Equations Implicit Solution of Heat Equation.
topic16_cylinder_flow_relaxation
Finite element method.
topic4: Implicit method, Stability, ADI method
topic4: Implicit method, Stability, ADI method
Numerical Analysis Lecture11.
Presentation transcript:

Scientific Computing Partial Differential Equations Poisson Equation

Partial Differential Equations Our study of PDE’s has focused on linear, second-order equations The following general form of such PDE’s can be classified by B 2 - 4AC (Variables – x and y/t)

Partial Differential Equations B 2 -4AC Category Example < 0 EllipticLaplace equation (steady state with 2 spatial dimensions) = 0 ParabolicHeat conduction equation (time variable with one spatial dimension) >0HyperbolicWave equation (time-variable with one spatial dimension)

Multi-dimensional Heat Equation Consider an object in which the temperature is a function of more than just the x-direction. Then the heat conduction equation can be written: – 2-D: – 3-D:

2-D Steady State The Steady State solution for the Heat Equation requires that the temperature reaches an equilibrium distribution, that is we have Then, This is called Laplace’s Equation or the Potential Equation.

The Laplace Equation Models a variety of problems involving the potential of an unknown variable u(x,y) The solution of this equation is used in thermodynamics (steady state of heat flow), fluid flow (finding potential function), and other problems where we are calculating the potential of some quantity.

The Poisson Equation Models a variety of problems involving the potential of an unknown variable u(x,y) where the right side of the equality is non-zero. For example, in calculations involving an Electric Field.

Electric Potential The electric field is related to the charge density by the divergence relationship: (Gauss’s Law) The electric field is related to the electric potential by a gradient relationship Therefore the potential is related to the charge density by Poisson's equation In a charge-free region of space, this becomes Laplace's equation Note: is called the Laplacian operator = sum of 2 nd partials

Poisson’s equation: Example Show that the 2D potential distribution satisfies the Poisson’s equation Let’s evaluate the Laplacian operator: Thus,

Poisson vs Potential Laplace’s Equation or Potential Equation: Poisson Equation:

Solution Method Both the Laplace and Poisson Equations involve calculating the Laplacian Operator. We will approximate this sum of derivatives based on a grid in x and y and centered finite differences:

Solution Method Here h = Δx and k = Δy (i,j) (i+1,j) (i-1,j) (i,j+1) (i,j-1)

Solution Method Thus, for the Poisson Equation For the Potential (Laplace) equation we have

Solution Method The equation is valid at all interior points of the grid. What about the boundary?

Boundary Conditions Simplest boundary conditions specify value of u(x,y) on each of the fours sides of the region (grid) 0 ≤ x ≤ 1, 0 ≤ y ≤ 1

Solution Method If we assume h = k, we get for the Poisson Equation (putting lower i, j terms first) For the Potential (Laplace) equation we have

Solution Method If we negate the Poisson equation and re-write we get: Consider the interior node equations for j=1:

Solution Method If we let Then, we can write the equations on the previous slide as where

Solution Method Now, consider the interior node equations for j=2:

Solution Method If we let Then, we can write the equations on the previous slide as

Solution Method Similarly, for j=3,4,…,n-2 we can write the equations as where

Solution Method Now, consider the interior node equations for j=n-1:

Solution Method If we let Then, we can write the equations on the previous slide as

Solution Method If we let Then, we can write the entire (grid interior) system of equations as:

Solution Method

The matrix A is sparse, block-tridiagonal (for the way we set up the vector for u), symmetric, and positive definite (x t A x > 0 for all x). Also, A is a (n-1) 2 x (n-1) 2 matrix.

Solution Method Since A is positive definite, the eigenvalues of A will be positive, so A is invertible. The solution exists as Now, this solution is not ideal, as it is computationally expensive to find the inverse of A. We could instead use Gaussian Elimination or LU factorization to solve for u, but this is not optimal, as A has a lot of zeroes, so we are wasting operations.

Iterative Solution Method It turns out (no proof) that our iterative methods from earlier in the course work well for this system. Review: The iterative methods we looked at to solve Ax=B were: – Jacobi Method – Gauss-Seidel Method – SOR (Successive Over-Relaxation)

Jacobi Iterative Formula Jacobi Iteration: D=diagonal of A. x (k+1) = D -1 (B + (D-A) x (k) ) Element-wise, this is

Jacobi Iterative Formula In our case the x vector is and x i k+1 corresponds to solving for the diagonal terms in Ax=B, thus in our case of the Jacobi equation becomes Now, after adding back the terms from the vector b, we get

Jacobi Iterative Formula So, we initialize u i,j 0 on the boundary of the grid, and set the interior values to some start values, say u ij = 1, then use the Jacobi iteration formula repeatedly to converge to the solution, keeping tabs on the error in our approximation.

Matlab Implementation function [x y u] = explicitPoisson(f, f0, f1, g0, g1, n) %Explicit solution of wave equation % Constants and vectors h = 1/n; x = 0:h:n*h; y = 0:h:n*h; % Initial guess at u is u=1 for all x,y u = ones(n+1,n+1); % Boundary conditions u(1:n+1, 1) = f0(x); u(1:n+1, n+1) = f1(x); u(1, 1:n+1) = g0(y); u(n+1, 1:n+1) = g1(y); % unew = next iterate, err will measure the error from % one iteration to next unew = u; err= unew-u;

Matlab Implementation % Iterative procedure epsilon = 1e-4; % tolerance for convergence imax = 1000; % maximum number of iterations allowed k = 1; % initial index value for iteration % Calculation loop while k<= imax for i = 2:n for j = 2:n unew(i,j)=(-h^2*f(i,j) + u(i-1,j)+u(i+1,j) +u(i,j-1)+u(i,j+1))/4.0; err(i,j) = abs(unew(i,j)-u(i,j)); end; u = unew; k = k + 1; errmax = max(max(err)); if errmax < epsilon u = u'; mesh(x,y,u); fprintf('Convergence for %i iterations.\n',k); return; end; end