Solutions 3. February 2, Apply composite Simpson s rule with m = 1, 2, 4 panels to approximate the integrals:

Σχετικά έγγραφα
Solutions_3. 1 Exercise Exercise January 26, 2017

Lecture 5: Numerical Integration

Review-2 and Practice problems. sin 2 (x) cos 2 (x)(sin(x)dx) (1 cos 2 (x)) cos 2 (x)(sin(x)dx) let u = cos(x), du = sin(x)dx. = (1 u 2 )u 2 ( du)

Oscillatory integrals

ΤΜΗΜΑ ΗΛΕΚΤΡΟΛΟΓΩΝ ΜΗΧΑΝΙΚΩΝ ΚΑΙ ΜΗΧΑΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

Math221: HW# 1 solutions

Section 7.6 Double and Half Angle Formulas

Example Sheet 3 Solutions

2 Composition. Invertible Mappings

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

Σχολή Εφαρμοσμένων Μαθηματικών και Φυσικών Επιστημών. Εθνικό Μετσόβιο Πολυτεχνείο. Thales Workshop, 1-3 July 2015.

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

Section 8.3 Trigonometric Equations

AMS 212B Perturbation Methods Lecture 14 Copyright by Hongyun Wang, UCSC. Example: Eigenvalue problem with a turning point inside the interval

EE512: Error Control Coding

Homework 3 Solutions

Areas and Lengths in Polar Coordinates

To find the relationships between the coefficients in the original equation and the roots, we have to use a different technique.

Απόκριση σε Μοναδιαία Ωστική Δύναμη (Unit Impulse) Απόκριση σε Δυνάμεις Αυθαίρετα Μεταβαλλόμενες με το Χρόνο. Απόστολος Σ.

Areas and Lengths in Polar Coordinates

2. THEORY OF EQUATIONS. PREVIOUS EAMCET Bits.

INTEGRAL INEQUALITY REGARDING r-convex AND

C.S. 430 Assignment 6, Sample Solutions

Srednicki Chapter 55

Finite Field Problems: Solutions

Problem Set 3: Solutions

CHAPTER 48 APPLICATIONS OF MATRICES AND DETERMINANTS

CHAPTER 101 FOURIER SERIES FOR PERIODIC FUNCTIONS OF PERIOD

Electromagnetic Waves I

Fourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

ST5224: Advanced Statistical Theory II

Some definite integrals connected with Gauss s sums

Approximation of distance between locations on earth given by latitude and longitude

forms This gives Remark 1. How to remember the above formulas: Substituting these into the equation we obtain with

b. Use the parametrization from (a) to compute the area of S a as S a ds. Be sure to substitute for ds!

SOLUTIONS TO PROBLEMS IN LIE ALGEBRAS IN PARTICLE PHYSICS BY HOWARD GEORGI STEPHEN HANCOCK

Inverse trigonometric functions & General Solution of Trigonometric Equations

derivation of the Laplacian from rectangular to spherical coordinates

Solution Series 9. i=1 x i and i=1 x i.

Second Order Partial Differential Equations

MathCity.org Merging man and maths

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

Homework 8 Model Solution Section

Concrete Mathematics Exercises from 30 September 2016

Exercises 10. Find a fundamental matrix of the given system of equations. Also find the fundamental matrix Φ(t) satisfying Φ(0) = I. 1.

CRASH COURSE IN PRECALCULUS

Section 9.2 Polar Equations and Graphs

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

Jesse Maassen and Mark Lundstrom Purdue University November 25, 2013

Matrices and Determinants

Variational Wavefunction for the Helium Atom

Solutions to Exercise Sheet 5

PARTIAL NOTES for 6.1 Trigonometric Identities

6.3 Forecasting ARMA processes

Notes on the Open Economy

Pg The perimeter is P = 3x The area of a triangle is. where b is the base, h is the height. In our case b = x, then the area is

ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?

The Simply Typed Lambda Calculus

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1

Second Order RLC Filters

Trigonometric Formula Sheet

Other Test Constructions: Likelihood Ratio & Bayes Tests

6.1. Dirac Equation. Hamiltonian. Dirac Eq.

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

CHAPTER (2) Electric Charges, Electric Charge Densities and Electric Field Intensity

Notes on Tobin s. Liquidity Preference as Behavior toward Risk

9.09. # 1. Area inside the oval limaçon r = cos θ. To graph, start with θ = 0 so r = 6. Compute dr

Orbital angular momentum and the spherical harmonics

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in

k A = [k, k]( )[a 1, a 2 ] = [ka 1,ka 2 ] 4For the division of two intervals of confidence in R +

Problem Set 9 Solutions. θ + 1. θ 2 + cotθ ( ) sinθ e iφ is an eigenfunction of the ˆ L 2 operator. / θ 2. φ 2. sin 2 θ φ 2. ( ) = e iφ. = e iφ cosθ.

Lecture 2. Soundness and completeness of propositional logic

Self and Mutual Inductances for Fundamental Harmonic in Synchronous Machine with Round Rotor (Cont.) Double Layer Lap Winding on Stator

Uniform Convergence of Fourier Series Michael Taylor

Section 7.7 Product-to-Sum and Sum-to-Product Formulas

MATH423 String Theory Solutions 4. = 0 τ = f(s). (1) dτ ds = dxµ dτ f (s) (2) dτ 2 [f (s)] 2 + dxµ. dτ f (s) (3)

1. For each of the following power series, find the interval of convergence and the radius of convergence:

Statistical Inference I Locally most powerful tests

Parametrized Surfaces

w o = R 1 p. (1) R = p =. = 1

If ABC is any oblique triangle with sides a, b, and c, the following equations are valid. 2bc. (a) a 2 b 2 c 2 2bc cos A or cos A b2 c 2 a 2.

1 String with massive end-points

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Math 6 SL Probability Distributions Practice Test Mark Scheme

Solution to Review Problems for Midterm III

Every set of first-order formulas is equivalent to an independent set

Written Examination. Antennas and Propagation (AA ) April 26, 2017.

Review Test 3. MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Probability theory STATISTICAL METHODS FOR SAFETY ANALYSIS FMS065 TABLE OF FORMULÆ (2016) Basic probability theory. One-dimensional random variables

4.6 Autoregressive Moving Average Model ARMA(1,1)

Περιβαλλοντική Βιοτεχνολογία- Environmental Biotechnology

Tridiagonal matrices. Gérard MEURANT. October, 2008

Econ Spring 2004 Instructor: Prof. Kiefer Solution to Problem set # 5. γ (0)

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

DiracDelta. Notations. Primary definition. Specific values. General characteristics. Traditional name. Traditional notation

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

Numerical Analysis FMN011

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

Transcript:

s Februry 2, 216 1 Exercise 5.2. Apply composite Simpson s rule with m = 1, 2, 4 pnels to pproximte the integrls: () x 2 dx = 1 π/2, (b) cos(x) dx = 1, (c) e x dx = e 1, nd report the errors. () f(x) = x 2. For m = 1 we put h = (1 )/2 = 1/2, x =, x 1 = 1/2, x 2 = 1; y = f(x ) =, y 1 = f(x 1 ) = 1/4, y 2 = f(x 2 ) = 1. The pproximtion is then I h/(y + 4y 1 + y 2 ) = ( + 4 1/4 + 1)/6 = 1/. The error is thus. For m = 2 we hve h = (1 )/4 = 1/4, (x, x 1,..., x 4 ) = (, 1/4, 1/2, /4, 1), (y, y 1,..., y 4 ) = (, 1/16, 1/4, 9/16, 1). The pproximtion is then I h/(y + 4y 1 + 2y 2 + 4y + y 4 ) = ( + 4 1/16 + 2 1/4 + 4 9/16 + 1)/12 = (1/4 + 2/4 + 9/4 + 4/4)/12 = 16/( 4 4) = 1/. The error is thus. One could continue with m =, but the error hs to be zero. Indeed, Simpson s rule is bsed on qudrtic interpoltion polynomils, which mens tht x 2 will be represented exctly by the interpolting polynomil nd the qudrture will be exct. (b) f(x) = cos(x) For m = 1 we put h = (π/2 )/2 = π/4, x =, x 1 = π/4, x 2 = π/2; y = f(x ) = 1, y 1 = f(x 1 ) = 1/ 2, y 2 = f(x 2 ) =. The pproximtion is then I h/(y + 4y 1 + y 2 ) = (1 + 4/ 2 + ) π/12 1.227. The error is thus.227. For m = 2, h = π/8, (x,..., x 4 ) = (, π/8, π/4, π/8, π/2), (y,..., y 4 ) (1,.928795, 1/ 2,.82684, ). I h/(y + 4y 1 + 2y 2 + 4y + y 4 ) 1.15, giving the error.15. For m =, h = π/6, I 1.261, errror.261. (c) f(x) = exp(x) For m = 1 we put h = (1 )/2 = 1/2, x =, x 1 = 1/2, x 2 = 1; y = f(x ) = 1, y 1 = f(x 1 ) = e 1/2, y 2 = f(x 2 ) = e. The pproximtion is then I h/(y + 4y 1 + y 2 ) = (1 + 4 e + e)/6 1.71886115. The error is thus 1.71886115 e + 1 5.79 1 4. For m = 2, h = 1/4, (x,..., x 4 ) = (, 1/4, 1/2, /4, 1),... I h/(y + 4y 1 + 2y 2 + 4y + y 4 ) 1.7181884192175, giving the error.7 1 5. For m =, h = 1/6, I 1.718289169928, errror 7.4 1 6. 2 Exercise 5.2.11 Find the degree of precision of the following pproximtion for f(x) dx: First of ll, let us evlute the integrl of monomil x n, n : [ ] { x x n n+1 x=1, for odd n, dx = = n + 1 2/(n + 1), for even n. x= 1

() f(1) + f(): Let us pply the qudrture to the monomil x n, n : { 1 n + () n, for odd n, = 2, for even n, Therefore the qudrture grees with the integrl for n =, 1 (nd ll odd n), nd its degree of precision is 1. (One could lso observe tht this is trpezoid qudrture on [, 1], which is known to be exct for polynomils up to degree 1.) (b) 2/[f(-1) + f() + f(1)]. We check the qudrture on monomils of incresing degree: 2, for n =, 2/[() n + n + () n ] =, for odd n, 4/, for even n >, which grees with the integrl for n =, 1 (nd odd n). Thus degree of precision is 1. (c) We check the qudrture on monomils of incresing degree: [(/ ) n + (1/ { ) n, for odd n, ] = 2/ n/2, for even n, which grees with the integrl for n =, 1, 2, (nd odd n). Thus degree of precision is. (This is n exmple of Gussin qudrture, which re exct for polynomils of degree up to 2n 1 when n points re used.) Exercise 5.2.16 Use the fct tht the error term of Boole s Rule (see Exercise 5.2.15) is proportionl to f (6) (c) to find the exct error term. We pply the qudrture to the monomil x 6, for which f (6) (c) 6!, for ll c. Thus 4h [ x x 6 7 dx = 7 ] x=4h x= = 47 h 7 7 nd we re interested in finding C. = 2h 45 (7 6 + 2 h 6 + 12 (2h) 6 + 2 (h) 6 + 7 (4h) 6 ) + C6! In [1]: from sympy import * init_printing() h,c=symbols( h C ) integrl = (4*h)**7/7 qudrture = 2*h/45*(2*h**6 + 12*(2*h)**6 + 2*(*h)**6 + 7*(4*h)**6) simplify(integrl-qudrture) Out[1]: Thus C = 28h 7 /(21 6!) = 8h 7 /945 128h7 21 2

4 Exercise 5.4.1 Apply Adptive Qudrture by hnd, using the Trpezoid Rule with tolernce T OL =.5 to pproximte the integrls. Find the pproximtion error. () In this cse, f(x) = x 2, =, b = 1. We begin with n = 1 intervl, =, b = b. We will use S[, b] to denote the Trpezoid qudrture pplied on the intervl [, b]. c = (+b)/2, S[, b] = ( 2 +1 2 )/2 = 1/2, S[, c] = ( 2 +(1/2) 2 )/4 = 1/16, S[c, b] = ((1/2) 2 +1 2 )/4 = 5/16. S[, b] S[, c] S[c, b] = 1/8 =.125 <.5 ((b )/(b )) =.15. Thus we stop with the pproximtion S[, c] + S[c, b] = /8 =.75 nd n error estimte (S[, b] S[, c] S[c, b])/ = /24.417. The ctul integrtion error is x2 /8 = 1/ /8 = /24. Our estimte is exct becuse f is constnt in this cse, thus the pproximte eqution (5.8) in the book is ctully exct. (b) f(x) = cos(x), =, b = π/2. S[, π/2] = (π/2) (1 + )/2 = π/2 1.578, S[, π/4] = (π/4) (1 + 1/ 2)/2.7854, S[π/4, π, 2] = (π/4) (1/ 2 + )/2.27768. S[, b] S[, c] S[c, b].5772.5 (π/2)/(π/2) =.15. Thus we need to split the intervl nd pply the dptive lgorithm recursively. S[, π/4] = (π/4) (1 + 1/ 2)/2.7854, S[, π/8] = (π/8) (1 + cos(π/8))/2.7775, S[π/8, π/4] = (π/8) (cos(π/8) + cos(π/4))/2.224, S[, π/4] S[, π/8] S[π/8, π/4].8741.5 (π/4)/(π/2) =.75. Thus we need to split this intervl gin pply the dptive lgorithm recursively. S[, π/8] = (π/8) (1 + cos(π/8))/2.7775, S[, π/16] = (π/16) (1 + cos(π/16))/2.19446, S[π/16, π/8] = (π/16) (cos(π/16) +cos(π/8))/2.18699, S[, π/8] S[, π/16] S[π/16, π/8].7 <.5 (π/8)/(π/2) =.75. Thus we re done on the intervl [, π/8] with the pproximtion S[, π/16] + S[π/16, π/8].8145. Let us look t the intervl [π/8, π/4] now. S[π/8, π/4] = (π/8) (cos(π/8) + cos(pi/4))/2.224, S[π/8, π/16] = (π/16) (cos(π/8) + cos(π/16))/2.172, S[π/16, π/4] = (π/16) (cos(π/16) + cos(π/4))/2.1515, S[π/8, π/4] S[π/8, π/16] S[π/16, π/4].14 <.5 (π/8)/(π/2) =.75. Thus we re done on the intervl [π/8, π/4] with the pproximtion S[π/8, π/16] + S[π/16, π/4].28. Let us look t the intervl [π/4, π/2] now. S[π/4, π/2] = (π/4) (cos(π/4) + cos(pi/2))/2.27768, S[π/4, π/8] = (π/8) (cos(π/4)+cos(π/8))/2.2198, S[π/8, π/2] = (π/8) (cos(π/8)+cos(π/2))/2.7514, S[π/4, π/2] S[π/4, π/8] S[π/8, π/2].1144 <.5 (π/4)/(π/2) =.75. Thus we re done on the intervl [π/4, π/2] with the pproximtion S[π/4, π/8]+s[π/8, π/2].28912. There re no intervls left, nd therefore the finl pproximtion is.8145 +.28 +.28912 =.9995 wheres the exct integrl is π/2 cos(x) = 1. Thus the error is.9995 1.6 <.5. (c) In this cse, f(x) = exp(x), =, b = 1. S[, 1] = (1 + e)/2 1.85914, S[,.5] = (1 + exp(.5))/4.66218, S[.5, 1] = (exp(.5) + exp(1))/4 1.9175. S[, b] S[, c] S[c, b].152 <.5 ((b )/(b )) =.15. Thus we stop with the pproximtion S[, c] + S[c, b] 1.759 nd n error estimte (S[, b] S[, c] S[c, b])/.5. The ctul integrtion error is exp(x) (S[, c] + S[c, b]).6. Our estimte is quite good in this cse. 5 Exercise 5.4.4 Develop n Adptive Qudrture method for rule (5.28). Let c = ( + b)/2, h = b nd pply the qudrture on [, b], [, c], nd [c, b] (we use the sme nottion s in the book):

c f(x) dx + c f(x) dx = S[, b] + 14h5 45 f (4) (c 1 ), c 1 [, b], f(x) dx = S[, c] + S[c, b] + 14(h/2)5 45 f (4) (c 2 ) + 14(h/2)5 f (4) (c ), 45 c 2 [, c], c [c, b]. Further ssuming tht f (4) (c 1 ) f (4) (c 2 ) f (4) (c ) we obtin: c f(x) dx + c f(x) dx = S[, b] + 14h5 45 f (4) (c 1 ), f(x) dx S[, c] + S[c, b] + 1 14h 5 16 45 f (4) (c 1 ). We cn now subtrct the second eqution from the first to obtin: S[, b] S[, c] S[c, b] 15 1 14h 5 16 45 f (4) (c 1 ). Thus the number S[, b] S[, c] S[c, b] gives n pproximtion to 15 times the error of the qudrture S[, c] + S[c, b]. The rest is exctly the sme s for other qudrtures; one stops subdividing the intervl when S[, b] S[, c] S[c, b] < 15 T OL (b )/(b orig orig ) nd returns S[, c] + S[c, b] s the pproximtion of the integrl over the intervl [,b]. 6 Exercise 5.5.1 Approximte the integrls using n = 2 Gussin Qudrture. Compre with the correct vlue nd give the pproximtion error. Gussin Qudrture with n = 2 is defined by the points x 1,2 = ±1/, w 1,2 = 1. In [2]: x1 = -1/sqrt() x2 = 1/sqrt() w1 = 1 w2 = 1 () In []: from sympy import * init_printing() x=symbols( x ) f=lmbd(x,x**+2*x) Out[]: integrte(f(x),(x,-1,1)) In [4]: # Numericl qudrture 4

Out[4]: Thus the error is, which grees with the theory for Gussin Qudrtures being exct for polynomils up to degree 2n 1. (b) In [5]: f=lmbd(x,x**4) Out[5]: integrte(f(x),(x,-1,1)) In [6]: # Numericl qudrture 2 5 Out[6]: In [7]: # Approximtion error 2/5-2/9 2 9 Out[7]: (c).1777777777777778 In [8]: f=lmbd(x,exp(x)) Out[8]: integrte(f(x),(x,-1,1)) 1 e + e In [9]: # Numericl qudrture Out[9]: e + e In [1]: # Approximtion error N(integrte(f(x),(x,-1,1))-()) Out[1]: (d).776299778724 5

In [11]: f=lmbd(x,cos(pi*x)) Out[11]: integrte(f(x),(x,-1,1)) In [12]: # Numericl qudrture Out[12]: 2 cos ( ) π In [1]: # Approximtion error N(-2*cos(sqrt()*pi/)) Out[1]:.48127298818 7 Exercise 5.5.7 Show tht the Legendre polynomils p 1 (x) = x nd p 2 (x) = x 2 1/ re orthogonl on [, 1]. p 1(x)p 2 (x) dx = (x x/) dx = becuse x x/ is n odd function. 8 Exercise 5.5.8 Compute Legendre polynomils up to degree. Legendre polynomils re given by the expression Thus p i (x) = 1 d 2 i i! dx i [(x2 1) i ]. p (x) = 1, p 1 (x) = 1/2[(x 2 1)] = x, p 2 (x) = 1/(4 2)[(x 2 1) 2 ] = 1/8[x 4 2x 2 + 1] = 1/8[12x 2 4] = /2(x 2 ), p (x) = 1/(8 6)[(x 2 1) ] = 1/48[x 6 x 4 + x 2 1] = 1/48[12x 72x] = 5/2[x /5x]. 9 Exercise 5.5.9 Verify the coefficients c i nd x i in Tble 5.1 for degree n =. We hve computed p (x) = 5/2x(x 2 /5) in Exercise 5.5.8. This immeditly implies tht p () = p (± /5) = confirming the roots listed in Tble 5.1. The coefficients c i re obtined by integrting the Lgrnge polynomils. For exmple, 6

nd therefore Similrly nd therefore L 2 (x) = (x x 1)(x x ) (x 2 x 1 )(x 2 x ) = (x + /5)(x /5) ( + /5)( /5) = 1 5 x2, c 2 = [1 5/x 2 ] dx = [x 5/9x ] x=1 x= = 2 1/9 = 8/9. (x )(x /5) L 1, (x) = ( /5 )( /5 /5) = x(x /5), 2 /5 c 1, = 5 6 1 Computer exercise 5.2.8 Answers: () 1.547866 (b) 1.277978 (c) 1.277978 11 Computer exercise 5.2.1 [x 2 x /5] dx = 5 6 [x / /5x 2 /2] x=1 x= = 5 2 6 = 5 9. See the file uniform refinement.m vilble on the wiki. Adpt the code to use Simpson s rule insted of Trpezoid. 7