Professional Documents
Culture Documents
Numerical Mid
Numerical Mid
oy-ygg-1.owtl%e4.int/: -I.oEt1:7-toti48IE/'0lt/-w&/
so .
'
& we
/ / 4812 /
3W °"
/
OE
/
0W +
'
t -
°
by
= •
¢g±E 4811=-2 E
Oy
=
(9.301×10-5) t (1.116×10-4) t (2.79×10-4) t (1.3287×10-3)
1.81231
by
Mmff
i. =
¥ ,
h =
7¥ ¥6 =
f '( ✗ 1h3
"
( ✗ ◦ 1h2 t
"
f- ( ✗ ,
) = f- ( ✗ ◦
It flight 1- ◦
2! 3 !
i. sin 35° ≈
sink 1- COSI
/ ¥, ) -
sin
¥(¥612 cos 1%13 =
0.5735752
☆
-
2! 3 !
Et
/ A 100%
= T -
i. Ey = 0.5735764 -
0.5735752 ✗ 1001 = 0.00021 %
Nz
.
0.5735764
2
3. จงหาคาตอบของระบบสมการต่อไปนี ้
𝑓(𝑥) = 𝑥 4 − 7.5𝑥 3 + 14.5𝑥 2 + 3𝑥 − 20
i ×
;
fix ;) f '( xp Each )
0 I -9 13.5
5 2.000 0.02.1 .
i. ✗ 2.000
☆
=
3
4. จงหาคาตอบของระบบสมการต่อไปนี ้
U = 𝑓(𝑥, 𝑦) = 4𝑥 + 5 sin(𝑦) − 1 = 0
V = 𝑔(𝑥, 𝑦) = 𝑥 2 + 𝑒 −0.5𝑦 − 5 = 0
กาหนดให้ x0=0.5 และ y0=-2.5
Sol .
Newton Raphson OU = 4
ox
OU b-
=
COSY
og
OV = 2X
ox
OV =
-
O.ge
-0-51
01
i ✗
i Yi Ui ri °%x °%y °%✗ °%y Ean Ea ,y
0.599kV 0.031%1
4 0.167 -3.208
✗
,
= 0.5 -
[(1.992×1.745)-(1.260×4.006)] =
-0.028 ✗
3=0.109
-
[(0.103×2.518)+(0.05×4.979)] = 0.166
I,
=
-2.5 -
(-11.260×4)+1.992 ] = -3.525
Yz
:
-3.234 -
[(0.05×4)+(0.103×0.218)] = -3.209
✗ 2=-0.028 -
[-10.758×2.91311-(0.828×4.637)]=0.109 ✗ 4=0.166 -
[ -
(0.001×2.488)+(0.003×4.989) ] =
0.167
1- (4) (2-913)-(4.637×0.056) ] [ -
(4×2.488)+(4.989×0.332) ]
12=-3.525 -
[(0.828×4)+(0.758×0.056)]=-3.243 y¢=
-
3.209 -
[(0.003×4)-(0.001×0.332)] = -3.208
i. ✗ =
0.167,1=-3.208
#
Bracketing method * nnmoderad #
① Bisection Method
✗ Lt ✗ ✗ new ✗ old 100%
of Ms n
,
Eal %) =
-
2 ✗
new
Us : win in Xu X, 6in
workout ✗r
,
0
I
f- (xp _
fcxu)
Open Method
① Fixed -
Point Iteration
Tofu ✗
qui ) riddim win ✗
-
it , i
-
Ea ( %) = ✗ it , -
✗i ✗ 100%
✗
in
② Newton -
✗ fix ;)
of s ✗ = -
it , i
'
f- ( X ;)
③ Secant Method ( Ditton )
[ thin ) fix ;) ]
9ms tix ) Yg
-
= =
✗ -
✗i
it ,
✗ = ✗i - f- ( ✗ i )
it ,
'
f- ( X ;)
④ Modified Newton Method ( Remedy)
( x ;)
, ,
fcxi ) thx ;)
KMS ✗ it =
✗ _
, i
?
If '( × ;) ] -
flxi )f"( X ;)
Example 4: Newton’s method
'
Sol .
f- (a) = 5C0S( 5×7+2×-3
i ×
;
fix ;) fix ;) Ea
0 I -2.958 0.418
{ §
3 2.41
4 2.72
11.397%
5 2.70 0.741%
① ②
Sol . 311 = sin ( 5×11-1/2 ✗ 2=37 -
sincsx )
3 3
✗ =
± 3✗
;
-
sin(5✗ ;)
?
it
✗ = sin ( 57 ;) + ×
,
it ,
3 i x
;
Ea 0 1
X; 91×7
0.014g igoon
I I 1.98
>
-
✗ i
;)
it
✗ Xi fcxi ) ,
#
__ -
it ,
Sol .
I ✗
ft
i
'l✗i)f( × ;)
f '( X
;
Ea
0.9 -2.87
0 I -2.96 -0.9
Uriomodi
Modi 2.2 12.44
-4.85/-6+33
-7 -
0.3667
0.08%
5
Point i
0
×
-1
;
Ea
Given x0 = -1 I
2
-0.917
-0.891 2.91%
3 -0.882
4 -0.879 0.341%
i. ✗ = -0.879
☆
Given x0 = -1
fait
Sol f' (7) ✗
Xi
= -
it ,
=
2✗tcos✗=O '
f- ( X ;)
.
I × fix ;) fix ;) Ea
;
0 -
I 0.1585 -1.4597
✗
-0.87671$
=
i.
I
0.0267
0.1585 -1.318
13.681
Given x0 = -1 I -0.8797 0.0033 -1.29 .
2 -0.8771 0.2961 .
i. ✗ =
-0.8771
✗ =
Xi
-
fcx ;) ☆
it ,
fix ;)
[ f- ( ✗ it fix ;) ]
"
f- (✗ ) =
, ) -
it ,
( ✗ it , ) -
( X ;)
in !U ✗
it ,
=
of ,( ✗ is Lil
Litt 92 ( ✗ in ski )
=
② Newton -
Raphson Method
Ui
=
✗ 31-2711-242-1=0 OU =
3×21-21 01=611
ox ox
4- =
3721-1=0 OU OW 1
2×+41
= =
01 09
3
501.7J Fixed Point
- i ×; Ea
rinwñiñitronutñ 0 0.5
4001-801-11-4142=2681.7951-15
5 0.7251 7.9991 .
1-13=4001-801-11-4142
2681.7951-12 6 0.6884 5.3311 .
Hit ,
=/ 4001-80141-41-1 ?
2681.7951-1 ?
7 0.7111 3.1921 .
8 0.6969 2.038%
9 /
'
E __
0.70229-0.7036×1001 .
10 0.7002 0.785%
,
0.70229
11 0.7036 0.483%
0.187%
#
=
* Hiss -_
0.70229M
Exercise
Roots of Equation
1. Solve the following equation
try ✗
◦
=
10
1=0.1,gln( 3,705011-(14-5.6)
✗
0.28
✗, =
15.168
i ✗
i
Eal 't )
0 10
I 15.168 34.07%
2 13.68 10.88%
3 14.048 2.62%
4 13.954 0.673%
5 13.978 0.172%
in ✗ = I
f- I
#
= =
13.978
i. f- =
0.0051
☆
2. Solve the following equation
✗ it =
X -
FIX ;)
, ;
f-
'
( ✗ it
✗ =3
◦
✗ 1=3-(-6.16-6)
-
23.05
=
2.732
0 3 -6.166 -23.05
3 2.618 0.535%
i. ✗ =
2.618
☆
3. Solve the following equation
=°i"51;%;;a!i"i_
. ✗
6.8471-8.19
12×11-12.6×-6.84
"
f- (x ) =
try ✗ ◦
= -4
✗
it ,
=
Xi
-
fcxi )fLx ;)
?
( fix ;) ] -
fix ;)f"l✗ ;)
✗ = -4 -
(34.1271-119.65)
,
(-119.6512-134-1271134.76)
✗ =
-3.58
,
3 -3.649 0.05%
i. ✗ 3.649
☆
= -
4. Solve the following equation
• Using False position method with root near 3.0 and 4.0
• Acceptable error = 1%
Sol .
✗ r= Xu
-
tlxu)( ✗ ,
-
✗ u)
fcx ,
) -
flxu )
7--3.71
#
i.
=/ 1)
Sol .
-8 I -2
A 2 -6 -
-
3 -
I 7
f- :| =/ 5)
' ° → ' -2
L 0.25 I • -5.75 1.
0 R2 1- f) R
= - -
0 8.1085 P' 3-
( ¥! ! )R2
[ L ]{y}={ B } [ u ]{x } -
_
{ y}
|-O :X:| f) f- / =/ :)
-20 -2 ×
:
i 8 I
¥
,
.
" : " ◦ -
:*
s -1.5
Y ,
= -20 i. ✗ 3=-19.24/7.86 =
-2.001
Y,
=
-38-10.251-201=-43 ✗ 2=[-431-1.51-2.0011] / -5.75=8
Yz
= -34 0.3751-207-0.2391-433=-16.223 ✗ 1=(-201-21-2.001) 1181 ] / -8 =
4
☆
- -
Iterative method
www.i wstuni?nxSol.-8X,tXz-
* Pivottñ
273=-20 1-81>111+1-21 /
-37 ✗ 171>1-311-1-211
21-7×3=-34
-
i.
aiiiiiiwwow
% Gauss -
seidel
✗ 1=1-20 -
✗
21-2×3 ] / -8 ✗
2,0--6.333
✗ 2=[-38-2×1,1-113] / -6 83,0=-4.857
✗ 3=1-341-37,1+72
] /7 ,
14 -5068".645 I 426.1-4%4187.2%4
i ✗ ✗2 ✗3 { {a {
, a
,✗ , ,x , a. ×
,
0 6.333 -4.857
-1.691
✗ 4.000
'
=
.
.
✗ 2--8.001
✗ 3=-2.000
#
Gauss Elimination
(÷ : : JR
Sol .
-20
'
-61-5-1-5
'
-2,0 Xi -38/-43 ,
-
C-
f) R ,
-134s Rs -
(f) Ri
¥10 7¥ ¥1 P' 3-
( ¥¥É)R2
'
-16.2174
8. 1087
f- )
8 I -2 -
20
0 0 8.1087 -16.2174
i. ✗ 3=-16.2174/8.1087 = -2
✗ 2=(-431-1.51-2) ] / -5.75 =
8
✗ =
(-201-21-2) -1181 ] / -8 = 4
fyz
,
wioñnswid ñwoto
"
/
:*
-6 -
11=-20
-34-0.3751-201=-26.5
Y,
__
g. 3=-38+0.251-20 ) 4.18181-26.57=67.8177
-
0.25 4.1818 I
U =
0 -1.375 7. 7- R2
-
④Rt ) 67.8177
0 -5.75
0
>
-1.5 ,
-33.909
R }
-
④Ri )
:X } -2
Rs
I Ra )
- =
✗ 2=(-26.5-7.751-2) ] / -1.375=8
[ L ]{ y } =
{ } B -
Sol .9Ñ✗ , =
Uiwiriñiynoiniroi [ L ]{ I} :{ B } -41
Uiwirinyniinhio
{ g) / 421=13400 )
✗ = 2 I 0 0 Y, 3800
g.
✗ 5- Usewvoñiyninnios I
3
3500
-
÷! { !! !! ! 1¥2) / )
3800
11=3800
0.4
noon 0.25 0.45 ✗ 3400
isisaoo Eason -5%0
= - .
y }= 3500
11380011-13-31-503001=-8900
3500 -
13
{ it
I 0 0 [ U ]{ X } :{ y } -
(2)
/ /¥4,1 f- )
4-3
(;
L =
I 0.3 0-35 ° " '
3800
,
,
"
it =
50,00
-27g
-8900
13
( /
0.3 0.35 0.4
U =
0 ¥0 ¥ Ra -
( ;R ) ,
✗ 3--2542.857
0 0.05
O
'
-0.25
-
%
>
R
} -1112,1 ✗
2=[-503001-4212542.8571]/-16 } = 6714.286
Rs (-3-1314)
-
✗ 1=(3800-0.412542857)-0.35167-14.2867 ] / 0.3 =
1442.857
Ynilnironil
}
i. : 1442.857M
Yannick 2--6714.286 M3
Ynilniroñi 3--2542.857 m3 µz
wioñnswidñwioto
6301081622071 Sec 2
501.9in ,
=
Uiwiriñivnoiniroi [ L ]{ I} -
{ B } -111
f) ftp://iiiiif
Uiwiriniynilnhio
1
I
i
✗ = 2
g.
✗ i. www.ivimnios :
1
i} 3600
' '
'
÷! { !! !! ! 1¥2) / )
3900 11=3900
0.4
noon 0.25 0.45 ✗ =
3200
ai-noo-E.no "= -2000
3600 y} 3600
11390011-13-31-20001 -9900
= -
=
13
( )
I 0 0 [ U ] {X } =
{ y} -
(2)
/ ¥; / =/ of
L =
1
-3
•
° % _
"
0 0 -9900
13
|
3 0-35 0.4
U =
0 ¥0 % ✗ 3--2828.5714
2=(-20001-1-212828.5714) ] / -1,3
-
t
0 ✗ =
8142.8572
26 ,
271.4286
M3 '
:O :ÑoIYnmnioÑs3iÑwÉn
V01 = -
271.4286 -
577.1428 = -
828.5714 M3
'
V02 =
8142.8572-2685.7144=5457.1428 m
2 -6 - 1 x1 − 38
- 3
-1 7 x2 = − 34
- 8 1 - 2 x3 − 20
" "" """"
6301081622071 Sec 2
Sol .
without partial pivoting I 0 0
=/ f)
4 2.3
t.is ↑
-
[ -38
g.
-
=
4 2.3 -341-1.51-381=-91
y,
-
-_
Y,
= -201-41-38 ) -
2.31-917=37.3
%
2 -6 -
/ / / ¥;/ =/ ¥! /
" 2 -6 -
0
¥ *
0 -10 5.5
" " I
-
18.65
④R2 ) →µ
.
Rs -
◦ ◦
[ L ]{ y } -
_
{B} -117 :X , =
-2 ✓
[ u ] {✗ } -
_
{ y} -12 ) ✗ 2=[-91-5.51-21] / -10=8 /
1=(-38+618)+11-27 ] / 2=4 /
☆
✗
Exercises on Optimization
Example
Use the golden section search to find the maximum
of 1£ in fcxswnn
on
x2
f ( x) = 2 sin x −
10
, × %/ ✗
.
, - -
2. 618 "
< T
I
1.888
✗ 1.440
ff
i. =
Example
Newton
Use the golden section search to find the maximum
of "
f- ( ) < 0
x
x2
f ( x) = 2 sin x −
10
flail
"
' f- ( X ;)
f- (x ) =
ZCOSX -
✗
5
try ✗ ◦
= 2
"
f- (x ) -25in x
fi
= -
fix ;)
"
x
; 1- ex ;) Eat .
0 2 -1.232 -2.019
ᵗᵈÉm÷[w
, 1.421-1-0.0002 '
3 1.4276 0.01%
maximum
i. ✗ 1.4276
☆
=
One-dimensional Optimization
"
Sol f' ( x ) 58 -15×2-20 ✗ it , -_ ✗ - f '( ✗ it
. =
i
"
f- (x ;)
20×3
"
f- (x ) = -
30A
/ .ua/,a.smfw.wofu.*.,
i ×; .
0 4 1020 1160
, ,
6 2.000 0.05%
i. ✗ =
2.000
☆
Application in Civil Eng.
คานยาว L = 5 m มีแรง P ขนาด 500 N กระทาที่กึ่งกลางคานตามรูป
÷ 1=5 M
, 1
501.888 Newton
Mill = 15 P ✗ =
X; _
f%✗i )
it ,
48 EI f "( ✗ ;)
Unwin L -5M ;
-
fcx ) =
K( ✗ 3- 15×21-50×1 ✗ :3 -
[31312-301311-50]
,
f-
'
( X) =
K( 3×2-30×+50 ) 1613 ) -
30 ]
"
f- (a) =
K( 6×-30 ) X =
1.9167
,
.mg/o3.5,3oa4-.,18.5,*04g/5.o6.,52.%,.4
ixitixpf.tn/pEa%03 -13 -12
I 1.9167
, ,
, , ,, 0.0021 .
i. ✗ = 2.11325 M
☆
Example
f ( x, y ) = 2 xy + 2 x − x 2 − 2 y 2
step1 : determine the gradient direction of this function at x = -1 and y = 1
f
= 2 y + 2 − 2x = 6
x
f
= 2 x − 4 y = −6
y
therefore gradient vector : f = 6i - 6 j
Sol . Gradient method
try ✗
◦
= -1
, Yo = I tlh) =
21-1 tbh ) ( I -
6h ) 1- 21 -
It 6h ) -
C- It 6h12 _
211 -
6h12
of 12h 12h 72h2 12h -112h 36h2 -124h 72h2
=
211-2 -
2X =
6 = -2 1- 1- - -
2 1- -
I - _
2 -
g✗
"
of = 2X -
41=-6
= -
7- + 72h -
180h
02
i. Ñ tf
'
=
bi -
6J f- Ch ) = 72 -
360h = 0
h =
0.2 → lmw% ✗
, , 4,
6h
✗
¥h It
=
=
✗ 1-
-
, ◦
,
✗ I t 610.2 ) 0.2
_
= -
=
.
.
¥yh 6h 610.2 )
Y, Lot
=
I
Y, I -0.2
= -
= -
=
MAX , = 0.2
, 4. = -0.2 f- ( h ) =
210.2 1- 1. 2h11-0.2T 1.2h ) 1-210.21-1 2h7 .
-
10.21-1 .
2h12 -
2C 0.2
-
1- 1. 2h12
¥ ,
= 1.2 = -
of =
1.2
01 '
f- ( h) = -2.88h t 2.88=0
a :| Ñ Tf =
1.2 it 1.2J h = 1.0 ibnwtw ✗
2,1 ,
0.2 1- 1. 2h
✗2 X t
%h X 0.2 1- 1.24.07 1.4
'
= = = =
,
. .
,
,
ñirioiwñ -0
¥y=0
-
in :
Example
f ( x, y ) = 2 xy + 2 x − x 2 − 2 y 2
step1 : determine the gradient direction of this function at x = -1 and y = 1
f
= 2 y + 2 − 2x = 6
x
f
= 2 x − 4 y = −6
y
therefore gradient vector : f = 6i - 6 j
Sol . Newton Method
¥ 211-2 2x
y
=
2×-41
-
=
off = -
2 02 f =
-4
ox
'
☒
if =
2
okay
1:11 :ᵗ÷H:÷÷÷;¥H:|
"
try ✗
◦
=
-1,10=1
1:11:11 : :/ I :|
pilot 0 =
6 -
20×1-201-111
0 6 t
20×-401-127
= -
snñowmri :| ñ
DX = 3
0
by =
i. ✗ = ✗ t DX = -
I t 3 = 2
◦
1 to I
y yo 1-
by
= = =
☆
Multi-dimensional Optimization
0¥ =
6✗ ? -
4×1×21-611 , -2×2 ¥ = -
2x ? -
27,1-6×2
, ,
Olf = 127 -
4×2 t b o 't = 6
,
ox ? oxi
02 f- =
-411 -
2
,
011,0×2
I :H¥¥H:÷¥÷÷÷÷.lk:1
hi ✗
,
= -1
,
✗
,
= I o :| Ñ
0 =
2 -
10 DX t 20×2 -41
,
0 = 6 t 2 DX t 60×2-127
,
DX = 0
,
DX = -
I
,
i. ✗ = -
I to = -
I
,
✗ It C- 1) 0
☆
= =
,