Finite Difference Derivations for Spreadsheet Modeling John C. Walton Modified: November 15, 2007 jcw

Similar documents
6.3 Testing Series With Positive Terms

Castiel, Supernatural, Season 6, Episode 18

Lecture III-2: Light propagation in nonmagnetic

Lecture 2: Finite Difference Methods in Heat Transfer

Zeros of Polynomials

3.2 Properties of Division 3.3 Zeros of Polynomials 3.4 Complex and Rational Zeros of Polynomials

Solutions to Homework 7

Chapter 10: Power Series

Discrete-Time Systems, LTI Systems, and Discrete-Time Convolution

ECE-S352 Introduction to Digital Signal Processing Lecture 3A Direct Solution of Difference Equations

Boundary Element Method (BEM)

Ma 530 Introduction to Power Series

The Random Walk For Dummies

Lecture 8: Solving the Heat, Laplace and Wave equations using finite difference methods

Let us give one more example of MLE. Example 3. The uniform distribution U[0, θ] on the interval [0, θ] has p.d.f.

1 Approximating Integrals using Taylor Polynomials

Math 113 Exam 3 Practice

Chapter 6 Overview: Sequences and Numerical Series. For the purposes of AP, this topic is broken into four basic subtopics:

Recursive Algorithms. Recurrences. Recursive Algorithms Analysis

Streamfunction-Vorticity Formulation

AP Calculus BC Review Applications of Derivatives (Chapter 4) and f,

TEACHER CERTIFICATION STUDY GUIDE

Free Surface Hydrodynamics

Chapter 7: Numerical Series

Infinite Sequences and Series

Seunghee Ye Ma 8: Week 5 Oct 28

Unit 4: Polynomial and Rational Functions

Math 257: Finite difference methods

Period #8: Fluid Flow in Soils (II)

PUTNAM TRAINING PROBABILITY

Math 113, Calculus II Winter 2007 Final Exam Solutions

Numerical Solution of the First-Order Hyperbolic Partial Differential Equation with Point-Wise Advance

Apply change-of-basis formula to rewrite x as a linear combination of eigenvectors v j.

Chapter 10 Partial Differential Equations and Fourier Series

Appendix: The Laplace Transform

FIR Filters. Lecture #7 Chapter 5. BME 310 Biomedical Computing - J.Schesser

Math 113 Exam 3 Practice

Measures of Spread: Standard Deviation

Properties and Tests of Zeros of Polynomial Functions

Riemann Sums y = f (x)

INF-GEO Solutions, Geometrical Optics, Part 1

Exercises and Problems

Chapter 6: Numerical Series

Chapter 4. Fourier Series

Chapter 3. Strong convergence. 3.1 Definition of almost sure convergence

Lesson 10: Limits and Continuity

INFINITE SEQUENCES AND SERIES

( ) (( ) ) ANSWERS TO EXERCISES IN APPENDIX B. Section B.1 VECTORS AND SETS. Exercise B.1-1: Convex sets. are convex, , hence. and. (a) Let.

Random Variables, Sampling and Estimation

UNIVERSITY OF CALIFORNIA - SANTA CRUZ DEPARTMENT OF PHYSICS PHYS 116C. Problem Set 4. Benjamin Stahl. November 6, 2014

Chapter 14: Chemical Equilibrium

Chapter Vectors

CO-LOCATED DIFFUSE APPROXIMATION METHOD FOR TWO DIMENSIONAL INCOMPRESSIBLE CHANNEL FLOWS

SNAP Centre Workshop. Basic Algebraic Manipulation

(A) 0 (B) (C) (D) (E) 2.703

1.3 Convergence Theorems of Fourier Series. k k k k. N N k 1. With this in mind, we state (without proof) the convergence of Fourier series.

A second look at separation of variables

10.6 ALTERNATING SERIES

Sequences and Series of Functions

x x x 2x x N ( ) p NUMERICAL METHODS UNIT-I-SOLUTION OF EQUATIONS AND EIGENVALUE PROBLEMS By Newton-Raphson formula

(b) What is the probability that a particle reaches the upper boundary n before the lower boundary m?

Chapter 9 - CD companion 1. A Generic Implementation; The Common-Merge Amplifier. 1 τ is. ω ch. τ io

Review Problems 1. ICME and MS&E Refresher Course September 19, 2011 B = C = AB = A = A 2 = A 3... C 2 = C 3 = =

Linear Regression Demystified

Recurrence Relations

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Statistics

Signals & Systems Chapter3

MATH 10550, EXAM 3 SOLUTIONS

EE / EEE SAMPLE STUDY MATERIAL. GATE, IES & PSUs Signal System. Electrical Engineering. Postal Correspondence Course

Lecture #20. n ( x p i )1/p = max

CALCULUS BASIC SUMMER REVIEW

TMA4205 Numerical Linear Algebra. The Poisson problem in R 2 : diagonalization methods

1 Generating functions for balls in boxes

Practice Problems: Taylor and Maclaurin Series

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Mark Lundstrom Spring SOLUTIONS: ECE 305 Homework: Week 5. Mark Lundstrom Purdue University

Introduction to Signals and Systems, Part V: Lecture Summary

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Lecture 2: Monte Carlo Simulation

PAPER : IIT-JAM 2010

PC5215 Numerical Recipes with Applications - Review Problems

The Borel hierarchy classifies subsets of the reals by their topological complexity. Another approach is to classify them by size.

Nonequilibrium Excess Carriers in Semiconductors

Z ß cos x + si x R du We start with the substitutio u = si(x), so du = cos(x). The itegral becomes but +u we should chage the limits to go with the ew

The picture in figure 1.1 helps us to see that the area represents the distance traveled. Figure 1: Area represents distance travelled

Math 312 Lecture Notes One Dimensional Maps

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) =

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018

CALCULUS IN A NUTSHELL INTRODUCTION:

subcaptionfont+=small,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0 subcaption ALGEBRAIC COMBINATORICS LECTURE 8 TUESDAY, 2/16/2016

NBHM QUESTION 2007 Section 1 : Algebra Q1. Let G be a group of order n. Which of the following conditions imply that G is abelian?

Section 5.5. Infinite Series: The Ratio Test

Summary: Congruences. j=1. 1 Here we use the Mathematica syntax for the function. In Maple worksheets, the function

SOME THEORY AND PRACTICE OF STATISTICS by Howard G. Tucker

NAME: ALGEBRA 350 BLOCK 7. Simplifying Radicals Packet PART 1: ROOTS

Salmon: Lectures on partial differential equations. 3. First-order linear equations as the limiting case of second-order equations

The Method of Least Squares. To understand least squares fitting of data.

Taylor expansion: Show that the TE of f(x)= sin(x) around. sin(x) = x - + 3! 5! L 7 & 8: MHD/ZAH

Section 13.3 Area and the Definite Integral

Section 11.8: Power Series

Transcription:

Fiite Differece Derivatios for Spreadsheet Modelig Joh C. Walto Modified: November 15, 2007 jcw Figure 1. Suset with 11 swas o Little Platte Lake, Michiga. Page 1 Modificatio Date: November 15, 2007

Review of Fudametals The goal of this sectio is to teach some of the fudametal cocepts of umerical methods ad their limitatios without gettig sidetracked too deep ito applied mathematics. I umerical modelig of groud water flow ad trasport we break the system to be modeled ito a series of discrete odes or elemets. The more fiely we divide the system the more accurate our umerical model. The easiest way to uderstad the basics of the modelig process is to derive ad program simple fiite differece models i spreadsheets. This provides a overview of modelig without a lot of complex ad tedious work. At least two methods for derivatio of fiite differece equatios exist: a) the flux / coservatio method ad b) Taylor s series approximatios The flux method is much more powerful ad very ituitive although the Taylor s series method is easier for simple cases ad thus preferred by studets. If we take ode i for the cotrol volume the the cotiuity equatio is: x i-1 i i+1 i+2 Figure 2. Example oe dimesioal fiite differece grid. where: Q V A q source of water, so a well would have a egative value (m 3 /s) volume of the cotrol volume Δy Δz, ote that directios ot modeled are geerally assumed to be of uit legth (m 3 ) surface area o relevat side of cotrol volume (m 2 ) flux ito or out of a cotrol volume surface, the sig of the flux depeds upo the directio that is defied to be positive, fluxes i the positive directio are positive fluxes (m 3 /m 2 /s) -- Iput Output + ( Source Sik) -- A i q i A q out out + Q (1) (2) Page 2 Modificatio Date: November 15, 2007

At this poit we have ot specified i the equatio how may directios we will model ad/or if the model will be trasiet or steady state. With steady state models the time derivative goes to zero. The ext step is to replace the derivatives with fiite differece approximatios ad to replace the geeric flux statemets with a costitutive law, Darcy s law i this case. For the flux method we assume that the boudary betwee each ode is half way betwee two odes. Sice a derivative is merely the slope, the commo sese approximatio of a derivative is to take the slope at small steps. The small steps ca be i time ad/or i space. For time this gives: + 1 Δh ( ) - ---- Δt ( t + 1 t ) Darcy s law is used to put the fluxes i terms of hydraulic head: (3) We will provide a oe dimesioal example i the x directio. Sice fluxes are at the odal iterfaces its easiest to refer to them as North, South, East, West, Top, Bottom. For a oe dimesioal system we have oly East ad West directios. The cotiuity equatio says that the chage i storage i the cotrol volume is equal to Iput - Output + Source: For the oe dimesioal case it is more cosistet to redefie Q area per uit time i the directio beig modeled (m/s). as the source of water per uit For space we get the followig fiite differece approximatios, for output from the cotrol volume: -- A q K h W K W + A x E K E + AQ x (4) (5) Δh - x ( ) --- ( ) + 1 x i + 1 x i (6) ad for iput to the cotrol volume: Δh - x ( 1 ) -- ( x i x i 1 ) (7) where: Page 3 Modificatio Date: November 15, 2007

poit i time, is the curret time ad +1 is oe time step i the future i ode umber What are the time steps o the hydraulic heads? Substitutio gives: + 1 ( ) ( ---- (8) t + 1 t A W K -- 1 ) W ( ) ( x i x i 1 ) A K ( + h 1 i ) + --- + AQ E E ( x i + 1 x i ) This looks complicated but is ot. First cosider that if the system is homogeeous the K E K W K If the o-modeled directios are assumed to be of legth 1 ad is costat the the areas ad volumes simplify to: A1 m 2 ad V m 2. Simplifyig gives: + 1 S s ( ---- ) ---- K Δt ( 1 ) ( h - i + 1 ) --- Q 2 + 2 + (9) or: + 1 S s ( ---- ) ---- K Δt ( 1 2 + + 1 ) -- Q 2 + K (10) or: + ΔtK Q ( 1 2 + + 1 ) + -- + h K i 1 2 Ss (11) The time step o the hydraulic heads deped upo the umerical method chose for advacig the equatios i time. Explicit methods assume that the value of h at the curret (i.e., kow) time step are used. The explicit method makes solutio of the equatios very simple: Just solve the equatio for the oly ukow h at time step +1. The implicit method assumes that the value of s take at a future time step. Thus a series of equatios (i.e., a matrix) must be solved to advace the solutio i time. The explicit method is easier to program but is less powerful because it is less stable. The maximum time step for the explicit method is: KΔt -- 1 S s ( 2 -- ) 2 (12) Page 4 Modificatio Date: November 15, 2007

Fiite Differece by Taylor s Series The equatio for two dimesioal horizotal flow i a homogeeous isotropic medium is: 2 h T x 2 h x 2 + T y y 2 + R L S (13) We will show a oe dimesioal example but the same derivatio applies to multiple dimesios. The Taylor s series approximatio to a fuctio, i this case hydraulic head is: hx ( + ) hx ( ) ( ) 2 2 h ( ) 3 3 h ( ) 4 4 h + + x 2! x 2 + 3! x 3 + 4! x 4 + Error I terms of our fiite differece grid where we have odes: (14) ad + ( ) 2 2 h ( ) 3 3 h ( ) 4 4 h + + x 2! x 2 + -- 3! x 3 + 4! x 4 + Error 1 (15) ( ) 2 2 h ( ) 3 3 x 2! x 2 h ( ) 4 4 h + 3! x 3 + -- 4! x 4 + E( 4 ) 1 These are fourth order accurate. If we ca accept secod order accuracy the they ca be trucated after the first two terms: (16) ad + ( ) 2 2 h + + -- x 2! x 2 + E( 2 ) 1 (17) ( ) 2 2 h + x 2! x 2 + E( 2 ) 1 to get secod order accurate equatios. If we add the above two equatios we get: (18) 2 h h i 1 2 + + 1 (19) x 2 --- ( ) 2 + E( 2 ) Or we could get eve more crude ad just trucate the above equatios to first order accuracy: Page 5 Modificatio Date: November 15, 2007

x x + 1 + E 1 ---- + E (20) (21) Page 6 Modificatio Date: November 15, 2007

Steady State Simulatio Example Let s apply our ewly foud fiite differece equatios to the two dimesioal flow i a cofied aquifer situatio give above. But, sice I m tired, oly to the steady state situatio with o sources or siks. At steady state this becomes: 2 T x h 2 h x 2 + T y y 2 0 Pluggig ad chuggig we fially get: + + + 4 h ( i 1, j) h ( i + 1, j) h (, ij 1) h (, ij+ 1), j (22) (23) Notice that this equatio has a circular logic whe applied to multiple odes. How do we solve such a equatio? 1. Put i boudary coditios. For fixed heads this is just the value of the head at the ode. For o flux boudary coditios cosider that there is o flux if the head is the same o both sides of the ode. Make a imagiary ode ad assume it has the same head as the ode o the opposite side (show example spreadsheet). 2. Put i the basic equatio o all iterior odes. 3. Set the spreadsheet to iterate to covergece. Page 7 Modificatio Date: November 15, 2007