Week 8 Lecture 1
Week 8 Lecture 1
Week 8, Lecture 1
Apr. 23, 2024
1
Quadrature
Node
Weight
1-node quadrature
𝑏 1
∫ 𝑝( 𝑥 ) 𝑑𝑥=¿
2
𝑥 2=( 𝑎+ 𝑏)/ 2 𝑎
𝑏 Simpson’s 1/3 rule
𝑥 3=𝑏 ∫ 𝑥 2 𝑑𝑥=𝑤 1 𝑥 12+𝑤 2 𝑥 22+ 𝑤3 𝑥 22= 13 ( 𝑏3 −𝑎3 ) 𝑎
𝑎
n-node quadrature
1
−1 𝑖=1
1 ∫ 𝑝 ( 𝑥) 𝑑𝑥 =2 𝑝 (0)
𝑝 ( 𝑥 )=𝑥∫ 𝑥𝑑𝑥=∑ 𝑤𝑖 𝑝 ( 𝑥 𝑖 ) =𝑤1 𝑥 1=0
−1
−1 𝑖=1
2-node quadrature-
1
4 unknowns
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
𝑏 1
𝑏−𝑎 𝑎+𝑏 𝑏−𝑎
∫ 𝑓 (𝑥)𝑑𝑥=∫ 𝑓 ( 2 ξ+ 2 ) 2 𝑑ξ
𝑎 −1
Three points
Exact solution
=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)
1 1
∫𝑒 𝑑𝑥=1.5 ∫ 𝑒
2 2
−2 −1
𝜀𝑡 =0.01 %
Estimate the aforementioned integral using dartboard Monte Carlo integration and 1500 points