11 online
11 online
TRAPEZOID RULE
ROMBERG ALGORITHM
GAUSSIAN QUADRATURE
NUNIERICAL INTEGRATION
text
a
Given f- Cx )
defined on [a, b ] ÷
.
Iff )
=/ fcxtdx-
I
a
→
o
←
b
' 2X
v
or
steps :
ein,
I in cut "
P [a ,
b] into smaller intervals •→
Numerical
-
Integration
in each sub interval find a
polynomial PiCxKf!x)
,
up
.
TRAPEZOID RULE
nfcxl
the rule : -
cut [ a
,
b ] to n sub intervals
[
•
I
Xo=oe Xi ( Xi in
- Xr = b , l
l
l
l
l
'
l l l' I 7
×
a Xi Xin
-
I -
- On
Hi , Xin ] approximate f- Cx ) by a
poly of degree L
picxi )
-
fcxi )
picxi.in/--fCxite )
linear
spline
Area of trapezoid =
f- ( Xi ) -1 f- ( Xiii ) Hit ,
-
Xi)
2.
Xi in
-
! Picxtdx
I
ftcxrdx
Xi
intervals
-
sum
up for all
b) fan .dx= × ,#
I
!÷f" iiicxidx
xi
UNIFORM GRID
b a
he
h Xi
-
=
Xiu
= -
← n
interval
length
b) fcxtdx E
!÷ 3. ffcxitfcxi
,
' .us ]
=
h .
? f- Cyo ) t f- Lxi ) t
fcxzn !
\ /
Tcf ; h )
'
[ ]
f ( x) = X I, I
-
en
12=5 intervals
-
2 -
El )
12=1
-
afcxl 5
I Xi f- ( Xi )
h -
2/5=0.4 O -
1.0 -
1.0 yo
:&:/
-
y
-
0.6 -
0.276
2 -
0.2
-
0.008
i
'
" s
s
or
.
-
•
.
4 0.6
5 1.0
en
fcx ) =x2
1
fcxi )
i
O -
±
1.0 1.0 1×2" "
~
= C. 816.41=0.72
}
" " ° ° " -
" "
difference
'
2 -
0.2 0.04 -2=0 . g
!
J
t l
3 0.2 0.04
4
5
at
1.0
0.36 ¥ ,
=
Igt }- =
2/3=0.667
1.0
en
fcxI= Htt [ -
1,1 ]
MATLAB -
TBD
Error Estimate
for Tcf : h
)
n -
y Xi -11
fffcx
-
Etcfih ) =
Icf ) -
Tcfih ) =
) -
picx ) ] .dx
i -_ o
Xi
-
Et :( f. h)
,
'
Xith
Reminder
Epi ( fih )
-_/[fCx ) -
Pilx , ] .dx
i -_
91 ,
- - -
.
n -
1
.
c'III. Hit
'
Xi l l
'
xix xin
can
÷
, O 1
with
Error Beard
Poly interpolation.
12 f' CG;)
'
ecxt-fcxl-P.fi ) = (x -
Xi ) (x -
Xia) Xi
-
fifties
-
3 -
h -
-
Xian
-
Xi
'
" '
E. ilfih ) =
.
f- Cgi ) h
Total Error is :
'
= - .
- . .
i -
. o -
-
average
"
n
f- CG)
'
Et ( fin ) ) q E Ea BT
-
a
- - -
,
so
,
Max abs .
value
of Et Cf : h )
"
(b ) ti f- CE ) Olli)
Et Cf : h)
, za
-
.
Max
G E Corb]
second
-
order
"
eny f- Cx ) e [ 0,2 ]
-
error
-
0.5154 ?
b. = 2
" -4
(b
'
be =D
4
fois
I. (Yn ) e lo
"
f- ( x ) = ex n 313.8 N
314 points
,
-
[0 ,
2 ]
Max f' Cx )
'
= ez
s
- -
SIMPSON 'S RULE
fcx) fly
a
Higher order
poly .
Pi CX)
• :
I
b] i
up [ a equal
'
-
Cut ,
into 212 i
'
i :
sub intervals I g
, i
k
b
king
't + z
Xo -_
or
Xzn =
b oh Xi =L
he Xiu
- -
2h
Lagrange form of Pi Cx)
:{
with uniform grid Picx )=fCXz ; ) . @ Xzits )(X
-
-
Kitz )
(ki Kita) -
i
-
Xzitz)
÷÷::÷÷:*:
""
÷ taxi .
"¥i:÷:c:* :÷¥i
ki ) H
zthfcxzitz) (X Xzi) @ Kiri ) tfcxzitz ) ( X Xzitr)
- -
+
-
-
(Xzitz -
Xzi) ite
-
Xzitr)
3
quadratic
Xzi
functions to integrate
-12
Jfx
's
I, Xzixn ) ( x Kita) DX
23h
= - - =
Xzi
X2i- 2
Iz -
-
J -
f -
Xzi ) Cx -
Xzitzjdx =
4zh3
Xzi
Xzi -12
ffx
'
Is = -
Xzi ) (x -
Xzitn) DX =
Ish
Xzi
Then ,
"
Pi Cx)
.dx=÷wfCXz ) Iet Lufkin ) Iz ÷ fcxzitc ) Is
+
; .
hjflxzi ) t
4hg-fcxzi.in ) thgfcxzitz )
=
Ig # ( Xz ; ) t 4 f- ( Kita ) t f- ( Kitz) )
5
then them :
sun
up
b) xgzitep
n -
a
"
④ ! !
far die
.
!
I $ 1
x :*
his kin , .
i
if
-
en
f- ( x ) = x' + I
compute §fCx7dx using Simpson 's
with n=5
rule
i Xi fcxi )
Scf ;
)=hz[ fo -14 fit fztfztllfstfytfq 4*5
° -
1 0.2 '
-
"
I -0.8 I
~
? -0.6
2fz Zfg
: :
:
-
' it
=÷[ fo -14 # tfstfztfq )t2(fzttqtfotfs )
°
+ fro ]
Sff ; 0.2 ) =
2,2955778
Sff : h )=
ffcxo ) -14 ?÷fCxzi , ) -12 fcxzi ) 1- f- ( Xan ) )
Simpson 's
Error Estimate for Rule
"'
Es, Ash ) =
6
The total error :
Es Cf : h )
fo .tn?!fcYsi)Lbz-E
= -
average
formula
a
error = ,
If "kg )
b "
Eslfih ) -
h max
{ C- Lab]
"
em
fake [ 0,2]
of points needed
# when
using Simpson 's Rule
to ensure that 10.510-4
error
I # (G)
(4) " "
I
x Y
-
a -0 180
' -
'"
maxlf I -
- e ere
hit
-
1.21810-3
→ h 10.18682
b
5.3 I 6 intervals
-
a
~= → n=
2h
points
-
-
-
RECURSIVE RULES
can be
applied to Tcf; h ) , Scf ;h ) or
any
other method .
Recursive Rule
# trapezoid
"
Divide [ a
,
b ] into 2
equal sub intervals
m
-
- O l l
17=1 1 a l
b -
or
M =L 1 a a a 1 him =
2pm
IN / t a b s u r u f
=3
I ' i ' ' ' ' ' ' ' ' ' ' ' '
m=y
s '
12pm 12 hm
=
,
Rule
Trapezoid
.
n
Xi
Tff : hmu )
=
h.nu?tzfCaItIz.fCb3t??!!tfCatihm+n )
.
Tcf ; hmu ) =
M - I
2
-
f- Catkin ) hmu )
Z i -
- o
This has a
recursive
similar form can be
applied to Sff, hem) form
rule with
a
sequence of approximations by trapezoid
Corny method )
different values of h .
8
associated with the
Trapezoid
the error rule can be
written as :
"
proof "
htt
>
Eff ; h ) Icf ) Ilf : h
) aah 't aah ta tanh
- -
= - -
=
can ,
be
achieved
by the derivatives
Taylor series are
depends on
" '
f-
When we half the
grid size
,
error becomes
Taufik
"
' "
(1) Icf ) =
Tcf, h ) 1- aah t aah t - - - - -
tanh
"
(2) Icf ) =
Tcf ; h 12 ) -192425-1944/25 't - - -
tan@ 12 )
eliminate
Goal the
leading term to
get higher order
: error a
approximation .
22 get
Multiply 12)
by and subtract CI ) we :
(22 -
1) Icf ) = 22 Tcf ; h z ) -
Tlfihjtaqhtagh 't - - - -
Ict ) =
Tcf: h z
) -
>
, , -
Uch) "
)
och
potation approximation
ROMBERG ALGORITHM
Given tlfih ) ,
Tltshl 2) , compute :
Ilf ; h )
Uch ) -
Tcf .in/zy+TCfih/2 )
22 -
1
"
I =
,
g
we can iterate this idea .
"
(4) Ict ) =
uchlz )ta4④zj' tao @ 12ft - - - -
tan @ 121
(3)
( %) Uch )
24 12 ) Uch )
" -
Uch
Uch 2)
-
Let ch ) =
=
+
24 -
y 24 -
y
the"
Icf , = ✓ ch ) + E hb + Tight
,
- - -
tank
-
6th order
approximation '
och
)
keep this until
one can
doing
desired is reached
a
accuracy
.
set h = b -
a
1211,0 ) =
Tcf .
'
HII )
R ( 2,0 ) =
Tcf ; h/z2 )
:
Rlm ,
o ) =
Tcf; hlzm )
10
Romberg Triangle
1210,0 )
>
1211,0 ) S RCI , t )
j
-
i
> u 3
in
> ✓ >
U
Rch, m -
7 ) Rch -
bin -
1 )
Rcn , m ) = Rcn , in -1 ) t
22M -
1
01¥ )
" "
h
f- Cx ) .
[
-
error
else divide
further
Gaussian quadrature
All numerical
integration rules
follow the form :
b) fcxlidx I
x; t
wo.fcx.lt
[ a,b ]
Wifcx ) twzfcxz )
called nodes
,
,
Wi 's
t - -
are
- -
1-
the
Anfcxn )
weights
11 -
.
W l r
+
Wo
,
l
For
enauple , trapezoid rule :
b or
b
-
Xo Xy w =
l l - a =
Wo =
,
or b 2
Icf ) I b-g.fi a) t
b -
g fcb )
= Cb a) -
LIED tzfcb!
/ Simpson 's rule :
Xo = a
,
X
,
=
atzb , Xz = b
Wo =
Wz = b -
a
w
,
= (b - a ) .
23
6
's
We fix the
points adjust , wi
Question Slnteior
Focus →
t.pt 69 .
ff
or
Cx) . dx I w
, f- Lxi ) a LX , lb
if f- Cx) is a
poly of .
degree 1
,
i. e. a line
f- (x)
oeotan.xga@o.ianxsdx-Ia.x! EEE
=
eines:
Wy f- ( Xy )
.
= Wei Cao + an X1 ) =
ao We .
tan (w Xp)
,
12
so
, Wy = b - a
W Xp = b2_a2
,
bta
×, -_
so
,
baffcx ) .dx=
=
Wyfcxy )
@ a) f- (
-
atzb)
we use
pore
only one
trapezoid point
Rule
to
exactly
integrate
boffin .dx -
- Cb a) -
no
,
-19
using Zno
,
-1=10
2
pts .
"
en
f Cx )
- e [ 0,2 ]
§exd× =
et -
I =
6.38905609
f CX ) = 2X
Ipt 69 = (2-0) f- ( 2¥ ) .
"
= (2) e = 5.4365636
# tzfco )
=
TR rule = @ - o ) 2) )
=(2 )
e2 = e 't
error
1
CH
2.
pt GQ →
f
or
@ ota ,
x -192×2) DX =
witch ) twzflxz)
X, C- Ca, b )
C- Ce, b)
+ will have
Xz
4 egs 24 unknowns
3
GR for interval [-1 ,
I] C can be extended to
any
)
b)
interval [ a,
Wo Wr
, ,
rule satisfies
genaetlyeqwh
[ f- Cx) .dx =
Wo .
fcxo) t wa f- ( xn )
then
f C- Pm
if enact
for degree of in
pts )
g
4 unknowns Xo , Xp , Wo
,
we nu (2
I
Need i
4 egs .
(2.) (2) - I =P
:#
-143=1 :
!fedx=z= wo.aitw.ci ,
f- Cx) -
-
X i
IX. dx=0 =
Wo . Xo t wi Xp -
Ix ?dx=%= #+
'
fCxI=x2 :
Wo .
w
,
.x
,
! XP
'
f- Cx ) -_x3 :
x ?dx= O =
Wo .
Xo -1W ,
fax )=x3
I
4 eqs 4 unknowns Xo= jz
-
, ,
Xp =
1/5
Wo =
Wy = 1. O
'
1B
Fs Note the
symmetry
CS fl yrs )
.
-
-11 f- ( Yrs )
try N=2 Xo , X , , Xz 213) T
-
i ,
1×3.44=0 '
Wo , Wi ,
wz
14 -
f degrees for poly .
-
fix ) -_x4
if I! =
}
¥1 ;
'
fcxtx -
- 213
transformation
t-2lxf@tbJb-oex-IzCb-eD.t +
Izcatb )
so
for -
I t 1 we have a x (b
15