• No results found

Numerical Integration - (4.3) k 1 bk 1 a k 1. k f x 1 k 1 bk 1 a k 1 9 hf a h hf b 0 1 b a 9 h h 3h b a.

N/A
N/A
Protected

Academic year: 2021

Share "Numerical Integration - (4.3) k 1 bk 1 a k 1. k f x 1 k 1 bk 1 a k 1 9 hf a h hf b 0 1 b a 9 h h 3h b a."

Copied!
7
0
0

Loading.... (view fulltext now)

Full text

(1)

Numerical Integration - (4.3) 1. The Degree of Accuracy of a Quadrature Formula:

The degree of accuracy of a quadrature formula Qf is the largest positive integer n such that

a b xkdx  Qxk, k  0, 1, 2, . . . , n. Example

a b fxdx  9 4hfa  h  34hfb, h   b− a

3 , 3h  b − a. Find the degree of

accuracy

of this quadrature formula Qf  9

4 hfa  h  34hfb. Consider fx  1, fx  x, fx  x2, . . . . It is known that

a b xkdx 1 k 1b k1− ak1. k fx 1 k 1b k1− ak1 9 4hfa  h  34hfb 0 1 b− a 9 4h 34h  3h  b − a 1 x 1 2 b 2 − a2 9 4ha  h  34hb  3h4 3a  h  b  b − a 4 3a  b − a  b  b − a4 2a  2b  12b 2 − 1 2 a 2 2 x2 1 3 b 3− 1 3a 3 9 4ha  h 2  3 4hb 2 1 3b 3 1 3a 3 3 x3 1 4 b 4− 1 4a 4 9 4ha  h 3  3 4hb 3  − 1 9 ba 3  1 6 b 2a2 1 9 b 3a 5 18 b 4 − 2 9 a 4

So the degree of accuracy is 2

Example Suppose that the quadrature formula

0 2

fxdx  c0f0  c1f1  c2f2

is exact for all polynomials of degree less than and equal to 2. Find c0, c1and c2

Qf  c0f0  c1f1  c2f2 . fx  1, c0  c1  c2  2 1 fx  x, 0 c1 2c2  2 2 fx  x2, 0 c 1  4c2  8 3 3 3 − 2: 2c2  2 3, c2  13 Substitute it into2 : c1  2 − 2 1 3  43 Substitute both c1and c2into1 :

c0  2 − 4 3 − 13  13

02 fxdx  1 3f0  43f1  13f2 2. Numerical Quadrature:

(2)

a b fxdx ≈

i0 n aifxi.

What are a0, a1, . . . , an? What is the approximation error?

a. Using Lagrange Interpolating Polynomials: If fx 

i0 n fxiLn,ix  f n1c n  1!

i0 n x − xi then

a b fxdx ≈

i0 n fxi

a b Ln,ixdx  ai

a b Ln,ixdx, i  0, 1, . . . , n

The corresponding approximation error is

Rint 

a b fn1c n  1!

i0 n x − xidx. Trapezoidal Rule:

Consider the 1st degree Lagrange interpolating polynomial P1x with data pairs a, fa and

b, fb . Let h  b − a. P1x  fa x − b a− b  fb x − ab− a  −fa x − bh  fb x − ah

a b P1xdx 

a b −fa x − b h  fb x − ah dx  − fa 2h x − b 2 fb 2h x − a 2 a b  1 2h fbh 2  fah2  h 2 fb  fa

Weighted Mean Value Theorem for Integrals: (Page 9, Theorem 1.11 Suppose that F is continuous on a, b ,

a b

gxdx exists, and gx does not change sign on a, b .

Then there exists a number c in a, b with

a b Fxgxdx  Fc

a b gxdx.

The corresponding approximation error:

Consider Fx  f ′′ c , and gx  x − ax − b. gx does not change sign on a, b .

Rtrap 

a b f ′′ c  2! x − ax − bdx  12f ′′ c

a b x − ax − bdx  1 2f ′′ c

a b x − ax − a − hdx  1 2f ′′ c

a b x − a2 − x − ah dx  1 2f ′′ c 1 3x − a 3− 1 2x− a 2h a b  1 2f ′′ c 1 3b − a 3 − 1 2b− a 2h  1 2f ′′ c 1 3h 3 − 1 2h 3  − 1 12f ′′ ch3

(3)

b. Using Taylor Polynomials and Difference Formulas:

Though we can derive an numerical quadrature using the formula:

in0fxi

a b Ln,ixdx, the remainder formula Rint 

a b fn1c n  1!

i0 n x − xidx

may not be easy to use to derive the approximation error. To derive the approximation error for the Trapezoidal Rule, we use the Weighted Mean Value Theorem which has a condition: gx does not change sign on a, b . This condition is not always satisfied for f

n1c

n  1!

i0 n

x − xi. For

example, to derive the approximation error for Simpson’s Rule (3 pairs of data, a 2nd degree Lagrange polynomial) Rint 

a b f ′′′c 3! x − x0x − x1x − x2dx Here gx  1

3!x − x0x − x1x − x2 which does change sign over the interval x0, x2 . By Taylor Theorem, we know

fx  Pnx  Rnx, and

a b fxdx 

a b Pnxdx 

a b Rnxdx where Pnx  fxi  fxi 1! x − xi  f ′′xi 2! x − xi 2 f ′′′ xi 3! x − xi 3 . . . f n xin! x − xin Rnx  f n1 c n  1! x − xin1

The approximation error for

a b fxdx ≈

a b Pnxdx is Rint

a b f n1c n  1! x − xin1dx.

Observe that the sign of f

n1

c

n  1! x − xin1does not change on the interval a, b . So by the

Weighted Mean-Value Theorem we know there exists a number c in a, b such that

ab f n1c n  1! x − xin1dxf n1c̄ n  1!

a b x − xin1dxfn1c̄ n  1! n 2 1 b− xin2− a − x in2

For the approximation error for Simpson’s Rule: choose xi  x1, and use x0, x1, x2 :

x0  a  x1 − h, x2  b  x1  h, h  b − a

2 Note that the interval a, b  x0, x2 is symmetric about x  x1. So,

(4)

x0 x2 x − x1mdx

x0 x1 x − x1mdx

x1 x2 x − x1mdx  0 if m is odd 2

x1 x2 x − x1mdx  2 m 1 x2 − x1 m1 2 m 1h m1 if m is even Consider

a b fxdx ≈

a b P3xdx

x0 x2 fx1  fx1 1! x − x1  f ′′x1 2! x − x1 2 f ′′′ x1 3! x − x1 3 dx  2hfx1  f ′′ x1 2 2 3h 3

Approximate f ′′x1 by the difference formula:

f ′′x  fx  h − fx  fx − h

h2 − 112f4c1h

2

we have the numerical integral formula:

Qf  2hfx1  h 3 3 fx2 − fx1  fx0 h2  2hfx1  h3fx2 − fx1  fx0  h 3fx0  4fx1  fx2 and the approximation error:

Rint

x0 x2 f 4c1 4! x − x1 4 dx− h3 3 1 12f 4c 2h2  f 4 c̄1 4! 2 5h 5 − h5 36f 4c 2  f4c 1 60 − 136 h 5  − h5 90f 4c where c is in x0, x2 .

Numerical integration formulas and approximation errors:

Name Approximation formula Approximation error

Trapezoidal Rule h 2 fb  fa , h  b − a − 112f ′′ ch3 Simpson’s Rule h 3 fx0  4fx1  fx2 , h  b − a2 − h 5 90 f 4c Example Approximate

0 /4

sinx2dx by the Trapezoidal Rule, and Simpson’s Rule . Estimate

corresponding approximation errors.

(5)

0.6 0.4 0.2 0 0.5 0.375 0.25 0.125 0 y  sinx2, 0 ≤ x ≤ 4, dash yT, dashdots y Trapezoidal Rule: yT  sin 2 16 −0 4 −0 x − 0  0  4 sin  2 16 yS  −0. 151 162 9  0. 776 077 7x  0. 940 758 1x − 0. 392 699 12 h   4 − 0  4 , T  12 4 f0  f 4  8 0 sin  2 16  0. 227 164 h  1 2 4 − 0  8 , S  1 3 8 f0  4f 8  f 4  13 8 0 4 sin  2 64  sin  2 14  0. 165 250 46 True error: RT

0 /4 sinx2dx − 0. 227 164  −7. 000 933 252 893 539 95  10−2 RS

0 /4 sinx2dx − 0. 165 250 46  8. 095 792 5  10−3 Approximation errors: f ′′x  −4sin x2x2  2 cos x2 f ′′′x  −8cos x2x3 − 12sin x2x

f4x  16sin x2x4 − 48cosx2x2 − 12 sin x2

0.8 0.6 0.4 0.2 0 2 1.5 1 0.5 0 x y x y y  f ′′x 0.8 0.6 0.4 0.2 0 25 20 15 10 5 0 x y x y y  |f4x|

(6)

f ′′x ≤ f ′′0  2, f 4x ≤ f 4 4 ≤ 16 sin 4 2 4 4 − 48 cos  4 2 4 2 − 12 sin  4 2 ≤ 28 ErrT  − h3 12f ′′  ≤ 2 12 4 3  8. 074 551  10−2 ErrS  − h5 90f4 ≤ 19028 8 5  2. 905 46  10−3 3. Newton-Cotes Formulas:

These formulas are derived using Lagrange interpolating polynomials.

Several numerical integration formulas are listed on Page 192-4: formulas (4.23)-(4.30). a. n  1 −point closed Newton - Cotes formulas:

x0  a, xn  b, h  b − an , xi  a  ih n # of pts # of sub-int. Formula (4.23)-(4.26) approx error c 1 2 1 h 1 2fx0  12fx1 − h 3 12 f ′′ c x0, x1 2 3 2 h 1 3 fx0  43fx1  13fx2 − h 5 90 f 4c x 0, x2 3 4 3 h 3 8 fx0  98 fx1  98 fx2  38 fx3 − 3h 5 80 f 4c x 0, x3 4 5 4 h 14 45 fx0  6445fx1  2445fx2  6445fx3  1445fx4 − 8h 7 945 f6c x0, x4 b. n  1 −point open Newton - Cotes formulas:

x−1  a, x0  a  h, xn  b − h, xn1  b, h  b − an 2, xi  xi−1  h.

The Midpoint formulas are open Newton - Cotes formulas.

n # of pts # of sub-int. Formula (4.27)-(4.30) approx error c 0 3 2 2hfx0 h 3 3 f ′′ c x−1, x1 1 4 3 h 3 2fx0  32fx1 3h3 4 f ′′ c x−1, x2 2 5 4 h 8 3fx0 − 43fx1  83fx2 14h5 45 f 4c x−1, x 3 3 6 5 h 55 fx   5 fx   5 fx   55fx95h5 f4c x−1, x

(7)

Example Use the Midpoint Rule (4.28) and4. 29 to approximate

0

/4

sinx2dx and estimate the

approximation errors. a. (4.28): h  1 3 4  12, x0  12, x1  0  2 12  6 T1  3 2 12 fx0  fx1  8 sin 12 2  sin  6 2  0. 133 211 b. (4.29): h  1 4 4  16. xi  0  i 16 , i  0, 1, 2 T2  4h 3 2fx0 − fx1  2fx2  43 16 2 sin 16 2 − sin 8 2  2 sin 3 16 2  0. 158 022 True errors: Ra

0 /4 sinx2dx − 0. 133 211  2. 394 366 7  10−2 Rb

0 /4 sinx2dx − 0. 158 022  8. 673 325 2  10−4 Approximation errors: a. Ra  3 4 h 3f ′′ ≤ 3 42 12 3  2. 691 517  10−2 b. Rb  14h5 45 f 4  ≤ 14 4530 16 5  2. 723 869  10−3

References

Related documents

The quality of both of these business outcomes relies directly on the quality (predictive accu- racy) of network analysis results provided, most notably, by the state estimation

Political Parties approved by CNE to stand in at least some constituencies PLD – Partido de Liberdade e Desenvolvimento – Party of Freedom and Development ECOLOGISTA – MT –

These forward-looking statements are subject to certain risks and uncertainties that could cause actual results to differ materially from our historical experience or our

: If this product contains ingredients with exposure limits, personal, workplace atmosphere or biological monitoring may be required to determine the effectiveness of the

Facet joint arthropathy - osteophyte formation and distortion of joint alignment MRI Axial T2 L3-L4 disk Psoas Paraspinal muscles Psoas Paraspinal NP AF MRI Axial T2 PACS, BIDMC

Specifically, we tested whether emotional responses would be less positive, and more negative, toward wearers of any Muslim veil compared with those wearing no veil (Hypothesis 1);

This model posits four types of health beliefs that affect an individual’s health behavior, in this case, the decision to seek mental health services: perceived

Deshpande (1996) classified the aspects of the ethical climate as professionalism, caring, rules, instrumentalism, productivity and he also classified the job