PHY307F/407F - Computational Physics Background Material for Expt. 3 - Heat Equation David Harrison

Similar documents
Donald Fussell. October 28, Computer Science Department The University of Texas at Austin. Point Masses and Force Fields.

Ph 20.3 Numerical Solution of Ordinary Differential Equations

Quantum algorithms (CO 781, Winter 2008) Prof. Andrew Childs, University of Waterloo LECTURE 15: Unstructured search and spatial search

lecture 36: Linear Multistep Mehods: Zero Stability

Now multiply the left-hand-side by ω and the right-hand side by dδ/dt (recall ω= dδ/dt) to get:

Projectile Motion with Air Resistance (Numerical Modeling, Euler s Method)

Physically Based Modeling CS Notes Spring 1997 Particle Collision and Contact

ma x = -bv x + F rod.

Feature Extraction Techniques

Comparison of Stability of Selected Numerical Methods for Solving Stiff Semi- Linear Differential Equations

Some Perspective. Forces and Newton s Laws

12 Towards hydrodynamic equations J Nonlinear Dynamics II: Continuum Systems Lecture 12 Spring 2015

Kinematics and dynamics, a computational approach

A note on the multiplication of sparse matrices

AN APPLICATION OF CUBIC B-SPLINE FINITE ELEMENT METHOD FOR THE BURGERS EQUATION

13.2 Fully Polynomial Randomized Approximation Scheme for Permanent of Random 0-1 Matrices

Ch 12: Variations on Backpropagation

Finite fields. and we ve used it in various examples and homework problems. In these notes I will introduce more finite fields

Explicit Approximate Solution for Finding the. Natural Frequency of the Motion of Pendulum. by Using the HAM

e-companion ONLY AVAILABLE IN ELECTRONIC FORM

Combining Classifiers

Chapter 6 1-D Continuous Groups

COS 424: Interacting with Data. Written Exercises

PHY 171. Lecture 14. (February 16, 2012)

Vector Spaces in Physics 8/6/2015. Chapter 4. Practical Examples.

Extension of CSRSM for the Parametric Study of the Face Stability of Pressurized Tunnels

13 Harmonic oscillator revisited: Dirac s approach and introduction to Second Quantization

Physics 139B Solutions to Homework Set 3 Fall 2009

Pattern Recognition and Machine Learning. Artificial Neural networks

Solving initial value problems by residual power series method

lecture 37: Linear Multistep Methods: Absolute Stability, Part I lecture 38: Linear Multistep Methods: Absolute Stability, Part II

Supplementary Information for Design of Bending Multi-Layer Electroactive Polymer Actuators

Ocean 420 Physical Processes in the Ocean Project 1: Hydrostatic Balance, Advection and Diffusion Answers

Kernel Methods and Support Vector Machines

Physics 221A: HW3 solutions

Measuring Temperature with a Silicon Diode

The path integral approach in the frame work of causal interpretation

Numerical Solution of the MRLW Equation Using Finite Difference Method. 1 Introduction

This model assumes that the probability of a gap has size i is proportional to 1/i. i.e., i log m e. j=1. E[gap size] = i P r(i) = N f t.

BALLISTIC PENDULUM. EXPERIMENT: Measuring the Projectile Speed Consider a steel ball of mass

Intelligent Systems: Reasoning and Recognition. Perceptrons and Support Vector Machines

Pattern Recognition and Machine Learning. Artificial Neural networks

Quantum Chemistry Exam 2 Take-home Solutions

UCSD Spring School lecture notes: Continuous-time quantum computing

On Lotka-Volterra Evolution Law

A Self-Organizing Model for Logical Regression Jerry Farlow 1 University of Maine. (1900 words)

Pattern Recognition and Machine Learning. Learning and Evaluation for Pattern Recognition

10.3 Spectral Stability Criterion for Finite-Difference Cauchy Problems

1 Brownian motion and the Langevin equation

Numerically repeated support splitting and merging phenomena in a porous media equation with strong absorption. Kenji Tomoeda

Intelligent Systems: Reasoning and Recognition. Artificial Neural Networks

4 = (0.02) 3 13, = 0.25 because = 25. Simi-

OSCILLATIONS AND WAVES

lecture 35: Linear Multistep Mehods: Truncation Error

Generalized AOR Method for Solving System of Linear Equations. Davod Khojasteh Salkuyeh. Department of Mathematics, University of Mohaghegh Ardabili,

Tutorial Exercises: Incorporating constraints

Block designs and statistics

Physics 215 Winter The Density Matrix

Bipartite subgraphs and the smallest eigenvalue

The Solution of One-Phase Inverse Stefan Problem. by Homotopy Analysis Method

The Weierstrass Approximation Theorem

Lecture 21. Interior Point Methods Setup and Algorithm

Lecture 42 Determining Internal Node Values

DRAFT. Memo. Contents. To whom it may concern SVN: Jan Mooiman +31 (0) nl

Seismic Analysis of Structures by TK Dutta, Civil Department, IIT Delhi, New Delhi.

Lecture 20 November 7, 2013

i ij j ( ) sin cos x y z x x x interchangeably.)

Dispersion. February 12, 2014

A note on the realignment criterion

Hee = ~ dxdy\jj+ (x) 'IJ+ (y) u (x- y) \jj (y) \jj (x), V, = ~ dx 'IJ+ (x) \jj (x) V (x), Hii = Z 2 ~ dx dy cp+ (x) cp+ (y) u (x- y) cp (y) cp (x),

Problem Set 2. Chapter 1 Numerical:

Chapter 1: Basics of Vibrations for Simple Mechanical Systems

Optimizing energy potentials for success in protein tertiary structure prediction Ting-Lan Chiu 1 and Richard A Goldstein 1,2

Lecture 8 Symmetries, conserved quantities, and the labeling of states Angular Momentum

Stability Analysis of the Matrix-Free Linearly Implicit 2 Euler Method 3 UNCORRECTED PROOF

ASSUME a source over an alphabet size m, from which a sequence of n independent samples are drawn. The classical

1 Bounding the Margin

Massachusetts Institute of Technology Quantum Mechanics I (8.04) Spring 2005 Solutions to Problem Set 4

Estimating Parameters for a Gaussian pdf

Bernoulli Wavelet Based Numerical Method for Solving Fredholm Integral Equations of the Second Kind

Multi-Scale/Multi-Resolution: Wavelet Transform

Principles of Optimal Control Spring 2008

I. Understand get a conceptual grasp of the problem

Comparison of Charged Particle Tracking Methods for Non-Uniform Magnetic Fields. Hann-Shin Mao and Richard E. Wirz

RESTARTED FULL ORTHOGONALIZATION METHOD FOR SHIFTED LINEAR SYSTEMS

First of all, because the base kets evolve according to the "wrong sign" Schrödinger equation (see pp ),

Department of Physics, Sri Venkateswara University, Tirupati Range Operations, Satish Dhawan Space Centre SHAR, ISRO, Sriharikota

Model Fitting. CURM Background Material, Fall 2014 Dr. Doreen De Leon

Explicit Analytic Solution for an. Axisymmetric Stagnation Flow and. Heat Transfer on a Moving Plate

Non-Parametric Non-Line-of-Sight Identification 1

Problem Set 8 Solutions

Scattering and bound states

Modeling Chemical Reactions with Single Reactant Specie

Reed-Muller Codes. m r inductive definition. Later, we shall explain how to construct Reed-Muller codes using the Kronecker product.

An earlier article in this column considered the problem

Numerical Studies of a Nonlinear Heat Equation with Square Root Reaction Term

A Simple Regression Problem

Finding Rightmost Eigenvalues of Large Sparse. Non-symmetric Parameterized Eigenvalue Problems. Abstract. Introduction

arxiv: v1 [stat.ml] 31 Jan 2018

Midterm 1 Sample Solution

Transcription:

INTRODUCTION PHY37F/47F - Coputational Physics Background Material for Expt 3 - Heat Equation David Harrison In the Pendulu Experient, we studied the Runge-Kutta algorith for solving ordinary differential equations (ODEs) Here, we study techniques for solving partial differential equations (PDEs) The general proble of solving PDEs is huge; Press et al in Nuerical Recipes clai it requires an entire book However, there are soe siple cases Separation of Variables: Consider the Schrödinger equation: h / Ψ(x,t) x +V(x)Ψ(x,t)ih Ψ(x,t) t () If we assue that the wavefunction can be written as a function of position ties a function of tie: then: Ψ(x,t) ψ(x)φ(t) h d / ψ(x) ψ(x) dx +V(x)ψ(x) ih φ(t) dφ c () dt where c is a constant Thus we have turned the proble into two ordinary differential equations First order PDEs: If the equations are linear, then a closed solution can easily be found If the equations are non-linear, a faily of paraetric solutions can be found The standard Matheatica package Calculus PDSolve handles this latter case Second order PDEs: There are two general classes of these: Poisson, soeties called "elliptic" 7

-- Cauchy, soeties called "initial value" The Poisson equation is, of course: u u + x y ρ(x,t) (3) This type of equation turns out to be very easy to solve using a technique called a relaxation ethod The Cauchy class of second order PDEs is subdivided further: i The wave equation (a hyperbolic for): ii u v u t x The heat equation (a parabolic for): (4) u u c (5) t x x For both of these, you will discover that stability is a proble: any reasonable looking algoriths just don t work unless care is taken In this Experient, we will concentrate on the heat equation Usually, u is the teperature We will assue that we are solving the equation for a one diensional slab of width L We will usually assue that c is a constant so the heat equation becoes: u(x,t) u(x,t) c t x We will adopt units where x/l x and tc/l t, so the heat equation is now: u(x,t) u(x,t) t x x These notes are organised as follows: I Explicit algorith II III Iplicit algorith Crank-Nicholson algorith (6)

-3- IV Schrödinger s equation V References Note that the "usual" code listing is not included in this docuent That is because you will be odifying soe of the code to produce a new procedure, and cutting and pasting the code within the notebook is the siplest way to do this Thus, the code listing appears in the notebook instead of these suppleentary notes for the Experient I EXPLICIT ALGORITHM We iagine that we divide our one diensional slab into n interior points, and will call the distance between each point x We will step through tiesteps We will be using the notation that: u j u(x j j x,t ) j n+ (n+) x,,, (I) (tie ) 4 3 3 4 5 6 n- n- n n+ j (position j x) We will write the initial condition as: u j g (x) (I) and the boundary conditions as: u α β u n+ It is reasonable to write the left hand side of the heat equation, Equation (6), as: (I3a) (I3b)

-4- u u + j u j t We write the right hand side of Equation (6) as: u x xj u x xj + u x xj (I4) / x (I5) Note that we write u/ x evaluated at two points that are not on our grid This doesn t atter because: Thus, Equation (I5) becoes: u x xj + u x xj u(x,t) x xj u j+ x u j u j u j x x u j+ u j +u j (I6) The above way of solving the second-order partial derivative is called the ethod of finite differences so: The heat equation states that Equation (I4) equals Equation (I6): u j + u j x u j+ u j +u j (I7) u + j u j + x u j+ u j +u j (I8) Note that the right hand side of Equation (I8) contains values of u at tie t, and these ters are cobined to give the value of u at the later tie t + (+) Once the values of u at tie t + (+) are known we can then find the values at t + (+), and so on Thus we can solve the heat equation for all values of t using this explicit algorith The deterination of u j + depends on knowing the values of u at three positions at the earlier tie:

-5- + j- j j+ Note that this schee does not allow one to deterine u + because we have no values for u But that does not atter: u + is the value of u at the left side of the slab, and is given by the boundary condition Equation (I3a) Siilarly the boundary condition Equation (I3b) gives the value for u + n+ So Equation (I8) is used only to evaluate the interior values of u + The above way of solving the heat equation is pretty siple Of the three algoriths you will investigate to solve the heat equation, this one is also the fastest and also can give the ost accurate result However, the result will be accurate only if you choose tiesteps and a space grid size x such that: ( x) µ Solutions produced in violation of Equation (I9) will be unstable, often producing ridiculous results Note that this eans that for a given tiestep the space grid size x can not be too sall For a given space grid size, the tiestep can not be too big We will discuss later in this docuent the fact that even if the tiestep and space grid satisfy Equation (I9), the explicit algorith can still produce wrong results for soe physical systes The reasons for the instability of the explicit algorith is soewhat beyond the level of this course; consult the references for further inforation However, we can justify Equation (I9) (I9) Golub and Ortega, 8

-6- The heat equation also governs the diffusion of, say, a sall quantity of perfue in the air You probably already know that diffusion is a for of rando walk so after a tie t we expect the perfue has diffused a distance x t One solution to the heat equation gives the density of the gas as a function of position and tie: u (x,t) ρ(x,t) e x σ σ (I) where: σ ct and c is the heat constant defined in Equation (5), for which we usually have been choosing units so that it equals In a diffusion context c is often called the diffusion constant Equation (I) shows that the density of the diffusing gas is a Gaussian, and that the standard deviation describing the width of the Gaussian increases as the square root of t This eans that in a tie, the olecules travel a distance x on the order of: x c Thus, if we are solving the equations using an explicit algorith, for a given : x (I) since otherwise the distribution is not spreading as fast as we know it should A trivial rearrangeent of Equation (I) gives: which is just Equation (I9) II IMPLICIT ALGORITHM ( x) Consider the following equation and copare it to Equation (I7) fro the previous section: u + u j ( x) (u + j+ u + j +u + j ) (II) Here we are evaluating u/ x using finite differences at tie t + instead of t A oent s reflection should convince you that Equation (II) is just as reasonable as Equation (I7) We rearrange Equation (II):

-7- (+µ)u + j µ(u + j+ +u + j ) u j (II) where recall that: µ ( x) Thus we are trying to find u at ties + at three different positions j-, j and j+ fro a single value of u at the earlier tie + j- j j+ At first glance, this is ipossible However, consider an (n+) (n+) identity atrix Id: Id an (n+) (n+) (,-) triangular atrix A: A and an n+ diensional colun atrix b :

-8- b µα µβ Then the entire set of equations for all values of j given by Equation (II) can be written as: (Id + µa)u + u +b (II3) where: u u u u u n u n+ If we know u, the values of u at tie, Equation (II3) ay be solved for u + using, for exaple, the LU decoposition that you studied in the Exercise The above technique for solving the heat equation is called an iplicit algorith You will discover in the Experient that this algorith is stable for all values of µ That is the good news There is also soe bad news: the iplicit technique is uch slower than the explicit one and is also uch less accurate for a given value of tiestep and space grid size x III CRANK-NICHOLSON ALGORITHM The explicit algorith begins with: u + u j ( x) (u j+ u j +u j ) while the iplicit one begins with: u + u j ( x) (u + j+ u + j +u + j ) Average these two equations:

-9- u + u j ( x) (u j+ u j +u j +u + j+ u + j +u + j )) (III) In ters of the atrices defined in the previous section, we can write Equation (III) as: µ (Id + A)u + µ (Id A)u +b (III) This equation is, of course, solvable using LU decoposition We are finding the values of u + j, u + j and u + j+ fro the values of u j,u j and u j+ + j- j j+ The above is the Crank-Nicholson algorith You will discover that it aintains the absolute stability of the iplicit algorith while recovering soe of the accuracy of the explicit one IV SCHRÖDINGER S EQUATION Assuing h and /, Schrödinger s equation is: i Ψ(x,t) HΨ(x,t) t H +V(x) x (IV) In the late 96 s, Goldberg, Schey and Schwartz had a good idea for a lecture deonstration in quantu echanics 3 They decided to solve this equation using thennew coputer technology to produce a ovie The initial conditions for Equation (IV) are 3 Goldberg, Schey and Schwartz, Aer Jour Phys 35, (967) 77

-- Ψ(x,)g(x) and the boundary conditions are: Ψ(,t) Ψ(,t) The solution to Equation (IV) can be written as: Ψ(x,t) e iht Ψ(x, ) (IV) Expand Equation (IV) and throw out higher order ters: Ψ(x,t + ) ( iht)ψ(x,t) (IV3) Thus if we know Ψ(x,t) we can produce a tie series of values for Ψ at ties t+, t+, Using finite differences to evaluate the / x ter in the Hailtonian H, the right hand side of Equation (IV3) will give a ter involving (Ψ j Ψ j +Ψ j+ ) This should be recognisable to you as an explicit algorith We can ultiply Equation (IV) by e iht and expand to get: ( + iht)ψ(x,t + ) Ψ(x,t) (IV4) Now evaluating the Hailtonian using finite differences will give a ter involving (Ψ + j Ψ + j +Ψ + j+ ) on the left hand side This is, of course, just an iplicit algorith Everything we have said about explicit and iplicit algoriths applies to these cases too However, the physics of Quantu Mechanics puts an additional constraint on Ψ: x Ψ * (x,t)ψ(x,t)dx for all ties t This is called unitarity and physically eans that the probability that the object being described by the wave function is soewhere between x and x is one It has been known since long before the invention of the coputer that Equations (IV3) and (IV4) violate unitarity This eans that neither the explicit or iplicit algorith can be used to solve Schrödinger s equation because they both violate a physical principle A long-known equation that does not violate unitarity is called Cayley s for Multiply Equation (IV) by e iht/ and expand both sides: (IV5)

-- ( + i Ht)Ψ(x,t +)( i Ht)Ψ(x,t) (IV6) Using finite differences to evaluate the / x ters in the Hailtonian on both sides of the equation will give us a Crank-Nicholson algorith The lesson to be learned here is that just knowing the nuerical ethods is soeties not sufficient Just as for the pendulu, where the physics pointed us to the syplectic algorith, here the physics points us to a Crank-Nicholson algorith when solving Schrödinger s equation V REFERENCES Gene H Golub and Jaes M Ortega, Scientific Coputing and Differential Equations (Acadeic Press, 99), Chapter 7 Willia H Press, Brian P Flannery, Saul A Teukolsky, and Willia T Vetterling, Nuerical Recipes: The Art of Scientific Coputing or Nuerical Recipes in C: The Art of Scientific Coputing (Cabridge Univ Press), Chapter 7 Exaples of solving Poisson s equation using relaxation ethods, and a visualisation of Schrödinger s equation solved using a Crank-Nicholson algorith ay be found at: http://eeraldathbuffaloedu/ ringland/instruction/pde/ Copyright 998 David M Harrison This is version, date (/d/y) /8/98