Numerical Integration Gerald Recktenwald Portland State University - - PDF document

numerical integration
SMART_READER_LITE
LIVE PREVIEW

Numerical Integration Gerald Recktenwald Portland State University - - PDF document

Numerical Integration Gerald Recktenwald Portland State University Mechanical Engineering Department gerry@me.pdx.edu These slides are a supplement to the book Numerical Methods with Matlab : Implementations and Applications , by Gerald W.


slide-1
SLIDE 1

Numerical Integration

Gerald Recktenwald Portland State University Mechanical Engineering Department gerry@me.pdx.edu

These slides are a supplement to the book Numerical Methods with Matlab: Implementations and Applications, by Gerald W. Recktenwald, c 2002, Prentice-Hall, Upper Saddle River, NJ. These slides are c

  • 2002 Gerald W. Recktenwald.

The PDF version of these slides may be downloaded or stored or printed only for noncommercial, educational

  • use. The repackaging or sale of these slides in any form, without written

consent of the author, is prohibited. The latest version of this PDF file, along with other supplemental material for the book, can be found at www.prenhall.com/recktenwald. Version 0.01 March 9, 2002

slide-2
SLIDE 2

Primary Topics

  • Basic concepts
  • Newton Cotes Rules

⊲ Trapezoid rule ⊲ Simpson’s rule

  • Gaussian Quadrature
  • Adaptive Quadrature
  • Improper Integrals

NMM: Numerical Integration page 1

slide-3
SLIDE 3

Figure 11.2

a b L NMM: Numerical Integration page 2

slide-4
SLIDE 4

Figure 11.3

a b f (x )

NMM: Numerical Integration page 3

slide-5
SLIDE 5

Figure 11.4

2 a b f (x ) Composite Rule: N panels 1 ... N Basic Rule: m nodes 1 2 ... m

NMM: Numerical Integration page 4

slide-6
SLIDE 6

Figure 11.5

f(x) x1 h = x2 –x1 x2 P

1(x)

f1 f2

NMM: Numerical Integration page 5

slide-7
SLIDE 7

Figure 11.6

x1 h x2 x3 xn–1 xn f1 f2 f3 fn–1 fn h h h fn–2 xn–2 a b

NMM: Numerical Integration page 6

slide-8
SLIDE 8

Figure 11.7

0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0.2 0.4 3 panels error = -0.208654 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0.2 0.4 4 panels error = -0.124097 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0.2 0.4 5 panels error = -0.081554

NMM: Numerical Integration page 7

slide-9
SLIDE 9

Figure 11.8

x1 x2 x3 f1 f2 f3 h h f(x) P2(x)

NMM: Numerical Integration page 8

slide-10
SLIDE 10

Figure 11.9

x1 x3 x5 f1 f3 f5 h xn fn h h h fn–2 fn–3 xn–2 xn–3

NMM: Numerical Integration page 9

slide-11
SLIDE 11

Figure 11.10

0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0.2 0.4 3 panels error = -0.007070 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0.2 0.4 4 panels error = -0.002368 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0.2 0.4 5 panels error = -0.000997

NMM: Numerical Integration page 10

slide-12
SLIDE 12

Figure 11.11

x1 x2 x3 f1 f2 f3 h h x1 x2 x3 f1 f2 f3 h h h h a b a b

Three point closed rule h = b – a 2 Three point open rule h = b – a 4

NMM: Numerical Integration page 11

slide-13
SLIDE 13

Figure 11.12

1.0000 1.0000

Order 2

1.0000 1.0000

Order 2

1.0000 1.0000

Order 2

1.0000 1.0000

Order 2

0.5556 0.8889 0.5556

Order 3

0.5556 0.8889 0.5556

Order 3

0.5556 0.8889 0.5556

Order 3

0.5556 0.8889 0.5556

Order 3

0.3479 0.6521 0.6521 0.3479

Order 4

0.3479 0.6521 0.6521 0.3479

Order 4

0.3479 0.6521 0.6521 0.3479

Order 4

0.3479 0.6521 0.6521 0.3479

Order 4

0.2369 0.4786 0.5689 0.4786 0.2369

Order 5

0.2369 0.4786 0.5689 0.4786 0.2369

Order 5

0.2369 0.4786 0.5689 0.4786 0.2369

Order 5

0.2369 0.4786 0.5689 0.4786 0.2369

Order 5

  • 1
  • 0.5

0.5 1

0.1713 0.3608 0.4679 0.4679 0.3608 0.1713 0.1713 0.3608 0.4679 0.4679 0.3608 0.1713 0.1713 0.3608 0.4679 0.4679 0.3608 0.1713 0.1713 0.3608 0.4679 0.4679 0.3608 0.1713

Order 6

NMM: Numerical Integration page 12

slide-14
SLIDE 14

Figure 11.13

xi xm,i xi+1 f(x) x1

*

x2

*

x3

*

x4

*

–1 f(z) z1 z2 z3 z4 1 2 1 2 1 H 2 H 2 NMM: Numerical Integration page 13

slide-15
SLIDE 15

Figure 11.14

10 10

1

10

2

10

3

10

  • 15

10

  • 10

10

  • 5

10 Truncation error Number of function evaluations

trapezoid simpson GL 4 node

NMM: Numerical Integration page 14

slide-16
SLIDE 16

Figure 11.15

a a b c d e b c d e a b c d e a b c d e a b c d e right left left right level 2 level 1 level 3 a b a b level 4 H for level 1 NMM: Numerical Integration page 15

slide-17
SLIDE 17

Figure 11.16

0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

  • 20

20 40 60 80 100 y = humps(x) 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0.01 0.02 0.03 0.04 0.05 0.06 0.07 x Space between f(x) evaluations

NMM: Numerical Integration page 16

slide-18
SLIDE 18

Figure 11.17

10

  • 10

10

  • 8

10

  • 6

10

  • 4

10

  • 2

10 10

  • 6

10

  • 4

10

  • 2

10 Absolute error tol quad quad8 10

  • 10

10

  • 8

10

  • 6

10

  • 4

10

  • 2

10 10

2

10

3

10

4

10

5

Absolute error flops quad quad8

NMM: Numerical Integration page 17