Scientific Computing Partial Differential Equations Implicit Solution of Heat Equation.

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

Finite Difference Discretization of Hyperbolic Equations: Linear Problems Lectures 8, 9 and 10.
Partial Differential Equations
Computational Modeling for Engineering MECN 6040
Chapter 8 Elliptic Equation.
Parabolic Partial Differential Equations
MATH 685/ CSI 700/ OR 682 Lecture Notes
Linear Systems of Equations
SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.
CS 584. Review n Systems of equations and finite element methods are related.
Special Matrices and Gauss-Siedel
PARTIAL DIFFERENTIAL EQUATIONS
Lecture 34 - Ordinary Differential Equations - BVP CVEN 302 November 28, 2001.
Parabolic PDEs Generally involve change of quantity in space and time Equivalent to our previous example - heat conduction.
PDEs & Parabolic problems Jacob Y. Kazakia © Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y):
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
CSE 245: Computer Aided Circuit Simulation and Verification
1 Chapter 9 NUMERICAL SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS.
Lesson 5 Method of Weighted Residuals. Classical Solution Technique The fundamental problem in calculus of variations is to obtain a function f(x) such.
Finite Difference Methods to Solve the Wave Equation To develop the governing equation, Sum the Forces The Wave Equation Equations of Motion.
Ordinary Differential Equations (ODEs)
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.
1 Chapter 6 Numerical Methods for Ordinary Differential Equations.
Scientific Computing Partial Differential Equations Poisson Equation Calculus of Variations.
Scientific Computing Partial Differential Equations Explicit Solution of Wave Equation.
COMPUTATIONAL MODELING FOR ENGINEERING MECN 6040 Professor: Dr. Omar E. Meza Castillo Department.
Computational Optimization
Chapter 8 Objectives Understanding matrix notation.
Roots of a Polynomial: Root of a polynomial is the value of the independent variable at which the polynomial intersects the horizontal axis (the function.
Most physically significant large-scale atmospheric circulations have time scales on the order of Rossby waves but much larger than the time scales.
Scientific Computing Partial Differential Equations Poisson Equation.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Programming assignment #2 Solving a parabolic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Numerical Methods.
CSE 245: Computer Aided Circuit Simulation and Verification Matrix Computations: Iterative Methods I Chung-Kuan Cheng.
Lesson 3 CSPP58001.
Engineering Analysis – Computational Fluid Dynamics –
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Numerical Analysis – Differential Equation
Numerical Analysis. Numerical Analysis or Scientific Computing Concerned with design and analysis of algorithms for solving mathematical problems that.
Numerical methods 1 An Introduction to Numerical Methods For Weather Prediction by Mariano Hortal office 122.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 271 Boundary-Value.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 27.
Ch 8.2: Improvements on the Euler Method Consider the initial value problem y' = f (t, y), y(t 0 ) = y 0, with solution  (t). For many problems, Euler’s.
Ordinary Differential Equations
Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for.
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.
The story so far… ATM 562 Fovell Fall, Convergence We will deploy finite difference (FD) approximations to our model partial differential equations.
The formulae for the roots of a 3rd degree polynomial are given below
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 32.
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.
Finding Rightmost Eigenvalues of Large, Sparse, Nonsymmetric Parameterized Eigenvalue Problems Minghao Wu AMSC Program Advisor: Dr. Howard.
MA2213 Lecture 9 Nonlinear Systems. Midterm Test Results.
Chapter 30.
Scientific Computing Lab
We will be looking for a solution to the system of linear differential equations with constant coefficients.
Advanced Numerical Methods (S. A. Sahu) Code: AMC 51151
Chapter 27.
Scientific Computing Partial Differential Equations Implicit Solution of Heat Equation.
6.5 Taylor Series Linearization
Discrete Least Squares Approximation
topic4: Implicit method, Stability, ADI method
MATH 175: Numerical Analysis II
topic4: Implicit method, Stability, ADI method
Programming assignment #1 Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Home assignment #3 (1) (Total 3 problems) Due: 12 November 2018
Presentation transcript:

Scientific Computing Partial Differential Equations Implicit Solution of Heat Equation

Explicit vs Implicit Methods Explicit methods have problems relating to stability Implicit methods overcome this but at the expense of introducing a more complicated algorithm In the implicit algorithm, we develop simultaneous equations for u at the j-th and (j+1)-st time steps

Explicit Method We use the centered-difference approximation for u xx at time step j: grid point involved with space difference grid point involved with time difference

Implicit Method We use the centered-difference approximation for u xx at step (j+1) : grid point involved with space difference grid point involved with time difference

We use the forward-difference formula for the time derivative and the centered-difference formula for the space derivative at time step (j+1): Implicit Method

Then the heat equation (u t =cu xx ) can be approximated as Or, Let r = (ck/h 2 ) Solving for u i,j we get: Implicit Method

Putting in the boundary conditions, we get the following equations for the (implicit) solution to the heat equation is: Implicit Method

Matrix Form of Solution

This is of the form To solve for u(:,j) we need to use a linear systems method. Since we have to solve this system repeatedly, a good choice is the LU decomposition method. Matrix Form of Solution

function z = implicitHeat(f, g0, g1, T, n, m, c) %Simple Implicit solution of heat equation % Constants h = 1/n; k = T/m; r = c*k/h^2; % x and t vectors x = 0:h:1; t = 0:k:T; % Boundary conditions u(1:n+1, 1) = f(x)'; u(1, 1:m+1) = g0(t); u(n+1, 1:m+1) = g1(t); Matlab Implementation

% Set up tri-diagonal matrix for interior points of the grid A = zeros(n-1, n-1); % 2 less than x grid size for i= 1: n-1 A(i,i)= (1+2*r); if i ~= n-1 A(i, i+1) = -r; end if i ~= 1 A(i, i-1) = -r; end % Find LU decomposition of A [LL UU] = lu_gauss(A); % function included below Matlab Implementation

% Solve for u(:, j+1); for j = 1:m % Set up vector b to solve for in Ax=b b = zeros(n-1,1); b = u(2:n, j)'; % Make a column vector for LU solver b(1) = b(1) + r*u(1,j+1); b(n-1) = b(n-1) + r*u(n+1,j+1); u(2:n, j+1) = luSolve(LL, UU, b); end z=u'; % plot solution in 3-d mesh(x,t,z); end Matlab Implementation

Usage: f = inline(‘x.^4’); g0 = inline(‘0*t’); g1 = inline(‘t.^0’); n=5; m=5; c=1; T=0.5; z = implicitHeat(f, g0, g1, T, n, m, c); Matlab Implementation

Calculated solution appears stable: Matlab Implementation

To analyze the stability of the method, we again have to consider the eigenvalues of A for the equation We have Using the Gershgorin Theorem, we see that eigenvalues are contained in circles centered at (1+2r) with max radius of 2r Stability

Thus, if λ is an eigenvalue of A, we have Thus, all eigenvalues are at least 1. In solving for u(:,j+1) in we have Since the eigenvalues of A -1 are the reciprocal of the eigenvalues of A, we have that the eigenvalues of A -1 are all <= 1. Thus, the implicit algorithm yields stable iterates – they do not grow without bound. Stability

Convergence means that as  x and  t approach zero, the results of the numerical technique approach the true solution Stability means that the errors at any stage of the computation are attenuated, not amplified, as the computation progresses Truncation Error refers to the error generated in the solution by using the finite difference formulas for the derivatives. Convergence and Stability

Example : For the explicit method, it will be stable if r<= 0.5 and will have truncation error of O(k+h 2 ). Implicit Method is stable for any choice of r and will again have truncation error of O(k+h 2 ). It would be nice to have a method that is O(k 2 +h 2 ). The Crank-Nicholson method has this nice feature. Convergence and Stability

Crank-Nicholson Method We average the centered-difference approximation for u xx at time steps j and j+1: grid point involved with space difference grid point involved with time difference

Crank-Nicholson Method We get the following

Putting in the boundary conditions, we get the following equations for the (C-N) solution to the heat equation is: Crank-Nicholson Method

Class Project: Determine the matrix for the C-N method and revise the Matlab implicitHeat function to implement C-N. Crank-Nicholson Method