DEPARTMENT OF MATHEMATICS. The University of Queensland. MATH3203 Scientific Computation: Algorithmic Design and Implementation

Similar documents
Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C.

Lesson 9: Diffusion of Heat (discrete rod) and ode45

Introduction to PDEs and Numerical Methods: Exam 1

Finite difference method for elliptic problems: I

Math 5587 Lecture 2. Jeff Calder. August 31, Initial/boundary conditions and well-posedness

Lecture 8: Differential Equations. Philip Moriarty,

Lecture 1. Finite difference and finite element methods. Partial differential equations (PDEs) Solving the heat equation numerically

Applied Linear Algebra in Geoscience Using MATLAB

Linear Systems of Equations. ChEn 2450

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4

Core Mathematics 3 Algebra

BTCS Solution to the Heat Equation

2.2. Methods for Obtaining FD Expressions. There are several methods, and we will look at a few:

Chapter 18. Remarks on partial differential equations

The method of lines (MOL) for the diffusion equation

CHAPTER 1. FUNCTIONS 7

Numerical Methods - Numerical Linear Algebra

Linear Algebra Linear Algebra : Matrix decompositions Monday, February 11th Math 365 Week #4

A fast and well-conditioned spectral method: The US method


Final Exam May 4, 2016

Finite difference method for solving Advection-Diffusion Problem in 1D

Lecture 7. Heat Conduction. BENG 221: Mathematical Methods in Bioengineering. References

Poisson Solvers. William McLean. April 21, Return to Math3301/Math5315 Common Material.

1 Finite difference example: 1D implicit heat equation

Chapter 2 Boundary and Initial Data

13 PDEs on spatially bounded domains: initial boundary value problems (IBVPs)

AM 205: lecture 14. Last time: Boundary value problems Today: Numerical solution of PDEs

Diffusion / Parabolic Equations. PHY 688: Numerical Methods for (Astro)Physics

HOMEWORK 4: Numerical solution of PDEs for Mathmatical Models, Analysis and Simulation, Fall 2011 Report due Mon Nov 12, Maximum score 6.0 pts.

MATH 1207 R02 FINAL SOLUTION

Manifesto on Numerical Integration of Equations of Motion Using Matlab

Kasetsart University Workshop. Multigrid methods: An introduction

Chapter 2. Solving Systems of Equations. 2.1 Gaussian elimination

Finite Difference Methods for Boundary Value Problems

Diffusion Processes. Lectures INF2320 p. 1/72

Tutorial 2. Introduction to numerical schemes

Diffusion - The Heat Equation

Matrix decompositions

1 Last time: least-squares problems

ECE580 Solution to Problem Set 6

Ch 4 Differentiation

Introduction. Math 1080: Numerical Linear Algebra Chapter 4, Iterative Methods. Example: First Order Richardson. Strategy

SCORE BOOSTER JAMB PREPARATION SERIES II

Algebra Year 10. Language

Computational Fluid Dynamics Prof. Sreenivas Jayanti Department of Computer Science and Engineering Indian Institute of Technology, Madras

Applied Math Qualifying Exam 11 October Instructions: Work 2 out of 3 problems in each of the 3 parts for a total of 6 problems.

Math 1080: Numerical Linear Algebra Chapter 4, Iterative Methods

2. If the discriminant of a quadratic equation is zero, then there (A) are 2 imaginary roots (B) is 1 rational root

Hani Mehrpouyan, California State University, Bakersfield. Signals and Systems

MATH 3511 Lecture 1. Solving Linear Systems 1

Discretization of PDEs and Tools for the Parallel Solution of the Resulting Systems

The Heat Equation with partial differential equations

Solving Ax = b w/ different b s: LU-Factorization

Chapter 3 Second Order Linear Equations

x n+1 = x n f(x n) f (x n ), n 0.

Iterative Methods for Linear Systems

An Introduction to Numerical Methods for Differential Equations. Janet Peterson

Lecture 16: 9.2 Geometry of Linear Operators

An Introduction to Physically Based Modeling: An Introduction to Continuum Dynamics for Computer Graphics

AMSC/CMSC 466 Problem set 3

Background. Background. C. T. Kelley NC State University tim C. T. Kelley Background NCSU, Spring / 58

Mathematics Algebra. It is used to describe the world around us.

Math 10b Ch. 8 Reading 1: Introduction to Taylor Polynomials

Numerical modeling of rock deformation: 06 FEM Introduction

Integration of Rational Functions by Partial Fractions

A primer on matrices

Matrix decompositions

Math 415 Exam I. Name: Student ID: Calculators, books and notes are not allowed!

Chapter 7. Tridiagonal linear systems. Solving tridiagonal systems of equations. and subdiagonal. E.g. a 21 a 22 a A =

CHAPTER 4. Introduction to the. Heat Conduction Model

1 One-Dimensional, Steady-State Conduction

Math 51 Second Exam May 18, 2017

The Relativistic Heat Equation

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF MATHEMATICS ACADEMIC YEAR / EVEN SEMESTER QUESTION BANK

The variational iteration method for solving linear and nonlinear ODEs and scientific models with variable coefficients

Integration of Rational Functions by Partial Fractions

The Process. 218 Technical Applications of Computers

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

Data Analysis and Manifold Learning Lecture 2: Properties of Symmetric Matrices and Examples

Multi-Factor Finite Differences

ADMISSIONS EXERCISE. MSc in Mathematical and Computational Finance. For entry 2018

Numerical Solutions to Partial Differential Equations

Multiple Degree of Freedom Systems. The Millennium bridge required many degrees of freedom to model and design with.

Chapter 2. Solving Systems of Equations. 2.1 Gaussian elimination

Boundary regularity of solutions of degenerate elliptic equations without boundary conditions

Solutions of separable equations often are in an implicit form; that is, not solved for the dependent variable.

Integration by parts Integration by parts is a direct reversal of the product rule. By integrating both sides, we get:

arxiv: v3 [math.na] 1 Jan 2015

Domain decomposition schemes with high-order accuracy and unconditional stability

Special Two-Semester Linear Algebra Course (Fall 2012 and Spring 2013)

9. Iterative Methods for Large Linear Systems

The continuity method

OCEAN/ESS 410. Class 3. Understanding Conductive Cooling: A Thought Experiment. Write your answers on the exercise sheet

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations

Problem set 3: Solutions Math 207B, Winter Suppose that u(x) is a non-zero solution of the eigenvalue problem. (u ) 2 dx, u 2 dx.

CS227-Scientific Computing. Lecture 4: A Crash Course in Linear Algebra

Solution to Homework 1

MATH 423 Linear Algebra II Lecture 11: Change of coordinates (continued). Isomorphism of vector spaces.

Introduction to PDEs and Numerical Methods Lecture 7. Solving linear systems

Transcription:

DEPARTMENT OF MATHEMATICS The University of Queensland MATH303 Scientific Computation: Algorithmic Design and Implementation Section A Boundary Value Problem in dimension Semester, 00 A simplified problem leading to an ordinary differential equation In the past sections we have considered differential equations whose solutions were dependent on the time variable. The main physical illustration of this was the heat transfer, but we assumed a uniform temperature distribution in the material. This is rarely the case and one can expect to have a varying temperature with respect to space, and this will result in the diffusion of heat. The math model for this is also a differential equation, but at least one of the independent variables must be space. The simplest boundary value problems have the form du κ + cu = f ( x) and boundary conditions u(0), u() given. () u = u(x) represents temperature and is an unknown function of x, and x is in some finite interval, say [0,]. κ is the thermal conductivity, and for small changes in temperature we assume it can be approximated by a constant. If the interval has length other than unity we can scale x and define κ and c accordingly. The function f can have many forms: (i) f = f(x) could be a heat source such as electrical resistance in a wire, (ii) f = c(usur4 - u4) from radiative cooling.

Also, there are types of boundary conditions which reflect how fast heat passes through the boundary. We have derived already set up partial differential equations similar to () based on Fourier's Heat Law: (a) heat flows from hot to cold, (b) the change in heat is proportional to the cross sectional area, change in time, and the gradient of the temperature. The d.e. for heat flow or heat diffusion in a thin wire can be obtained by the following argument Consider a thin wire so that there is diffusion in only one direction, x. Then f has units of (heat)/(volume time). If there is no time dependence for the temperature, then Fourier's heat law for a thin wire when coupled with Newton's law of cooling to the surrounding region takes the form: zero heat change in heat content is approximately equal to (heat from electrical resistance) + (cooling from surrounding region) + (heat from diffusion from the left and right ends). If r is the radius of the wire and A = π r, then the above relation becomes du( x + h) du( x h) 0 f ( xha ) + h πrcu ( ext u) + κ A κ A κ is the constant of proportionality and will depend on the type of material in the wire. Divide both sides of this approximation by ha and let h go to zero to get a variation of (). du c c κ + u = f( x) + u ext () r r Solution of the differential equation by finite differences If κ, c and f are constants, then the closed form solution of () or () is relatively easy to find. However, if they are more complicated or if we have diffusion (or conduction - same thing) in two and three dimensional space, then closed form solutions are harder to find. An alternative is the

finite difference method which is a way of converting continuum problems such as () or () into a finite set of algebraic equations. We approximate the second derivative by approximating it with difference quotients. Thus du du' u'( x+ h) u'( x = h ux ( + h) ux ( ) Now u'( x), so putting this into the previous expression h ux ( + h) ux ( ) ux ( + h) ux ( ) h h = h h du ux ( + h) ux ( + h) ux ( ux ( ) ux ( h) We could equally have used u'( x) then we would have h obtained an expression symmetric about x, thus du ux ( + h) ux ( ) + ux ( h). One reason for preferring this might be h that we don t know whether the values ahead of or behind x are the more important. Here we've assume equal spacing either before or ahead of the current value of x. Effectively we've divided the wire into n equal parts with 0 xi = ih and h=. We denote u(0 + ih) = u( ih) = ui n With u ext = 0 the finite difference method (or discrete model approximation) to () is ui ui + ui c κ + + ui = f i, for 0 < i < n (3) h r ) ) This gives n equations for n unknowns. The end points u l = u(0) and u n = u() are given as is f i = f(x i ).

The discrete system (3) may be written in matrix form. For ease of notation we multiply (3) by h, let B = κ + h c/r, and n = 5 so that there are 4 equations and 4 unknowns. Bu κu = h f + κu 0 u Bu κu3 h f u Bu3 κu4 h f3 u3 Bu4 h f4 κu5 κ + = κ + = κ + = + The matrix form of this is the tridiagonal system AU = F where A is, in general an ( n ) ( n ) tridiagonal matrix and U and F are ( n -) column vectors. a c 0 0 b A = 0 0 (4) cn 0 0 bn a n Solution of the linear system The solution can be obtained by either using the tridiagonal (or Thomas) algorithm, or using a solver that is provided with Matlab or other mathematical software. Let us consider the tridiagonal system Ax = d where A is given in (4) and x and d are column vectors. The following important algorithm computes the LU factorisation of a tridiagonal matrix. It can be found in the book by Atkinson, Introduction to Numerical Analysis. The book is in the list of reference books for the course. If L and U are lower and unit upper bidiagonal matrices

α 0 0 γ 0 0 b 0 0 L and U = = 0 0 γ n 0 0 bn αn 0 0 such that LU =A, then we solve Au = f with the process LUu = f, so solve Ly = f and Uu = y. The tridiagonal LU factorisation algorithm is. c α = a γ = α n n n n ci αi = ai biγi γi =, i=,3,... n α α = a bγ. i We can integrate the solution process with the computation of the LU factors. To see this, consider solving Ly=f. To find y we only need α, and in general, to find y i we only need y i-, b i (which is given) and α. After finding y we can solve Uu = f as a normal back substitution. Matlab code for solution of the thin wire model The following function finds an approximate solution of the boundary value problem du c c κ + u = f( x) + u, (0) 0, () ext u = u u = u. r r It is set up to approximate u at an equally spaced set of points. The values of f(x) are input, computed at a set of equally spaced points and the external temperature u ext has been set to zero. function [u,x] = wire_model(k,c,r,u0,u,f) % Evaluates the numerical solution of an o.d.e

% which models heat conduction in a metal wire % Written by John A. Belward (himself) on August 9th, 00 % Last updated on August 9th 00 % Usage: [u,x] = wire_model(k,c,r,u0,u,f) % where k is the conductivity, c the rate of heat loss due to cooling % r the radius, u0, u end temperatures, f the heat input vector % of length n-. % u and x are n+ vectors of the temperature u at points x n=length(f)+; h = /n; x = 0:h:; rhs=h^*f; rhs() = rhs()+k*u0; rhs(n-)=rhs(n-)+k*u; b=(*k+h^**(c/r)*ones(length(rhs),)); cvec =-k*ones(n-,); a=diag(b); a=a+diag(cvec,); a=a+diag(cvec,-); rhs; u=a\rhs; u(:n)=u; u()=u0; u(n+) = u; The following plots are 5 obtained with the calls: 0 5 [u,x] = wire_model(.00,.0,.3,0,0,f) [u,x] = wire_model(.00,.0,.,0,0,f) [u,x] = wire_model(.00,.0,.,0,0,f) 0 0 0. 0.4 0.6 0.8 f being a 9-vector, all elements equal to unity.