Numerical Differentiation and Integration
Numerical Differentiation and Integration
1st-Order
- this higher terms are called truncation error
- or Zero-order
+
approx.
dcri
* Backward Finite
Difference
a) one-term
f(xi-1) I f(x:) b)
2 terms
f(xi--) = f(xi) – f(xi) h c) 3
terms
f(x1=) < $(xi) – f'(xi) k + f(xi) d)
higher terms
f(x:-1) = f(xi) - f(xi).h + $"
-
So using only 2
terms,
f(xi) - f(x,-1) f(xi) -
+ orn) → (0)
ħ & So using 3 terms and the procedure
outlined before, 3 f(xi) – 4 f(Xina) + f(xi-2)
+ Olha) | » (D) 2h
5.4
* Central Finite
Difference :
Recall
that fof.D
B-F-D f (x:xs) = f(xi)+F(;) h+ f(x: \+014) +0:1) f(n) = f(xi) – f(x:) h +
f(xi) - (h)
(C.1) – (C2)
gives f (xixl) - f(x-1) = 2h. f'(xi) + 0(h)
(0.2)
f (x1+1) – f(x;-)
+ och) |
(e)
- zh
X1+1
vo
Xtrue
From Eq.
(a)
f(titl) - f()
0-2-0-925-145 , & =
58.9%
f(xi) =
FFD
-
h
0.5
:-/45 , & = 58.6
f(xi) - f(xi)
From Eq.
(16)
0.925 –
12
- 0.5
= -0.55, Et = 39.7%.
BED
0.2 - 1.2
f(x+1) - f(x-1)
2h
From Eq.
(e),
CFD
1.0,
< =
9.6%
Min. Error
ffd7
f'(xi)=
-
2
h
2 A 0-25
G = 5-82).
f (xi-z) = f(0.5-240-25) =
f(0)- 1-2
3 f(xi) - 4 $(x,-1) +
f(xs-2) BED; $(i)=
3 #0-925- 4*-10,35
+ 12
2h
20-25
-0.87 &=
3.77').
CFDA f'(xi) -
- f (x1+2) +8 f(xi+1)
-8f(x1=1)+ f(xi-2)
72 h
Numerical Integration -
Simpson's
- Simpson 38 From Celentus, we know that the definite integral
for the function f(x) over an
interval [a b ] Can be represented by the area
under the Curue.
over en
Most of the methods are built on the fact that the area under
the Curve is the
value of integration. But Celculating the area
differs from one to another. a) Trapezoidal Rule:
YA
Xo
รั ก
*K-1 xk f(tk)+
f(Aku).ax
An
interval
A=
Az ox.
+(80)+4
f(*)+F(x) oz.
f(43)+Ffw..
2 7
2
CO2
..
Where
2n
Vx+1
Soluti
on
Exampl
e
Sinx
da
,
n= 6
x
+
T
Solution
0-42285
0.8 864)
Exampl
e
(f(x) = 0.2 + 25x4 - 200x2+675 x _ 900
x
400 x
3
, n=2 inh
one- interval
| True
integration /
=
1.6405
So bezce ( soud +
Freunde
= 0.870 (02 + 6-2323] =
0.1128
* Simpson's Rule
*
Aside from using the Trapezoidel rule with finer
segmentation, another way to obtain a more accurate estemate of
an integral is to use higher order polynomials to connect the point.
Jeans 15. od petnae) 4 46) + 2 Ž 4W) + f(n)
3n
2,4,6
SL
Exam
ple
na 2
Recall
that
I true =
1.6405
16.7%.
1.6405 1-3671
*100 = 1-6405
Exempl
e:
t
I sint
- dx
,nab
7+
XS
The true value is not easy to find but can be estimated using
thousands of interuch to approach o. 433985
5.9
Examp
le
DIOL
6) Simpson's &
Rule
n intervals should be divisible by 3, so 3, 6,
9, so on... because this rule approximates a
cubic function.
Exampl
e:
f(x)= 0.2+ 25 % - 200 x?+675 x'_ goo "
+ 400 gs
h. 08-0, 0.2667
To 0.87, n=3
sob
to
f(0) = 0.2
f(0.2667)- 1.432
+(0.533) =
3-487 f1018) =
0.232
T
o
10:2607|0.333
08
x X2 X3
7.432
0-26670-533
3.4871 0.232
f(x) 10-2
.
Recalling the true
value = 1.6405
&t=
7.4%
(less than
Simpsons /
Rule
)