Numerical Integration
Numerical Integration Numerical Integration
Trapezoidal Rule: Example • Numerically integrate: f ( x ) = 0.2 + 25x − 200x + 675x 2 3 − 900x 4 + 400x 5 a = 0, b = 0.8 (Analytical answer = 1.6405333) © 2003-2006 Roberto Muscedere 6
Trapezoidal Rule: Example f (0) = 0.2 f (0.8) = 0.232 I ≅ 0.2 0.232 ⎞ 0 .8 ⎜ ⎛ + ⎟ = ⎝ 2 ⎠ 0.1728 • Significant difference from analytical solution of 1.6405333 © 2003-2006 Roberto Muscedere 7
- Page 1 and 2: Numerical Integration • Newton-Co
- Page 3 and 4: Trapezoidal Rule • Trapezoidal Ru
- Page 5: Trapezoidal Rule • Same result if
- Page 9 and 10: Trapezoidal Rule • Add a series o
- Page 11 and 12: • Grouping the terms: Trapezoidal
- Page 13 and 14: Trapezoidal Rule: Example f (0) = 0
- 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 />
= 0.2<br />
f<br />
(0.8)<br />
=<br />
0.232<br />
I<br />
≅<br />
0.2<br />
0.232<br />
⎞<br />
0 .8<br />
⎜<br />
⎛ +<br />
⎟ =<br />
⎝ 2 ⎠<br />
0.1728<br />
• Significant difference from analytical solution<br />
of 1.6405333<br />
© 2003-2006 Roberto Muscedere 7