0% found this document useful (0 votes)
26 views12 pages

Week 8 Lecture 1

Uploaded by

sooo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views12 pages

Week 8 Lecture 1

Uploaded by

sooo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Engineering Numerical Analysis

Week 8, Lecture 1
Apr. 23, 2024

Lecturer: Dr. MM Javidan

College of Engineering, Sungkyunkwan University


Spring Semester 2024

1
Quadrature

 Approximation of an integral using numerical


methods is called quadrature
𝑛
𝐼=∑ 𝑤𝑖 𝑓 (𝑥𝑖 ) Quadrature rule
𝑖=1

Node
Weight

𝑎 ≤ 𝑥 1 < 𝑥2 < …< 𝑥𝑛 ≤ 𝑏

Common choice for quadrature rules is monomial basis with


equally spaced nodes and samples at each end of the interval

College of Engineering, Sungkyunkwan University 2


Method of Undetermined Coefficients
weights for nodes are found so that the quadrature rule is exact for polynomials with the degree

1-node quadrature
𝑏 1

𝑝 ( 𝑥 )=1 ∫ 𝑑𝑥=∑ 𝑤𝑖 𝑝 ( 𝑥 𝑖 ) =𝑤 1=𝑏 − 𝑎


𝑎 𝑖=1
2-node quadrature 𝑏 1
𝑤1 =𝑤2= (𝑏 − 𝑎)
𝑝 ( 𝑥 )=𝑥 ∫ 𝑑𝑥=𝑤 1+ 𝑤2=𝑏− 𝑎 𝑏
2
∫ 𝑝( 𝑥 ) 𝑑𝑥= 𝑏 −𝑎
𝑎
𝑥1 =𝑎 𝑏
(𝑝 ( 𝑎 ) +𝑝 ( 𝑏))
∫ 𝑥𝑑𝑥=𝑤1 𝑥 1+ 𝑤2 𝑥 2= 12 (𝑏 2 − 𝑎2 ) 𝑎 2
𝑥 2=𝑏 𝑎 Trapezoidal rule
𝑏
3-node quadrature
2 ∫ 𝑑𝑥=𝑤 1+ 𝑤2 +𝑤3 =𝑏 − 𝑎 1 4
𝑝 ( 𝑥 )=𝑥 𝑎
𝑏
𝑤1 =𝑤3 = (𝑏 −𝑎 )𝑤2 = ( 𝑏− 𝑎)
6 6
𝑥1 =𝑎 ∫ 𝑥𝑑𝑥=𝑤 𝑥
1 1 + 𝑤 𝑥
2 2 +𝑤 𝑥
3 3 =
1 2
(𝑏 −𝑎 )
2
𝑏

∫ 𝑝( 𝑥 ) 𝑑𝑥=¿
2
𝑥 2=( 𝑎+ 𝑏)/ 2 𝑎
𝑏 Simpson’s 1/3 rule
𝑥 3=𝑏 ∫ 𝑥 2 𝑑𝑥=𝑤 1 𝑥 12+𝑤 2 𝑥 22+ 𝑤3 𝑥 22= 13 ( 𝑏3 −𝑎3 ) 𝑎
𝑎

College of Engineering, Sungkyunkwan University 3


Method of Undetermined Coefficients
weights for nodes are found so that the quadrature rule is exact for polynomials with the degree

n-node quadrature

College of Engineering, Sungkyunkwan University 4


Gauss Quadrature
weights and nodes are found so that the quadrature rule is exact for polynomials with the degree
1-node quadrature-
Interval
2 unknowns (x 도
’s are not fixed
모르니까 ) 1 1 𝑤 =2 𝑥 =0
𝑝 ( 𝑥 )=1 ∫ 𝑑𝑥=∑ 𝑤 𝑖 𝑝 ( 𝑥 𝑖 ) =𝑤1=2
1 1
1

1
−1 𝑖=1
1 ∫ 𝑝 ( 𝑥) 𝑑𝑥 =2 𝑝 (0)
𝑝 ( 𝑥 )=𝑥∫ 𝑥𝑑𝑥=∑ 𝑤𝑖 𝑝 ( 𝑥 𝑖 ) =𝑤1 𝑥 1=0
−1

−1 𝑖=1

2-node quadrature-
1
4 unknowns
1

∫ 𝑑𝑥=𝑤1 +𝑤 2=2 𝑝 ( 𝑥 )=𝑥


3
∫ 𝑥 3 𝑑𝑥=𝑤 1 𝑥13 +𝑤 2 𝑥 23=0
𝑝 ( 𝑥 )=1 −1
−1

1 𝑤1 =𝑤2=1
𝑝 ( 𝑥 )=𝑥∫ 𝑥𝑑𝑥=𝑤1 𝑥1 +𝑤1 𝑥1 =0
−1 𝑥1 =1/ √ 3 𝑥 2=−1/ √ 3
1
−1
𝑝 ( 𝑥 )=𝑥∫ 𝑥 2 𝑑𝑥=𝑤1 𝑥12 +𝑤2 𝑥22 =2/ 3
( ) ( )
2
1 1
−1
∫ 𝑝 ( 𝑥) 𝑑𝑥 =𝑝 −
√ 3
+𝑝
√3
−1

College of Engineering, Sungkyunkwan University 5


Gauss Quadrature

𝑏 1
𝑏−𝑎 𝑎+𝑏 𝑏−𝑎
∫ 𝑓 (𝑥)𝑑𝑥=∫ 𝑓 ( 2 ξ+ 2 ) 2 𝑑ξ
𝑎 −1

College of Engineering, Sungkyunkwan University 6


Gauss Quadrature
Evaluate the integral of the function down below between 0 and 0.8
Two points

Three points

Exact solution

College of Engineering, Sungkyunkwan University 7


Monte Carlo Integration

Dartboard Monte Carlo integration

College of Engineering, Sungkyunkwan University 8


Monte Carlo Integration

=400*B7^5-900B7^4+675*B7^3-200*B7^2+25*B7+0.2
=4*RAND()
ε 𝑡 =1.1 %
=0.8*RAND()

=if(C21<D21,1,0)

College of Engineering, Sungkyunkwan University 9


Improper Integral

College of Engineering, Sungkyunkwan University 10


Improper Integral
Evaluate cumulative normal distribution
function at
1
𝑥=
𝑡 𝑡=0.25ξ−0.25
−2 1 −2 0
1
(∫ 𝑒 𝑑𝑥 +∫ 𝑒 ∫𝑒 ∫ 𝑡12 𝑒−1 /(2𝑡 ) 𝑑𝑡
2 2 2 2
−𝑥 /2 −𝑥 /2 −𝑥 /2
𝑁 ( 𝑥 )= 𝑑𝑥 ) 𝑑𝑥=
√ 2 𝜋 −∞ −2 −∞ − 1/ 2

Fourth quadrature 로 값 구한거 , 이거 쓰려고 범위도 -1 에서 1 로 바꾸어준것

1 1

∫𝑒 𝑑𝑥=1.5 ∫ 𝑒
2 2

𝑑 ξ=1.5 ( 𝑤1 𝑓 ( ξ1 ) + 𝑤2 𝑓 ( ξ 2 ) +𝑤3 𝑓 ( ξ 3 ) + 𝑤4 𝑓 ( ξ 4 ) ) =2.051783


−𝑥 /2 − ( 1.5 𝜉 −0.5 ) / 2

−2 −1

𝜀𝑡 =0.01 %

College of Engineering, Sungkyunkwan University 11


Assignment 9

Estimate the aforementioned integral using dartboard Monte Carlo integration and 1500 points

College of Engineering, Sungkyunkwan University 12

You might also like