Error Estimation •
ea = p − p
•
er =
vii) vii) Error: Error: max f ( x) − S ( x) ≤
*
a ≤ x ≤b
p − p * p
Fixed Point Iteration •
•
•
g ( x) = x g ' ( x ) ≤k <1
p n
= g ( p n −1 )
n ≥1
Newton Method •
An efficient method belonging to FP Iteration
•
g ( x) = x −
f ( x) f ' ( x)
= x )
•
g ' ( p ) = 0 (slope is 0 at the root g ( x)
•
f ' ( x) ≠ 0 (otherwise, Newton Method is undefined)
•
pn = p n−1 −
( (
f pn−1
) )
f ' pn −1
Cubic Spline Interpolation •
Piecewise Linear Approximation i)
Easy
ii) No assuranc assurancee of differenti differentiabil ability ity iii) No assurance assurance of smoothness smoothness •
Piecewise Quadratic Approximation i)
Continu Continuousl ously y different differentiab iable le on the interval interval
ii) ii) Smoo Smooth th iii) Can’t satisfy satisfy endpoint endpoint condition conditionss •
Piecewise Cubic Approximation i)
Also Also called called Cubic Cubic Spline Spline Interp Interpolat olation ion
ii) ii) Conti Continu nuou ously sly 1 st & 2nd differentiable on the interval iii) iii) Smoot Smooth h iv) Meet Endpoin Endpointt Conditions Conditions as: (1) Free Boundary: Boundary:
S
" ( x 0 )
S
=
" ( x n )
0
=
(2) Clamped Boundary: S ' ( x 0 ) = f ' ( x n ) & S ' ( x n ) = f ' ( x n ) v)
Form: S j ( x) = a j
+ b j ( x − x j ) + c j ( x − x j ) 2 + d j ( x − x j )3
vi) vi) Ration Rationale ale (1) S j-1 ( x j ) = S j ( x j ) = f ( x j ) (give 2 equations) (2) S j- 1 ' ( x j ) = S j ' ( x j ) (give 1 equation) (3) S j-
1
" ( x j )
S j
"(x
=
j
)
(give 1 equation)
5M 384
4 * max ( x j +1 − x j ) 0≤ j ≤n −1
ax f ( 4 ) ( x) ≤ M ) (where m a≤ x≤b
x1 Numerical Differentiation •
i)
1st Derivative i)
=
=
f ( x0
+ h) − f ( x0 )
x2
h
− f " (ξ ( x0 ))
h
ii) n=1: xx Rule
2
− h)
=
2h
+ h) − f ( x0 − h)
−
2h
h2 6
+
i) h
3
a
f (3) (ξ 0 )
•
f (ξ 0 )
12h
•
+
h
+
5
4
30
f ( x0
f (5) (ξ 0 )
h)
b − a n
x1
h h3 f ( x)d x= [ f ( x0 ) + f ( x1 )] − f " (ξ ) 2 12 x0
∫
x2
ii) n=2: Simpson’s Rule
5
∫ f ( x)dx = 3 [ f ( x ) + 4 f ( x ) + f ( x )] − 90 f h
h
0
1
2
( 4)
(ξ )
x0
iii) n=3: Simpson’s
3 8
x3
Rule
3h 5
∫ f ( x)dx = 8 [ f ( x ) + 3 f ( x ) + 3 f ( x ) + f ( x )] − 80 f 3h
0
x0
Simple Open Newton-Cotes Formulas
b − a h = n + 2
1
2
2
3
( 4)
(ξ )
n −1
∑
m −1
2 j
j =1
(b − a ) h 2
f ( x j ) + f (b) −
12
m
∑ f ( x
)+4
j =1
b
2
f " (ξ )
j =1
2 j −1
) + f (b) −
b − a h = f " (ξ ) n
(b − a) h 4 180
f ( 4) (ξ )
b−a h = 2m n m = 2
f (5) (ξ 0 )
=−−
n=1: Trapezoidal Rule
4
f (a) + 2
∫ f ( x)dx = 3 f (a) + 2∑ f ( x
iii) Midpoint Rule
Simple Closed Newton-Cotes Formulas h =
i)
•
h4
2nd Derivative:
Numerical Integration
h
a
− 2h) − 8 f ( x0 − h) + 8 f ( x0 + h) − f ( x0 + 2h)
f " ( x 0 )
1
h
b
ii) Simpson’s
( 3)
12h
vi) 5P Midpoint: f ' ( x0 ) =
∫
f ( x)dx =
Trapezoidal Rule
2
− 25 f ( x0 ) + 48 f ( x0 + h) − 36 f ( x0 + 2h) +16 f ( x0 + 3h) − 3 f ( x 0 + 4h) f ( x0
0
3h3
Composite
v) 5P Forward: f ' ( x0 )
∫ f ( x)d x= 2 [ f ( x ) + f ( x )] − b
2
− 3 f ( x0 ) + 4 f ( x0 + h) − f ( x0 + 2h)
iv) 3P Midpoint: f ' ( x0 ) =
•
h
+ f " (ξ ( x0 ))
h
f ( x0
3h
x− 1
f ( x0 ) − f ( x0
iii) 3P Forward: f ' ( x0 ) =
0
x− 1
ii) Backward-Difference Formula:
f ' ( x0 )
∫ f ( x)d x= 2h f ( x ) + 3 f "(ξ )
n=0: Midpoint Rule
Forward-Difference Formula:
f ' ( x0 )
h3
∫ a
m
∑ f ( x
f ( x)dx = 2h
j =0
2 j
)+
2 (b − a) h
6
f " (ξ )
h = b − a 2m + 2
b
∫
Gaussian Quadrature f ( x) dx ≈
n
•
∑c f ( x ) i
M = N 1 (h) + K 1 h 2
i =1
a
i)
h 4 N 1 ( ) − N 1 (h) 2 N 2 (h) = 3 h 16 N 2 ( ) − N 2 (h) h 2 Step of ⇒ N 3 (h) = 2 15 h j 1 4 − N j −1 ( ) − N j −1 (h) N (h) = 2 j 4 j −1 −1
ii)
h 16 N 1 ( ) − N 1 (h) 4 N 2 (h) = 15 h 256 N 2 ( ) − N 2 (h) h N (h) = 4 ⇒ Step of 3 4 255 h j 1 16 − N j −1 ( ) − N j −1 (h) N (h) = 4 j j 1 16 − −1
b
•
n =2:
•
n = 3:
∫ f ( x)dx ≈ f ( 0.5773502692
) + f ( − 0.5773502692 )
a
b
∫ f ( x)dx ≈ 0.555556 f ( 0.7745966692
) + 0.88889 f ( 0) + 0.555556 f ( − 0.7745966692 )
a b
•
n = 4:
∫ f ( x)dx ≈
0.347855 f ( 0.8611363116
) + 0.652145
f ( 0.3399810436
)
a
+ 0.347855 f ( −0.8611363116 ) + 0.652145 f ( −0.3399810436
)
b
•
n = 5:
∫ f ( x)dx ≈
0.236927 f ( 0.9061798459
) + 0.47863 f ( 0.5384693101 ) + 0.568889
f (0 )
a
+ 0.236927 f ( −0.9061798459 b
•
Transformation of Boundary:
1
) + 0.47863
1
M = N 1 (h) + K 1h + K 2 h2 + K 3h3 + ...
i)
ii)
)
b − a ( b − a)t + (b + a) dt 2 2
Richardson’s Extrapolation •
f ( − 0.5384693101
∫ f ( x)dx ≈ −∫ f a
+ K 2 h 4 + K 3 h 6 + ...
i
h 2 N 1 ( ) − N 1 ( h) 2 = N h ( ) 2 1 h 4 N 2 ( ) − N 2 (h) h 2 Step of ⇒ N 3 (h) = 2 3 h 2 j −1 N j −1 ( ) − N j −1 (h) N (h) = 2 j j 2 −1 − 1 h 4 N 1 ( ) − N 1 ( h) 4 N 2 (h) = 3 h 16 N 2 ( ) − N 2 (h) h 4 St ep of ⇒ N 3 (h) = 4 15 h j 1 4 − N j −1 ( ) − N j −1 (h) N (h) = 4 j 4 j −1 − 1
Lipschitz Condition: A function f (t , y ) is said satisfy a Lipschitz condition in the variable y on a set
D ⊂ R 2 if a constant L > 0 exists with f (t , y1 ) − f (t , y 2 ) ≤ L y1 − y 2 wherever (t , y1 ), (t , y 2 ) ∈ D . The constant L is called a Lipschitz constant for f Suppose f (t , y ) is defined on a convex set D ⊂ R 2 . If a constant L > 0 exists with ∂ f (t , y ) ≤ L , for all (t , y ) ∈ D , y ∂
then f satisfies a Lipschitz condition on D in the variable y with Lipschitz constant L
Higher-Order Taylor Method •
•
dy dt
= f (t , y ), a ≤ t ≤ b, y (a ) =α
wi +1
= wi + hT ( n) (t i , wi )
•
Local Truncation Error = O(h ) =
•
Order 1 (n=1: Euler’s Method)
n
i)
wi +1
hn
f (n +1)!
(n)
(ξ ,
y (ξ i )
i
)
h1 h f ' ξ i , y (ξ i ) = f ' ξ i , y(ξ i ) (1 +1)! 2
(
)
(
)
Order 2 i)
wi +1
= wi + hT ( 2) (t i , wi ) h = wi + h f (t i , wi ) + f ' (t i , wi ) 2
ii) Local Truncation Error O( h 2 )
•
=
Order 3 i)
wi +1
h2 (2 1) !
=+
ξ f " ( y (ξ i , i ))
h2 6
=
= wi + hT (3) (t i , wi ) 2 h h = wi + h f (t i , wi ) + f ' (t i , wi ) + f "(t i , wi ) 2 6
3 ii) Local Truncation Error = O(h ) =
h3 h 3 (3) f (3) ξ i , y (ξ i ) = f ξ i , y(ξ i ) (3 +1)! 24
(
)
(
)
Taylor’s Expansion of 2 variables •
f ( t , y ) = P n ( t , y ) + Rn ( t , y)
= ( t − t ) 0
0
f ( t 0 , y0 ) 0!
( t − t ) ∂ f ( , ) ( y − y ) ∂ f ( , t y + t y + 1! ∂ y 1! ∂t 0
0
0
0
0
0
)
( t − t 0 ) 2 ∂ 2 f ( y − y0 ) 2 ∂ 2 f 2( t − t 0 )( y − y0 ) ∂ 2 f + ( t 0 , y 0 ) + ( t 0 , y0 ) + ( t 0 , y0 ) 2 2 t y 2 ! t 2 ! 2 ! y ∂ ∂ ∂ ∂ 2 2 ( t t ) 3 3 f 3( t t ) ( y − y0 ) ∂ 3 f 3( t − t 0 ) ( y − y0 ) ∂ 3 f ( y − y 0 ( t 0 , y 0 ) + ( t 0 , y 0 ) + + − 0 ∂ 3 ( t 0 , y0 ) + − 0 2 2 3 ! t 3 ! t y 3 ! t y 3! ∂ ∂ ∂ ∂ ∂
y0 )
1 n+1 n +1 ∂ n+1 f ( t − t 0 ) n +1− j ( y − y0 ) j n+1− j j ( ξ , µ ) + ∑ ∂t ∂ y ( n + 1)! j =0 j
= wi + hT (1) (t i , wi ) = wi + h[ f (t i , wi )]
1 ii) Local Truncation Error =O(h ) =
•
1 n n ∂ n f ( t − t 0 ) n − j ( y − y0 ) j n − j j ( t 0 , + ∑ ! ∂t ∂ y n j =0 j
Runge-Kutta Methods •
a = 1 1 2 a = 1 ⇒w =w + h [ f (t , 2 2 i +1 i i 2 α =h 2 δ 2 =h
Taylor Method Order 2 wi +1 = wi + hT
(2)
(t i , wi ) + O(h ) 2
2
h h =wi +h f (t i , wi ) + f ' (t i , wi )+ 2 6
(
f " ξ i,
h d f h2 = wi + h f (t i , wi ) + * (t , y(t ) ) (t , y (t ) )= (t , w ) + f "( ξ i , y(ξ i )) 2 d t 6 i
i
i
•
i
i
i
•
i
Runge-Kutta Manipulation I i)
h
Use a1 f ( t + α 1 , y + β 1 ) to replace f (t i , wi ) + f ' (t i , wi ) of TM Order 2 2
ii) Taylor Polynomial of Degree 1 about (t , y ) :
) a f ( t , y) +a1α 1 a1 f (t +α , y +β 1 1 = 1
∂ ∂ ∂ f f f ( t , y) +a1β 1 ( t , y) +a1 R1 ( t +α 1 , y +β 1) ∂t ∂ y ∂ y
iii) f (t i , wi ) +
h f ' (t i , wi ) 2
= f (t i ,
wi ) +
h ∂ f * (t , y (t )) 2 ∂t
( t , y ( t ))=( t i , wi )
+
f ∂ (t , ∂ y
y (t )) * f (t i , wi )
( t , y ( t )
iv) Midpoint Method:
a1 =1 h h h = ⇒ α wi +1 =wi +hf t i + , wi + f (t i , wi ) 1 2 2 2 h β = f t , y 1 2
(
•
)
Runge-Kutta Manipulation II h
i)
Use a1 f ( t , y ) + a2 f ( t + α 2 , y + δ 2 f ( t , y ) ) to replace f (t i , wi ) + f ' (t i , wi ) of TM Order 2
ii)
M-Euler Method:
2
(t i , wi )) ]
1 a1 = 4 3 a2 = 4 ⇒w = w + h f (t , w ) +3 f (t + 2h , w + 2h f (t , i +1 i i i i i i 2h 4 3 3 α 2 = 3 δ = 2h 2 3
h2 h ∂ f ∂ f = wi + h f (t i , wi ) + * (t , y(t ) ) (t , y(t ) )= (t , w ) + (t , y(t ) )* f (t i , wi ) (t , y(t ))= (t , w ) + f "( ξ 2 ∂ t ∂ y 6 i
+hf
iii) Heun’s Method:
i
∂ 2 ∂ = wi + h f (t i , wi ) + h * f (t , y(t ) )(t , y(t ))= (t , w ) + f (t , y(t ) )* d y (t , y(t ) )= (t , w ) + h f " ( ξ i , y(ξ i ) 2 ∂ t ∂ y d t 6 i
wi ) + f (t i+1 , wi
=
,