Download - Dr. Nirav Vyas numerical method 3.pdf
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
1/18
Numerical Methods - Numerical
Integration
N. B. Vyas
Department of Mathematics,Atmiya Institute of Tech. and Science, Rajkot (Guj.)[email protected]
N. B. Vyas Numerical Methods - Numerical Integration
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
2/18
Numerical Integration
Let I =
ba
y dx where y = f (x) takes the values y0, y1, . . . , yn for
x0, x1, . . . , xn
N. B. Vyas Numerical Methods - Numerical Integration
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
3/18
Numerical Integration
Let I =
ba
y dx where y = f (x) takes the values y0, y1, . . . , yn for
x0, x1, . . . , xn
Let us divide the interval (a, b) into n sub-intervals of width h sothat x0 = a, x1 = a + h = x0 + h, x2 = x0 + 2h, . . .,xn = x0 + nh = b then
N. B. Vyas Numerical Methods - Numerical Integration
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
4/18
Numerical Integration
Let I =
ba
y dx where y = f (x) takes the values y0, y1, . . . , yn for
x0, x1, . . . , xn
Let us divide the interval (a, b) into n sub-intervals of width h sothat x0 = a, x1 = a + h = x0 + h, x2 = x0 + 2h, . . .,xn = x0 + nh = b then
I = ba
y dx = x0+nhx0
f (x) dx
N. B. Vyas Numerical Methods - Numerical Integration
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
5/18
Numerical Integration
Let I =
ba
y dx where y = f (x) takes the values y0, y1, . . . , yn for
x0, x1, . . . , xn
Let us divide the interval (a, b) into n sub-intervals of width h sothat x0 = a, x1 = a + h = x0 + h, x2 = x0 + 2h, . . .,xn = x0 + nh = b then
I = ba
y dx = x0+nhx0
f (x) dx
Trapezoidal rule:
b=x0+nh
a=x0
f (x)dx = h
2 [(y0 + yn) + 2 (y1 + y2 + .... + yn)]; h = b − a
n
If the number of strips is increased; that is, h is decreased, thenthe accuracy of the approximation is increased.
N. B. Vyas Numerical Methods - Numerical Integration
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
6/18
Numerical Integration
Simpson’s 1
3rd rule:
N. B. Vyas Numerical Methods - Numerical Integration
N I
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
7/18
Numerical Integration
Simpson’s 1
3rd rule:
x0+nh x0
f (x)dx = h3 [(y0 + yn) + 4(y1 + y3 + ....)
+2(y3 + y4 + ....)]; h = b−an
N. B. Vyas Numerical Methods - Numerical Integration
N I
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
8/18
Numerical Integration
Simpson’s 1
3rd rule:
x0+nh x0
f (x)dx = h3 [(y0 + yn) + 4(y1 + y3 + ....)
+2(y3 + y4 + ....)]; h = b−an
while applying this rule, the given interval must be divided intoeven number of equal sub-intervals. i.e. n must be even.
N. B. Vyas Numerical Methods - Numerical Integration
N I
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
9/18
Numerical Integration
Simpson’s 1
3rd rule:
x0+nh x0
f (x)dx = h3 [(y0 + yn) + 4(y1 + y3 + ....)
+2(y3 + y4 + ....)]; h = b−an
while applying this rule, the given interval must be divided intoeven number of equal sub-intervals. i.e. n must be even.
Simpson’s 3
8th rule:
N. B. Vyas Numerical Methods - Numerical Integration
N I
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
10/18
Numerical Integration
Simpson’s 1
3rd rule:
x0+nh x0
f (x)dx = h3 [(y0 + yn) + 4(y1 + y3 + ....)
+2(y3 + y4 + ....)]; h = b−an
while applying this rule, the given interval must be divided intoeven number of equal sub-intervals. i.e. n must be even.
Simpson’s 3
8th rule:
x0+nh x0 f (x)dx =
3h
8 [(y0 + yn) + 3(y1 + y2 + y4 + y5 + ....)+2(y3 + y6 + ....)]; h =
b−an
N. B. Vyas Numerical Methods - Numerical Integration
Numerical Integration
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
11/18
Numerical Integration
Simpson’s 1
3rd rule:
x0+nh x0
f (x)dx = h3 [(y0 + yn) + 4(y1 + y3 + ....)
+2(y3 + y4 + ....)]; h = b−an
while applying this rule, the given interval must be divided intoeven number of equal sub-intervals. i.e. n must be even.
Simpson’s 3
8th rule:
x0+nh x0 f (x)dx =
3h
8 [(y0 + yn) + 3(y1 + y2 + y4 + y5 + ....)+2(y3 + y6 + ....)]; h =
b−an
while applying this rule, the number of sub-intervals should betaken as a multiple of 3 i.e. n must be multiple of 3
N. B. Vyas Numerical Methods - Numerical Integration
Numerical Integration
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
12/18
Numerical Integration
Gaussian Integration Formula:
1 −1
f (t)dt =
n
i=1
wif (ti)
It should be noted here that, t = ±1 is obtained by setting
x = 1
2 [(b + a) + t (b − a)]
N. B. Vyas Numerical Methods - Numerical Integration
Numerical Integration
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
13/18
Numerical Integration
Gaussian Integration Formula: The following table gives thevalues for n = 2, 3, 4, 5
N. B. Vyas Numerical Methods - Numerical Integration
Example
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
14/18
Example
Ex. Evaluate1
0
e−x2
dx by using Gaussion integration formula for
n = 3.
Sol. Here, we have to first convert the given integral from 0 to 1 into
an integral from −1 to 1. x = 12 [(b + a) + t (b − a)], a = 0 and
b = 1
∴ x = t + 1
2 ⇒ dx =
dt
2
∴
1
0 exp(−x
2
)dx =
1
2
1
−1 exp
−
1
4 (t + 1)
2dt
N. B. Vyas Numerical Methods - Numerical Integration
Error
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
15/18
Error
Error in Quadrature Formula:
If y p is a polynomial representing the function y = f (x) in theinterval [x0, xn] the error in the quadrature formula is given by
E =
xn x0
f (x) =
xn x0
y pdx
N. B. Vyas Numerical Methods - Numerical Integration
Error
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
16/18
Error
Error in Trapezoidal rule:
|error| ≤ (b − a)h2
12|f (M )|
where f (M ) = max|f 0(x)|, |f
1(x)|, ..., |f
n−1(x)|
∴ error is of order h2
total error = dh3
12 y0 + y
1 + ... + y
n−1
N. B. Vyas Numerical Methods - Numerical Integration
Error
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
17/18
Error
Error in Simpson’s 1
3rd rule:
|error| ≤ (b − a) h4
180|f 4(M )|
where f 4(M ) = max|y40|, |y
42|, ..., |y
4n−2|
∴ error is of order h4
total error = h5
90 y40 + y
42 + ... + y
4n−2
N. B. Vyas Numerical Methods - Numerical Integration
Error
-
8/20/2019 Dr. Nirav Vyas numerical method 3.pdf
18/18
Error
Error in Simpson’s 3
8th rule:
|error| ≤ (b − a)h4
80|f 4(M )|
where f 4(M ) = max|y40|, |y
43|, ..., |y
4n−3|
∴ error is of order h4
total error = 3h5
80 y40 + y
43 + ... + y
4n−3
N. B. Vyas Numerical Methods - Numerical Integration