Numerical Integration
Numerical Integration Numerical Integration
Simpson’s 1/3 Code (p.3) double Integration::Simpsons13(int n) { double h=(xn-x0)/n; double sum=0.0; double x=x0; double I; for(int i=1; i
Simpson’s 1/3 Code (p.4) double FUN(double x) // User supplied function { return 0.2 + 25*x - 200*x*x * + 675*x*x*x * * - 900*x*x*x*x* * * + 400*x*x*x*x*x; } int main() { Integration I(FUN,0,0.8); int i; for(i=2;i
- 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 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: Simpson’s 1/3 Code (p.2) double I
Simpson’s 1/3 Code (p.4)<br />
double FUN(double x) // User supplied function {<br />
return 0.2 + 25*x - 200*x*x * + 675*x*x*x * * - 900*x*x*x*x* * *<br />
+ 400*x*x*x*x*x; }<br />
int main() {<br />
<strong>Integration</strong> I(FUN,0,0.8);<br />
int i;<br />
for(i=2;i