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

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

Relevant self-assessment exercises: [LIST SELF-ASSESSMENT EXERCISES HERE]

Notes for CS542G (Iterative Solvers for Linear Systems)

MATH 333: Partial Differential Equations

Chapter 10 Exercises

Part 1. The diffusion equation

Partial Differential Equations, Winter 2015

Mathematics Qualifying Exam Study Material

Numerical Solutions to Partial Differential Equations

Numerical Solutions to PDE s

Final: Solutions Math 118A, Fall 2013

Applied Mathematics 205. Unit III: Numerical Calculus. Lecturer: Dr. David Knezevic

Math 251 December 14, 2005 Final Exam. 1 18pt 2 16pt 3 12pt 4 14pt 5 12pt 6 14pt 7 14pt 8 16pt 9 20pt 10 14pt Total 150pt

1 Finite difference example: 1D implicit heat equation

PARTIAL DIFFERENTIAL EQUATIONS. Lecturer: D.M.A. Stuart MT 2007

Separation of variables

Wave Equation With Homogeneous Boundary Conditions

Mathematical Methods - Lecture 9

Finite difference method for elliptic problems: I

Final Exam May 4, 2016

Partial Differential Equations

Preliminary Examination, Numerical Analysis, August 2016

Chapter 3 Second Order Linear Equations

Mat1062: Introductory Numerical Methods for PDE

Georgia Tech PHYS 6124 Mathematical Methods of Physics I

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs

11.3 MATLAB for Partial Differential Equations

[2] (a) Develop and describe the piecewise linear Galerkin finite element approximation of,

Math 7824 Spring 2010 Numerical solution of partial differential equations Classroom notes and homework

Solving the Heat Equation (Sect. 10.5).

Finite Difference Methods Assignments

MATH 251 Final Examination August 10, 2011 FORM A. Name: Student Number: Section:

Homework 3 solutions Math 136 Gyu Eun Lee 2016 April 15. R = b a

LECTURE # 0 BASIC NOTATIONS AND CONCEPTS IN THE THEORY OF PARTIAL DIFFERENTIAL EQUATIONS (PDES)

Partial differential equation for temperature u(x, t) in a heat conducting insulated rod along the x-axis is given by the Heat equation:

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

PDEs, part 1: Introduction and elliptic PDEs

SAMPLE FINAL EXAM SOLUTIONS

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

Numerical Analysis of Differential Equations Numerical Solution of Parabolic Equations

1 Assignment 1: Nonlinear dynamics (due September

1. Differential Equations (ODE and PDE)

Cache Oblivious Stencil Computations

AMSC/CMSC 466 Problem set 3

CS205B / CME306 Homework 3. R n+1 = R n + tω R n. (b) Show that the updated rotation matrix computed from this update is not orthogonal.

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.

MIT (Spring 2014)

HOMEWORK 3: Phase portraits for Mathmatical Models, Analysis and Simulation, Fall 2010 Report due Mon Oct 4, Maximum score 7.0 pts.

Staple or bind all pages together. DO NOT dog ear pages as a method to bind.

A review of stability and dynamical behaviors of differential equations:

Partial Differential Equations

Finite Difference Method for PDE. Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36

Math 251 December 14, 2005 Answer Key to Final Exam. 1 18pt 2 16pt 3 12pt 4 14pt 5 12pt 6 14pt 7 14pt 8 16pt 9 20pt 10 14pt Total 150pt

Math 5440 Problem Set 6 Solutions

The amount of work to construct each new guess from the previous one should be a small multiple of the number of nonzeros in A.

PDEs, part 3: Hyperbolic PDEs

Section 12.6: Non-homogeneous Problems

Numerical Methods for PDEs

Separation of Variables in Linear PDE: One-Dimensional Problems

Last time: Diffusion - Numerical scheme (FD) Heat equation is dissipative, so why not try Forward Euler:

Numerical Solutions to Partial Differential Equations

Partial Differential Equations

Lecture Notes on Numerical Schemes for Flow and Transport Problems

Marching on the BL equations

Lecture Notes on Numerical Schemes for Flow and Transport Problems

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

Homework 6 Math 309 Spring 2016

Take Home Exam I Key

Math 46, Applied Math (Spring 2009): Final

Finite Difference Methods for Boundary Value Problems

Appendix C: Recapitulation of Numerical schemes

UNIVERSITY OF MANITOBA

2 A brief interruption to discuss boundary value/intial value problems

Brownian Motion. 1 Definition Brownian Motion Wiener measure... 3

Finite difference methods for the diffusion equation

My signature below certifies that I have complied with the University of Pennsylvania s Code of Academic Integrity in completing this exam.

17 Source Problems for Heat and Wave IB- VPs

Finite difference method for heat equation

Qualifying Examination

MA 201: Method of Separation of Variables Finite Vibrating String Problem Lecture - 11 MA201(2016): PDE

Diffusion Processes. Lectures INF2320 p. 1/72

Analysis III (BAUG) Assignment 3 Prof. Dr. Alessandro Sisto Due 13th October 2017

A Fast Fourier transform based direct solver for the Helmholtz problem. AANMPDE 2017 Palaiochora, Crete, Oct 2, 2017

Numerical Solutions to Partial Differential Equations

Math 46, Applied Math (Spring 2008): Final

HOMEWORK 1 SOLUTIONS

Analysis III Solutions - Serie 12

Finite Difference Method

Simple Examples on Rectangular Domains

Mathématiques appliquées (MATH0504-1) B. Dewals, Ch. Geuzaine

Solving linear systems (6 lectures)

1 Introduction to MATLAB

3.5 Finite Differences and Fast Poisson Solvers

ODE Homework 1. Due Wed. 19 August 2009; At the beginning of the class

Tutorial 2. Introduction to numerical schemes

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

Introduction and Stationary Iterative Methods

LINEAR SECOND-ORDER EQUATIONS

u xx + u yy = 0. (5.1)

APPM GRADUATE PRELIMINARY EXAMINATION PARTIAL DIFFERENTIAL EQUATIONS SOLUTIONS

Transcription:

HOMEWORK 4: Numerical solution of PDEs for Mathmatical Models, Analysis and Simulation, Fall 2011 Report due Mon Nov 12, 2012. Maximum score 6.0 pts. Read Strang s (old) book, Sections 3.1-3.4 and 6.4-6.5. 1. Selected theoretical problems (Score: 1.5) a) If u(x,y) = x 2 in the square S = { 1 < x,y < 1}, compute both sides of ( u)dxdy = ˆn u ds. (Divergence theorem) S C b) If curl v = 0 and divw = 0 in a three-dimensional volume V, with w ˆn = 0 on the boundary, show that v and w are orthogonal, v T wdv = 0. How could an arbitrary vector field f(x,y,z) be split into v + w? c) Find the coefficients that make AU n+1 + BU n + CU n 1 = D f n + E f n 1 third order accurate for u = f (u) = au. But show that Az 2 +Bz+C = 0 has a root with z > 1, which means exponential instability. d) Substitute the true u(x,t) into the Lax-Friedrichs method for u t = cu x. Use u t = cu x and u tt = c 2 u xx (constant c) to find the coefficient of the numerical dissipation u xx. e) Consider the Poisson equation with Robin boundary conditions: u n + a(x)u(x) = 0 u = f x Ω lr 3 x Ω, where a(x) > 0 on Ω. Prove that the solution is unique. (Hint: Use Green s first identity. ) 2. The convection diffusion equation (Score: 2.0) Consider the convection-diffusion equation u t + au x = ηu xx, < x < with u(x,0) = f (x). Consider either the case with 2π periodic initial data, f (x) = f (2π + x), and hence a 2π-periodic solution, or the Cauchy problem, whatever you prefer. 1

Assume a step size x > 0 and a time step t > 0. The following finite difference approximation is given: j u n j + a un j+1 un j 1 = η un j 1 2un j + un j+1 t (2 x) ( x) 2 a) What is the order in space and time of the proposed method? b) What is the stability condition for this method? What is the stability condition for the cases i) a = 0, and ii) η = 0? c) With a = 1, for what choices of η > 0 would you expect this method to work well, and produce an accurate solution? For what choices would you expect it to do worse? ( t kept within stability limits). Pick some initial conditions and perform numerical computations to illustrate your point. Compare to the solutions obtained when discretizing by Explain. 3. The wave equation (Score: 2.5) j u n j + a un j un j 1 = η un j 1 2un j + un j+1 t x ( x) 2 In this exercise, we will consider the wave equation in one dimension: u tt u xx = 0, 0 < x < 1, (1) u(0,x) = u 0 (x), u t (0,x) = v 0 (x). The Leap-Frog method for this equation reads: j 2u n j + u n 1 j = λ 2 (u n j+1 2u n j + u n j 1), λ = t x, (2) where u n j u(x j,n t), x j = j x, j = 1,...N 1 and x = 1/N. a) Implement the Leap-Frog method with Dirichlet boundary conditions, u(t,0) = u(t,1) = 0. The Leap- Frog method can then be viewed as solving the system of ODEs u tt = Au, (3) with central differencing in time and A given by (2). A will be tridiagonal with 2/( x) 2 on the diagonal and 1/( x) 2 on the super and sub diagonals. 2

Use N = 64, λ = 1 and a pulse as initial data, u 0 j = u 0(x j ), where ( u 0 (x) = exp 100(x x s ) 2), x s = 0.5. (4) Since the Leap-Frog method is a two-step method you need one more initial value to get started. Use the exact solution u 1 j = [u 0 (x j t) + u 0 (x j + t)]/2. Plot the solution in every time step inside your time stepping loop, so that you can see what happens. (You need to add drawnow after the plot command for this to work). What happens as the pulses hit the boundary? Use subplot and plot snapshots of the solution at several different points in time in the same figure. Start at t = 0 and end at t = 2. Verify that the CFL condition is necessary by varying λ. b) A flute can be modeled with a version of the wave equation. Assume that the length of the flute is L and that the mean difference in pressure to the ambient pressure in a cross section of the flute is denoted p(τ,ξ ), where τ denotes the physical time and ξ the distance from the mouth piece. There are holes along the flute of different sizes that can be covered or open. A very simple model is that p satisfies the equation p ττ c 2 0p ξ ξ + D(ξ )p = G(τ,ξ ), p(τ,0) = p(τ,l) = 0, (5) where c 0 is the speed of sound in air (344 m/s) and D(ξ ) is a variable coefficient that is zero where there is no hole and positive at each hole. The larger the whole is, the larger interval where D(ξ ) > 0. The function G(τ,ξ ) represents the very complicated process of blowing into the mouth piece. First assume that all holes are covered, such that D(ξ ) 0. The root note of the flute is then given by the lowest eigenmode of the system, i.e. the standing wave with the lowest frequency. In our case we have Dirichlet boundary conditions, and f fund = c 0 /2L. The lowest note that one can play at a recorder (or English flute) of type C5 (Swedish: Blockflöjt C5) is about 523 Hz, which yields L 33 cm. (In reality it is a bit shorter). If the holes for the fingers are large, the effect of an open hole is the same as if the flute would end at the whole: the pressure in the flute cannot vary much as compared to the surrounding air and p in our equation must be 0 at the hole, i.e. the Dirichlet boundary condition can be placed at the location of the hole instead of at ξ = L. If we want to be able to play the frequency f h we can place a large finger hole at the distance ˆξ = c 0 /2 f h from the mouth piece. Assume that we want to play all tempered notes in an octave above C5 on a recorder, i.e the frequencies f k = 2 k/12 f 0, med k = 0,...,12 and f 0 = 523.25. We can then place large holes at the distances ˆξ k (16.4, 17.4, 18.4, 19.5, 20.7, 21.9, 23.2, 24.6, 26.1, 27.6, 29.3, 31.0) cm from the mouth piece. It would be quite impractical with so many closely placed holes. In addition, ten fingers is not sufficient to cover them all simultaneously. Instead one uses small holes, which results in 3

an effect in between completely covering or opening the hole. The holes can be placed more sparsely and fewer are needed, since more frequencies can be obtained by different combinations of open and closed holes. Now to the actual assignment: Start by non-dimensionalizing (5) through the variable changes τ = Lt/c 0 and ξ = Lx. Let u(t,x) := p(lt/c 0,Lx). Show that u(t,x) satisfies u tt u xx + d(x)u = g(t,x), u(t,0) = u(t,1) = 0, where d(x) och g(t,x) are somewhat modified as compared to D(ξ ) och G(τ,ξ ). Use the program you wrote in a), but modify it such that d(x)u and the forcing function g(t,x) are included. The Leap-Frog method becomes j 2u n j + u n 1 j = λ 2 (u n j+1 2u n j + u n j 1) ( t) 2 d(x j )u n j + ( t) 2 g(t n,x j ). In analogy with (3) this can be seen as a numerical solver of the ODE u tt = Au Du + g(t), (6) based on central differencing in time. Here, D = diag(d(x j )), a diagonal matrix, och g(t) = {g(t,x j )}. Make sure that A och D are stored as sparse matrices in your implementation. Let u(t,x) 0 for t 0 (dvs u 1 j = u 0 j 0) and g(t,x) = e 10t sin(πx). First do a simulation with all finger holes closed, i.e. d(x) 0. Solve the problem with N = 128 for a long time, until t = 20, and sample in each time step the solution at x = 0.25. Save the sampled values in a long vector, so that you obtain an approximation of u(t,0.25) for t [0,20]. Fourier transform the values in the long vector with Matlabs fft routine and plot the absolute value of the components with semilogy. Rescale the variables such that the x-axis in the plot corresponds to the frequencies in a flute of length L = 0.33 m, and display only frequencies up to 2000 Hz. Does the first spike in the plot correspond to the theoretical base (fundamental) frequency c 0 /2L 523 Hz? Repeat the experiment with a variable d(x), as given by ( ) { x ˆx 1 + cos(2πz), z 1/2, d(x) = sd h, d h (z) = 1000 w 0, z > 1/2. This models a finger hole where ˆx is the x-coordinate for the hole, w is the width of the hole and s a measure of the size of the hole. Choose w = 0.05 and try with different sizes of s and different positions ˆx. How does the base frequency change? Is it true that a big hole (s 1) yields about the same effect as a shorter flute with the length ˆx? Include frequency diagrams according to above for some selected cases. Try to have several holes open, e.g. d(x) = s 1 d h ((x ˆx 1 )/w) + s 2 d h ((x ˆx 2 )/w) for some choices of s 1, s 2, ˆx 1, ˆx 2. 4

c) There is a more direct way to compute the basic frequency of the system. A standing wave with frequency f and amplitude v(x) can be written U(t, x) = v(x) exp(i2π f t). It satisfies the same wave equation, but without the forcing function G(t,x), i.e. U tt U xx + d(x)u = 0, U(t,0) = U(t,1) = 0, Since U tt = (2π f ) 2 U we obtain an equation for v, v xx + d(x)v = (2π f ) 2 v, v(0) = v(1) = 0, i.e. (2π f ) 2 is an eigenvalue and v(x) an eigen function to the operator xx + d(x). The numerical approximation to this operator is simply the matrix A + D in (6). Go through the cases that you have reported in b). Compute the eigenvalues and eigenvectors to A + D for these d(x). State the frequency that is given by the smallest eigenvalue - does it agree with the spikes in the frequency diagram? Plot the corresponding eigenvector (eigen function). Optional excercise: Place seven holes with different coordinates ˆx k and sizes s k, w k, that is d(x) = 7 k=1 ( ) x ˆxk s k d h. w k Try to select ˆx k, s k och w k such that one can play the full scale mentioned above, ( f 0,..., f 12 ) through different combinations of open and closed holes. The top two holes on a real recorder are really two pairs of small holes next to each other. You can therefore allow for two different sizes s for these holes. 5