FTCS Solution to the Heat Equation

Similar documents
FTCS Solution to the Heat Equation

[ ] 2. [ ]3 + (Δx i + Δx i 1 ) / 2. Δx i-1 Δx i Δx i+1. TPG4160 Reservoir Simulation 2018 Lecture note 3. page 1 of 5

J i-1 i. J i i+1. Numerical integration of the diffusion equation (I) Finite difference method. Spatial Discretization. Internal nodes.

P R = P 0. The system is shown on the next figure:

Linear Response Theory: The connection between QFT and experiments

Approximate Analytic Solution of (2+1) - Dimensional Zakharov-Kuznetsov(Zk) Equations Using Homotopy

Volatility Interpolation

HEAT CONDUCTION PROBLEM IN A TWO-LAYERED HOLLOW CYLINDER BY USING THE GREEN S FUNCTION METHOD

( ) () we define the interaction representation by the unitary transformation () = ()

Mechanics Physics 151

Department of Economics University of Toronto

Density Matrix Description of NMR BCMB/CHEM 8190

Mechanics Physics 151

WiH Wei He

Graduate Macroeconomics 2 Problem set 5. - Solutions

DEEP UNFOLDING FOR MULTICHANNEL SOURCE SEPARATION SUPPLEMENTARY MATERIAL

Handout # 6 (MEEN 617) Numerical Integration to Find Time Response of SDOF mechanical system Y X (2) and write EOM (1) as two first-order Eqs.

Density Matrix Description of NMR BCMB/CHEM 8190

Lecture 18: The Laplace Transform (See Sections and 14.7 in Boas)

Ordinary Differential Equations in Neuroscience with Matlab examples. Aim 1- Gain understanding of how to set up and solve ODE s

Lecture 6: Learning for Control (Generalised Linear Regression)

Notes on the stability of dynamic systems and the use of Eigen Values.

Chapter Lagrangian Interpolation

Let s treat the problem of the response of a system to an applied external force. Again,

Solution in semi infinite diffusion couples (error function analysis)

3. OVERVIEW OF NUMERICAL METHODS

John Geweke a and Gianni Amisano b a Departments of Economics and Statistics, University of Iowa, USA b European Central Bank, Frankfurt, Germany

Comb Filters. Comb Filters

2/20/2013. EE 101 Midterm 2 Review

CS286.2 Lecture 14: Quantum de Finetti Theorems II

The Finite Element Method for the Analysis of Non-Linear and Dynamic Systems

Li An-Ping. Beijing , P.R.China

( t) Outline of program: BGC1: Survival and event history analysis Oslo, March-May Recapitulation. The additive regression model

Including the ordinary differential of distance with time as velocity makes a system of ordinary differential equations.

On One Analytic Method of. Constructing Program Controls

Chapter 6: AC Circuits

In the complete model, these slopes are ANALYSIS OF VARIANCE FOR THE COMPLETE TWO-WAY MODEL. (! i+1 -! i ) + [(!") i+1,q - [(!

Lecture VI Regression

FI 3103 Quantum Physics

How about the more general "linear" scalar functions of scalars (i.e., a 1st degree polynomial of the following form with a constant term )?

. The geometric multiplicity is dim[ker( λi. number of linearly independent eigenvectors associated with this eigenvalue.

. The geometric multiplicity is dim[ker( λi. A )], i.e. the number of linearly independent eigenvectors associated with this eigenvalue.

Cubic Bezier Homotopy Function for Solving Exponential Equations

Pendulum Dynamics. = Ft tangential direction (2) radial direction (1)

CH.3. COMPATIBILITY EQUATIONS. Continuum Mechanics Course (MMC) - ETSECCPB - UPC

Implementation of Quantized State Systems in MATLAB/Simulink

On computing differential transform of nonlinear non-autonomous functions and its applications

Single-loop System Reliability-Based Design & Topology Optimization (SRBDO/SRBTO): A Matrix-based System Reliability (MSR) Method

Chapter 2 Linear dynamic analysis of a structural system

Handout # 13 (MEEN 617) Numerical Integration to Find Time Response of MDOF mechanical system. The EOMS for a linear mechanical system are

CS434a/541a: Pattern Recognition Prof. Olga Veksler. Lecture 4

Outline. Probabilistic Model Learning. Probabilistic Model Learning. Probabilistic Model for Time-series Data: Hidden Markov Model

Fall 2010 Graduate Course on Dynamic Learning

An introduction to Support Vector Machine

UNIVERSITAT AUTÒNOMA DE BARCELONA MARCH 2017 EXAMINATION

Should Exact Index Numbers have Standard Errors? Theory and Application to Asian Growth

Example: MOSFET Amplifier Distortion

Variants of Pegasos. December 11, 2009

A NEW TECHNIQUE FOR SOLVING THE 1-D BURGERS EQUATION

Introduction to Compact Dynamical Modeling. III.1 Reducing Linear Time Invariant Systems. Luca Daniel Massachusetts Institute of Technology

Mechanics Physics 151

Bayesian Inference of the GARCH model with Rational Errors

Advanced Machine Learning & Perception

Research Article Numerical Approximation of Higher-Order Solutions of the Quadratic Nonlinear Stochastic Oscillatory Equation Using WHEP Technique

THE PREDICTION OF COMPETITIVE ENVIRONMENT IN BUSINESS

10. A.C CIRCUITS. Theoretically current grows to maximum value after infinite time. But practically it grows to maximum after 5τ. Decay of current :

EEL 6266 Power System Operation and Control. Chapter 5 Unit Commitment

Econ107 Applied Econometrics Topic 5: Specification: Choosing Independent Variables (Studenmund, Chapter 6)

, t 1. Transitions - this one was easy, but in general the hardest part is choosing the which variables are state and control variables

Discrete Markov Process. Introduction. Example: Balls and Urns. Stochastic Automaton. INTRODUCTION TO Machine Learning 3rd Edition

(,,, ) (,,, ). In addition, there are three other consumers, -2, -1, and 0. Consumer -2 has the utility function

Existence and Uniqueness Results for Random Impulsive Integro-Differential Equation

Mohammad H. Al-Towaiq a & Hasan K. Al-Bzoor a a Department of Mathematics and Statistics, Jordan University of

NATIONAL UNIVERSITY OF SINGAPORE PC5202 ADVANCED STATISTICAL MECHANICS. (Semester II: AY ) Time Allowed: 2 Hours

Response of MDOF systems

by Lauren DeDieu Advisor: George Chen

Motion in Two Dimensions

Machine Learning 4771

GENERATING CERTAIN QUINTIC IRREDUCIBLE POLYNOMIALS OVER FINITE FIELDS. Youngwoo Ahn and Kitae Kim

Scattering at an Interface: Oblique Incidence

( ) [ ] MAP Decision Rule

Robustness Experiments with Two Variance Components

Online Appendix for. Strategic safety stocks in supply chains with evolving forecasts

Lecture 2 M/G/1 queues. M/G/1-queue

Advanced Macroeconomics II: Exchange economy

Part II CONTINUOUS TIME STOCHASTIC PROCESSES

GMM parameter estimation. Xiaoye Lu CMPS290c Final Project

Relaxation Methods for Iterative Solution to Linear Systems of Equations

CHAPTER 10: LINEAR DISCRIMINATION

A NOVEL NETWORK METHOD DESIGNING MULTIRATE FILTER BANKS AND WAVELETS

Bifurcation & Chaos in Structural Dynamics: A Comparison of the Hilber-Hughes-Taylor-α and the Wang-Atluri (WA) Algorithms

( ) lamp power. dx dt T. Introduction to Compact Dynamical Modeling. III.1 Reducing Linear Time Invariant Systems

Math 128b Project. Jude Yuen

Panel Data Regression Models

THEORETICAL AUTOCORRELATIONS. ) if often denoted by γ. Note that

Chapters 2 Kinematics. Position, Distance, Displacement

F-Tests and Analysis of Variance (ANOVA) in the Simple Linear Regression Model. 1. Introduction

Supplementary Material to: IMU Preintegration on Manifold for E cient Visual-Inertial Maximum-a-Posteriori Estimation

Cyclone. Anti-cyclone

Neural Networks-Based Time Series Prediction Using Long and Short Term Dependence in the Learning Process

Transcription:

FTCS Soluon o he Hea Equaon ME 448/548 Noes Gerald Reckenwald Porland Sae Unversy Deparmen of Mechancal Engneerng gerry@pdxedu ME 448/548: FTCS Soluon o he Hea Equaon Overvew Use he forward fne d erence approxmaon o @u/@ @u @ uk+ u k Use he cenral d erence approxmaon o @ u/@x a me k @ u = uk u k + uk + @x x x 3 Solve for u k+ The compuaonal formula s explc: each value of u k+ can be updaed ndependenly 4 FTCS s easy o mplemen, bu s only condonally sable 5 Truncaon errors are O ( x) and O( ) ME 448/548: FTCS Soluon o he Hea Equaon page

Fne D erence Operaors Choose he forward d erence o evaluae he me dervave a = k @u = uk+ @ k,x u k + O( ) () Approxmae he spaal dervave wh he cenral d erence operaor and ake all nodal values a me k @ u @x x = uk u k + uk + x + O( x ) () ME 448/548: FTCS Soluon o he Hea Equaon page FTCS Approxmaon o he Hea Equaon Subsue Equaon () and Equaon () no he hea equaon u k+ u k = uk u k + uk + x + O( ) +O( x ) (3) Drop runcaon error erms o ge u k+ u k = uk u k + uk + x (4) ME 448/548: FTCS Soluon o he Hea Equaon page 3

FTCS Compuaonal Molecule k+ k k FTCS scheme enables explc calculaon of u a hs node Soluon s known for hese nodes =, k= = + n x x= x=l ME 448/548: FTCS Soluon o he Hea Equaon page 4 FTCS Approxmaon o he Hea Equaon Solve Equaon (4) for u k+ u k+ = ru k + + ( r)uk + ruk (5) where r = / x FTCS s an explc scheme because provdes a smple formula o updae u k+ ndependenly of he oher nodal values a k+ k+ k k =, k= = + n x x= x=l ME 448/548: FTCS Soluon o he Hea Equaon page 5

demoftcs Code funcon errou = demoftcs(nx,n) % Commens and processng of oponal npus skpped % --- Assgn physcal and mesh parameers alfa = ; L = ; max = ; % Dffuson coeffcen, doman lengh and max me dx = L/(nx-); d = max/(n-); r = alfa*d/dx^; r = - *r; % --- Assgn IC and BC u s nalzed o a vecor ha ncludes BC x = lnspace(,l,nx) ; u = sn(p*x/l); % --- Loop over me seps for k=:n uold = u; % prepare for nex sep for =:nx- u() = r*uold(-) + r*uold() + r*uold(+); end end Remember ha he formula for updang u k+ u k+ = ru k + + ( r)uk + ruk s ME 448/548: FTCS Soluon o he Hea Equaon page 6 Alernave formulaon o he FTCS Algorhm Equaon (5) can be expressed as a marx mulplcaon u (k+) = Au (k) (6) where u (k+) s he vecor of u values a me sep k +, u (k) s he vecor of u values a me sep k, anda s he rdagonal marx 3 r ( r) r r ( r) r A = (7) 6 7 4 r ( r) r5 The frs and las rows of A are se o enforce he Drchle boundary condons a x = and x = L ME 448/548: FTCS Soluon o he Hea Equaon page 7

Run he demoftcs code >> demoftcs Error n FTCS soluon = 4 FTCS Exac 8 u 6 4 4 6 8 x ME 448/548: FTCS Soluon o he Hea Equaon page 8 moveftcs(5): Unsable FTCS Soluon 5 = 4 Inal Condon FTCS soluon 5 = 63 Inal Condon FTCS soluon 5 = 96 Inal Condon FTCS soluon 5 5 5 5 5 5 4 6 8 4 6 8 4 6 8 5 = 8 Inal Condon FTCS soluon 5 = 88 Inal Condon FTCS soluon 5 = Inal Condon FTCS soluon 5 5 5 5 5 5 4 6 8 4 6 8 4 6 8 5 = Inal Condon FTCS soluon 5 = 9 Inal Condon FTCS soluon 5 = 4 Inal Condon FTCS soluon 5 5 5 5 5 5 4 6 8 4 6 8 4 6 8 ME 448/548: FTCS Soluon o he Hea Equaon page 9

Condonally Sable FTCS Scheme Observaons: The FTCS soluon appears o be sable a frs Toward he end of he smulaon me, oscllaons grow exponenally Insably s no caused by runcaon error Insably s fed by round-o errors, bu no drecly caused by round-o We ll use a smplfed form of Fourer Sably Analyss Suppose ha he nal condon s a small sne wave The correc soluon s a decay of he sne wave Under wha condon does he soluon grow nsead of decay? Sably or nsably s an nrnsc propery of he scheme FTCS s condonally sable for soluons o he hea equaon ME 448/548: FTCS Soluon o he Hea Equaon page Sably Analyss Suppose he nal condon looks lke hs x u (x) = cos = ( ) x where s a suably small value The soluon a me sep k =s u () = r u (x + )+u (x ) + ( r)u (x ) = r ( ) +( ) + ( r) ( ) = r ( ) + +( ) + ( r) ( ) ME 448/548: FTCS Soluon o he Hea Equaon page

Sably Analyss Snce ( ) + =( ) for any, he soluon a k =can be furher smplfed u () = r ( ) + ( r) ( ) = ( 4r) ( ) = ( 4r)u (x ) The paern s u () = ( 4r)u (x ) u (3) = ( 4r)u () (x )=( 4r) u (x ) u (4) = ( 4r)u (3) (x )=( 4r) 3 u (x ) where u () s he numercal soluon a x and k =; and where ( 4r) s he square of ( 4r) ME 448/548: FTCS Soluon o he Hea Equaon page Sably Analyss The general paern s u k = ( 4r)k u (x ) where ( 4r) k s ( 4r) rased o he k power Therefore, he soluon grows when 4r > Therefore, sably requres 4r < and ( 4r) < 4r <=) 4r <=) r> rue for any r> The second case s ( 4r) < =) 4r <=) r< ME 448/548: FTCS Soluon o he Hea Equaon page 3

Sably Analyss The quck and dry sably analyss shows ha he FTCS scheme s sable only f r = x < (8) Recall: s a parameer of he physcal problem We mus choose and x so ha Equaon (8) s sasfed ME 448/548: FTCS Soluon o he Hea Equaon page 4 Workng wh he FTCS Sably Creron To ncrease accuracy, we wan o decrease boh x and For a gven x, he sably lm for FTCS mposes an upper lm on < x (9) Choosng and x so ha r< does no guaranee an accurae numercal soluon r< only guaranees ha he FTCS soluon wll no blow up ME 448/548: FTCS Soluon o he Hea Equaon page 5

Workng wh he FTCS Sably Creron When reducng x and o mprove accuracy, follow a pah lke A!C no A!B Noe ha he axes have logarhmc scales log( ) Unsable B C A Sable ( x) = α log( x) ME 448/548: FTCS Soluon o he Hea Equaon page 6 Measurng he FTCS Truncaon Error The error repored by demoftcs s defned as E(n x,n )= p nx ku k u(x, k )k () The facor of / p n x convers ku k u(x, k )k o an average error ME 448/548: FTCS Soluon o he Hea Equaon page 7

Measurng he FTCS Truncaon Error Desgnae he local error a x = x and = k as e k = uk u(x, k ) () Defne ē k as an RMS average error per node a me sep k ē k " n x Xnx = (e k ) # / () Algebrac subsuon shows ha E(n x,n )=ē k If he soluon o he hea equaon s smooh, hen E(n x,n )=O( ) +O( x ) ME 448/548: FTCS Soluon o he Hea Equaon page 8 Measurng he runcaon error Sysemacally reduce x and o deermne wheher runcaon error predcon s realzed by he code We know he exac soluon, so we use Equaon() Ths s a es of wheher he code correcly mplemens FTCS Recall ha for FTCS E(n x,n )=O( ) +O( x ) bu sably requres = C x,wherec s a consan Therefore, a sable soluon o FTCS should demonsrae E(n x,n )=O( x ) ME 448/548: FTCS Soluon o he Hea Equaon page 9

Measurng he runcaon error Suppose we don know he exponen of he runcaon error for our code In oher words, nsead of we have where p s uknown E(n x,n )=O( x ) E(n x,n )=O( x p ) Snce x = L n x we have E(n x,n )=O( x p L p )=O (n x ) p ME 448/548: FTCS Soluon o he Hea Equaon page Measurng he runcaon error Smplfy he precedng expresson E(n x,n )=O( x p ) L p = O (n x ) p O (n x ) p O n p x gnore mulplcave consans leadng powers domnae Therefore, we expec E(n x,n )=O n p x ME 448/548: FTCS Soluon o he Hea Equaon page

Measurng he runcaon error Measure E(n x,n ) on wo d erence meshes, n x, and n x, Wh we form he rao Solve for p E(n x,n )=O n p x E(n x,,n ) E(n x,,n ) = n p x, n p x, = p nx, n x, p = log (E(n x,,n )/E(n x,,n )) log (n x, /n x, ) ME 448/548: FTCS Soluon o he Hea Equaon page convftcs Code funcon convftcs % convftcs Convergence of FTCS on a seres of fner spaal meshes % --- Se consans o be conssen wh demoftcs alfa = ; L = ; max=; rsafe = 49999; % sable r<5 % --- Specfy nx and compue n conssen wh sably lm nx = [8 6 3 64 8 56]; dx = L/(nx-); n = cel( + alfa*max*((nx-)^)/(rsafe*l^) ); % --- Loop over mesh szes, sore error and compue order of scheme fprnf( \n nx n error E(j)/E(j-) p\n ); er = NaN; p = ; for j=:lengh(nx); e(j) = demoftcs(nx(j),n(j)); f j> er = e(j)/e(j-); p = log(er)/log(nx(j-)/nx(j)); end fprnf( %5d %5d %3e %84f %84f\n,nx(j),n(j),e(j),er,p); end % -- plong code skpped ME 448/548: FTCS Soluon o he Hea Equaon page 3

Runnng he convftcs Code >> convftcs nx n error E(j)/E(j-) p 8 68e-3 NaN 6 9 356e-3 49 54 3 386 36e-4 46 553 64 589 797e-5 444 39 8 6453 97e-5 47 7 56 6 4895e-6 485 85 E(n x,n y ) 3 4 FTCS deal The las column of ex oupu shows ha demoftcs has he rgh runcaon error behavor 5 6 3 x ME 448/548: FTCS Soluon o he Hea Equaon page 4 Summary for he FTCS Scheme FTCS s easy o mplemen The updae formula s u k+ = ru k + + ( r)uk + ruk The FTCS scheme s condonally sable when r = x < / In wo spaal dmensons wh y = x, he sably condon s r < /4 In 3D wh y = z = x, he sably condon s r</8 There are much beer schemes for solvng he hea equaon FTCS s a oy used o nroduce he numercal soluon of PDEs ME 448/548: FTCS Soluon o he Hea Equaon page 5