Numerical Integration
Numerical Integration Numerical Integration
Trapezoidal Rule: Example • Numerically integrate (using two segments, n=2): f ( x ) = 0.2 + 25x − 200x + 675x 2 3 − 900x 4 + 400x 5 a = 0, b = 0.8, n = 2 (Analytical answer = 1.6405333) © 2003-2006 Roberto Muscedere 12
Trapezoidal Rule: Example f (0) = 0.2 f (0.4) = 2.456 f (0.8) = 0.232 I ≅ ⎛ 0.2 + 2(2.456) + 0.232 ⎞ 0 .8 ⎜ ⎟ = ⎝ 4 ⎠ 1.0688 • Significantly better than with one segment of the trapezoidal rule (0.1728) © 2003-2006 Roberto Muscedere 13
- Page 1 and 2: Numerical Integration • Newton-Co
- Page 3 and 4: Trapezoidal Rule • Trapezoidal Ru
- Page 5 and 6: Trapezoidal Rule • Same result if
- Page 7 and 8: Trapezoidal Rule: Example f (0) = 0
- Page 9 and 10: Trapezoidal Rule • Add a series o
- Page 11: • Grouping the terms: Trapezoidal
- Page 15 and 16: Trapezoidal Code (p.2) double Integ
- Page 17 and 18: Trapezoidal Code -Output n=1, I=0.1
- Page 19 and 20: Simpson’s 1/3 Rule ( x − x1 )(
- Page 21 and 22: Simpson’s 1/3 Rule: Example • N
- Page 23 and 24: Simpson’s 1/3 Rule • Add a seri
- Page 25 and 26: Simpson’s 1/3 Rule • Grouping t
- Page 27 and 28: I f Simpson’s 1/3 Rule: Example (
- Page 29 and 30: Simpson’s 1/3 Code (p.2) double I
- Page 31 and 32: Simpson’s 1/3 Code (p.4) double F
Trapezoidal Rule: Example<br />
f<br />
(0)<br />
=<br />
0.2<br />
f<br />
(0.4)<br />
=<br />
2.456<br />
f<br />
(0.8)<br />
=<br />
0.232<br />
I<br />
≅<br />
⎛ 0.2 + 2(2.456) + 0.232 ⎞<br />
0 .8<br />
⎜<br />
⎟ =<br />
⎝ 4 ⎠<br />
1.0688<br />
• Significantly better than with one segment of<br />
the trapezoidal rule (0.1728)<br />
© 2003-2006 Roberto Muscedere 13