You are on page 1of 481

PHNG PHP TNH

B MN TON NG
DNG
H.BCH KHOA
TP.H CH MINH
Ging vin:
TS.L Th Qunh H
2
GII THIU MN HC
MSMH: 006023 S TN CH: 2
S tit: 45 tit
Gio trnh
Phng php tnh L Thi Thanh
Numerical Analysis Burden & Faires
My tnh b ti
Gia hc k: Trc nghim (20%)
Bi tp ln (20%)
Cui hc k: Trc nghim (60%)
3
NI DUNG MN HC
M u: S gn ng v sai s.
Chng 1: Gii phng trnh phi tuyn
Chng 2: Gii h phng trnh i s tuyn tnh
Chng 3: Ni suy v bnh phng cc tiu
Chng 4: Tnh gn ng o hm, tch phn
Chng 5: Gii gn ng phng trnh vi phn
thng
4
Gii thiu: Khi nim v sai s
1/ SAI S GI THUYT: Chp nhn khi xy dng
m hnh
2/ SAI S S LIU BAN U: Cc hng s vt
l, o lng
3/ SAI S PHNG PHP: phng php gii xp
x sai s s c (gii hn yu cu)
4/ SAI S TNH TON: ch yu do lm trn s
trong tnh ton
5
Sai s tuyt i & sai s tng i
A: gi tr chnh xc; a: gi tr gn ng. Vit: A ~ a
Sai s tuyt i: Aa = ,A a, (phi thc t: A khng tnh
c!)
Thc t: Tm s dng Aa, cng b cng tt tha
,A a, s Aa
,A a, s Aa a Aa s A s a + Aa. Vit A = a Aa
V d A = , a = 3.14
3.14 0.01 < < 3.14 + 0.01 c th chn a = 0.01
3.14 0.002 < < 3.14 + 0.002 c th chn a = 0.002
Sai s tng i oa
a
A a
a
A a

A
o = ~
6
V d v sai s
A = e; a = 2,7
a 0,019 < e < a + 0,019
c th chn a = 0,019
Sai s tng i oa ~ a/ ,a, = 0,019/2,7 ~ 0,007
7
Cng thc tng qut ca sai s
Gi s phi tm i lng y theo cng thc
y = f (x
1
, x
2
,, x
n
)
y x
i
,
- gi tr chnh xc; x
i
, y gi tr gn ng
Nu f l hm kh vi lin tc th
( ) ( )

=

c
c
~ =
n
i
i
i
n n
x x
x
f
x x x f x x x f y y
1
2 1 2 1
,..., , ,..., ,
( )

=
A
c
c
= A
n
i
i n
i
x x x x
x
f
y
1
2 1
,..., ,
( )

=
A
c
c
=
A
= o
n
i
i
i
y
x
x
f
y
y
1
ln
8
( )

=
A
c
c
= A
n
i
i n
i
x x x x
x
f
y
1
2 1
,..., ,
( )

=
A
c
c
=
A
= o
n
i
i
i
y
x
x
f
y
y
1
ln
Sai s ca tng, hiu:
( )
n n
x x x x x x f = ... ,..., ,
2 1 2 1

=
A = A =
c
c
n
i
i
i
x y
x
f
1
1
Sai s ca tch, thng
( )

=
o = o =
c
c
n
i
i
i i
x y
x x
f
1
1 ln
( )
1 1
2
1
1 2 1
.... . ,..., ,

=
n n
x x x x x x f
Cng thc tng qut ca sai s (tt)
9
V d tm sai s ca tng v hiu
Cho x = 2.51 0.01; y = 2.50 0.01.
Tm sai s tuyt i v sai s tng i ca tng
v hiu ca 2 s : S
1
= x + y; S
2
= x y.
So snh sai s tuyt i v sai s tng i ca 2
i lng ny.
10
V d tm sai s ca tch v thng
Cho x = 2.50 0.01; y = 0.10 0.01.
Tm sai s tuyt i v sai s tng i ca tch
v thng ca 2 s : S
3
= x y; S
4
= x / y.
So snh sai s tuyt i v sai s tng i ca 2
i lng ny.
11
lm trn s thp phn a thnh a n ch s th k sau
du chm thp phn, ta xt ch s th k+1 l
k+1
.
Nu
k+1
5 ta tng
k
ln mt n v
Nu
k+1
< 5 ta gi nguyn
k
Sai s lm trn: ua = ,a a,
Lm trn s trong bt ng thc
a x b
Quy trn s v sai s quy trn
Vit s dng thp phn:
9 0 , 10 10
1
2 1
s s + + =

i
m m
a o o o

12
Ch s c ngha
Trong cch vit thp phn ca s a, ch s c
ngha l tt c cc ch s bt u t mt ch s
khc khng tnh t tri sang
V d:
10,20003 c 7 ch s c ngha
0,010203 c 5 ch s c ngha
10,20300 c 7 ch s c ngha
13
V d v ch s c ngha
Trong cch vit thp phn ca mt s, cc ch s
khng bn tri khng phi l ch s c ngha!
Tm cc ch s c ngha ca cc s sau
0,03456; 10,1110; 0,00456700
14
Ch s ng tin
Cho a A vi sai s tuyt i a. Trong cch vit thp
phn ca s a, ch s
k
gi l ng tin, nu
1
10
2
k
a A s
1
= 0.001 10
2
k
a A s
k log (2a)
V d: a = 12,3456 vi a = 0,001
vy a c 4 ch s ng tin
a = 0,0044 a = 0,0054
( )
log 2 k a > A 2 k >
15
V d - ch s ng tin
Cho gi tr h = 6,626176 0,000036
Xc nh s ch s ng tin ca h
16
V d
A c gi tr gn ng l a = 12.7 vi sai s tng
i oa = 0.012%. Trong cch vit thp phn ca a
c bao nhiu ch s ng tin?
Vy a c 2 ch s ng tin sau du thp phn nn
tng cng a c 3 ch s ng tin
( ) ( ) = o = A > a a a m 2 log 2 log
m > - 2
51 , 2 %) 012 . 0 7 . 12 2 log( = =
17
Chng 1: Phng trnh phi
tuyn
18
NI DUNG
1. Khi nim tng qut. Cng thc sai s
2. Phng php chia i
3. Phng php lp n
4. Phng php Newton (tip tuyn)
5. H phng trnh phi tuyn. Phng php
Newton Raphson.
19
Khi nim tng qut
Phng trnh f(x) = 0 (1),
f: hm s lin tc, c o hm
Khong cch ly nghim: on [a,
b] (hoc khong), trn phng
trnh (1) c nghim duy nht
Nu hm f(x) lin tc trn on [a,
b] v gi tr ca hm tri du trn
hai u mt th phng trnh (1) c
nghim trn [a, b]. Nu f(x) n
iu th nghim l duy nht
Tm KCLN: lp bng bin thin
20
Cng thc sai s
Cng thc sai s tng qut: Phng trnh f(x) = 0 (1)
vi nghim chnh xc trn khong cch ly nghim [a, b]
Nu x* l nghim gn ng ca nghim chnh xc trong
[a, b] v
x
| | ( )
, , 0 x a b f x m ' e > >
( )
*
*
f x
x x
m
s
( )
( ) ( )
*
*
f x f x
f c
x x

'
=

( )
0 f x = ( )
0 f c m
'
> >
th ta c cng thc nh gi sai s tng qut
Chng minh
21
Cng thc sai s (tt)
V d: Phng trnh f(x) = x 2 = 0 c khong
cch ly nghim [1,2]
Nu chn nghim gn ng
Gii
x 0.00595
Sai s lun lm trn ln
*
*
/ 0.005?
1.41
/ 0.006?
x
a
x
b

= A =

*
0.006
x
A =
22
Phng php chia i
tng: Lin tc chia
i khong cch ly
nghim
f(x) = 0 trn khong cch
ly nghim [a, b]. K hiu:
a
0
= a, b
0
= b
f(a
0
). f(b
0
) <0
Chia i: c
0
= (a
0
+ b
0
)/2
Sai s
a
0
b
0
x
x
0
a
1
b
1
y = f (x)
x
1
1
2
n
n
b a
x x
+

s
( ) | |
1
2 log
log

> s A
c
c
a b
n
23
Tm nghim gn ng ca phng trnh f(x) =
0 trn on [a, b] bng phng php chia i
1. f(a). f(b) < 0, a
0
= a, b
0
= b;
2. k = 0
3. Chia i: c
k
= (a
k
+ b
k
)/2 ; c
k
= (b
k
a
k
)/2
k+1
4. Nu c
k
< c th nghim gn ng x* = c
k
; nu
khng:
Nu f (c
k
) f (a
k
) < 0 th a
k+1
= a
k
; b
k+1
= c
k
; nu
khng a
k+1
= c
k
; b
k+1
= b
k
k = k + 1
5. Quay tr li 3
24
Phng php chia i (tt)
c im ca phng php chia i:
n gin
chnh xc khng cao
Tnh tay: lp bng cha mi kt qu trung gian cn thit
n a
n
b
n
c
n
c
n
0 a
0

(Du f(a
0
))
b
0
+
(Du f(b
0
))
(a
0
+ b
0
)/2
Du ?
(b
0
a
0
)/2
Nghim xp x
25
V d phng php chia i
Xp x nghim ca phng trnh f(x) = x cosx = 0 trn
khong cch ly nghim [0, 1] vi sai s 0.1
( ) | |
1
2 log
log

> s A
c
c
a b
n
( )
log 1 0 0.1
1 3
log 2
n n
(

> =
n a
n
b
n
c
n
c
n
0 0 1 + 0.5
1
2
3
0.5
0.5 1 + 0.75 0.25 +
0.5 0.75 + 0.625 0.125
0.625 0.75 + 0.6875 0.0625
26
Bi tp phng php chia i
x = tg (x) trong [4,4.5] vi
sai s nh hn 0.01
( )
log 4.5 4 0.01
1 5
log2
n n
(

> =
n a
n
b
n
c
n
c
n
0 4 4.5 + 4.25 0.25
1 4.25 4.5 + 4.375 0.125
2 4.375 4.5 + 4.4375 0.0625
3 4.4375 4.5 + 4.46875 0.03125
4 4.46875 4.5 + 4.484375 0.015625
5 4.484375 4.5 4.4921875 0.0078
27
Bi tp phng php chia i
e
x
sin x = 0 trn [0, 1] vi c = 0,1
28
n a
n
b
n
c
n
c
n
0
0 + 1 0.5 + 0.5
1
0.5 + 1 0.75 0.25
2
0.5 + 0.75 0.625 0.125
3
0.5 + 0.625 0.5625 + 0.0625
4
0.5625 + 0.59375 0.578125 + 0.015625
5
0.578125 + 0.59375 0.5859375 + 0.0078125
e
x
sin x = 0 trn [0, 1] vi c = 0,1
29
Bi tp phng php chia i
3x ln (2x + 1) = 0 trn [ 0.4, 0.2]; c = 0,01
30
3x ln (2x + 1) = 0 trn [ 0.4, 0.2]; c = 0,01
n a
n
b
n
c
n
c
n
0 0.4 + 0.2 0.3 + 0.1
1 0.3 + 0.2 0.25 0.05
2 0.3 + 0.25 0.275 0.025
3 0.3 + 0.275 0.2875 0.0125
4 0.3 + 0.2875 0.29375 + 0.00625
5 0.29375 + 0.2875 0.290625 0.003125
6 0.29375 + 0.290625 0.2921875 + 0.0015625
7 0.2921875 + 0.290625 0.29140625 + 0.00078125
31
3. Phng php lp n
Chuyn (1) v dng tng ng trong [a, b] x = g (x)
Nghim cn gi l im bt ng ca hm g (x)
Gi tr ban u x
0
ty thuc [a, b]
x
n+1
= g (x
n
), n = 0, 1, 2, 3
Dy {x
n
} l dy lp n, hm g (x) hm lp
Dy lp n x
n+1
= g(x
n
) hi t v l nghim ca
phng trnh x = g (x)
32
3. Phng php lp n (tt)
V d: Kim tra nhng
dy sau c l lp n?
Nu c, vit ra hm lp g.
Tnh 5 s hng u ca
dy (x
0
bt k). T ,
on tnh hi t.
1
1
/ cos
10
/ 1
15
n
n
n
n
x
a x
z
b z
+
+
| |
=
|
\ .
= +
33
Dy lp n hi t
34
Dy lp n phn k
35
Hm co
Hm y = g(x) co trn [a, b] vi h s co q nu nh tn ti
mt s q, 0 q < 1 gi l h s co sao cho:
| | ( ) ( )
1 2 1 2 1 2
, , : x x a b g x g x q x x e s
VD: Hm y = x co trn [1/4, 1/4] vi q =1/2 v
| | ( ) ( )
2 2
1 2 1 2 1 2 1 2 1 2
1
, 1 4,1 4 :
2
x x x x x x x x x x e = + s
xe (a, b), |g(x)| q < 1 th g(x) co trn [a, b] vi h s co q
36
V d iu kin co
Trong nhng hm sau y, hm no tho iu kin co?
Xc nh hng s q vi cc hm co
( ) | |
( ) | |
( ) ( ) | |
2
/ cos , 0,1
1
/ 1, , , 0
/ arccos , , , 0
a g x x x
b g x x a b a b
x
c g x x x a b a b
= e
= + e < <
= e < <
37
Phng php lp n
Phng trnh f (x) = 0.
Xc nh khong cch ly nghim [a, b]
a v dng lp n x = g(x), sao cho:
g co trn [a, b]
xe (a, b), g(x)e (a, b),
Ly x
0
bt k e [a, b].
Dy lp x
n+1
= g(x
n
) o
Ch : Nhiu cch chn hm g
cng n gin cng tt
38
c lng sai s
q: h s co ca hm lp n g(x)
1 0
1
n
n
q
x x x x
q
s

1
1
n n n
q
x x x x
q

s

n
x x s c
( ) | |
q
x x q
n
log
1 log
0 1

>
c
S ln lp ti thiu:
V d phng php lp n
f(x) = x
3
+ x 1000 = 0 vi sai s 10
-8
Khong cch ly nghim: [9, 10]
Lp n: x = 1000 x
3
= g(x): Kim tra iu kin co?
Xy dng hm lp mi:
Dy lp
n x
n
c
n
0 10
1
2
3
( )
3
1000 x x g x = =
| |
( )
0
3
1
9,10
1000
n n n
x
x g x x
+
e

= =

Sai s
1
1
n n n
q
x x x
q

o s

1
0.0035
n
n n n
x x x

c
o s

9.966554934 1.2 10
4
9,966667166 4 10
7
9,966666789 10
9
40
V d phng php lp n (tt)
Xp x nghim ca phng trnh f(x) = x cosx = 0 trn [0,
1] vi phng php lp n, x
0
= 0 vi sai s 10
-8
Dng lp x = cosx = g(x) q = 0.85
xe (0,1), g(x)e (0,1),
x
0
= 0 x
1
= 1
c lng sai s
n x
n
c
n
0 0
1
2
3
( )
8
0.85
1 0 10
1 0.85
n
n
x x n

s s

1 5.6667
0.5403023059 2.6050
0.8575332158 1.7978
41
4. Phng php Newton (tip tuyn)
f(x) = 0 lp n
Cng thc lp Newton:
( )
( )
( )
( )
0
'
f x
f x x x g x
f x
= = =
( )
( )
( )
n
n
n n n
x f
x f
x x g x
'
1
= =
+
42
4. Phng php Newton (tt)
43
iu kin lp Newton sai s
iu kin hi t:
1. o hm f, f khng
i du trn [a, b]
2. Gi tr lp ban u
tho: f(x
0
) . f(x
0
) > 0
(iu kin Fourier)
c lng sai s: Cng
thc tng qut

( )
*
*
f x
x x
m
s
44
V d phng php lp Newton (tip tuyn)
Gii xp x f(x) = x cosx = 0 trn [0,1] sai s 10
-8
1/ Kim tra iu kin hi t
2/ Xy dng dy lp:
n x
n
c
n
0 1
1
2
3
( )
( )
0
1
1
cos
1 sin
n n
n n
n
x
x x
x x
x
+
=

Sai s:
( )
1
n
n n
f x
x x s = c
0.46
0.750363868 0.019
0.739112891 4.7 10
5
0.739085133 2.9 10
10
45
Bi tp
sin x e
x
= 0 trn [0,1]
iu kin hi t:
1. o hm f , f khng i du trn [a, b]
2. Gi tr lp ban u tho: f(x
0
) . f(x
0
) > 0 (iu
kin Fourier)
c lng sai s : Cng thc tng qut
( )
*
*
f x
x x
m
s
46
V d
Hi t chm gn im cc tr, im un
Gii phng trnh f(x) = x = 0 trn [-1, 1]
x 2 x 3 = 0 vi x
0
= 0.9999 (1.0001)
sin x =0 vi x
0
~ /2
47
5. H PHNG TRNH PHI TUYN.
PHNG PHP NEWTON RAPHSON.
Xt h n gin gm 2 phng trnh phi tuyn
F(x,y) = 0, G (x,y) = 0
F(x,y), G (x,y) lin tc v c o hm ring theo x v y lin tc
trong ln cn nghim
( )
, x y
( )
, 0
x y
x y
F F
J x y
G G
' '
= =
' '
48
g
=

0
g
=

0
g
=

0
5. H PHNG TRNH PHI TUYN.
PHNG PHP NEWTON RAPHSON.
Xt h n gin gm 2 phng trnh phi tuyn
F(x,y) = 0, G (x,y) = 0
F(x,y), G (x,y) lin tc v c o hm ring theo x v y lin tc
trong ln cn nghim
( )
, x y
( )
, 0
x y
x y
F F
J x y
G G
' '
= =
' '
( )
( ) ( )
( ) ( )
( )
( ) ( )
( ) ( )
1
1
, ,
1
, , ,
, ,
1
, , ,
n n y n n
n n
n n y n n n n
x n n n n
n n
x n n n n n n
F x y F x y
x x
G x y G x y J x y
F x y F x y
y y
G x y G x y J x y
+
+
'
=
'
'
=
'
Nu chn (x
0
, y
0
) gn nghim th
s hi t v nghim ca h
V d lp Newton Raphson vi h phi tuyn
Tm nghim gn ng x
1
, y
1
ca h phi tuyn sau vi 3 ch s l:
( )
( )
2
2
, 3ln 0
, 2 5 1 0
F x y x x y
G x y x xy x
+ =

+ =

0 0
1.5, 1.5 x y = =
Gii: Ma trn J = f(x)
( )
3
1 2
,
4 5
x y
x y
F F
y
J x y
x
G G
x y x
' '
+
= =
' '

b nh: x
(k)
gn nghim
n x
(n)
Ma trn Jacobian J Vect f(x
(n)
) Vect h
0 1.5 3 3
1.5 2.5 1.5
1
0.466
0.25
1.379
1.535
0.121
0.035
0.013
0.025
3.175 3.07
2.051 -1.379
52
2 2
3
1 0
0
x y
x y
+ =

chn x
0
= 0.8, y
0
= 0.5
n x
(n)
Ma trn Jacobian J Vect f(x
(n)
) Vect h
0 0.8
0.5
1
( )
2
2 2
,
3 1
x y
x y
F F
x y
J x y
G G
x
' '
= =
' '

V d lp Newton Raphson vi h phi
tuyn (tt)
1.6 1
1.92 1
0.110
0.012
0.028
0.065
0.828
0.565
4.81 10
3
2.66 10
3
53
2
3
0.5 0
5 0
x x y
x xy y
+ =

chn x
0
= 1.2, y
0
= 0.1
n x
(n)
Ma trn Jacobian J Vect f(x
(n)
) Vect h
0 1.2 1.4 1 0.16 0.00675
0.1 3.82 7 1.028 0.15054
1 1.20675 3.56 10
5
0.25054 4.91 10
3
( )
2
2 1 1
,
3 5 5 1
x y
x y
F F
x
J x y
G G
x y x
' '

= =
' '

V d lp Newton Raphson vi h phi
tuyn (tt)
54
V d lp Newton Raphson vi h phi
tuyn (tt)
( )
2 1
,
2 2
x y
x y
F F
x
J x y
G G
x y
' '

= =
' '
2
2 2
1
5
y x
y x
+ =

chn x
0
= y
0
= 1.75
n x
(n)
Ma trn Jacobian J Vect f(x
(n)
) Vect h
0 1.75
1.75
1
3.5 1
3.5 3.5
0.3125
1.125
0.1409
0.1806
1.6091
1.5696
0.0196
0.0528
55
V d lp Newton Raphson vi h phi
tuyn (tt)
( )
2 1
,
2 2
x y
x y
F F
x
J x y
G G
x y
' '

= =
' '
2
2 2
1
5
y x
y x
+ =

chn x
0
= y
0
= 1.5
n x
(n)
Ma trn Jacobian J Vect f(x
(n)
) Vect h
0 1.5
1.5
1
0.25
0.5
3 1
3 3
0.1042
0.0625
1.6042
1.5625
0.0110
0.0149
Bi tp n chng 1
f(x) = sin x e
x
= 0 trn [0,1] - Phng php Newton
1/ Kim tra iu kin hi t
f(x) = cos(x) + e
x
f(x) >0 x e [0,1]
f(x) = sin (x) e
x
f(x) <0 x e [0,1]
2/ Xy dng dy lp:
( )
( )
0 1
sin
0,
cos
n
n
x
n
n n
x
n
x e
x x x
x e

= =
+
n x
n
c
n
0 0
1
2
3
4
Sai s:
( ) ( )
0.90
n n
n
f x f x
x x
m
s =
1,1012
0,5 0,1400
0,5856438169 0,0045
0,5885294126 0,6 10
5
0,5885327440 1,2 10
10
57
Bi tp n chng 1 (tt)
f (x) = ln (x) + cos x =0 trn [0.1,1]
vi chnh xc 10
2
58
Li gii bng phng php chia i
n a
n
b
n
c
n
c
n
0 0.1 1 + 0.55 + 0.45
1 0.1 0.55 + 0.325 0.225
2 0.325 0.55 + 0.4375 + 0.1125
3 0.325 0.4375 + 0.38125 0.05625
4 0.38125 0.4375 + 0.409375 + 0.028125
5 0.38125 0.409375 + 0.3953125 0.0140625
6 0.3953125 0.409375 + 0.40234375 0.00703125
59
Li gii bng phng php lp n
Xy dng hm lp:
Dy lp
n x
n
c
n
0 0,1
1
2
3
( )
cos x
x e g x

= =
| |
( )
0
cos
1
0.1,1
n
x
n n
x
x g x e

+
e

= =

Sai s
1
1
n n n
q
x x x
q

o s

1
0.5
n
n n n
x x x

c
o s

0,369722 0,269723
0,393597 0,023876
0,397113 0,003517
60
f (x) = ln (x) + cos x =0 trn [0.1,1] vi
chnh xc 10
2
bng phng php Newton
1/ Kim tra iu kin hi t
f(x) = 1/x sin x f(x) >0 x e [0.1, 1]
f(x) = 1/x cos x f(x) < 0 x e [0.1, 1]
2/ Xy dng dy lp:

+
=
=
+
n n
n n
n n
x x
x x
x x
x
sin 1
cos ln
1 , 0
1
0
Sai s:
( ) ( )
15 , 0
x f
m
x f
x x
n
= s
n x
n
c
n
0 0.1 8.71721
1 0.232077 3.24998
2 0.351593 0.70971
3 0.394179 0.05093
4 0.397727 0.00031
5 0.397748 1.07

10
8
61
Bi tp n chng 1 (tt)
f(x) = x + 2 x 1 = 0 trn [0,1]
Phng php Newton vi chnh xc 10
5
62
Bi tp n chng 1 (tt)
f(x) = (x 2) ln x = 0 trn [1,2]
Phng php Newton vi chnh xc 10
5
63
f(x) = x + 2 x 1 = 0 trn [0,1]
Phng php lp n vi chnh xc 10
5
n x
n
c
n
0 0
1 0.5 0.5
2 0.444444 0.055556
3 0.455056 0.010612
4 0.453088 0.001968
5 0.453455 0.000367
6 0.453387 6.844

10
5
7 0.453400 1.276

10
5
8 0.453397 2.379

10
6
Xy dng hm lp:
Dy lp
2
1
2
x
x
=
+
1
1
n n n
q
x x x
q

o s

1
0.5
n
n n n
x x x

c
o s

Sai s
| |
( )

+
= =
e
+
2
1
1 , 0
2
1
0
n
n n
x
x g x
x
q = 0,5
64
Bi tp n chng 1 (tt)
( )
3 3
sin 1
3 1
x y
x xy y
+ =

+ =

chn x
0
=0.2, y
0
= 1.2
n x
(n)
Ma trn Jacobian Vect f(x
(n)
) Vect h
0 0.2 0.17 0.17 0.0146 0.0466
1.2 3.48 3.72 0.016 0.0393
1 0.2466 0.0036
1.2393 0.0016
65
Phng php Newton Raphson cho h m
phng trnh phi tuyn
Xt h gm m phng trnh
( )
( )

=
=
0 , ,
0 , ,
2 1
2 1 1
m m
m
x x x f
x x x f

f
1
,,f
m
l cc hm
lin tc v c o
hm ring theo x
1
,
x
2
, x
m
v lin tc
trong ln cn
nghim ( )
m
x x x , ,
2 1

( )
m
m m m
m
m
m
x
f
x
f
x
f
x
f
x
f
x
f
x
f
x
f
x
f
x x J
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
=

2 1
2
2
2
1
2
1
2
1
1
1
1
, ,
66
Phng php Newton Raphson cho h m
phng trnh phi tuyn (tt)
Gi s chn (x
10
, x
20
,, x
m0
) gn nghim th
( )
m
m
k
m
m
k
m m m
m k k
m k k
n m n n
n k n k
x
f
x
f
f
x
f
x
f
x
f
x
f
x
f
f
x
f
x
f
x
f
x
f
x
f
f
x
f
x
f
x
f
x x x J
x x
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
=
+
+
+
+




1 1 2 1
2
1
2
2
1
2
2
2
1
2
1
1
1
1
1
1
2
1
1
1
, 2 1
, 1 ,
,..., ,
1
s hi t v nghim ca h
ct th k trong ma trn Jacobian
bin th k
V d phng php Newton Raphson cho
h m phng trnh phi tuyn
Gii h ba phng
trnh sau
( )
( )
( )

= + =
= =
= + + =
0 , ,
0 20 2 , ,
0 36 4 36 9 , ,
2 2 2
3
2 2
2
2 2 2
1
z y x z y x f
z y x z y x f
z y x z y x f
( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( ) z y x f
z
z y x f
y
z y x f
x
z y x f
z
z y x f
y
z y x f
x
z y x f
z
z y x f
y
z y x f
x
z y x J
, , , , , ,
, , , , , ,
, , , , , ,
, ,
3 3 3
2 2 2
1 1 1
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
=
( )
z y x
y x
z y x
z y x J
2 2 2
20 4 2
8 72 18
, ,

==
V d phng php Newton Raphson cho
h m phng trnh phi tuyn (tt)
( )
z y x
y x
z y x
z y x J
2 2 2
20 4 2
8 72 18
, ,

=
( )
( )
( )
( )
n n n n n
n n n n
n n n n n
n n n
n n
z y z y x f
y z y x f
z y z y x f
z y x J
x x
2 2 , ,
20 4 , ,
8 72 , ,
, ,
1
3
2
1
1

=
+
( )
( )
( )
( )
n n n n n
n n n n
n n n n n
n n n
n n
z z y x f x
z y x f x
z z y x f x
z y x J
y y
2 , , 2
20 , , 2
8 , , 18
, ,
1
3
2
1
1
=
+
( )
( )
( )
( )
n n n n n
n n n n n
n n n n n
n n n
n n
z y x f y x
z y x f y x
z y x f y x
z y x J
z z
, , 2 2
, , 4 2
, , 72 18
, ,
1
3
2
1
1

=
+
69
V d phng php Newton Raphson cho
h m phng trnh phi tuyn (tt)
0 , 1 , 1
0 0 0
= = = z y x
n x
n
y
n
z
n
0 1.0 1.0 0.0
1 0.9 0.9 0.04
2 0.8936507937 0.8945436508 0.04008928571
3 0.8936282347 0.8945270105 0.04008928614
4 0.8936282345 0.8945270104 0.04008928616
Kt qu nhn c vi
70
Bi tp phng trnh phi tuyn
e
x
sin x = 0
trn [0, 1] vi c = 0,1
3x ln (2x + 1) = 0
trn [ 0.4, 0.2]; c = 0,01
71
Phng php lp n e
x
sin x = 0
trn[0, 1]
Xy dng hm lp:
Dy lp
n x
n
c
n
0 0
1
2
3
4
5
Sai s
1
1
n n n
q
x x x
q

o s

0,5 0,61
0,563553 0,07642
0,397113 0,02104
( )
2
sin x e
x x g
x

=

| |
( )

=
e
+ n n
x g x
x
1
0
1 , 0

n
n n n
x x x
c
+
s o
1
25 . 1
0,586254 0,00626
0,587836 0,00191
72
Phng php lp n 3x ln (2x + 1)
= 0 trn [ 0.4, 0.2]
Xy dng hm lp:
x = g (x) = (e
x
1) /2
Dy lp
n x
n
c
n
0 0
1
2
3
4
5
6
7
Sai s
1
1
n n n
q
x x x
q

o s

| |
( )
0
1
0.4, 0.2
n n
x
x g x
+
e

1
4, 9
n
n n n
x x x
+
c
o s

q = 0,83
-0.3494 0.2471
-0.3247 0.1206
-0.3112 0.0658
-0.3035 0.0381
-0.2988 0.0227
-0.2960 0.0138
-0.2943 0.0085
73
Phng php Newton
f(x) = sin x e
x
= 0 trn [0,1]
1/ Kim tra iu kin hi t
f(x) = cos(x) + e
x
f(x) >0 x e [0,1]
f(x) = sin (x) e
x
f(x) <0 x e [0,1]
2/ Xy dng dy lp:
( )
( )
0
1
0,
sin
cos
n
n
x
n
n n
x
n
x
x e
x x
x e

+

=

n x
n
c
n
0 0
1
2
3
4
Sai s:
( ) ( )
0.90
n n
n
f x f x
x x
m
s =
1,1012
0,5 0,1400
0,5856438169 0,0045
0,5885294126 0,6 10
5
0,5885327440 1,2 10
10
74
Phng php Newton
f(x) = 3x ln (2x + 1) = 0 trn [ 0.4, 0.2]
1/ Kim tra iu kin hi t
f(x) = 3 2/(2x + 1) f(x) <0 x e [0.4, 0.2]
f(x) = 4/(2x + 1) f(x) >0 x e [0.4, 0.2]
2/ Xy dng dy lp:
0
1
0, 4,
3 ln(2 1)
3 2/(2 1)
n n
n n
n
x
x x
x x
x
+
=

n x
n
c
n
0 -0,4
1
2
3
4
5
Sai s:
( ) ( )
1/ 3
n n
n
f x f x
x x
m
s =
1.2284
-0.3415 0.3732
-0.3039 0.0731
-0.2923 0.0051
-0.291411 3 10
5
-0.291406 1.5 10
9
2. H phng trnh tuyn tnh
Mn hc:
Phng php tnh
76
Ni dung
A. Cc phng php gii ng
1/ Phng php kh Gauss (phn t tr).
2/ Phn tch nhn t LU
3/ Phn tch Cholesky
B. Cc phng php lp
1/ Lp Jacobi
2/ Lp Gauss Seidel
C. S iu kin v h iu kin xu
77
Tng quan
H n phng trnh tuyn tnh, n n Dng Ax = b
11 12 1
21 22 2
1 2
...
...
... ... ... ...
...
n
n
n n nn
a a a
a a a
A
a a a
| |
|
|
=
|
|
\ .
1
2
...
n
b
b
b
b
| |
|
|
=
|
|
\ .
( )
1
2
1 2
...
...
T
n
n
x
x
x x x x
x
| |
|
|
= =
|
|
\ .
78
Tng quan (tt)
n gin nht: Ma trn ng cho
H tng ng vi n phng trnh bc nht
11
22
0 ... 0
0 ... 0
... ... ... ...
0 0 ...
nn
a
a
A
a
| |
|
|
=
|
|
\ .
n i b x a
i i ii
, 1 = =
ii
i
i
a
b
x =
79
Tng quan (tt)
n gin: Ma trn tam gic trn
11 12 1
22 2
...
0 ...
... ... ... ...
0 0 ...
n
n
nn
a a a
a a
A
a
| |
|
|
=
|
|
\ .

=
|
|
.
|

\
|
=
=

+ =
1 ,..., 1 ,
1
1
n k x a b
a
x
a
b
x
n
k j
j kj k
kk
k
nn
n
n
80
Tng quan (tt)
n gin: Ma trn tam gic di
11
21 22
1 2
0 ... 0
... 0
... ... ... ...
...
n n nn
a
a a
A
a a a
| |
|
|
=
|
|
\ .

=
|
|
.
|

\
|
=
=

=
n k x a b
a
x
a
b
x
k
j
j kj k
kk
k
,..., 2 ,
1
1
1
11
1
1
81
Phng php kh Gauss
S dng cc php bin i s cp theo hng
chuyn v mt h phng trnh mi tng ng
c ma trn h s dng tam gic
Cc php bin i s cp hay s dng:
Nhn mt hng vi mt s khc khng;
Hon chuyn hai hng cho nhau;
Cng mt hng cho mt hng khc nhn vi mt s
khc khng.
82
Phng php kh Gauss (tt)

= + + +
= + + +
= + + +
n n nn n n
n n
n n
b x a x a x a
b x a x a x a
b x a x a x a

2 2 1 1
2 2 2 22 1 21
1 1 2 12 1 11
( ) ( ) ( )
( ) ( ) ( )

= + +
= + +
= + + +
1 1
2
1
2
1
2
1
2 2
1
22
1 1 2 12 1 11
n n nn n
n n
n n
b x a x a
b x a x a
b x a x a x a

1
11 1
11
0
k
k
a
a m
a
= =
83
Phng php kh Gauss (tt)

= +
= +
= +
14 30 8 4
5 14 7 6
1 3 2 2
3 2 1
3 2 1
3 2 1
x x x
x x x
x x x
Ma trn h s m rng
( )
2 2 3 1
6 7 14 5
4 8 30 14
A A b

| |
|
= =
|
|

\ .
3
2
6
11
21
21
= = =
a
a
m
jj
kj
kj
a
a
m = 2
2
4
11
31
31
= = =
a
a
m
2 2 3 1
6 7 14 5
4 8 30 14

| |
|

|
|

\ .
2 2 1
3 3 1
3
2
h h h
h h h


2 2 3 1
0 1 5 2
0 4 24 12

| |
|

|
|

\ .
84
Phng php kh Gauss (tt)
4
1
4
22
32
32
=

= =
a
a
m
|
|
|
.
|

\
|

12 24 4 0
2 5 1 0
1 3 2 2

=
= +
= +
4 4
2 5
1 3 2 2
3
3 2
3 2 1
x
x x
x x x
2 3 3
4h h h
|
|
|
.
|

\
|

4 4 0 0
2 5 1 0
1 3 2 2
( ) ( )
( )

= + =
= =
= =
2 2 / 3 2 1
3 1 / 5 2
1 4 / 4
3 2 1
3 2
3
x x x
x x
x
|
|
|
.
|

\
|
=
1
3
2
x
85
Phng php kh Gauss (tt)
Kh ct 1: a
(1)
11
=0
Kh ct 2: a
(2)
22
=0
Gii li: a
(3)
33
=0
Phn t tr (pivot) a
kk
=0
86
Kh Gauss vi lnh Maple
> with(linalg); # Khi ng gi lnh i s tuyn tnh
> A := matrix(2,3,[2, 3, 4, 1, 2, 3]); # Nhp ma trn
> m21 := A[2,1]/A[1,1]; # Tnh h s kh
> A := addrow(A,1,2,m21) ; # Cng hng h
2
h
2
m
21
h
1
> A := swaprow(A,1,2) ; # Nu cn thit, i hng h
2
h
1
> AA := gausselim(A); # Lnh gp kh Gauss ton ma trn
> x := backsub(AA) ; # H dng tam gic trn: Gii li
87
Phng php kh Gauss (tt)
VD: Gii h

= + +
= + +
= +
= +
4 3 4
2
20 3 3 2 2
8 2
4 3 2 1
3 2 1
4 3 2 1
4 3 2 1
x x x x
x x x
x x x x
x x x x
Phng php kh Gauss (tt)
(0)
1 1 2 1 8
2 2 3 3 20
1 1 1 0 2
1 1 4 3 4
A

| |
|

|
=
|

\ .
(3)
1 1 2 1 8
0 2 1 1 6
0 0 1 1 4
0 0 0 2 4
A

| |
|

|
=
|

|
\ .
( )
7 3 2 2
T
x =

Phn t
(1)
22
0 a =
do tip tc ta i ch hng th 2 v th 3
2 2 1
3 3 1
4 4 1
2 h h h
h h h
h h h



(1)
1 1 2 1 8
0 0 1 1 4
0 2 1 1 6
0 0 2 4 12
A

| |
|

|
=
|

|
\ .
(2)
1 1 2 1 8
0 2 1 1 6
0 0 1 1 4
0 0 2 4 12
A

| |
|

|
=
|

|
\ .
4 4 3
2 h h h +

Thc t tnh ton: vn lm trn s


Quy tc lm trn trn my tnh: Lm trn ch s c ngha
35 , 12 10 235 , 1 10 234567 , 1 34567 , 12
1 1
= ~ =
Tr kh: a
11
= 0.003 = 0
1764 67 , 1763
11
21
21
~ = =
a
a
m
Bin i ct mt: (E
2
) (E
2
) m
21
(E
1
)
1 2
2
0.003 59.14 59.17
104300 104400
x x
x
+ =

VD: Gii h trn my tnh vi php lm trn 4 ch c ngha

=
= +
) (E 78 . 46 130 . 6 291 . 5
) (E 17 . 59 14 . 59 003 . 0
2 2 1
1 2 1
x x
x x
Nghim chnh xc: [10, 1]
T
2
1
1.001
10
x
x
=

Ti sao?
Thc t tnh ton: vn lm trn s (tt)
i hng
VD: Gii h trn my tnh vi php lm trn 4 ch c ngha

=
= +
) (E 78 . 46 130 . 6 291 . 5
) (E 17 . 59 14 . 59 003 . 0
2 2 1
1 2 1
x x
x x
Nghim chnh xc: [10, 1]
T
1 2 2
1 2 1
5.291 6.130 46.78 (E )
0.003 59.14 59.17 (E )
x x
x x
=

+ =

Tr kh: a
11
= 5.291 = 0
4
21
21
11
5.6700 10
a
m
a

= =
Bin i ct mt: (E
1
) (E
1
) m
21
(E
2
)
1 2 2 2
2 1
5.291 6.130 46.78 (E ) 1.000
59.14 59.14 10.00
x x x
x x
= =


= =

91
V d

= + +
= + +
= +
= + +
8 2 3 2
4 2 2 3
18 3 2 4 2
6 2 3 2
4 3 2 1
4 3 2 1
4 3 2 1
4 3 2 1
x x x x
x x x x
x x x x
x x x x
|
|
|
|
|
.
|

\
|




8 1 2 3 2
4 2 1 2 3
18 3 2 4 2
6 2 3 2 1
|
|
|
|
|
.
|

\
|




20 5 4 7 0
14 8 10 4 0
6 1 8 0 0
6 2 3 2 1
|
|
|
|
|
.
|

\
|




20 5 4 7 0
14 1 8 0 0
6 4 10 4 1
6 2 3 2 1
92
V d (tt)
|
|
|
|
|
.
|

\
|




20 5 4 7 0
6 1 8 0 0
14 8 10 4 0
6 2 3 2 1
|
|
|
|
|
.
|

\
|



5 , 4 9 5 , 13 0 0
6 1 8 0 0
14 8 10 4 0
6 2 3 2 1
|
|
|
|
|
.
|

\
|



8
117
16
117
0 0 0
6 1 8 0 0
14 8 10 4 0
6 2 3 2 1
|
|
|
|
|
.
|

\
|

=
2
1
2
1
x
93
Phng php Gauss Jordan
Ci tin phng php Gauss
Ti mi bc, khi chn phn t bin i, ta chn phn
t c gi tr tuyt i ln nht, sao cho khng cng hng
v ct vi cc phn t chn trc
Phn t ny gi l phn t chnh hoc phn t tri
Bin i sao cho tt c cc phn t trn cng ct ca phn
t tri bng 0
Qua n bc nh vy ta s tm c nghim
Phn t
(1)
22
0 a = do tip tc ta i ch hng th 2 v th 3
94
Phng php Gauss Jordan (tt)
(0)
43
4 a = Chn phn t chnh l phn t
(0)
1 1 2 1 8
2 2 3 3 20
1 1 1 0 2
1 1 4 3 4
A

| |
|

|
=
|

\ .
1 1 4
2 2 4
3 3 4
2
4 3
4
h h h
h h h
h h h



(1)
1 1 0 5 20
5 5 0 21 92
3 5 0 3 12
1 1 4 3 4
A

| |
|

|
=
|

|

\ .
(1)
24
21 a =
Phn t chnh tip theo (khng nm trn hng th t v ct th
ba) l phn t
1 1 2
3 3 2
4 4 2
21 5
7
7
h h h
h h h
h h h


+
(2)
4 4 0 0 40
5 5 0 21 92
16 40 0 0 8
12 12 28 0 64
A

| |
|

|
=
|
|

\ .
95
Phng php Gauss Jordan (tt)
(2)
32
40 a =
Phn t chnh tip theo (khng nm
trn hng th hai, th t v ct th
ba, th t) l phn t
(2)
4 4 0 0 40
5 5 0 21 92
16 40 0 0 8
12 12 28 0 64
A

| |
|

|
=
|
|

\ .
1 1 3
2 2 3
4 4 3
10
8
10 3
h h h
h h h
h h h

+
+
(3)
56 0 0 0 392
56 0 0 168 728
16 40 0 0 8
168 0 280 0 616
A

| |
|

|
=
|
|

\ .
(4)
56 0 0 0 392
0 0 0 168 336
0 280 0 0 840
0 0 280 0 560
A

| |
|

|
=
|
|
\ .
Phn t chnh cui
cng l phn t
(3)
11
56 a =
2 2 1
3 3 1
4 4 1
7 2
3
h h h
h h h
h h h
+
+
+
1
4
2
3
56 392
168 336
280 840
280 560
x
x
x
x
=

7
3
2
2
x

96
V d Phng php Gauss - Jordan

= + +
= + +
= +
= + +
8 2 3 2
4 2 2 3
18 3 2 4 2
6 2 3 2
4 3 2 1
4 3 2 1
4 3 2 1
4 3 2 1
x x x x
x x x x
x x x x
x x x x
|
|
|
|
|
.
|

\
|




8 1 2 3 2
4 2 1 2 3
18 3 2 4 2
6 2 3 2 1
2 4 4
2 3 3
2 1 1
3 4
2
2
h h h
h h h
h h h
+


|
|
|
|
|
.
|

\
|




22 5 2 0 14
10 7 0 0 4
18 3 2 4 2
6 1 8 0 0
|
|
|
|
|
.
|

\
|




8 1 2 3 2
4 2 1 2 3
18 3 2 4 2
6 2 3 2 1
|
|
|
|
|
.
|

\
|




22 5 2 0 14
10 7 0 0 4
18 3 2 4 2
6 1 8 0 0
|
|
|
|
|
.
|

\
|




22 5 2 0 14
114 59 4 0 0
104 26 16 28 0
6 1 8 0 0
|
|
|
|
|
.
|

\
|



728 0 98 0 826
114 59 4 0 0
4312 0 1008 1652 0
468 0 468 0 0
|
|
|
|
|
.
|

\
|



826 0 0 0 826
118 59 0 0 0
3304 0 0 1652 0
1 0 1 0 0

=
=
=
=
826 826
118 59
3304 1652
1
1
4
2
3
x
x
x
x

=
=
=
=
1
2
2
1
1
4
2
3
x
x
x
x
4 3 3
4 2 2
1 1
2 7
7
h h h
h h h
h h

3 4 4
3 2 2
3 1 1
5 59
26 59
59
h h h
h h h
h h h
+

+
1 5 4
1 3 3
2 2
1 1
98
4
1008
468 /
h h h
h h h
h h h
h h


98
Phng php kh Gauss (tt)
( )
2.43 3.45 -6.21 1.45
0.43 4.24 -5.05 2.23
2.67 -1.13 3.27 3.21
A b
| |
|
=
|
|
\ .
1 2 3
1 2 3
1 2 3
2.43 3.45 6.21 1.45
0.43 4.24 5.05 2.23
2.67 1.13 + 3.27 3.21
x x x
x x x
x x x
+ =

+ =

( )
2.43 3.45 6.21 1.45
0 3.630 3.951 1.973
0 0 4.737 4.292
A b

| |
|
=
|
|
\ .
0.740
1.530
0.906
x
| |
|
=
|
|
\ .
99
Phn tch nhn t LU
Phn tch ma trn h s A thnh tch ca hai ma
trn L v U, trong L l ma trn tam gic di
cn U l ma trn tam gic trn
Khi vic gii h phng trnh Ax = b s a v
vic gii h phng trnh Ly = b v Ux = y
Nu A l ma trn khng suy bin th bao gi cng
tn ti mt ma trn P khng suy bin sao cho ma
trn PA phn tch c thnh tch ca ma trn tam
gic di L v ma trn tam gic trn U
100
Phn tch nhn t LU (tt)
To ma trn kh L, ma trn kt qu U v xt tch L.U

= +
= +
= +
14 30 8 4
5 14 7 6
1 3 2 2
3 2 1
3 2 1
3 2 1
x x x
x x x
x x x
|
|
|
.
|

\
|
1 4 2
0 1 3
0 0 1
|
|
|
.
|

\
|

4 0 0
5 1 0
3 2 2 2 2 3
6 7 14
4 8 30

| |
|

|
|

\ .
. =
101
Phn tch nhn t LU (tt)
Kt qu: Nu qu trnh kh Gauss din ra bnh
thng (khng i hng), ma trn A ca h Ax = b
phn tch c thnh tch LU, tc A = LU vi
L (lower): ma trn tam gic di, ng cho
chnh bng 1, cha cc h s kh v tr kh
U (upper): ma trn tam gic trn, cng l ma trn
kt qu nhn c sau qu trnh kh Gauss
102
Phn tch nhn t LU (tt)
Ma trn A phn tch c thnh dng LU, ma trn L c
ng cho chnh bng 1 (phng php Doolittle)
Cc h s ca L v U
1 1
1
1
11
1
,
1
1
,
1
,
(1 )
(2 )
(2 )
1
(1 )
j j
j
j
j
i j ij ik kj
k
j
i j ij ik kj
k
i j
u a j n
a
l i n
a
u a l u i j
l a l u j i
u

=
= s s

= s s

= s s

| |
= < <
|
\ .

Gii thut tm LU (ng cho L bng 1)


2 2 3
6 7 14
4 8 30
A

| |
|
=
|
|

\ .
2 2 3
0 1 5
0 4 24

| |
|

|
|

\ .
2 2 3
0 1 5
0 0 4

| |
|

|
|
\ .
1 0 0
1 0
1
L
| |
|
= -
|
|
- -
\ .
H s kh:
tru PT
cot Cung
( )
( )
2 0
6 , 1
4 4
A
| | | |
| |

| |
| |

\ . \ .
2
Cot 1: Cot 2 :
0
; 1
4
| | | |
| |
| |
| |
\ . \ .
1
He so kh cot 1: 3 hso kh cot 2:
2
1 0 0
3 1 0
2 4 1
L
| |
|
=
|
|
\ .
Phn tch LU vi ng cho chnh L bng 1 Kh Gauss
(khng i hng). Cc h s kh to L, ma trn kt qu: U
104
Phn tch nhn t LU (tt)
H Ax = b (LU) x = b
(1)
(2)
Ux y
Ly b
=

Gii h u Gii 2 h tam gic:


Ly = b (2) tm y;
Ux = y (1) tm x
105
Phn tch nhn t LU (tt)
(2) Ly b =
1 0 0 2 2 3
3 1 0 0 1 5
2 4 1 0 0 4
A

| | | |
| |
= -
| |
| |
\ . \ .
( )
2 2 3 1
6 7 14 5
4 8 30 14
A A b

| |
|
= =
|
|

\ .
1 0 0 1
3 1 0 5
2 4 1 14
| |
|
|
|
\ .
1
2
4
y
| |
|
=
|
|
\ .
(1) Ux y =
2 2 3 1
0 1 5 2
0 0 4 4

| |
|

|
|
\ .
2
3
1
x
| |
|
=
|
|
\ .
106
Phn tch nhn t LU (tt)
Gi s ma trn A phn tch c thnh dng LU nh sau:
S dng phn tch LU trn gii h Ax = b = (9 5 7 11)
T
3 7 2 2 1 0 0 0 3 7 2 2
3 5 1 1 1 1 0 0 0 2 1 1

6 4 0 0 2 5 1 0 0 0 1 1
9 5 5 4 3 8 3 1 0 0 0 1
A

| | | | | |
| | |

| | |
= = -
| | |

| | |

\ . \ . \ .
107
Phn tch nhn t LU (tt)
1 0 0 0 9
1 1 0 0 5
2 5 1 0 7
3 8 3 1 11

| |
|

|
|

\ .
9
4
5
1
y

| |
|

|
=
|
|
\ .
Gii Ly = b tm y

Gii Ux = y tm x
3 7 2 2 9
0 2 1 1 4
0 0 1 1 5
0 0 0 1 1

| |
|

|
|

\ .
4.17
4.5
6
1
x
| |
|
|
=
|

\ .

108
Phn tch nhn t LU (tt)
S dng phng php nhn t gii h
1 2 3
1 2 3
1 2 3
2 5 4 1
3 3 9 0
3 6 5 4.1
x x x
x x x
x x x
+ =

+ + =

+ + =

2 5 4
3 3 9
3 6 5
A

| |
|
=
|
|
\ .
1 0 0
1.5 1 0
1.5 1.286 1
L
| |
|
=
|
|
\ .
2.674
0.124
0.932
x
| |
|
=
|
|

\ .
2 5 4
0 10.5 3
0 0 4.858
U

| |
|
=
|
|

\ .
109
Phn tch nhn t LU theo phng php Doolittle,
phn t u
33
s l bao nhiu
2 1 2
6 5 9
4 4 4
A

| |
|
=
|
|

\ .
110
Phn tch nhn t LU (tt)
1 2 3
1 2 3
1 2 3
2 2 3 1
6 7 14 6
4 8 30 18
x x x
x x x
x x x
+ =

+ =

+ =

(2) Ly b =
1 0 0 2 2 3
3 1 0 0 1 5
2 4 1 0 0 4
A

| | | |
| |
= -
| |
| |
\ . \ .
1 0 0 1
3 1 0 6
2 4 1 18
| |
|
|
|
\ .
1
3
4
y
| |
|
=
|
|
\ .
(1) Ux y =
2 2 3 1
0 1 5 3
0 0 4 4

| |
|

|
|
\ .
1
2
1
x
| |
|
=
|
|
\ .
111
Phn tch nhn t LU (tt)
S dng phng php nhn t gii h
1 2 3
1 2 3
1 2 3
2.2 0.3 0.2 1.5
0.3 3.4 0.2 2.4
0.2 0.2 0.2 4.1
x x x
x x x
x x x
+ + =

+ + =

+ + =

112
Bi tp phng php phn tch nhn
t LU
S dng phng php nhn t gii h
1 2 3
1 2 3
1 2 3
2.2 0.3 0.2 1.5
0.3 3.4 0.2 2.4
0.2 0.2 0.2 4.1
x x x
x x x
x x x
+ + =

+ + =

+ + =

2.2 0.3 0.2 1.5


0.3 3.4 0.2 2.4
0.2 0.2 4.1 3.2
| |
|
|
|
\ .
2.2 0.3 0.2
0 3.359 0.173
0 0 0.173
U
| |
|
=
|
|
\ .
1 0 0
0.136 1 0
0.091 0.051 1
L
| |
|
=
|
|
\ .
y = (1.5, 2.195, 3.851)
T
x = (1.275, 0.491, 22.267)
T
113
Phn tch nhn t LU (tt) Trng
hp ma trn ba ng cho
11 12
21 22 23
32 33
1, 1 1,
, 1 ,
0 0 0
0 0
0 0 0
0 0 0
0 0 0
n n n n
n n n n
a a
a a a
a a
A
a a
a a

| |
|
|
|
=
|
|
|
|
|
\ .

Trng hp ma trn ba ng cho (tt)


Phn r LU cho ta
21
32
1 0 0 0
1 0 0
0 1 0
0 0 0 1
l
L l
| |
|
|
|
=
|
|
|
\ .

11 12
22 23
33
0 0
0 0
0 0 0
0 0 0
nn
u u
u u
U u
u
| |
|
|
|
=
|
|
|
\ .

21
11 11 12 12 21
11
, , , 1 1,
1,
, 1 , 1 1,
,
, ,
2, 3,...,
, 2, 3,..., 1
i i i i i i i i
i i
i i i i i i
i i
a
u a u a l
u
u a l u i n
a
u a l i n
u

+
+ + +

= = =

= =

= = =

Trng hp ma trn ba ng cho (tt)


2 1 0 0
1 10 5 0
0 1 5 2
0 0 1 4
A
| |
|

|
=
|

|
\ .
5
18
40
27
b

| |
|

|
=
|

\ .
S dng phng php nhn t gii h phng trnh Ax = b vi
1 0 0 0
0.5 1 0 0
0 0.11 1 0
0 0 0.22 1
L
| |
|
|
=
|
|

\ .
2 1 0 0
0 9.5 5 0
0 0 4.47 2
0 0 0 4.45
U
| |
|

|
=
|

|
\ .
5
15.5
38.37
35.58
y

| |
|

|
=
|

\ .
3
1
5
8
x

| |
|
|
=
|
|

\ .
116
Trng hp ma trn ba ng cho (tt)
2 1 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0 0 0 0
0 1 2 1 0 0 0 0 0 0
0 0 1 2 1 0 0 0 0 0
0 0 0 1 2 1 0 0 0 0
0 0 0 0 1 2 1 0 0 0
0 0 0 0 0 1 2 1 0 0
0 0 0 0 0 0 1 2 1 0
0 0 0 0 0 0 0 1 2 1
0 0 0 0 0 0 0 0 1 2
A

| |
|

|
|

|

|
|

= |

|
|

|

|
|

|
|

\ .
2
1
1
1
1
1
1
1
1
2
b
| |
|
|
|
|
|
|
= |
|
|
|
|
|
|
|
\ .
S dng phng php nhn t gii h 10 phng trnh Ax = b vi
x = [6, 10, 13, 15, 16, 16, 15, 13, 10, 6]
T
11
7
Gii h phng trnh ba ng cho
H phng trnh dng ny gp rt nhiu trong thc tin
gii quyt cc h phng trnh ton-l
118
Phng php truy ui
gii h phng trnh dng Ax = F
Phng trnh tng qut ca h
A
k
x
k-1
+ C
k
x
k
+ B
k
x
k+1
= F
k
(1)
Gi s cc n lin h vi nhau theo cng thc
x
k
= o
k+1
x
k+1
+ |
k+1
(2)
Vi k = 1, 2,, n-1
119
Phng php truy ui (tt)
Biu din x
k-1
v x
k
qua x
k+1
v thay vo phng
trnh (1):
x
k
= o
k+1
x
k+1
+ |
k+1
x
k-1
= o
k
x
k
+ |
k
= o
k
(o
k+1
x
k+1
+ |
k+1
) + |
k
A
k
[o
k
(o
k+1
x
k+1
+ |
k+1
) + |
k
] +
+ C
k
(o
k+1
x
k+1
+ |
k+1
) + B
k
x
k+1
= F
k
120
Phng php truy ui (tt)
A
k
[o
k
(o
k+1
x
k+1
+ |
k+1
) + |
k
] + C
k
(o
k+1
x
k+1
+
|
k+1
) + B
k
x
k+1
= F
k
(A
k
o
k
o
k+1
+ C
k
o
k+1
+B
k
) x
k+1
+
+ (A
k
|
k+1
+ A
k
|
k
+ C
k
|
k+1
F
k
) = 0
k k k
k k k
k
k k k
k
k
A C
A F
A C
B
o +
|
= |
o +
= o
+ + 1 1
,
ng thc ny s khng ph thuc vo nghim
ca h nu c hai du ngoc bng khng. T
121
Phng php truy ui (tt)
T phng trnh u tin C
1
x
1
+ B
1
x
2
= F
1
T ta c
1
1
2
1
1
2
,
C
F
C
B
= | = o
T phng trnh cui cng
A
n
x
n-1
+ C
n
x
n
= F
n
m x
n-1
= o
n
x
n
+ |
n
t ta c
n n n
n n n
n
C A
A F
x
+ o
|
=
122
Phn tch Cholesky
Trng hp c bit ca phng php nhn t LU
c dng cho ma trn A i xng v xc nh
dng
nh ngha:
Ma trn vung A i xng nu A
T
= A tc a
ij
=a
ji
Ma trn vung A xc nh dng nu vi mi
vct x =0 ta lun c x
T
Ax > 0
123
Phn tch Cholesky (tt)
VD: ma trn A sau y i xng v xc nh dng
( )
1 2 3
, ,
T
x x x x =
1 1 0
1 5 2
0 2 2
A
| |
|
=
|
|

\ .
2 2 2
1 2 3 1 2 2 3
5 2 2 4 0
T
x Ax x x x x x x x = + + + >
nh l: Mt ma trn l xc nh dng khi v ch
khi tt c cc nh thc con chnh ca n u dng
nh thc con chnh cp k, 1 k n ca ma trn l
nh thc con thu c t k hng v k ct u tin
ca ma trn
124
Phn tch Cholesky (tt)
nh l: Ma trn A i xng xc nh dng tn ti
ma trn tam gic di B tha mn: A = BB
T
( )
( )
( )

< <
|
|
.
|

\
|
=
s < =
s < =
=

=
i j b b a
b
b
n i b a b
n i
b
a
b
a b
j
k
jk ik ij
jj
ii
i
k
ik ii ii
i
i
1
1
1
1
1
1
1
1
2
11
1
1
11 11
Minh ha gii thut Cholesky
1 1 0
1 5 2
0 2 2
A
| |
|
=
|
|

\ .
11
21 22
31 32 33
0 0
0
b
B b b
b b b
| |
|
=
|
|
\ .
11 11
b a =
1
1
11
i
i
a
b
b
=
i=2
21
21
11
a
b
b
=
31
31
11
a
b
b
=
i=3
1
2
1
i
ii ii ik
k
b a b

=
=

i=2
1
2 2
22 22 2 22 21
1
k
k
b a b a b
=
= =

i=3
2
2 2 2
33 33 3 33 31 32
1
k
k
b a b a b b
=
= =

j=3
1
1
1
i
ij ij ik jk
k
jj
b a b b
b

=
(
=
(

1
32 31 21
32 32 3
1
22 22
1
k jk
k
a b b
b a b b
b b
=
(
= =
(

Minh ha gii thut Cholesky


2 1 0
1 2 1
0 1 2
A

| |
|
=
|
|

\ .
11
21 22
31 32 33
0 0
0
b
B b b
b b b
| |
|
=
|
|
\ .
11 11
b a =
1
1
11
i
i
a
b
b
=
i=2
21
21
11
a
b
b
=
31
31
11
a
b
b
=
i=3
1
2
1
i
ii ii ik
k
b a b

=
=

i=2
1
2 2
22 22 2 22 21
1
k
k
b a b a b
=
= =

i=3
2
2 2 2
33 33 3 33 31 32
1
k
k
b a b a b b
=
= =

j=3
1
1
1
i
ij ij ik jk
k
jj
b a b b
b

=
(
=
(

1
32 31 21
32 32 3
1
22 22
1
k jk
k
a b b
b a b b
b b
=
(
= =
(

Minh ha gii thut Cholesky (tt)


1 1 0
1 5 2
0 2 2
A
| |
|
=
|
|

\ .
11
21 22
31 32 33
0 0
0
b
B b b
b b b
| |
|
=
|
|
\ .
11 11
b a =
11
1 b =
i=2
21
21
11
a
b
b
=
31
31
11
a
b
b
=
i=3
i=2
2
22 22 21
b a b =
i=3
2 2
33 33 31 32
b a b b =
j=3
32 31 21
32
22
a b b
b
b

=
21
1
1
1
b = =
31
0
0
1
b = =
2
22
5 1 2 b = =
32
2 0 1
1
2
b

= =
( )
2
2
33
2 0 1 1 b = =
0 0
0 B
| |
|
=
|
|
\ .
1
0
2
1 1
1
Minh ha gii thut Cholesky (tt)
1 1 0
1 5 2
0 2 2
A
| |
|
=
|
|

\ .
S dng phng php Cholesky gii h phng trnh Ax = b vi
1
3
2
b
| |
|
=
|
|

\ .
1 1 0 1 0 0 1 1 0
1 5 2 1 2 0 0 2 1
0 2 2 0 1 1 0 0 1
T
A BB
| | | || |
| | |
= = =
| | |
| | |

\ . \ .\ .
1 0 0
1 2 0
0 1 1
B
| |
|
=
|
|

\ .
By b =
1
2
3
1 0 0 1
1 2 0 3
0 1 1 2
y
y
y
| || | | |
| | |
=
| | |
| | |

\ .\ . \ .
1
1
1
y
| |
|
=
|
|

\ .
T
B x y =
1
2
3
1 1 0 1
0 2 1 1
0 0 1 1
x
x
x
| || | | |
| | |
=
| | |
| | |

\ .\ . \ .
1
0
1
x
| |
|
=
|
|

\ .
129
Phn tch Cholesky (tt)
A khng phi xc nh dng (ch i xng). Khi
cc phn t ca ma trn tam gic B sao cho
A = BB
T
c th cha s phc 2 h B
T
x = y &
By = b: phc. Nhng nghim x s l nghim thc!
Minh ha gii thut Cholesky (tt)
1 2 0
2 3 2
0 2 3
A
| |
|
=
|
|

\ .
11 11
b a =
11
1 b =
i=2
21
21
11
a
b
b
=
31
31
11
a
b
b
=
i=3
i=2
2
22 22 21
b a b =
i=3
2 2
33 33 31 32
b a b b =
j=3
32 31 21
32
22
a b b
b
b

=
1 0 0
2 0
0 2 1
B i
i
| |
|
=
|
|
\ .
21
2 b =
31
0 b =
22
b i =
32
2 b i =
( )
2
2
33
3 0 2 1 b i = =
det 1 A =
Minh ha gii thut Cholesky (tt)
1 2 0
2 3 2
0 2 3
A
| |
|
=
|
|

\ .
S dng phng php Cholesky gii h phng trnh Ax = b vi
5
11
1
b
| |
|
=
|
|
\ .
1 2 0 1 0 0 1 2 0
2 3 2 2 0 0 2
0 2 3 0 2 1 0 0 1
T
A i i i BB
i
| | | || |
| | |
= = =
| | |
| | |

\ . \ .\ .
1 0 0
2 0
0 2 1
B i
i
| |
|
=
|
|
\ .
By b =
1
2
3
1 0 0 5
2 0 11
0 2 1 1
y
i y
i y
| || | | |
| | |
=
| | |
| | |
\ .\ . \ .
5
1
y i
| |
|
=
|
|

\ .
T
B x y =
1
2
3
1 2 0 5
0 2
0 0 1 1
x
i i x i
x
| || | | |
| | |
=
| | |
| | |

\ .\ . \ .
3
1
1
x
| |
|
=
|
|

\ .
132
Bi tp gii thut Cholesky
S dng phng php Cholesky gii h phng trnh Ax = b vi
7 3 5 1
3 10 2 2
5 2 4 1
1 2 1 4
A
| |
|

|
=
|

|

\ .
4
18
7
2
b

| |
|

|
=
|
|
\ .
133
Chun vct v chun ma trn
Khng gian tuyn tnh thc R.
Chun ca vct x e R l mt s thc x tha
x e R, x > 0; x = 0 x = 0
x e R, e R, x= -x
x, y e R, x + y x + y (bt ng thc
tam gic)
Xt ch yu chun thng dng sau
x =[x
1
, x
2
,, x
n
]
T
e R
1 2
1
1
...
n
n k
k
x x x x x
=
= + + + =

( )
1 2
1,
max , ,..., max
n k
k n
x x x x x

=
= =
134
Chun vct v chun ma trn (tt)
Chun ma trn tng ng vi chun vect
1 0
max max
x x
Ax
A Ax
x
= =
= =
1
1
1
max
n
ij
j n
i
A a
s s
=
=

1
1
max
n
ij
i n
j
A a

s s
=
=

1
1
n
k
k
x x
=
=

1,
max
k
k n
x x

=
=
theo hng theo ct
135
V d chun vct v chun ma trn
0
3
4
x
| |
|
=
|
|

\ .
1
7
4
x
x

=

3 7 2
3 5 1
6 4 0
A

| |
|
=
|
|

\ .
( )
( )
1
max 12,16, 3 16
max 12, 9,10 12
A
A

= =

= =

136
V d chun vct v chun ma trn
(tt)
x = [1, 1, 2, 2]
T
x
1
= 6
x

= 2
A
1
= 6
A

= 7
|
|
.
|

\
|


=
4 3
2 1
A
137
Vector Norm
Given an n -dimensional vector x =[x
1
, x
2
,, x
n
]
T
a general vector norm x, is a nonnegative norm
defined such that
x > 0 when x 0 ; x = 0 iff x = 0
x= -xfor any scalar
x + y x + y
The vector norm x
p
for p = 1, 2, ... is defined as
p
n
i
p
i
p
x x
1
1
|
.
|

\
|
=

=
138
Vector Norm (cont)
p
n
i
p
i
p
x x
1
1
|
.
|

\
|
=

=
1 2
1
1
...
n
n k
k
x x x x x
=
= + + + =

( )
1 2
1,
max , ,..., max
n k
k n
x x x x x

=
= =
2 2
2
2
1
2 1
1
2
2
...
n
n
i
i
x x x x x + + + =
|
.
|

\
|
=

=
139
Matrix Norm
Given a square complex or real matrix A, a matrix
normAis a nonnegative number associated
with A having the properties
A > 0 when A 0 and A = 0 iff A = 0
k A = |k| A for any scalar k
A + B s A + B
A B s AB
140
S hi t ca dy cc vct
Dy cc vct vi x
(k)
eR
n
hi t v vct
khi k +
x
( )
0
k
x x khi k + (hi t theo chun)
( )
lim
k
k
x x

=
iu kin cn v : dy hi t v
(hi t theo ta )
, 1,
m
x m n =
( )
{ }

=0 k
k
x
( )
{ }
k
m
x
141
Tng quan phng php lp
Chng 1: Phng php lp n vi phng trnh f(x) = 0
( )
( )
1
( )
( ) 0
( ) ( ) : ' 1
n n
x g x
f x x g x
g x g y q x y g x q
+
=

= =

s s <

H Ax = b x = Tx + c = g(x), T: ma trn, c: vect.


iu kin: g(x) g(y) s qx y
Dy lp: x
(k+1)
= T x
(k)
+ c
Nu T <1 th dy lp cc vct ny hi t v
nghim ca h vi mi vect lp ban u x
(0)
142
Tng quan phng php lp (tt)
Nu T <1 th dy lp cc vct ny hi t v nghim
ca h vi mi vect lp ban u x
(0)
Cc cng thc nh gi sai s
( ) (1) (0)
1
k
k
T
x x x x
T
s

( ) ( ) ( 1)
1
k k k
T
x x x x
T

s

Tng quan phng php lp (tt)


Ma trn A l ma trn ng cho tri nghim ngt:
1,
n
ij ii
j j i
a a
= =
<

11 12 1
21 22 2
1 2
...
...
... ... ... ...
...
n
n
n n nn
a a a
a a a
A
a a a
| |
|
|
=
|
|
\ .
11
22
0 ... 0
0 ... 0
... ... ... ...
0 0 ...
nn
a
a
a
| |
|
|
=
|
|
\ .
12 1
21 2
1 2
0 0 ... 0 0 ...
0 ... 0 0 0 ...
... ... ... ... ... ... ... ...
... 0 0 0 ... 0
n
n
n n
a a
a a
a a

| | | |
| |

| |

| |
| |

\ . \ .
D L U =
Ax = b (D L U) x = b
theo hng
Phng php lp Jacobi
Ax = b (D L U) x = b
Dx = (L + U) x + b
x = D

(L + U) x + D

b
K hiu T
j
= D

(L + U) c
j
= D

b
x
(k+1)
= T
j
x
(k)
+ c
j
, k =1,2,3
1
( 1) ( ) ( )
1 1
1
i n
k k k
i ij j ij j i
j j i
ii
x a x a x b
a

+
= = +
| |
= +
|
\ .

i = 1, 2,, n
( )
1, 1
1, 1,
1,
max max 1
n
ij
n
ij j j i
j
i n i n
j j i
ii ii
a
a
T D L U
a a
= =

= =
= =
= + = = <

V d phng php lp Jacobi (tt)


1 2 3
1 2 3
1 2 3
10 7
2 10 10
4 10 11
x x x
x x x
x x x
+ + =

+ =

+ =

1 2 3
2 1 3
3 1 2
0.1 0.1 0.7
0.2 0.1 1.0
0.4 0.1 1.1
x x x
x x x
x x x
= +

= + +

= + +

1 2 3
2 1 3
1 2 3
0.1 0.1 0.7
0.2 0.1 1.0
0.4 0.1 1.1
x x x
x x x
x x x
= +

= + +

+ + =

x = T x + c
Vi vect x
(0)
= (2, 2, 2)
T
, tm nghim
xp x x
(k)
bng php lp Jacobi ca h
phng trnh sau v nh gi sai s
Nghim chnh xc x = (0.5, 1, 1)
T
|
|
|
.
|

\
|
+
|
|
|
.
|

\
|


=
1 . 1
0 . 1
7 . 0
0 1 . 0 4 . 0
1 . 0 0 2 . 0
1 . 0 1 . 0 0
x x
V d phng php lp Jacobi
0.7
1.0
1.1
c
| |
|
=
|
|
\ .
0 0.1 0.1
0.2 0 0.1
0.4 0.1 0
T

| |
|
=
|
|

\ .
x
(k+1)
= T x
(k)
+ c
{ }
max 0.2, 0.3, 0.5
0.5 1
T

=
= <
k
x
1
(k)
x
2
(k)
x
3
(k)
,,x
(k)
- x
(k-1)
,,

0 2 2 2
1 0.3 0.8 0.5 1.7
3
0.495 0.992 0.971 0.089
2
0.57 0.99 1.06 0.56
( )
|
|
|
.
|

\
|
=
2
2
2
0
x
( )
|
|
|
.
|

\
|
=
5 . 0
8 . 0
3 . 0
1
x
( )
|
|
|
.
|

\
|
=
06 . 1
99 . 0
57 . 0
2
x
( )
|
|
|
.
|

\
|
=
971 . 0
992 . 0
495 . 0
3
x
V d phng php lp Jacobi
1 2 3
1 2 3
1 2 3
10 7
2 10 10
4 10 11
x x x
x x x
x x x
+ + =

+ =

+ =

1 2 3
2 1 3
3 1 2
10 7
10 2 10
10 4 11
x x x
x x x
x x x
= +

= + +

= + +

( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
1
1 2 3
1
2 1 3
1
3 1 2
10 7
10 2 10
10 4 11
k k k
k k k
k k k
x x x
x x x
x x x
+
+
+
= +

= + +

= + +

k
x
1
(k)
x
2
(k)
x
3
(k)
,,x
(k)
- x
(k-1)
,,

0 2 2 2
1 0.3 0.8 0.5 1.7
3
0.495 0.992 0.971 0.089
2
0.57 0.99 1.06 0.56
V d phng php lp Jacobi (tt)
1 2 3
1 2 3
1 2 3
10 7
2 10 10
4 10 11
x x x
x x x
x x x
+ + =

+ =

+ =

1 2 3
2 1 3
3 1 2
0.1 0.1 0.7
0.2 0.1 1.0
0.4 0.1 1.1
x x x
x x x
x x x
= +

= + +

= + +

1 2 3
2 1 3
1 2 3
0.1 0.1 0.7
0.2 0.1 1.0
0.4 0.1 1.1
x x x
x x x
x x x
= +

= + +

+ + =

x = T x + c
Vi vect x
(0)
= (0, 0, 0)
T
, tm nghim
xp x x
(k)
bng php lp Jacobi ca h
phng trnh sau v nh gi sai s
Nghim chnh xc x = (0.5, 1, 1)
T
|
|
|
.
|

\
|
+
|
|
|
.
|

\
|


=
1 . 1
0 . 1
7 . 0
0 1 . 0 4 . 0
1 . 0 0 2 . 0
1 . 0 1 . 0 0
x x
V d phng php lp Jacobi
0.7
1.0
1.1
c
| |
|
=
|
|
\ .
0 0.1 0.1
0.2 0 0.1
0.4 0.1 0
T

| |
|
=
|
|

\ .
x
(k+1)
= T x
(k)
+ c
{ }
max 0.2, 0.3, 0.5
0.5 1
T

=
= <
(0)
0
0
0
x
| |
|
=
|
|
\ .
(1)
0.7
1.0
1.1
x
| |
|
=
|
|
\ .
(2)
0.49
0.97
0.92
x
| |
|
=
|
|
\ .
k
x
1
(k)
x
2
(k)
x
3
(k)
,,x
(k)
- x
(k-1)
,,

0 0 0 0
1 0.7 1.0 1.1 1.1
3
0.511 0.994 1.001 0.081
2
0.49 0.97 0.92 0.21
V d phng php lp Jacobi
k
x
1
(k)
x
2
(k)
x
3
(k)
,,x
(k)
- x
(k-1)
,,

0 0 0 0
1 0.7 1.0 1.1 1.1
3
0.511 0.994 1.001 0.081
2
0.49 0.97 0.92 0.21
1 2 3
1 2 3
1 2 3
10 7
2 10 10
4 10 11
x x x
x x x
x x x
+ + =

+ =

+ =

1 2 3
2 1 3
3 1 2
10 7
10 2 10
10 4 11
x x x
x x x
x x x
= +

= + +

= + +

( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
1
1 2 3
1
2 1 3
1
3 1 2
10 7
10 2 10
10 4 11
k k k
k k k
k k k
x x x
x x x
x x x
+
+
+
= +

= + +

= + +

V d phng php lp Jacobi (tt)


1 2 3 4
1 2 3
1 2 3 4
1 4
10 2 2 4
5 1
2 5 2
3 9 2
x x x x
x x x
x x x x
x x
+ + =

+ + =

+ =

Nghim ng x =(0.3333, 0.2222, 0.4444, 0.1111)


T
1 2 3 4
2 1 3
3 1 2 4
4 1
( 1) ( ) ( ) ( )
( 1) ( ) ( )
( 1) ( ) ( ) ( )
( 1) ( )
10 2 2 4
5 1
5 2 2
9 3 2
k k k k
k k k
k k k k
k k
x x x x
x x x
x x x x
x x
+
+
+
+
= + +

= +

= +

k
x
1
(k)
x
2
(k)
x
3
(k)
x
4
(k)
,,x
(k)
- x
(k-1)
,,

0 0 0 0 0
1 0.4000 0.2000 0.4000 0.2222 0.4000
2 0.3644 0.2000 0.4444 0.0889 0.1333
3 0.3333 0.2160 0.4249 0.1007 0.0311
x
(0)
= (0, 0, 0, 0)
T
V d phng php lp Jacobi (tt)
1 2 3 4
1 2 3 4
1 3 4
2 3 4
7 2 2 3
2 8 3 2
5 2 5
2 4 4
x x x x
x x x x
x x x
x x x
+ + =

+ + + =

+ + =

+ =

k
x
1
(k)
x
2
(k)
x
3
(k)
x
4
(k)
,,x
(k)
- x
(k-1)
,,

0 0

1 1 1
1 2 3 4
2 1 3 4
3 1 4
4 2 3
( 1) ( ) ( ) ( )
( 1) ( ) ( ) ( )
( 1) ( ) ( )
( 1) ( ) ( )
7 2 2 3
8 2 3 2
5 2 5
4 2 4
k k k k
k k k k
k k k
k k k
x x x x
x x x x
x x x
x x x
+
+
+
+
= +

= +

= + +

Nghim ng x =( 0.1752, -0.5338, 0.4166, 1.3710)


T
1

0.2857

0.7500 0.6000 1.7500 0.7500
4

0.1339

0.4850 0.4073 1.2983 0.0916
2

0.3714

0.6223 0.2429 1.5250 0.3571
3

0.2196

0.4388 0.3157 1.3719 0.1835
Phng php lp Gauss-Seidel
Tng t lp Jacobi nhng vi thng tin cp nht ho
1 2 3 4
1 2 3
1 2 3 4
1 4
10 2 2 4
5 1
2 5 2
3 9 2
x x x x
x x x
x x x x
x x
+ + =

+ + =

+ =

( 1) ( ) ( ) ( )
1 2 3 4
( 1) ( ) ( )
2 1 3
( 1) ( ) ( ) ( )
3 1 2 4
( 1) ( )
4 1
0.2 0.1 0.2 0.4
0.2 0.2 0.2
0.2 0.4 0.2 0.4
0.3333 0.2222
k k k k
k k k
k k k k
k k
x x x x
x x x
x x x x
x x
+
+
+
+
= + +

= +

= +

Lp
Jacobi
( 1) ( ) ( ) ( )
1 2 3 4
( 1) ( 1) ( )
2 1 3
( 1) ( 1) ( ) ( )
3 1 2 4
( 1) ( 1)
4 1
0.2 0.1 0.2 0.4
0.2 0.2 0.2
0.2 0.4 0.2 0.4
0.3333 0.2222
k k k k
k k k
k k k k
k k
x x x x
x x x
x x x x
x x
+
+ +
+ +
+ +
= + +

= +

= +

Lp
Gauss-
Seidel
154
1 2
1 2
23 2 3
2 17 4
x x
x x
+ =

+ =

( ) ( )
( ) ( )
1
1 2
1
2 1
23 3 2
17 4 2
k k
k k
x x
x x
+
+

= +

Lp
Jacobi
Vi x = (0,0); tm x
(3)
bng lp Jacobi
155
Phng php lp Gauss-Seidel
1 2
1 2
23 2 3
2 17 4
x x
x x
+ =

+ =

( ) ( )
( ) ( )
1
1 2
1
2 1
23 3 2
17 4 2
k k
k k
x x
x x
+
+

= +

( ) ( )
( ) ( )
1
1 2
1 1
2 1
23 3 2
17 4 2
k k
k k
x x
x x
+
+ +

= +

Lp
Jacobi
Lp Gauss-
Seidel
Tng t lp Jacobi nhng vi thng tin cp nht ho
156
Phng php lp Gauss-Seidel (tt)
Nghim chnh xc: {0.10886, 0.24810}
Vi x
(0)
= {0,0} gii bng cc phng php lp
Jacobi Gauss-Seidel
k x
1
(k)
x
2
(k)
x
1
(k)
x
2
(k)
0 0 0 0 0
1 0.13043 0.23529 0.13043 0.25064
2 0.10997 0.25064 0.10864 0.24808
3 0.10864 0.24823 0.10886 0.24810
Phng php lp Jacobi v Gauss-Seidel

= +
= +
= + +
11 10 4
10 10 2
7 10
3 2 1
3 2 1
3 2 1
x x x
x x x
x x x

+ + =
+ + =
+ =
1 . 1 1 . 0 4 . 0
0 . 1 1 . 0 2 . 0
7 . 0 1 . 0 1 . 0
2 1 3
3 1 2
3 2 1
x x x
x x x
x x x
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )

+ + =
+ + =
+ =
+
+
+
1 . 1 1 . 0 4 . 0
0 . 1 1 . 0 2 . 0
7 . 0 1 . 0 1 . 0
2 1
1
3
3 1
1
2
3 2
1
1
k k k
k k k
k k k
x x x
x x x
x x x
Jacobi
Gauss-
Seidel
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )

+ + =
+ + =
+ =
+ + +
+ +
+
1 . 1 1 . 0 4 . 0
0 . 1 1 . 0 2 . 0
7 . 0 1 . 0 1 . 0
1
2
1
1
1
3
3
1
1
1
2
3 2
1
1
k k k
k k k
k k k
x x x
x x x
x x x
Phng php lp Gauss-Seidel
1 2 3
1 2 3
1 2 3
10 7
2 10 10
4 10 11
x x x
x x x
x x x
+ + =

+ =

+ =

1 2 3
2 1 3
3 1 2
( 1) ( ) ( )
( 1) ( 1) ( )
( 1) ( 1) ( 1)
0.1 0.1 0.7
0.2 0.1 1.0
0.4 0.1 1.1
k k k
k k k
k k k
x x x
x x x
x x x
+
+ +
+ + +

= +

= + +

= + +

Vi vect x
(0)
= (2, 2, 2)
T
, tm nghim
xp x x
(k)
bng php lp Gauss-Seidel
ca h phng trnh v nh gi sai s
Nghim chnh xc x = (0.5, 1, 1)
T
k
x
1
(k)
x
2
(k)
x
3
(k)
,,x
(k)
- x
(k-1)
,,

0 2 2 2
1 0.3 1.14 1.094 1.7
2 0.4766 1.1014 1.0108 0.1766
3 0.4975 1.0016 1.0012 0.0210
V d phng php lp Gauss- Seidel
1 2 3
1 2 3
1 2 3
10 7
2 10 10
4 10 11
x x x
x x x
x x x
+ + =

+ =

+ =

1 2 3
2 1 3
3 1 2
10 7
10 2 10
10 4 11
x x x
x x x
x x x
= +

= + +

= + +

( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )

+ + =
+ + =
+ =
+ + +
+ +
+
11 4 10
10 2 10
7 10
1
2
1
1
1
3
3
1
1
1
2
3 2
1
1
k k k
k k k
k k k
x x x
x x x
x x x
k
x
1
(k)
x
2
(k)
x
3
(k)
,,x
(k)
- x
(k-1)
,,

0 2 2 2
1 0.3 1.14 1.094 1.7
2 0.4766 1.1014 1.0108 0.1766
3 0.4975 1.0016 1.0012 0.0210
Phng php lp Gauss-Seidel
1 2 3
1 2 3
1 2 3
10 7
2 10 10
4 10 11
x x x
x x x
x x x
+ + =

+ =

+ =

1 2 3
2 1 3
3 1 2
( 1) ( ) ( )
( 1) ( 1) ( )
( 1) ( 1) ( 1)
0.1 0.1 0.7
0.2 0.1 1.0
0.4 0.1 1.1
k k k
k k k
k k k
x x x
x x x
x x x
+
+ +
+ + +

= +

= + +

= + +

Vi vect x
(0)
= (0, 0, 0)
T
, tm nghim
xp x x
(k)
bng php lp Gauss-Seidel
ca h phng trnh v nh gi sai s
Nghim chnh xc x = (0.5, 1, 1)
T
k
x
1
(k)
x
2
(k)
x
3
(k)
,,x
(k)
- x
(k-1)
,,

0 0 0 0
1
2
0.7 0.86 0.906
0.906
0.5234 0.9859 0.9892
0.1766
V d phng php lp Gauss- Seidel
k
x
1
(k)
x
2
(k)
x
3
(k)
,,x
(k)
- x
(k-1)
,,

0 0 0 0
1 0.7
0.86 0.906
0.906
3 0.50248 0.99843
0.99885 0.021
2
0.52340 0.98592
0.98923 0.1766
1 2 3
1 2 3
1 2 3
10 7
2 10 10
4 10 11
x x x
x x x
x x x
+ + =

+ =

+ =

1 2 3
2 1 3
3 1 2
10 7
10 2 10
10 4 11
x x x
x x x
x x x
= +

= + +

= + +

( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )

+ + =
+ + =
+ =
+ + +
+ +
+
11 4 10
10 2 10
7 10
1
2
1
1
1
3
3
1
1
1
2
3 2
1
1
k k k
k k k
k k k
x x x
x x x
x x x
V d phng php lp Gauss-Seidel
1 2 3 4
1 2 3
1 2 3 4
1 4
10 2 2 4
5 1
2 5 2
3 9 2
x x x x
x x x
x x x x
x x
+ + =

+ + =

+ =

Nghim ng x =(0.3333, 0.2222, 0.4444, 0.1111)


T
k
x
1
(k)
x
2
(k)
x
3
(k)
x
4
(k)
,,x
(k)
- x
(k-1)
,,

0 0 0 0 0
1 0.4000 0.1200 0.3680 0.0889 0.4000
2 0.3570 0.2022 0.4273 0.1032 0.0822
3 0.3375 0.2180 0.4403 0.1097 0.0195
( ) ( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( )

+ =
+ + =
+ =
+ + =
+
2 3 9
2 2 5
1 5
4 2 2 10
1 4
4 2 1 3
3 1 2
4 3 2
1
1
k k
k k k k
k k k
k k k k
x x
x x x x
x x x
x x x x
V d phng php lp Gauss-Seidel (tt)
1 2 3 4
1 2 3 4
1 3 4
2 3 4
7 2 2 3
2 8 3 2
5 2 5
2 4 4
x x x x
x x x x
x x x
x x x
+ + =

+ + + =

+ + =

+ =

Dng phng php lp Gauss-Seidel tm


x
(2)
lm trn n 4 ch s
x
(0)
= (0, 1, 1, 1)
T
V d phng php lp Gauss-Seidel (tt)
1 2 3 4
1 2 3 4
1 3 4
2 3 4
7 2 2 3
2 8 3 2
5 2 5
2 4 4
x x x x
x x x x
x x x
x x x
+ + =

+ + + =

+ + =

+ =

1 2 3 4
2 1 3 4
3 1 4
4 2 3
( 1) ( ) ( ) ( )
( 1) ( 1) ( ) ( )
( 1) ( 1) ( )
( 1) ( 1) ( 1)
7 2 2 3
8 2 3 2
5 2 5
4 2 4
k k k k
k k k k
k k k
k k k
x x x x
x x x x
x x x
x x x
+
+ +
+ +
+ + +
= +

= +

= + +

k
x
1
(k)
x
2
(k)
x
3
(k)
x
4
(k)
,,x
(k)
- x
(k-1)
,,

0 0 -1 1 1
Nghim ng x =(-0.1752, -0.5338, 0.4166, 1.3710)
T
1 -0.2857 -0.6786 0.5429 1.4750 0.4750
2 -0.2643 -0.5719 0.3571 1.3752 0.1857
3 -0.1788 -0.5111 0.4142 1.3591 0.0855
4 -0.1650 -0.5340 0.4234 1.3728 0.0228
165
H phng trnh b nhiu
V d: Gii cc h phng trnh
2 5
2.01 5.02
x y
x y
+ =

+ =

2 5
2.01 5.1
x y
x y
+ =

+ =

1
2
x
y
| | | |
=
| |
\ . \ .
15
10
x
y

| | | |
=
| |
\ . \ .
Nhiu v phi
H gn nhau, nghim xa nhau!
2 5
1.99 5.02
x y
x y
+ =

+ =

9
2
x
y
| | | |
=
| |

\ . \ .
Nhiu v tri
166
S iu kin ca ma trn
Xt h phng trnh Ax = b c nghim x = A

1
b
Nu b c s gia b th x c s gia tng ng x
Ax = b x = A
1
b
1 1
x A b A b

A = A s A
b Ax A x = s
1
x b
A A
x b

A A
s
( )
1
Cond( ) k A A A A

= = S iu kin ca ma trn A
k(A) cng gn 1 h cng n nh
k(A) cng ln h cng mt n nh h iu kin xu
167
S iu kin ca ma trn (tt)
Xt h phng trnh
2 5
2.01 5.02
x y
x y
+ =

+ =

( )
1
3.01 401 1207.01 1 k A A A

= = =
1 2
1 2.01
A
| |
=
|
\ .
1
201 200
100 100
A


| |
=
|

\ .
168
1
25 41 10 6
41 68 17 10
10 17 5 3
6 10 3 2
A


| |
|

|
=
|

|

\ .
( )
1
33, 136, cond 4488 A A A


= = =
10 7 8 7
7 5 6 5
8 6 10 9
7 5 9 10
A
| |
|
|
=
|
|
\ .
1.003 58.09
5.550 321.8
A
| |
=
|
\ .
35 . 327 =

A
V d
1
879.5 158.8
15.17 2.741
A


| |
=
|

\ .
169
n chng 2
A. Cc phng php gii ng
1/ Phng php kh Gauss (phn t tr).
2/ Phn tch nhn t LU
3/ Phn tch Cholesky
B. Cc phng php lp
1/ Lp Jacobi
2/ Lp Gauss Seidel
C. S iu kin v h iu kin xu
170
Bi tp n chng 2
Tm cc gi tr ca ma trn l xc nh dng
1 1
1 2 1
1 1 4
o
| |
|
|
|

\ .
1 2
4 1
2 1 8
o
| |
|
o
|
|

\ .
1 1
1 3 1
1 5
o
| |
|

|
|
o
\ .
o > 8/7
1 31 1 31
4 4
+
< o <
1 7 1 7
3 3
+
< o <
171
Bi tp n chng 2 (tt)
S dng phng php Cholesky gii h
1 2
1 2 3
2 3
2 2
2 1
2 2
x x
x x x
x x
=

+ =

+ =

1 2 3
1 2 3
1 2 3
3 2 1
3 4 2 4
2 2 3
x x x
x x x
x x x
+ =

+ =

+ =

1 2 3 4
1 2 3 4
1 2 3
1 2 4
4 1
3 0
2 1
2 2
x x x x
x x x x
x x x
x x x
+ + + =

+ + =

+ =

+ + =

172
|
|
|
.
|

\
|



=
14 7 4
7 10 2
4 2 4
A
|
|
|
.
|

\
|

=
1 3 2
0 3 1
0 0 2
B
173
Bi tp n chng 2 (tt)
1.4142 0 0
0.7071 1.2247 0
0 0.8165 1.1547
B
| |
|
=
|
|
\ .
1 0 0
3 5 0
4 1
2
5 5
B i
i
| |
|
|
=
|
|
|

|
\ .
2 0 0 0
0.5 1.6583 0 0
0.5 0.7538 1.0871 0
0.5 0.4523 0.0836 1.2403
B
| |
|
|
=
|

|
\ .
174
Bi tp n chng 2 (tt)
Tm cc gi tr ca > 0 v > 0 ma trn l
ng cho tri nghim ngt
4 1
2 5 4
2
o
| |
|
|
|
|
| o
\ .
3 2
5
2 1
|
| |
|
o |
|
|
o
\ .
2 4
2
4 1
|
| |
|
o |
|
|
o
\ .
3
0.5
2
o <

| <

o > |+

1
5
3
| <

o+| <

o >

6
2
5
| >

o| >

o >

175
Bi tp n chng 2 (tt)
S dng phng php Jacobi tm nghim gn ng
vi sai s 10
-
. Chn chun v cng
1 2 3
1 2 3
1 2 3
4 1
3 8 2 0
3 3 10 4
x x x
x x x
x x x
+ =

+ + =

+ + =

1 2
1 2 3
2 3
10 9
10 2 7
2 10 6
x x
x x x
x x
=

+ =

+ =

1 2
1 2 3
2 3 4
3 4
10 5 6
5 10 4 25
4 8 11
5 11
x x
x x x
x x x
x x
+ =

+ =

+ =

+ =

1 2 3
1 2 4
1 3 4
2 3 4
4 2
4 1
4 0
4 1
x x x
x x x
x x x
x x x
+ + =

+ =

+ =

176
Cho h phng trnh
Vi x
(0)
= [1, 2, 3]
T
tnh vect x
(1)
theo
phng php Jacobi
1 2 3
1 2 3
1 2 3
25 2 16
2 18 35
2 2 20 58
x x x
x x x
x x x
=

+ =

+ + =

177
V d phng php lp Jacobi (tt)
1 2 3 4
1 2 3 4
1 3 4
2 3 4
7 2 2 3
2 8 3 2
5 2 5
2 4 4
x x x x
x x x x
x x x
x x x
+ + =

+ + + =

+ + =

+ =

Dng phng php lp Jacobi tm x


(1)
lm
trn n 4 ch s
x
(0)
= (0, 1, 1, 1)
T
Ma trn lp trong cc phng php
Ma trn A l ma trn ng cho tri nghim ngt:
1,
n
ij ii
j j i
a a
= =
<

11 12 1
21 22 2
1 2
...
...
... ... ... ...
...
n
n
n n nn
a a a
a a a
A
a a a
| |
|
|
=
|
|
\ .
11
22
0 ... 0
0 ... 0
... ... ... ...
0 0 ...
nn
a
a
a
| |
|
|
=
|
|
\ .
12 1
21 2
1 2
0 0 ... 0 0 ...
0 ... 0 0 0 ...
... ... ... ... ... ... ... ...
... 0 0 0 ... 0
n
n
n n
a a
a a
a a

| | | |
| |

| |

| |
| |

\ . \ .
D L U =
Ax = b (D L U) x = b
theo hng
179
Tm ma trn lp trong phng php
Jacobi
Ax = b (D L U) x = b
Dx = (L + U) x + b
x = D

(L + U) x + D

b
=> T
j
= D

(L + U)
|
|
|
|
|
.
|

\
|
=
nn
a
a
a
D
... 0 0
... ... ... ...
0 ... 0
0 ... 0
22
11
|
|
|
|
|
.
|

\
|



= +
0 ...
... ... ... ...
... 0
... 0
2 1
2 21
1 12
n n
n
n
a a
a a
a a
U L
Ma trn lp trong phng php Jacobi (tt)
T
j
= D

(L + U)
|
|
|
|
|
.
|

\
|
=

nn
a
a
a
D
1 ... 0 0
... ... ... ...
0 ... 1 0
0 ... 0 1
22
11
1
( )
|
|
|
|
|
.
|

\
|



= + =

0 ...
... ... ... ...
... 0
... 0
2 1
22 2 22 21
11 1 11 12
1
nn n nn n
n
n
j
a a a a
a a a a
a a a a
U L D T
Ma trn T
j
c ng cho chnh bng 0
181
Tm ma trn lp trong phng php
Gauss-Seidel
Ax = b (D L U) x = b
(D L) x = U x + b
x = (D L)

U x + (D L)

b
=> T
g
= (D L)

U
Tm ma trn lp trong phng php
Gauss-Seidel (tt)
T
g
= T
g
= (D L)

U
|
|
|
|
|
.
|

\
|
=
nn
a
a
a
D
... 0 0
... ... ... ...
0 ... 0
0 ... 0
22
11
|
|
|
|
|
.
|

\
|
=
nn n n
a a a
a a
a
L D
...
... ... ... ...
0 ...
0 ... 0
2 1
22 21
11
|
|
|
|
|
.
|

\
|


=
0 ... 0 0
... ... ... ...
... 0 0
... 0
2
1 12
n
n
a
a a
U
Ma trn T
g
c ct th nht bng 0
183
Ma trn lp phng php Gauss-
Seidel cho h hai phng trnh hai n
T
g
= T
g
= (D L)

U
|
|
.
|

\
|
=
22 21
11
0
a a
a
L D
|
|
.
|

\
|

=
0 0
0
12
a
U
( )
|
|
|
|
.
|

\
|

=

22
22 11
21
11
1
1
0 1
a
a a
a
a
L D
( )
|
|
|
|
.
|

\
|

= =

22 11
21 12
11 12
1
0
0
a a
a a
a a
U L D T
g
Chng 3. Ni suy v phng php
bnh phng cc tiu
Mn hc:
Phng php tnh
18
5
Ni dung
1. Ni suy a thc Lagrange
2. Sai s ni suy Lagrange
3. Ni suy Newton, mc ni suy cch u
4. Ni suy spline bc ba
5. Phng php bnh phng cc tiu
18
6
Tng quan v ni suy
Bi ton dn n ni suy
Ni suy: Bng cha (n+1) cp d liu
{ (x
k
, y
k
) }, k = 0 n
Mc ni suy x
0
x
1
x = o e{ x
k
} x
n-1
x
n
Gi tr ni suy y
0
y
1
y = ? y
n-1
y
n
x
k
: mc ni suy, y
k
: gi tr (hm) ni suy
T bng ny, ni suy gi tr y ti im x = o?
18
7
iu kin ni suy
Hm f(x) lin tc trn on [x
0
, x
n
]
f(x
k
) = y
k
C v s hm tha iu kin trn!
Minh ha hnh hc
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
-1 -0.5 0 0.5 1
18
9
Ni suy a thc
Ni suy a thc: Xc nh a thc y = P(x) tho
iu kin ni suy
P(x
k
) = y
k
, k = 0 n y (o) ~ P(o)
a thc
L do chn a thc
C th xp x hm lin tc vi sai s ty
C th ly o hm v tch phn bao nhiu ln ty
Tnh gi tr a thc v o hm d dng
( )
1
1 1 0
n n
n n n
P x a x a x a x a

= + + + +
19
0
Minh ha ni suy a thc
Mc ni suy
1
0 1
Gi tr ni suy 0.5 1 2
3 mc n = 2 P(x) = ax + bx + c (3 h s cn tm)
P(1) = 0.5 a b + c = 0.5
P(0) = 1 c = 1
P(1) = 2 a + b + c = 2
a = 0.25, b = 0.75, c = 1
P(x) = 0.25 x + 0.75 x + 1
x = 0.8 P(x) = 0.25 (0.8) + 0.75 0.8 + 1 = 1.76
So snh vi gi tr chnh xc: f(x) = 2
x
; f(0.8) ~ 1.7411
x = 0.8, y ~?
Khi n tng th s iu kin ca ma trn h s cng tng ln!
Cond(A)
1.0E+00
1.0E+02
1.0E+04
1.0E+06
1.0E+08
1.0E+10
1 2 3 4 5 6 7 8 9 10
a thc ni suy Lagrange
Xy dng cc a thc
ph c bc n v tha
( )
( )
1 khi
0 khi
k
n j
j k
p x
j k
=

=

=

Do cc a thc ph c bc n v c n nghim
x
0
, x
1
, x
k-1
, x
k+1
, x
n
, nn
( )
( )
1
k
n k
p x =
( )
( ) ( )( ) ( )( ) ( ) 1
1 1 1 0
= =
+ n k k k k k k k k
k
n
x x x x x x x x x x C x p
( )( ) ( )( ) ( )
n k k k k k k k
x x x x x x x x x x
C

=
+

1 1 1 0
1
( )
( )
( )( ) ( )( ) ( )
( )( ) ( )( ) ( )
n k k k k k k k
n k k
k
n
x x x x x x x x x x
x x x x x x x x x x
x p


=
+
+


1 1 1 0
1 1 1 0
( )
( ) ( )( ) ( )( ) ( )
n k k
k
n
x x x x x x x x x x C x p =
+

1 1 1 0
19
3
a thc ni suy Lagrange (tt)
a thc ni suy Lagrange c dng
( )
( )
0
( )
n
k
n k
k
L x p x y
=
=

x
1
0 1
y 0.5 1 2
( )
( )
(0)
2
1
2
x x
p x

=
( ) ( ) ( )
(1)
2
1 1 p x x x = +
( )
( )
(2)
2
1
2
x x
p x
+
=
(0) (1) (2)
2 2 2
( ) 0.5 1 2 L x p p p = + +
2
2
1 3
( ) 1
4 4
0.25 0.75 1
L x x x
x x
= + +
= + +
L(0.8) = 1.76
19
4
a thc ni suy Lagrange (tt)
( ) ( ) ( ) ( )
0 1 n
w x x x x x x x =
( )
( )
( ) ( )
( ) k
n
k k
w x
p x
w x x x
=
'

( )
( )
( )( )
0
n
k
k
k k
w x
L x y
w x x x
=
=
'

19
5
a thc ni suy Lagrange (tt)
x x
0
x
1
x
n
x
0
x x
0
x
0
x
1
x
0
x
n
D
0
x
1
x
1
x
0
x x
1
x
1
x
n
D
1

x
n
x
n
x
0
x
n
x
1
x x
n
D
n
w(x)
( ) ( )

=
=
n
k
k
k
n
D
y
x w x L
0
( )
( )
( ) ( )
0
n
k
k
k k
w x
L x y
w x x x
=
=
'

19
6
a thc ni suy Lagrange (tt)
Trng hp cc mc cch u x
k+1
x
k
= h = const
x
k
= x
0
+ kh. t q = (x x
0
)/h
( )
k
x x q k h =
( )
i j
x x i j h =
( )
( ) ( ) ( )
( ) ( )
0
1 1
! !
n k
n
k
k
q q q n
L x y
k n k q k

=

=


( )
( )( ) ( ) ( )( )
( )( ) ( ) ( )( )
0 1 1 1 ( )
0 1 1 1
k k n k
n
k k k k k k k n
x x x x x x x x x x
p x
x x x x x x x x x x
+
+

=

( )
( ) ( ) ( )( ) ( )
( )
( )
1 1 1 1
! !
n k
k
n
q q q k q k q n
p x
k n k

+
=


19
7
Sai s ni suy Lagrange
( ) ( ) ( )
f x L x Kw x = +
Gi s f(x) c o hm n cp n+1 lin tc trn [a, b]
Chn K sao cho (x
*
) = 0 (x
*
x
i
)
Xt hm ph ( ) ( ) ( ) ( )
x f x L x Kw x =
Tn ti e [a, b] sao cho
(n+1)
() = 0
( ) ( ) ( )
( 1) ( 1)
1 ! 0
n n
f K n
+ +
= + =
( )
( )
( 1)
1 !
n
f
K
n
+

=
+
( ) ( )
( )
( )
( 1)
*
1 !
n
M
f x L x w x
n
+
s
+
19
8
a thc ni suy Lagrange: v d
x
1
0 1
y 0.5 1 2
x = 0.8, y ~?
( ) ( )
3
(3)
ln 2 2
x
f x =
f(x) = 2
x
, n = 2
| |
( ) ( )
3 3
(3)
1,1
max ln 2 2 2 ln 2
x
x
M
e
= =
( ) ( )
( )
( ) ( ) ( )
3
2 ln 2
0.8 1 0.8 0.8 1 0.032
3!
f x L x s + ~
( ) ( )
0.8
2 1.76 0.0189 f x L x = =
19
9
a thc ni suy Lagrange: bi tp
x 0 0.25 0.75 1
y 1.3 1.5 1.6 1.8
Xy dng a thc ni suy Lagrange v s dng xp x gi tr
ca hm ti x*
x* = 0.5
20
0
a thc ni suy Lagrange: bi tp
x 0 0.25 0.75 1
y 1.3 1.5 1.6 1.8
x* = 0.5
( )
( )
0
( )
n
k
n k
k
L x p x y
=
=

( )
( )( ) ( )
(0)
3
0.25 0.75 1
0.25 0.75 1
x x x
p x

=

( )
( )( ) ( )
(1)
3
0 0.75 1
0.25 0.5 0.75
x x x
p x

=

( )
( )( )( )
(2)
3
0 0.25 1
0.75 0.5 0.25
x x x
p x

=

( )
( )( )( )
(3)
3
0 0.25 0.75
1 0.75 0.25
x x x
p x

=

( )
(0)
0.5 0.1667 p =
( )
(1)
0.5 0.6667 p =
( )
(3)
0.5 0.1667 p =
( )
(3)
0.5 0.6667 p =
(0.5) 1.5500 L =
20
1
a thc ni suy Lagrange: bi tp
Xy dng a thc ni suy Lagrange v s dng xp
x gi tr ca hm ti x*
x 1 0 1 2
y 4 2 0 1
x* = 1.25
20
2
Bi tp
Xy dng a thc ni suy Lagrange v s dng xp
x gi tr ca hm ti x*
x 0 0.5 1 1.5
y 2 0 8 1
x* = 0.75
x 0 0.5 1 1.5
y 0.5 1 1 4
x* = 0.75
20
3
Bi tp
Xy dng a thc ni suy Lagrange v s dng xp
x gi tr ca hm ti x* = 345; 355; 365. nh gi sai
s xp x vi y = f(x) = Lg(x)
x 340 350 360 370
y 2,531 2,544 2,556 2,568
20
4
Khi nim t sai phn
T sai phn cp mt
| |
k k
k k
k k
x x
y y
x x f

=
+
+
+
1
1
1
,
T sai phn cp p
| |
| | | |
k p k
p k k k p k k k
p k k k
x x
x x x f x x x f
x x x f

=
+
+ + + + +
+ +
1 1 2 1
1
,..., , ,..., ,
,..., ,
| | | |
k k k k
x x f x x f , ,
1 1 + +
=
T sai phn cp n ca a thc bc n l hng s
T sai phn cp ln hn n ca a thc bc n bng 0
20
5
V d t sai phn
x
1
0 1
y 0.5 1 2
x
k
f(x
k
) f [x
k
, x
k+1
] f [x
k
, x
k+1
, x
k+2
]
-1 0.5
0 1
1 2
0.5
1
0.25
20
6
Xy dng a thc ni suy Newton
nh ngha t sai phn cp
mt ca hm f (x)
| |
( )
0
0
0
,
x x
y x f
x x f

=
( ) | |( )
0 0 0
, x x x x f y x f + =
nh ngha t sai phn cp hai ca hm f (x)
| |
| | | |
1
1 0 0
1 0
, ,
, ,
x x
x x f x x f
x x x f

=
( ) | |( ) | |( )( )
1 0 1 0 0 1 0 0
, , , x x x x x x x f x x x x f y x f + + =
| | | | | |( )
1 1 0 1 0 0
, , , , x x x x x f x x f x x f + =
20
7
Cng thc Newton tin
Lp li n bc th n
( ) | |( ) | |( )( )
| |( )( ) ( )
| |( )( ) ( )
n n
n n
x x x x x x x x x x f
x x x x x x x x x f
x x x x x x x f x x x x f y x f
+
+ +
+ + + =

... ,..., , ,
... ,..., ,
... , , ,
1 0 1 0
1 1 0 1 0
1 0 2 1 0 0 1 0 0
( ) | |( ) | |( )( )
| |( )( ) ( )
1 1 0 1 0
1 0 2 1 0 0 1 0 0
) 1 (
... ,..., ,
... , , ,

+
+ + + =
n n
x x x x x x x x x f
x x x x x x x f x x x x f y x N
( ) | |( )( ) ( )
n n n
x x x x x x x x x x f x R = ... ,..., , ,
1 0 1 0
( ) ( ) ( ) x R x N x f
n
+ =
) 1 (
Cng thc Newton tin xut pht t
nt x
0
20
8
Cng thc Newton li
( ) | |( ) | |( )( )
| |( )( ) ( )
n n
n n n n n n n n n
x x x x x x x x x f
x x x x x x x f x x x x f y x N
+
+ + + =

... ,..., ,
... , , ,
2 1 1 0
1 1 2 1
) 2 (
( ) ( ) ( ) x R x N x f
n
+ =
) 2 (
Cng thc Newton li xut pht t
nt x
n
( ) ( )
( )
( )
( 1)
*
1 !
n
M
f x L x w x
n
+
s
+
Sai s ca cng thc ni suy Newton: tng t Lagrange
20
9
V d cng thc ni suy Newton tin
x
1
0 1
y 0.5 1 2
x
k
f(x
k
) f [x
k
, x
k+1
] f [x
k
, x
k+1
, x
k+2
]
-1 0.5
0.5
0 1 0.25
1
1 2
x = 0.8, y ~?
N(x) = 0.5 + 0.5 (0.8 + 1) + 0.25 (0.8 + 1) (0.8 0) = 1.76
21
0
Cng thc ni suy Newton trng hp
mc cch u
Sai phn hu hn cp 1 ca hm ti im x
k
Ay
k
= y
k+1
y
k
Sai phn hu hn cp p ca hm ti im x
k
A
p
y
k
= A (A
p1
y
k
)
Quan h gia t sai phn v sai phn hu hn
1
, ,...,
!
p
k
k k k p
p
y
f x x x
p h
+ +
A
( =

q = (x x
0
)/h p = (x x
n
)/h
Cng thc ni suy Newton trng hp
mc cch u (tt)
( ) | |( ) | |( )( )
| |( )( ) ( )
1 1 0 1 0
1 0 2 1 0 0 1 0 0
) 1 (
... ,..., ,
... , , ,

+
+ + + =
n n
x x x x x x x x x f
x x x x x x x f x x x x f y x N
( ) ( )
( ) ( )
2
(1)
0 0
0
0
1 ...
1! 2!
1 ... 1
!
n
y y
N x y q q q
y
q q q n
n
A A
= + + +
A
+ +
( ) | |( ) | |( )( )
| |( )( ) ( )
n n
n n n n n n n n n
x x x x x x x x x f
x x x x x x x f x x x x f y x N
+
+ + + =

... ,..., ,
... , , ,
2 1 1 0
1 1 2 1
) 2 (
( ) ( )
( ) ( )
2
(2)
1 2
0
1 ...
1! 2!
1 ... 1
!
n n
n
n
y y
N x y p p p
y
p p p n
n

A A
= + + + +
A
+ + +
a thc ni suy Lagrange: bi tp
Xy dng a thc ni suy Lagrange v s dng xp x gi tr
ca hm ti x*
x 1 0 1 2
y 4 2 0 1
x* = 1.75
( )( )
( ) ( )( )
(0)
1 2
1 2 3
x x x
p

=

( )( )( )
( )( )
(1)
1 1 2
1 1 2
x x x
p
+
=

( ) ( )
(3)
1 1
3 2 1
x x x
p
+
=

( )
( ) ( )
( )( )( )
( )( )( )
( )( )
( ) ( )
3
1 2 1 1 2 1 1
4 2
1 2 3 1 1 2 3 2 1
1 5
2
2 2
x x x x x x x x x
L x
x x
+ +
= + +

= +
( ) ( ) 3047 . 0 2 75 . 1
2
5
75 . 1
2
1
75 . 1
3
~ + = L
Cng thc ni suy Newton
Xy dng a thc ni suy Newton v xp x gi tr ti x*
x 1 0 1 2
y 4 2 0 1
x* = 1.75
( ) ( ) ( ) ( )
(1) 3
1 1 5
4 2 1 1 1 2
2 2 2
N x x x x x x x = + + + = +
x
k
f(x
k
) f [x
k
, x
k+1
] f [x
k
, x
k+1
, x
k+2
] f [x
k
,x
k+1
,x
k+2,
x
k+3
]
1 4
0 2
1 0
2 1
2
2
1
0
1.5
0.5
( ) ( ) 3047 . 0 2 75 . 1
2
5
75 . 1
2
1
75 . 1
3
~ + = L
Cng thc ni suy Newton mc cch u
Xy dng a thc ni suy Newton v xp x gi tr ti x*
x 1 0 1 2
y 4 2 0 1
x* = 1.75
x
k
f(x
k
) Ay
k
Ay
k
Ay
k
1 4
0 2
1 0
2 1
2
2
1
0
3
3
( ) ( ) ( )( ) 2 1
! 3
1
! 2
75 . 1
0
3
0
2
0 0 1

A
+
A
+ A + = q q q
y
q q
y
q y y N
75 . 2
0
*
=

=
h
x x
q
25 . 0
*
=

=
h
x x
p
n
( ) ( ) ( )( ) 2 1
! 3
1
! 2
75 . 1
0
3
1
2
2 3 2
+ +
A
+ +
A
+ A + = p p p
y
p p
y
p y y N
a thc ni suy Lagrange: bi tp
Xy dng a thc ni suy Lagrange v s dng xp x gi tr
ca hm ti x*
x 1 0 1 2
y 4 2 0 1
x* = 1.25
( )( )
( ) ( )( )
(0)
1 2
1 2 3
x x x
p

=

( )( )( )
( )( )
(1)
1 1 2
1 1 2
x x x
p
+
=

( ) ( )
(3)
1 1
3 2 1
x x x
p
+
=

( )
( ) ( )
( )( )( )
( )( )( )
( )( )
( ) ( )
3
1 2 1 1 2 1 1
4 2
1 2 3 1 1 2 3 2 1
1 5
2
2 2
x x x x x x x x x
L x
x x
+ +
= + +

= +
( ) ( )
3 1 5
1.25 1.25 1.25 2 0.1484
2 2
L = + ~
Cng thc ni suy Newton
Xy dng a thc ni suy Newton v xp x gi tr ti x*
x 1 0 1 2
y 4 2 0 1
x* = 1.25
( ) ( ) ( ) ( )
(1) 3
1 1 5
4 2 1 1 1 2
2 2 2
N x x x x x x x = + + + = +
( ) ( )
3 1 5
1.25 1.25 1.25 2 0.1484
2 2
L = + ~
x
k
f(x
k
) f [x
k
, x
k+1
] f [x
k
, x
k+1
, x
k+2
] f [x
k
,x
k+1
,x
k+2,
x
k+3
]
1 4
0 2
1 0
2 1
2
2
1
0
1.5
0.5
Trng hp mc cch u v d
Cho bng gi tr sin x t 15 55. Xy dng a
thc ni suy tin (li) cp 3 & tnh sin16 (sin54)
x y Ay A
2
y A
3
y
15 0.2588
20 0.3420
25 0.4226
30 0.5
35 0.5736
40 0.6428
45 0.7071
50 0.7660
55 0.8192
0.0832
0.0806
0.0774
0.0736
0.0692
0.0643
0.0589
0.0532
0.0026
0.0032
0.0038
0.0044
0.0049
0.0054
0.0057
0.0006
0.0006
0.0006
0.0005
0.0005
0.0003
21
8
Trng hp mc cch u v d (tt)
a thc ni suy tin: x ~ 15
15
5
x
q

=
( )
( ) ( )( )
(1)
1 1 2
0.2588 0.0832 0.0026 0.0006
2! 3!
q q q q q
N x q

= +
x = 16 q = 0.2 N
(1)
(0.2) = 0.2756
a thc ni suy li: x ~ 55
55
5
x
p

=
( )
( ) ( )( )
(2)
1 1 2
0.8192 0.0532 0.0057 0.0003
2! 3!
p p p p p
N x p
+ + +
= +
x = 54 p = 0.2 N
(2)
( 0.2) = 0.8090
sin 16 = 0.2756
sin 54 = 0.8090
21
9
Bi tp a thc ni suy Newton
x 0 1 2 3
y 1 5 12 25
x* = 0.5
x 0 0.1 0.2 0.3
y 1.12 1.52 2.12 2.25
x* = 0.02
x 10 11 12 13
y 8.15 8.34 8.12 8.25
x* = 10.25
22
0
Hin tng Runge
Ni suy hm f(x) = 1/(1+ 25x), x e [1, 1] bng
a thc ni suy, 5 mc cch u. Tnh L(0.95), so
snh gi tr tnh c vi gi tr chnh xc f(0.95)
x
k
1 0.5 0 0.5 1
y
k
0.038 0.138 1 0.138 0.038
L(0.95) = 0. 1599 Gi tr chnh xc f (0.95) = 0.04
( ) ( ) ( ) ( )
0 1
0.0604
n
w x x x x x x x = =
( ) ( )( ) ( )( )
0
0 0 1 0 2 0 3 0 4
0.0207
w
p
x x x x x x x x x x
= =

( ) ( )( )( )( )
1
1 0 1 1 2 1 3 1 4
0.1112
w
p
x x x x x x x x x x
= =

( )( ) ( ) ( )( )
2
2 0 2 1 2 2 3 2 4
0.2545
w
p
x x x x x x x x x x
= =

( )( ) ( )( ) ( )
3
3 0 3 1 3 2 3 3 4
0.3581
w
p
x x x x x x x x x x
= =

( )( ) ( ) ( ) ( )
4
4 0 4 1 4 2 4 3 4
0.8058
w
p
x x x x x x x x x x
= =

( ) ( )
4 2
0
3.3153 4.2768 1
n
k k
k
L x p x y x x
=
= = +

( )
0.95 0.1595 L ~
22
2
x 1 0.5 0 0.5 1
1 1.95 0.5 1 1.5 2 2.925
0.5 0.5 1.45 0.5 1 1.5 0.54375
0 1 0.5 0.95 0.5 1 0.2375
0.5 1.5 1 0.5 0.45 0.5 0.16875
1 2 1.5 1 0.5 0.05 0.075
0.0604
( ) ( )

=
=
n
k
k
k
n
D
y
x w x L
0
( )
( )
( ) ( )
0
n
k
k
k k
w x
L x y
w x x x
=
=
'

x
k
y
k
Ay A
2
y A
3
y A
4
y
1 0.038
0.5 0.138
0 1
0.5 0.138
1 0.038
0.1
0.862
0.862
0.1
0.762
1.724
0.762
2.486
2.486
4.972
h= 0.5, p= (x x
n
)/h = (0.95 1)/0.5 = 0.1
N
(2)
(x) = 0.1599
N
(1)
(x) = 0.1599
( )
( )
( ) ( )( )
( )( )( )
! 4
3 2 1
972 . 4
! 3
2 1
486 . 2
! 2
1
762 . 0 1 . 0 038 . 0
2
+ + +
+
+
+ +
+
+
+ =
p p p p
p p p p p
p x N
( )
( )
( ) ( )( )
( )( )( )
! 4
3 2 1
972 . 4
! 3
2 1
486 . 2
! 2
1
762 . 0 1 . 0 038 . 0
1

+
+

+ + =
q q q q
q q q q q
q x N
th hm ban u v a thc ni suy
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Runge's phenomenon


4th-order
5th-order
6th-order
Runge function
22
5
o hm ca hm Runge
( )
2
25 1
1
x
x f
+
=
( )
( )
2
2
25 1
50
x
x
x f
+

= '
( )
( ) ( )
2
2
3
2
2
25 1
50
25 1
5000
x x
x
x f
+

+
=
' '
( )
( )
( ) ( )
3
2
4
2
3
3
25 1
15000
25 1
750000
x
x
x
x
x f
+
+
+

=
( )
( )
( ) ( ) ( )
3
2
4
2
2
5
2
4
3
25 1
15000
25 1
4500000
25 1
150000000
x x
x
x
x
x f
+
+
+

+
=
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-4
-3
-2
-1
0
1
2
3
4
First derivative of Runge function f'(x)
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-50
-40
-30
-20
-10
0
10
20
Second derivative of Runge function f"(x)
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-600
-400
-200
0
200
400
600
Third derivative of Runge function f"'(x)
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-1
-0.5
0
0.5
1
1.5
x 10
4
Fourth derivative of Runge function f
(4)
(x)
o hm ca hm Runge th
22
7
Ni suy spline bc ba
Ni suy Lagrange:
Bc qu ln
th phc tp
Thay a thc ni suy
bc n bng a thc
ni suy bc thp
(bc 1, 2, 3 ) trn
tng on [x
k
, x
k+1
],
k = 0 n 1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
Runge's phenomenon


4th-order
5th-order
tng ni suy ghp trn bc ba
( ) ( )
( ) ( )
( ) ( )

' '
=
' '
'
=
'
=
1 1 1 0
1 1 1 0
1 1 1 0
x S x S
x S x S
x S x S
( ) 0
0 0
=
' '
x S
( ) 0
2 0
=
' '
x S
22
9
Ni suy spline (ghp trn) bc ba nh
ngha
Hm f (x) xc nh trn on [a, b] v
a = x
0
< x
1
< x
2
< < x
n
= b ; y
k
= f (x
k
), k = 0,1,,n
Mt spline bc ba ni suy hm f (x) trn [a, b] l
hm S(x) tha cc iu kin sau:
S(x) c o hm n cp hai lin tc trn [a, b]
Trn mi on [x
k
, x
k+1
], k = 0,1,,n1, S(x) S
k
(x)
l mt a thc bc ba
S(x
k
) = f (x
k
)= y
k
, k = 0,1,, n
Ni suy spline bc ba (tt)
1/ Hm dng bc 3 trn tng on [x
k
, x
k+1
], k = 0 n 1
( ) ( ) ( ) | |
( ) ( ) ( ) | |
( ) ( ) | |

e + + + =
e + + + =
e + + + =
=
n n n n n n n n
x x x x x c x x b a S
x x x x x d x x c x x b a S
x x x x x d x x c x x b a S
S
, ,
, ,
, ,
1
2
1 1 1 1 1 1
2 1
3
1 1
2
1 1 1 1 1 1
1 0
3
0 0
2
0 0 0 0 0 0


2/ iu kin ni suy: S(x
k
) = y
k
, k = 0, 1,, n
3/ iu kin ghp trn:
( ) ( )
( ) ( )
( ) ( )
1 1 1
1 1 1
1 1 1
0,1,..., 2
k k k k
k k k k
k k k k
S x S x
S x S x k n
S x S x
+ + +
+ + +
+ + +
=

' '
= =

'' ''
=

23
1
Xc nh spline bc ba
Trn on [x
k
, x
k+1
], k = 0,1,,n1, t h
k
= x
k+1
x
k
( ) ( ) ( ) ( )
2 3
k k k k k k k k
S x a b x x c x x d x x = + + +
iu kin ni suy: S(x
k
) = y
k
, k = 0, 1,,n
a
k
= S(x
k
) = S
k
(x
k
) = y
k
( ) ( )
2 3
1 1 1 k k k k k k k k k k k
a b h c h d h S x S x y
+ + +
+ + + = = =
2
1
, 0,1,..., 1
k k
k k k k k
k
y y
b c h d h k n
h
+

= =
iu kin lin tc S
k
(x
k+1
) = S
k+1
(x
k+1
) k = 0, 1,,n 2
23
2
Xc nh spline bc ba (tt)
iu kin lin tc ca o hm bc nht v hai
( ) ( )
( ) ( )
1 1 1
1 1 1
0,1,..., 2
k k k k
k k k k
S x S x
k n
S x S x
+ + +
+ + +
' '
=

'' ''
=

( ) ( ) ( ) ( )
2 3
k k k k k k k k
S x a b x x c x x d x x = + + +
( ) ( ) ( )
2
2 3
k k k k k k
S x b c x x d x x
'
= + +
( ) ( )
2 6
k k k k
S x c d x x
''
= +
( ) ( )
1 1 1 k k k k
S x S x
+ + +
'' ''
=
1
3
k k k k
c d h c
+
+ =
( ) ( )
1 1 k k k k
S x S x
+ +
' '
=
2
1
2 3
k k k k k k
b c h d h b
+
+ + =
Xc nh spline bc ba (tt)
1
3
k k k k
c d h c
+
+ =
2
1
2 3
k k k k k k
b c h d h b
+
+ + =
2
1
k k k k
k
k k
k
h d h c
h
y y
b

=
+
k
k k
k
h
c c
d
3
1

=
+
k
k k
k k
k
k k
k
h
c c
h c
h
y y
b
3
1 1

=
+ +
3 3
2
1 1 k k k k
k
k k
k
h c h c
h
y y
b
+ +

=
3 3
2
1 2 1 1
1
1 2
1
+ + + +
+
+ +
+

=
k k k k
k
k k
k
h c h c
h
y y
b
( )
3 3
2
2
3 3
2
1 2 1 1
1
1 2
1
1 1
+ + + +
+
+ +
+
+ +

=
= + +

k k k k
k
k k
k k k k k
k k k k
k
k k
h c h c
h
y y
h c c h c
h c h c
h
y y
Xc nh spline bc ba (tt)
( )
3 3
2
2
3 3
2
1 2 1 1
1
1 2
1
1 1 + + + +
+
+ +
+
+ +

= + +

k k k k
k
k k
k k k k k
k k k k
k
k k
h c h c
h
y y
h c c h c
h c h c
h
y y
( )
k
k k
k
k k
k k k k k
k k k k k k k k
h
y y
h
y y
h c c h c
h c h c h c h c

=
= + + +
+
+
+ +
+
+ + + + +
1
1
1 2
1
1 1 2 1 1
2
3 3
2
3 3
2
k
k k
k
k k k k k k k k k k
h
y y
h
y y h c h c h c h c

= + + +
+
+
+ + + + + + + 1
1
1 2 1 2 1 1 1
3 3
2
3
2
3
( )
k
k k
k
k k
k k k k k k k
h
y y
h
y y
c h c h h c h

= + + +
+
+
+ +
+ + + +
1
1
1 2
2 1 1 1
3 3 2
2 ,..., 0 = n k
23
5
Xc nh spline bc ba (tt)
2
1
, 0,1,..., 1
k k
k k k k k
k
y y
b c h d h k n
h
+

= =
( )
1 1
1 1 1 1
1
2 3 3 ,
1, 2..., 1
k k k k
k k k k k k k
k k
y y y y
h c h h c h c
h h
k n
+
+


+ + + =
=
1 1 1
3
k k k k
c d h c

+ =
2
1 1 1 1 1
2 3
k k k k k k
b c h d h b

+ + = 0,1,..., 2 k n =
2
1
1 1 1 1 1
1
, 1,...,
k k
k k k k k
k
y y
b c h d h k n
h

= =
Xc nh spline bc ba (tt)
2
1
, 0,1,..., 1
k k
k k k k k
k
y y
b c h d h k n
h
+

= =
( )
1 1
1 1 1 1
1
2 3 3 ,
1, 2..., 1
k k k k
k k k k k k k
k k
y y y y
h c h h c h c
h h
k n
+
+


+ + + =
=
1 1 1
3
k k k k
c d h c

+ =
2
1 1 1 1 1
2 3
k k k k k k
b c h d h b

+ + =
1,..., 1 k n =
2
1
1 1 1 1 1
1
, 1,...,
k k
k k k k k
k
y y
b c h d h k n
h

= =
2 2
1 1 1
1 1 1 1 1 1
1 1 1
2
1 1
2
3
,
3
k k k k k k
k k k k k k
k k k
k k k k
k k k
k k
y y c c c c
c h h c h h
h h h
y y c c
c h h
h h



+ +

+ + =

=
1
1
1
3
k k
k
k
c c
d
h

=
1,..., 1 k n =
2 2 2
1 1 1 1 1
1 1 1 1
1 1 1
3 3
k k k k k k k k k k
k k k k k k k
k k k k k
c c c c c c y y y y
h c h h c h h
h h h h h
+ +



+ + + + =
2 2
1 1 1
1 1 1 1 1 1
1 1 1
2
1 1
2
3
,
3
k k k k k k
k k k k k k
k k k
k k k k
k k k
k k
y y c c c c
c h h c h h
h h h
y y c c
c h h
h h



+ +

+ + =

=
1,..., 1 k n =
1 1
1 1 1 1 1
1
1 1 1 1
3 3 3 3
k k k k
k k k k k k k k k
k k
y y y y
c h c h h h h c h
h h
+
+


| | | |
+ + + + =
| |
\ . \ .
( )
1 1
1 1 1 1
1
2 3 3
k k k k
k k k k k k k
k k
y y y y
h c c h h c h
h h
+
+


+ + + =
Spline bc ba t nhin
iu kin bin t nhin:
( ) ( )
0
0
n
S x S x
'' ''
= =
( )
( )
( )
0 0 1 1
1 1 2 2
2 2 1 1
1 0 0 0
2 0
0 2 0
0 0 0 0 2
0 0 0 0 0 0 1
n n n n
h h h h
h h h h
A
h h h h

| |
|
+
|
|
+
=
|
|
|
+
|
|
\ .



1 0 2 1
1 0
1 1 2
1 2
0
3 3
3 3
0
n n n n
n n
y y y y
h h
e
y y y y
h h


| |
|

|

|
|
=
|
|

|
|
|
\ .

II/ c = [c
0
, c
n
]
T
l nghim ca h Ac = e vi
I/ Xc nh h
k
= x
k+1
x
k
, k = 0 n 1. H s a
k
= y
k
, k = 0 n
III/
( )
1
1
1
2
3
3
k k k
k k k
k
k k
k
k
y y h
b c c
h
c c
d
h
+
+
+

= +

ma trn A
(n+1) (n+1)
23
9
Xy dng hm ni suy ghp trn bc 3
Tm hm bc 3 trn tng on,
lin tc v c o hm n cp 2
ni suy bng s liu sau:
x
1
0 1
y 0.5 1 2
Hm ni suy:
( )
( ) | |
( ) | |
2 3
0 0 0 0 0
2 3
1 1 1 1 1
, 1, 0
, 0,1
S x a b x c x d x x
S x
S x a b x c x d x x
= + + + e

=

= + + + e

( )
( ) ( ) ( ) ( ) | |
( ) | |
2 3
0 0 0 0 0
2 3
1 1 1 1 1
1 1 1 , 1, 0
, 0,1
S x a b x c x d x x
S x
S x a b x c x d x x

= + + + + + + e

=

= + + + e

Dng thun tin hn:


24
0
V d spline bc ba t nhin
x 1 0 1
y 0.5 1 2
Lp hm ni suy spline bc 3
S(x) tho iu kin bin t
nhin v ni suy bng sau
( )
( ) ( ) ( ) ( ) | |
( ) | |
2 3
0 0 0 0 0
2 3
1 1 1 1 1
1 1 1 , 1, 0
, 0,1
S x a b x c x d x x
S x
S x a b x c x d x x

= + + + + + + e

=

= + + + e

I/ Bc chia
0 1
1 h h = =
H s a
k
= y
k
, k = 0, 1, 2 a
0
=0.5, a
1
=1, a
2
=2
V d spline bc ba t nhin (tt)
Ma trn A s l ma trn 3 3 c dng nh sau
( )
( )
( )
0 0 1 1
1 1 2 2
2 2 1 1
1 0 0 0
2 0
0 2 0
0 0 0 0 2
0 0 0 0 0 0 1
n n n n
h h h h
h h h h
A
h h h h

| |
|
+
|
|
+
=
|
|
|
+
|
|
\ .



( )
0 0 1 1
1 0 0
2
0 0 1
A h h h h
| |
|
= +
|
|
\ .
1 0 2 1
1 0
1 1 2
1 2
0
3 3
3 3
0
n n n n
n n
y y y y
h h
e
y y y y
h h


| |
|

|

|
|
=
|
|

|
|
|
\ .

1 0 2 1
1 0
0
3 3
0
y y y y
e
h h
| |
|

|
=
|
|
\ .
24
2
V d spline bc ba t nhin (tt)
Ma trn A s l ma trn 3 3 c dng nh sau
( )
( )
( )
0 0 1 1
1 1 2 2
2 2 1 1
1 0 0 0
2 0
0 2 0
0 0 0 0 2
0 0 0 0 0 0 1
n n n n
h h h h
h h h h
A
h h h h

| |
|
+
|
| +
=
|
|
|
+
|
|
\ .



( )
0 0 1 1
1 0 0
2
0 0 1
A h h h h
| |
|
= +
|
|
\ .
1 0 2 1
1 0
1 1 2
1 2
0
3 3
3 3
0
n n n n
n n
y y y y
h h
e
y y y y
h h


| |
|

|

|
|
=
|
|

|
|
|
\ .

1 0 2 1
1 0
0
3 3
0
y y y y
e
h h
| |
|

|
=
|
|
\ .
k h
k
a
k
b
k
e
k
c
k
d
k
0 1 0.5 0 0
1 1 1
2 2 0 0
II/ c = [c
0
, c
n
]
T
l nghim ca h Ac = e vi
1 0 0
1 4 1
0 0 1
A
| |
|
=
|
|
\ .
0
1.5
0
e
| |
|
=
|
|
\ .
0
0.375
0
c
| |
|
=
|
|
\ .
1.5 0.375
1 0
0
0
0.125
3
c c
d
h

= =
0.125
2 1
1
1
0.125
3
c c
d
h

= =
0.125
( )
1 0 0
0 0 1
0
2 0.375
3
y y h
b c c
h

= + =
( )
2 1 1
1 1 2
1
2 0.75
3
y y h
b c c
h

= + =
0.375
0.75
( )
( ) ( )
3
2 3
0.5 0.375 1 0.125 1
1 0.75 0.375 0.125
x x
S x
x x x

+ + + +

=

+ +

nu 1 s x s 0
nu 0 s x s 1
24
4
Ni suy spline bc ba hm Runge
Ni suy hm f(x) = 1/(1+ 25x), x e [1, 1] bng
a thc ni suy, 5 mc cch u. Tnh L(0.95), so
snh gi tr tnh c vi gi tr chnh xc f(0.95)
x
k
1 0.5 0 0.5 1
y
k
0.038 0.138 1 0.138 0.038
L(0.95) = 0. 1599 Gi tr chnh xc f (0.95) = 0.04
I/ Bc chia
H s a
k
= y
k
, k = 0, 1, 4 a
0
= 0.038, a
1
= 0.138, a
2
=1,
a
3
= 0.138, a
4
= 0.038
h
0
= h
1
= h
2
= h
3
= h
4
= 0.5,
V d spline bc ba t nhin (tt)
Ma trn A s l ma trn 5 5 c dng
( )
( )
( )
|
|
|
|
|
|
.
|

\
|
+
+
+
=
1 0 0 0 0
2 0 0
0 2 0
0 0 2
0 0 0 0 1
3 3 2 2
2 2 1 1
1 1 0 0
h h h h
h h h h
h h h h
A
|
|
|
|
|
|
|
|
|
.
|

\
|

=
0
3 3
3 3
3 3
0
2
2 3
3
3 4
1
1 2
2
2 3
0
0 1
1
1 2
h
y y
h
y y
h
y y
h
y y
h
y y
h
y y
e
( )
|
|
|
|
|
|
.
|

\
|
=
0 1 0 0 0 0
572 . 4 5 . 0 2 5 . 0 0 0
344 . 10 0 5 . 0 2 5 . 0 0
572 . 4 0 0 5 . 0 2 5 . 0
0 0 0 0 0 1
e A
x
k
1 0.5 0 0.5 1
y
k
0.038 0.138 1 0.138 0.038
|
|
|
|
|
|
.
|

\
|
=
0
0903 4
2171 7
0903 4
0
.
.
.
c
|
|
|
|
|
|
.
|

\
|

=
0
1.5624
0.0001
1.5636
0.4828
b
k h
k
a
k
b
k
e
k
c
k
d
k
0 0.5 0.038 0 0
1 0.5 0.138
2 0.5 1
3 0.5 0.138
4 0.038 0 0
4.572
10.344
4.572
4.0902
7.2171
4.0902
0.4828
1.5636
0.0001
1.5624
2.7269
7.5383
7.5383
2.7269
( )
( ) ( ) | |
( ) ( ) ( ) | |
| |
( ) ( ) ( ) | |

e +
e +
e + + + + +
e + + +
=
1 , 5 . 0 5 . 0 7269 . 2 5 . 0 0902 . 4 5 . 0 5624 . 1 138 . 0
5 . 0 , 0 5383 . 7 2171 . 7 0001 . 0 1
0 , 5 . 0 5 . 0 5383 . 7 5 . 0 0902 . 4 5 . 0 5636 . 1 138 . 0
5 . 0 , 1 1 7269 . 2 1 4828 . 0 038 . 0
3 2
3 2
3 2
3
x x x x
x x x x
x x x x
x x x
x S
S(0.95) = 0.0143 f(0.95) = 0.0424
th hm Runge v cc hm ni suy
spline t nhin bc ba
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1


Spline with 5 points
Spline with 9 points
Runge function
th hm Runge, a thc ni suy
Lagrange v hm ni suy spline t nhin bc
ba trong trng hp 5 im mc
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
-1 -0.5 0 0.5 1
Hm Runge Spline 5 im Lagrange 5 im
24
9
Spline bc ba rng buc
iu kin xc nh mt spline bc 3 rng buc
S(a) = o, S(b) = |
iu kin ny xc nh hai phng trnh
1 0
0 0 0 1
0
1
1 1 1
1
2 3 3
2 3 3
n n
n n n n
n
y y
h c h c
h
y y
h c h c
h

+ = o

+ = |

Spline bc ba rng buc


( )
( )
( )
0 0
0 0 1 1
1 1 2 2
2 2 1 1
1 1
2 0 0
2 0
0 2 0
0 0 0 0 2
0 0 0 0 0 2
n n n n
n n
h h
h h h h
h h h h
A
h h h h
h h


| |
|
+
|
|
+
=
|
|
|
+
|
|
\ .



1 0
0
1 0 2 1
1 0
1 1 2
1 2
1
1
3 3
3 3
3 3
3 3
n n n n
n n
n n
n
y y
h
y y y y
h h
e
y y y y
h h
y y
h

| |
o
|
|
|

|
|
|
=
|

|

|
|

|
|
|
\ .

II/ c = [c
0
,
c
n
]
T
l nghim
ca h Ac = e
vi
III/
( )
1
1
1
2
3
3
k k k
k k k
k
k k
k
k
y y h
b c c
h
c c
d
h
+
+
+

= +

25
1
Bi tp spline
Xc nh spline t nhin ni suy cc bng s
x 1 3 6
y 3 7 13
x 1 2 4
y 3 3 4
g (x) = 1+ 2 x
( )
( ) ( )
( ) ( ) ( )
3
2 3
1 1
3 1 1
12 12
1 1 1
3 2 2 2
6 4 24
x x
g x
x x x

+ +

1 s x s 2
2 s x s 4
25
2
Bi tp spline (tt)
x 1 2 3 4
y 1 2 2 1
Spline t nhin
k h
k
a
k
b
k
e
k
c
k
d
k
0 1 1 0 0
1 1 2
2 1 2
3 1 0 0
Bi tp spline (tt)
x 0 1 2
y 1 2 1
Bin rng buc g(0) = g(2)=1
k h
k
a
k
b
k
e
k
c
k
d
k
0 1 1 1 0 1.5 1.5
1 1 2 0.5 6 3 2.5
2 1 6 4.5
2 1 0
1 4 1
0 1 2
A
| |
|
=
|
|
\ .
( )
( ) ( ) ( )
2 3
2 3
3 3
1
2 2
1 5
2 1 3 1 1
2 2
x x x
g x
x x x

+ +

0 s x s 1
1 s x s2
0
6
6
e
| |
|
=
|
|
\ .
1.5
3
4.5
c
| |
|
=
|
|
\ .
Bi tp spline (tt)
x 0 1 2
y 1 2 1
Bin rng buc g(0) = g(2)=0.5
k h
k
a
k
b
k
e
k
c
k
d
k
0 1 1 1 0 1.5 1.5
1 1 2 0.5 6 3 2.5
2 1 6 4.5
2 1 0
1 4 1
0 1 2
A
| |
|
=
|
|
\ .
( )
( ) ( ) ( )
2 3
2 3
3 3
1
2 2
1 5
2 1 3 1 1
2 2
x x x
g x
x x x

+ +

0 s x s 1
1 s x s2
0
6
6
e
| |
|
=
|
|
\ .
1.5
3
4.5
c
| |
|
=
|
|
\ .
25
5
Bi tp spline bc ba
( )
( ) ( ) ( )
3
2 3
1 2
0 1
1 2
1 1 1
x x
x
g x
x
a b x c x d x
+
s s

=

s s
+ + +

Mt spline bc ba t nhin xc nh trn [0, 2] c dng


Hy xc nh cc h s a, b, c, d
Khi x = 1
3
1 2 a x x = +
2
2 3 b x =
2 6 c x =
( )
0 S x
''
= Khi x = 2 ( )
2 6 1 0 c d x + =
a = 2, b = 1 , c = 3 , d = 1
Dn s Nng (ngn ngii)
620
640
660
680
700
720
740
760
1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004
S lng xe khch Nng
300
350
400
450
500
550
600
1994 1995 1996 1997 1998 1999 2000 2001 2002 2003
n
g

n





.
Lu lng nc sng (m/s) v mc nc (m)
0
50
100
150
200
250
300
350
400
450
500
5.7 5.75 5.8 5.85 5.9 5.95 6 6.05 6.1 6.15
m
Ch s SOI v lng ma Tha Thin Hu
0
200
400
600
800
1000
1200
1400
1600
1800
2000
-25 -20 -15 -10 -5 0 5 10 15 20 25
26
0
Phng php bnh phng cc tiu
Xp x d liu thc nghim bng hm s
Nhiu d liu v gi tr y
k
c sai s p t
L(x
k
) = y
k
l khng c ngha
Gii quyt: tm mt hm f (x) n gin th hin
tt nht dng iu ca tp hp im, khng nht
thit i qua cc im
( ) ( )
2
1
min
n
k k
k
g f f x y
=
= (

Dn s Nng (ngn ngii)


y = 13.313x - 25924
620
640
660
680
700
720
740
760
1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004
Lu lng nc sng (m/s) v mc nc (m)
y = -2601.1x
3
+ 48530x
2
- 299744x + 613506
0
50
100
150
200
250
300
350
400
450
500
5.7 5.75 5.8 5.85 5.9 5.95 6 6.05 6.1 6.15
26
3
Trng hp tuyn tnh f(x) = A + Bx
( ) ( )
2
1
min
n
k k
k
g f f x y
=
= (

( ) ( )
2
1
, min
n
k k
k
g A B A Bx y
=
= +

0, 0
g g
A B
c c
= =
c c
im dng
( )
( )
1
1
0
0
n
k k
k
n
k k k
k
A Bx y
A Bx y x
=
=

+ =

+ =

1 1
2
1 1 1
n n
k k
k k
n n n
k k k k
k k k
nA B x y
A x B x x y
= =
= = =

+ =

+ =



26
4
Trng hp f(x) = A + Bx + Cx
( ) ( )
2
2
1
, , min
n
k k k
k
g A B C A Bx Cx y
=
= + +

0, 0, 0
g g g
A B C
c c c
= = =
c c c
im dng
2
1 1 1
2 3
1 1 1 1
2 3 4 2
1 1 1 1
n n n
k k k
k k k
n n n n
k k k k k
k k k k
n n n n
k k k k k
k k k k
nA B x C x y
A x B x C x x y
A x B x C x x y
= = =
= = = =
= = = =

+ + =

+ + =

+ + =




26
5
Trng hp f(x) = Acos x + Bsin x
( ) ( )
2
1
, cos sin min
n
k k k
k
g A B A x B x y
=
= +

2
1 1 1
2
1 1 1
cos cos sin cos
cos sin sin sin
n n n
k k k k k
k k k
n n n
k k k k k
k k k
A x B x x y x
A x x B x y x
= = =
= = =

+ =

+ =



26
6
Bi tp - phng php bnh phng cc
tiu
x 0 1 2
y 1.5 3.5 1.9
f(x) = Acos x + Bsin x
x 0 0.5 1
y 1 1.5 1.5
A = 1.0261, B = 1.1548
A = 1.6206, B = 2.9639
Chng 4. Tnh gn ng o hm,
tch phn
Mn hc:
Phng php tnh
Ni dung
Tng quan: Tnh qua a thc ni suy Lagrange
A. Tnh gn ng o hm:
o hm cp 1: xp x 2 im (tin, li); xp x 3 im
(hng tm).
o hm cp 2: hng tm. Sai s
B. Tnh gn ng tch phn
Cng thc hnh thang & Simpson
Cng thc hnh thang & Simpson m rng
Tng quan
Hm y = f(x), hoc xc nh qua bng gi tr, hoc
biu thc phc tp (khng d tm o hm f hay
tch phn)
Tnh cc o hm cp 1 v cp 2 da vo cc gi
tr ri rc y
k
ca hm ti cc nt x
k
tng: xy dng a thc ni suy Lagrange xp
x hm f(x) trong mt on no , v khi
f(x) ~ L(x) v f(x) ~ L (x)
a thc ni suy Lagrange
( )
( ) ( ) ( )( ) ( )
( ) ( ) ( ) ( ) ( )
0 1 1 1 ( )
0 1 1 1
k k n k
n
k k k k k k k n
x x x x x x x x x x
p x
x x x x x x x x x x
+
+

=

( )
( )
0
( )
n
k
n k
k
L x p x y
=
=

Trng hp cc mc cch u x
k+1
x
k
= h = const
t q = (x x
0
)/h
( )
( ) ( ) ( )
( ) ( )
0
1 1
! !
n k
n
k
k
q q q n
L x y
k n k q k

=

=


Minh ha trng hp 2 im nt
a thc ni suy Lagrange c dng
x x
0
x
1
y y
0
y
1
y
0
= f(x
0
) v
y
1
= f(x
1
) = f(x
0
+ h)
( )
0 1
0 1
x x x x
L x y y
h h

= +
( )
( ) ( )
0 0
1 0
f x h f x
y y
f x
h h
+

'
~ ~
x trn [x
0
, x
1
]
Ti x
0
cng thc sai phn tin
Ti x
1
cng thc sai phn li
Sai s trng hp 2 im nt
Biu din f(x) qua chui Taylor bc 2, x = x
0
+ h
( ) ( ) ( ) ( )
2
0 0 0 0
2!
h
f x h f x hf x f x
' ''
+ = + +
Sai s ca cng thc sai phn hai im
( ) ( )
( ) ( )
0 0
0 0
2!
f x h f x
h
f x f x
h
+
' '' = +
2
2
h M
= A
Trng hp 3 im nt
x x
0
x
1
x
2
y y
0
y
1
y
2
x
2
x
1
= x
1
x
0
= h
y
0
= f(x
0
)
y
1
= f(x
1
) = f(x
0
+ h)
y
2
= f(x
2
) = f(x
0
+ 2h)
a thc Lagrange c dng
( )
( ) ( ) ( )( ) ( )( )
1 2 0 2 0 1
0 1 2
2 2 2
2 2
x x x x x x x x x x x x
L x y y y
h h h

= +
( ) ( ) ( ) ( )
0 1 2
2 1 0 2 0 1
2 2 2
2 2
2 2 2
x x x x x x
L x y y y y y y
h h h

'
~ + + +
( )
2 1 0
2
2 y y y
L x
h
+
''
~
Trng hp 3 im nt (tt)
( ) ( ) ( ) ( )
0 1 2
2 1 0 2 0 1
2 2 2
2 2
2 2 2
x x x x x x
L x y y y y y y
h h h

'
~ + + +
( ) ( )
( ) ( ) ( )
0 0 0
0 1 2
0 0
3 4 2
3 4
2 2
f x f x h f x h
y y y
f x L x
h h
+ + +
+
' ' ~ = =
cng thc sai phn tin
cng thc sai
phn hng tm
cng thc sai phn li
( ) ( )
( ) ( )
0 0
2 0
1 1
2
2 2
f x h f x
y y
f x L x
h h
+

' ' ~ = =
( ) ( )
( ) ( ) ( )
0 0 0
0 1 2
2 2
4 3 2
4 3
2 2
f x f x h f x h
y y y
f x L x
h h
+ + +
+
' ' ~ = =
Trng hp 3 im nt (tt)
Cng thc sai phn hng tm thng c vit di dng
( )
( ) ( )
0 0
0
2
f x h f x h
f x
h
+
' ~
( )
( ) ( ) ( )
0 0 0
0
2 4 3
2
f x h f x h f x
f x
h
+
' ~
Cng thc sai phn li c vit di dng
S dng cng thc sai phn hng tm xp x o hm cp 2
( )
( ) ( ) ( )
0 0 0
0
2
2 f x h f x f x h
f x
h
+ +
'' ~
Trng hp 3 im nt (tt) Xp x o
hm cp 2
S dng cng thc sai phn hng tm xp x
o hm cp 2
( )
2 1 0
2
2 y y y
L x
h
+
''
~
( )
2 1 0
2
2 y y y
f x
h
+
''
~
Sai s trng hp 3 im nt
Biu din f(x) qua chui Taylor bc 3, x = x
0
+ h v
x = x
0
+ 2h
Sai s ca cng thc sai phn tin ba im
3
2
3
h M
= A
( ) ( ) ( ) ( )
( )
( )
0
3
3
0
2
0 0 0
! 3 ! 2
x f
h
x f
h
x f h x f h x f +
' '
+
'
+ = +
( ) ( ) ( ) ( )
( )
( )
0
3
3
0
2
0 0 0
! 3
8
! 2
4
2 2 x f
h
x f
h
x f h x f h x f +
' '
+
'
+ = +
( ) ( ) ( )
( )
( )
( )
0
3
2
0
0 0 0
3 2
2 4 3
x f
h
x f
h
h x f h x f x f

'
=
+ + +
Sai s trng hp 3 im nt (tt)
Biu din f(x) qua chui Taylor bc 3, x = x
0
+ h v
x = x
0
h
Sai s ca cng thc sai phn hng tm
6
2
3
h M
= A
( ) ( ) ( ) ( )
( )
( )
0
3
3
0
2
0 0 0
! 3 ! 2
x f
h
x f
h
x f h x f h x f +
' '
+
'
+ = +
( ) ( ) ( ) ( )
( )
( )
0
3
3
0
2
0 0 0
! 3 ! 2
x f
h
x f
h
x f h x f h x f
' '
+
'
=
( ) ( )
( )
( )
( )
0
3
2
0
0 0
6 2
x f
h
x f
h
h x f h x f
+
'
=
+
Sai s trng hp 3 im nt (tt)
Biu din f(x) qua chui Taylor bc 4, x = x
0
+ h v
x = x
0
h
Sai s ca cng thc sai phn hng tm xp x
o hm bc hai
12
2
4
h M
= A
( ) ( ) ( ) ( )
( )
( )
( )
( )
0
4
4
0
3
3
0
2
0 0 0
! 4 ! 3 ! 2
x f
h
x f
h
x f
h
x f h x f h x f + +
' '
+
'
+ = +
( ) ( ) ( ) ( )
( )
( )
( )
( )
0
4
4
0
3
3
0
2
0 0 0
! 4 ! 3 ! 2
x f
h
x f
h
x f
h
x f h x f h x f +
' '
+
'
=
( ) ( ) ( )
( )
( )
( )
0
4
2
0
2
0 0 0
12
2
x f
h
x f
h
h x f x f h x f
+
' '
=
+ +
Tng kt xp x o hm
Xp x
o hm
cp 1
2 im:
3 im:
Hng tm:
Xp x f(x
0
):
( )
( ) ( ) ( )
12
,
2
' '
2
4
2
0 0 0
0
h M
h
h x f x f h x f
x f = A
+ +
~
3
,
2
) 2 ( ) ( 4 ) ( 3
) ( '
2
3 0 0 0
0
h M
h
h x f h x f x f
x f = A
+ + +
~
2
,
) ( ) (
) ( '
2 0 0
0
h M
h
x f h x f
x f

= A
+
~
6
,
2
) ( ) (
) ( '
2
3 0 0
0
h M
h
h x f h x f
x f

= A
+
~
Bi tp minh ha
x 0.5 0 0.5
y 1.6487 1 0.6065
cng thc sai phn tin
cng thc sai phn li
cng thc sai phn hng tm
Tnh f (x) khi x = 0
( )
x
f x e

=
f (x) = 0.7869
f (x) = 1.2974
f (x) = 1.0422
Bi tp minh ha (tt)
x 1 0 1
y 0.5 1 2
cng thc sai phn tin
cng thc sai phn li
cng thc sai phn hng tm
Tnh f (x) khi x = 0
( )
2
x
f x =
f (x) = 1
f (x) = 0.5
f (x) = 0.75
Gi tr chnh xc f (x) = ln (2.0) ~ 0.6931
Bi tp
( )
2
cos5 f x x x = h = 0.1, 0.01, 0.001
h = 0.1
x 0.9 1.1
y -0.17074 0.85749
f (1.0) ~
5.1412
h = 0.01
x 0.99 1.01
y 0.23070 0.33789
f (1.0) ~
5.3597
h = 0.001
x 0.999 1.001
y 0.27831 0.28903
f (1.0) ~
5.3619
( )
2
2 cos5 5 sin5 f x x x x x
'
=
( )
1.0 5.3619 f
'
=
Tnh f (x) ti x
0
= 1.0
Bi tp (tt)
Tnh f (x) ti x
0
= 1.0
( )
2
3 x
f x x e

=
h = 0.1, 0.01, 0.001
x 0.9 1.1
y 0.28414 1.03280
h = 0.1
f (1.0) ~
3.7433
x 0.99 1.01
y 0.59503 0.66974
h = 0.01
f (1.0) ~
3.7358
x 0.999 1.001
y 0.62839 0.63586
h = 0.001
f (1.0) ~
3.7358
( )
2
2
3 2
x
f x x xe

'
= + ( )
1.0 3.7358 f
'
=
Xp x tch phn
Mc ch: tnh gn ng tch phn xc nh
( )
b
a
I f x dx =
}
Xp x hm f (x) trn on [a, b] bng a thc ni
suy Lagrange L
n
(x) v
( ) ( )
*
b b
n
a a
I f x dx I L x dx = ~ =
} }
Cng thc Newton-Cotes
Xt php phn hoch u ca on [a, b]
h = (b a) / n, x
0
= a, x
k
= x
0
+ kh, q = (x a) / h
( )
( ) ( ) ( )
( ) ( )
0
1 1
! !
n k
n
k
k
q q q n
L x y
k n k q k

=

=


( ) ( )
*
0
b
n
k k
k
a
I f x dx I b a H y
=
= ~ =

}
( )
( )
( ) ( )
0
1 1
! !
n k
n
k
q q q n
H dq
nk n k q k


=

}

trong
Tnh cht: H
k
= H
nk
0
1
n
k
k
H
=
=

( )
( ) ( ) ( )
( ) ( )
0
0
1 1
! !
n k
b n
n
k
k
a
q q q n
L x dx y hdq
k n k q k

=
(

= =
(

(

} }

( ) ( ) ( )
( ) ( )
1
0
0
1 1
! !
n k
n
k
k
q q q n
b a
y dq
n k n k q k

=
(

= =
(

(

}

( )
( )
( )
( ) ( )
( )
1
0
0
1 1
! !
n k
n
k
k
q q q n
b a y dq
nk n k q k

=
(

= =
(

(

}

( )
0
n
k k
k
b a y H
=
=

Sai s ca cng thc Newton-Cotes
nu n l
nu n chn
( ) ( )
( )
( )
( )
( ) x w
n
f
x L x f
n
! 1
1
+

+ =
+
( )
( ) ( )
( )
( ) ( )


+

+
= A
}
}
+
+
+
+
n n
n
n n
n
dq n q q q
n
h M
dq n q q q
n
h M
0
2
3
2
0
2
1
... 1
! 2
... 1
! 1
Cng thc hnh thang
a b 0 x
A
B
y
0
=f(a)
y
1
=f(b)
y=f(x)
Cng thc hnh thang (tt)
T cng thc Newton Cotes
( ) ( )
*
0
b
n
k k
k
a
I f x dx I b a H y
=
= ~ =

}
( )
( )
( ) ( )
0
1 1
! !
n k
n
k
q q q n
H dq
nk n k q k


=

}

vi
Khi n = 1
0 1
1
2
H H = =
*
0 1
2
y y
I I h
+
~ =
Thng thng: chia nh on [a, b] thnh n phn bng nhau
v p dng cng thc hnh thang cho tng on
Cng thc hnh thang m rng
x
0
x
1
x
f(x)
x
2
h h x
3
h h x
4
n
a b
h

=
Cng thc hnh thang (tt)
Chia on [a, b] lm n on bng nhau di h
( )
1
0
1
2
2
b
n
k n
k
a
h
f x dx y y y

=
(
| |
~ + +
( |
\ .

}
Sai s
( )
2
2
12
h b a M
| |
( )
2
,
max
x a b
M f x
e
'' =
Cng thc hnh thang m rng
Cng thc Simpson
x
0
x
1
x
f(x)
x
2
h h
L(x)
Cng thc Simpson (tt)
Cng thc Newton Cotes
( ) ( )
*
0
b
n
k k
k
a
I f x dx I b a H y
=
= ~ =

}
( )
( )
( ) ( )
0
1 1
! !
n k
n
k
q q q n
H dq
nk n k q k


=

}

vi
Khi n = 2
0 2
1
6
H H = =
1
2
3
H =
( )
*
0 1 2
4
3
h
I I y y y ~ = + +
( )( )
2
0
0
1 1 8 1
1 2 6 4
4 4 3 6
H q q dq
| |
= = + =
|
\ .
}
( )
2
2
0
1 1
1
4 6
H q q dq = =
}
( )
2
1
0
1 2
2
2 3
H q q dq = =
}
Cng thc Simpson m rng
x
0
x
2
x
f(x)
x
4
h h x
n-2
h x
n
n
a b
h

=
...
h x
3
x
1
x
n-1
Cng thc Simpson (tt)
Chia on [a, b] lm n = 2m on bng nhau, di
2
b a
h
m

=
( )
1
0 2 1 2 2
1 1
4 2
3
b
m m
k k m
k k
a
h
f x dx y y y y

= =
(
| | | |
~ + + +
( | |
\ . \ .


}
Sai s
( )
4
4
180
h b a M
Cng thc Simpson m rng
Bi tp
1
1
I x dx

=
}
1
0
x
I e dx

=
}
Tm cc tch phn bng cng thc hnh thang v Simpson vi
4 on nh. So snh vi cng thc gii tch.
Hnh thang
Simpson
I = 0.63541
I = 0.63213
Gii tch I = 0.63212
x 0 0.25 0.5 0.75 1
y 1 0.77880 0.60653 0.47237 0.36788
Bi tp Tm s on chia
Tm s on chia n xp x vi sai s 10
5
tch
phn sau bng a) cng thc hnh thang, b) cng
thc Simpson
1
0
x
I e dx

=
}
( ) ( ) ( )
( )
( )
4
, ,
x x x x
f x e f x e f x e f x e

' ''
= = = =
a) Hnh thang
| |
( ) ( )
0,1
max 0 1
x
f x f
e
'' '' = =
nh gi sai s
( )
2
2
2
1
12 12
h b a M
n

= s c
1
12
n >
c
b) Simpson
| |
( )
( )
( )
( )
4 4
0,1
max 0 1
x
f x f
e
= =
nh gi sai s
( )
4
4
4
1
180 180
h b a M
n

= s c
4
1
180
n >
c
Vi c = 10
5
th n
1
= 92, n
2
= 5
Bi tp
Hm f(x) cho bi bng s
Dng cng thc Simpson m rng tnh gn ng tch
phn sau vi M = 1.6
x 0 0.25 0.5 0.75 1
f(x) 0.5M 2.2 1.3M 1 3.6 M
( )
}
=
1
0
dx x f x I
Bi tp
Hm f(x) cho bi bng s
Dng cng thc Simpson m rng tnh gn ng tch
phn sau vi M = 2.1
x 0.1 0.2 0.3 0.4 0.5
f(x) 1.2 0.5M 2.7 M 3.6
( )
}
=
5 . 0
1 . 0
2
dx x f x I
Chng 5: Gii phng trnh vi phn
thng
Mn hc:
Phng php tnh
30
2
Ni dung
A. Bi ton Cauchy
1/ Cng thc Euler
2/ Cng thc Euler ci tin v Runge Kutta
3/ H phng trnh vi phn thng
4/ Phng trnh vi phn bc cao
B. Bi ton bin:
1/ Phng php sai phn hu hn
30
3
Bi ton Cauchy
Bi ton vi iu kin ban u
( ) ( ) ( )
( )
0
, , y x f x y x a x b
y a y
'
= s s

Mc ch ca li gii s:
Tm tt c cc gi tr y
0
, y
1
, , y
n
ti cc nt li
Nu x
k
= x
0
+ kh, h = (b a)/n li u
a = x
0
< x
1
< < x
n
= b, y(x
i
) ~ y
i
30
4
Phng php Euler
S dng cng thc xp x o hm 2 im
( )
( ) ( )
1 k k
k
y x y x
y x
h
+

'
=
( ) ( )
( )
1
,
k k
k k
y x y x
f x y
h
+

=
( ) ( )
1 1
,
k k k k k
y x y y hf x y
+ +
~ = +
30
5
V d phng php Euler
Gii phng trnh y' = xy, y(0)=1 trn on [0, 1] vi bc
chia h = 0.2 v so snh vi nghim chnh xc
k x
k
y
k
y (x
k
) |y (x
k
) y
k
|
0 0 1.000000 1.000000 0.000000
1 0.2
2 0.4
3 0.6
4 0.8
5 1.0
1.000000 1.020201 0.020201
1.040000 1.083287 0.043287
1.123200 1.197217 0.074017
1.257984 1.377128 0.119144
1 k k k k
y y hx y
+
= +
1.459261 1.648721 0.189460
2
2
x
e y =
th nghim chnh xc v gn ng - Phng
php Euler
0.8
0.9
1.0
1.1
1.2
1.3
1.4
1.5
1.6
1.7
0 0.2 0.4 0.6 0.8 1
Nghim gn ng Nghim chnh xc
Bi tp
y = 3y, y(0) = 1, h = 0.1, 0 s x s 1
i x Euler
Nghim chnh xc
0 0 1.000000
1 0.1
2 0.2
3 0.3
4 0.4
5 0.5
6 0.6
7 0.7
8 0.8
9 0.9
10 1
1.300000
1.690000
2.197000
2.856100
3.712930
4.826809
6.274852
8.157307
10.604499
13.785849
1.000000
1.349859
1.822119
2.459603
3.320117
4.481689
6.049647
8.166170
11.023176
14.879732
20.085537
30
8
Bi tp phng php Euler
y = 1 + (x y) ,
2 x 3
y (2) = 1, h = 0,2
k x
k
y
k
0 2.0 1.0000
1 2.2 1.4000
2 2.4 1.7280
3 2.6 2.0183
4 2.8 2.2860
5 3.0 2.5388
30
9
Bi tp phng php Euler
y = 1 + (x y) ,
2 x 3
y (2) = 1, h = 0,2
k x
k
y
k
0 2.0 1.0000
1 2.2 1.4000
2 2.4 1.7024
3 2.6 1.9703
4 2.8 2.2202
5 3.0 2.4592
Phng php Euler ci tin
( )
( ) ( )
1 1
1 1
, ,
2
k k k k
k k k
f x y f x y
y x y y h
+ +
+ +
+
~ = +
( )
( ) ( ) ( )
1
1 1
, , ,
2
k k k k k k
k k k
f x y f x y hf x y
y x y y h
+
+ +
+ +
~ = +
k x
k
y
k
y (x
k
) |y (x
k
) y
k
|
0 0 1.000000 1.000000 0.000000
1 0.2 1.020201
2 0.4 1.083287
3 0.6 1.197217
4 0.8 1.377128
5 1 1.648721
1.020000 0.000201
1.082832 0.000455
1.196313 0.000905
1.375281 0.001847
1.644836 0.003885
Bi tp
y = 3y, y(0) = 1, h = 0.1, 0 s x s 1
i x Euler ci tin
Nghim chnh xc
0 0 1.000000 1.000000
1 0.1 1.345000 1.349859
2 0.2 1.809025 1.822119
3 0.3 2.433139 2.459603
4 0.4 3.272571 3.320117
5 0.5 4.401609 4.481689
6 0.6 5.920164 6.049647
7 0.7 7.962620 8.166170
8 0.8 10.709724 11.023176
9 0.9 14.404579 14.879732
10 1 19.374158 20.085537
i x Euler Euler ci tin
Nghim chnh xc
0 0 1.000000 1.000000 1.000000
1 0.1 1.300000 1.345000 1.349859
2 0.2 1.690000 1.809025 1.822119
3 0.3 2.197000 2.433139 2.459603
4 0.4 2.856100 3.272571 3.320117
5 0.5 3.712930 4.401609 4.481689
6 0.6 4.826809 5.920164 6.049647
7 0.7 6.274852 7.962620 8.166170
8 0.8 8.157307 10.709724 11.023176
9 0.9 10.604499 14.404579 14.879732
10 1 13.785849 19.374158 20.085537
th nghim chnh xc v gn ng - theo
phng php Euler v Euler ci tin
0
5
10
15
20
25
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Euler Euler ci tin Nghim chnh xc
31
4
3/ Phng php Runge Kutta
( ) ( )
( )
( )
( )
( )

+ + + + + =
+ + + =
+ + =
=
+ ~ + =

=
+
k
n n n
k
n
k
n k n k
k
n
k k
k k
k
k
k k
k
k k
k
n
j
k
j j k k k
K K K y h x hf K
K K y h x hf K
K y h x hf K
y x hf K
K A y h x y x y
1 1 , 2 2 1 1
2 32 1 31 3 3
1 21 2 2
1
1
1
,
,
,
,
| | | o
| | o
| o


31
5
Phng php Runge Kutta (tt)
Cc h s A
j
,
j
, j=1..n v
ji
, j=2..n, i=1,..n1 xc nh theo
phng php sau:
( ) ( )

=
+ =
n
j
k
j j k k
K A y h x y h
1
Gi thit rng y(h) v (h) c o hm n cp m, Do (0) =
0 khai trin MacLaurin ca (h) nh sau:
( ) ( ) ( )
( )
( ) ( )
m m
h O
m
h h h + + +
' '
+
'
= 0
!
1
... 0
2
1
0
2
Cc h s A
j
,
j
, j=1..n v
ji
, j=2..n, i=1,..n1 c xc nh
theo iu kin:
( ) ( )
( )
( ) 0 0 ... 0 0 = = =
' '
=
'
m
( ) ( )
m
h O h =
31
6
Phng php Runge Kutta. Mt s
trng hp thng s dng
a) Trng hp n = m = 1
b) Trng hp n = m = 2
c) Trng hp n = m = 4
31
7
Trng hp n = m = 1
( ) ( )
( )

=
+ ~ + =
+
k k
k
k
k k k
y x hf K
K A y h x y x y
,
1
1 1 1
( ) ( ) ( ) ( )
k k k k
k
k k
y x hf A y h x y K A y h x y h ,
1 1 1
+ = + =
1
1
= A
Cng thc Euler
31
8
Trng hp n = m = 2
( )
( )
( )

| + o + =
=
+ + ~ +
k
k k
k
k k
k
k k
k k
K y h x hf K
y x hf K
K A K A y h x y
1 21 2 2
1
2 2 1 1
,
,
( ) ( )
k k
k k
K A K A y h x y h
2 2 1 1
+ =
A
1
, A
2
,
2
,
21
l cc h s cn xc nh theo iu kin
( ) ( ) 0 0 0 = ' ' = '
Trong
( ) ( ) ( )
( ) ( ) ( ) ( ) | | { } ... , ... ,
,
21 2 1 21 2 2
1
y k k x
k
k k
k k k
f y x f f h K y h x f A
y x f A h x y h
'
| +
'
o + | + o +
+ ' = '
( ) ( ) ( ) ( ) ( ) | | | | { } ... ... , ... 2
21 2 2
h f y x f f A h x y h
y k k x k
+
'
| +
'
o +
' '
=
' '
31
9
Trng hp n = m = 2 (tt)
Cho h = 0, v s dng iu kin
( ) ( ) 0 0 0 = ' ' = '

= |
= o
=
0 2 1
0 2 1
0 1
2 21
2 2
2 1
A
A
A A
H ny c v
s nghim!
1 , 2 1
21 2 2 1
= | = o = = A A
( ) ( )
( )
( )

+ + =
=
+ + ~ +
k
k k
k
k k
k
k k
k k
K y h x hf K
y x hf K
K K y h x y
1 2
1
2 1
,
,
2
2 1 , 1 , 0
21 2 2 1
= | = o = = A A
Cng thc Euler ci tin
( )
( )
( )

+ + =
=
+ ~ +
2 , 2
,
1 2
1
2
k
k k
k
k k
k
k
k k
K y h x hf K
y x hf K
K y h x y
32
0
Trng hp n = m = 4
( ) ( ) ( )
( )
( )
1 1 2 3 4
1
1
2
2
3
4 3
1
2 2
6
,
,
2 2
,
2 2
,
k k k k
k k k
k
k k
k
k
k k
k
k
k k
k k
k k
y x y x h y K K K K
K hf x y
K h
K hf x y
K h
K hf x y
K hf x h y K
+

= + ~ + + + +

| |

= + +

|
\ .

| |

= + +
|

\ .

= + +

Phng php RungeKutta bc 4


32
1
Minh ha phng php RungeKutta
k x
k
y
k
y (x
k
) |y (x
k
) y
k
|
0 0 1.000000
1.000000 0
1 0.2 1.020201
1.020201 7.0310
9
2 0.4 1.083287
1.083287 7.57 10
8
3 0.6 1.197217
1.197217 3.55 10
7
4 0.8 1.377126
1.377128 1.35 10
6
5 1 1.648717
1.648721 4.59 10
6
1.377126
1.35 10
6
1.020201
7.0310
9
1.083287
7.57 10
8
1.197217
3.55 10
7
1.648717
4.59 10
6
32
2
Chia [a, b] lm n
on:
h=(b a)/n,
x
i
= a+ih
Cc phng php gii phng trnh vi phn
thng
( )
( )
( )
1
2 1
1 1 2
,
,
2
k
k k
k k
k k
k k
k k
K hf x y
K hf x h y K
y y K K
+
=
= + +
= + +
( ) ( )
( )
0
, y x f x y
y a y
'
=

( )
1
,
k k k k
y y hf x y
+
= +
Tm y(x) trn [a, b]
( )
( )
( )
1
1 2
2
3 4 3
1 1 2 3 4
, ,
2 2
, ,
2 2
1
2 2
6
k
k k
k k k k
k
k k k
k k k k
k k k k
k k
K
h
K hf x y K hf x y
K
h
K hf x y K hf x h y K
y y K K K K
+
| |
= = + +
|
\ .
| |
= + + = + +
|
\ .
= + + + +
Bi ton
Cauchy
Phng php Euler
Phng php
Euler ci tin
Phng php Runge - Kutta
Chia [a, b] lm n on: h=(b a)/n, x
k
= a+kh
Cc phng php gii PTVP thng
( )
( )
( )
1
2 1
1 1 2
,
,
2
k
k k
k k
k k
k k
k k
K hf x y
K hf x h y K
y y K K
+
=
= + +
= + +
( ) ( )
( )
0
, y x f x y
y a y
'
=

( )
1
,
k k k k
y y hf x y
+
= +
Tm y(x) trn [a, b]
( )
( )
( )
1
1
2
2
3
4 3
1 1 2 3 4
,
,
2 2
,
2 2
,
1
2 2
6
k
k k
k
k
k k
k
k
k k
k k
k k
k k k k
k k
K hf x y
K
h
K hf x y
K
h
K hf x y
K hf x h y K
y y K K K K
+
=
| |
= + +
|
\ .
| |
= + +
|
\ .
= + +
= + + + +
Bi ton Cauchy
Phng php Euler
Phng php
Euler ci tin
Phng php Runge - Kutta
32
4
Tnh K
1
, K
2
, K
3
, K
4
, y(0.2)
( )

=
=
+ =
'
2 . 0
5 . 0 0
3
2 3
h
y
y xy x y
32
5
Tnh K
1
, K
2
, K
3
, K
4
, y(0.2)
K
1
= 0.050
K
2
= 0.0238
K
3
= 0.0219
K
4
= 0.0066
y[0.2] = 0.5225
( )

=
=
+ =
'
2 . 0
5 . 0 0
3
2 3
h
y
y xy x y
32
6
chnh xc ca cc phng php
Euler O (h)
Euler ci tin O (h)
Runge Kutta bc bn O (h
4
)
32
7
V d
Gii phng trnh y' = xy, y(0)=1 trn on [0, 1] vi bc
chia h = 0.2 v so snh vi nghim chnh xc
x Euler Euler ci
tin
Runge -
Kutta
Nghim
chnh xc
0 1.000000 1.000000 1.000000
1.000000
0.2 1.000000 1.020000 1.020201
1.020201
0.4 1.040000 1.082832 1.083287
1.083287
0.6 1.123200 1.196313 1.197217
1.197217
0.8 1.257984 1.375281 1.377126
1.377128
1.0 1.459261 1.644836 1.648717
1.648721
2
2
x
e y =
Bi tp
y = 3y, y(0) = 1, h = 0.1, 0 s x s 1
i x Euler Euler ci tin Runge - Kutta
Nghim chnh
xc
0 0 1.000000 1.000000 1.000000 1.000000
1 0.1 1.300000 1.345000 1.349838 1.349859
2 0.2 1.690000 1.809025 1.822061 1.822119
3 0.3 2.197000 2.433139 2.459487 2.459603
4 0.4 2.856100 3.272571 3.319907 3.320117
5 0.5 3.712930 4.401609 4.481335 4.481689
6 0.6 4.826809 5.920164 6.049075 6.049647
7 0.7 6.274852 7.962620 8.165268 8.166170
8 0.8 8.157307 10.709724 11.021784 11.023176
9 0.9 10.604499 14.404579 14.877618 14.879732
10 1 13.785849 19.374158 20.082367 20.085537
32
9
Bi tp (tt)
( )
3
2 , 0 1, 0 0, 0.1
x
y xe y x y h
'
= s s = =
( ) ( )
2
1 , 2 3, 2 1, 0.1 y x y x y h
'
= + s s = =
( )
1 , 1 2, 1 2, 0.1
y
y x y h
x
' = + s s = =
( )
cos 2 sin3 , 0 1, 0 1, 0.1 y x x x y h
'
= + s s = =
nghim chnh xc
nghim chnh xc
nghim chnh xc
nghim chnh xc
( )
3 3 2
1 1 1
5 25 25
x x x
y x xe e e = +
( )
1
1
y x x
x
=

( )
ln 2 y x x x x = +
( )
1 1 4
sin 2 cos 3
2 3 3
y x x x = +
1/
2/
3/
4/
33
0
Bi tp (tt)
nghim chnh xc
nghim chnh xc
5/
6/
( ) ( ) 2 . 0 , 1 0 , 1 0 , 0 1
2
= = s s = + +
'
h y x y x y
2 2
2
2
+ +
=
x x
y
( ) ( ) 25 . 0 , 1 0 , 1 0 , 2 = = s s =
'
h y x y x y
2 3
2
+ =

x e y
x
( )
3
2 , 0 1, 0 0, 0.1
x
y xe y x y h
'
= s s = =
nghim chnh xc ( )
3 3 2
1 1 1
5 25 25
x x x
y x xe e e = +
x Euler Euler ci tin Runge - Kutta
Nghim chnh xc
0 0 0 0 0
0.1 0 0.007 0.005755 0.005752
0.2 0.013 0.029 0.026819 0.026813
0.3 0.047 0.075 0.071155 0.071145
0.4 0.112 0.158 0.150795 0.150778
0.5 0.222 0.295 0.283643 0.283617
0.6 0.402 0.513 0.496060 0.496020
0.7 0.684 0.851 0.826540 0.826481
0.8 1.119 1.368 1.330944 1.330857
0.9 1.777 2.144 2.089902 2.089774
1 2.761 3.298 3.219283 3.219099
( ) ( )
2
1 , 2 3, 2 1, 0.1 y x y x y h
'
= + s s = =
nghim chnh xc ( )
1
1
y x x
x
=

x Euler Euler ci tin Runge - Kutta


Nghim chnh xc
2 1 1 1 1
2.1 1.2 1.191 1.190909 1.190909
2.2 1.381 1.366 1.366666 1.366667
2.3 1.548 1.530 1.530769 1.530769
2.4 1.705 1.685 1.685714 1.685714
2.5 1.853 1.833 1.833333 1.833333
2.6 1.995 1.974 1.975000 1.975000
2.7 2.131 2.111 2.111764 2.111765
2.8 2.264 2.244 2.244444 2.244444
2.9 2.393 2.373 2.373684 2.373684
3 2.518 2.499 2.500000 2.500000
( )
1 , 1 2, 1 2, 0.1
y
y x y h
x
' = + s s = =
nghim chnh xc ( )
ln 2 y x x x x = +
i x Euler
Euler ci
tin Runge - Kutta
Nghim chnh
xc
0 1 2 2 2 2
1 1.1 2.3000 2.3045 2.304841 2.304841
2 1.2 2.6091 2.6182 2.618785 2.618786
3 1.3 2.9265 2.9402 2.941073 2.941074
4 1.4 3.2516 3.2700 3.271060 3.271061
5 1.5 3.5839 3.6069 3.608197 3.608198
6 1.6 3.9228 3.9505 3.952005 3.952006
7 1.7 4.2680 4.3003 4.302067 4.302068
8 1.8 4.6191 4.6561 4.658015 4.658016
9 1.9 4.9757 5.0174 5.019521 5.019522
10 2 5.3375 5.3839 5.386293 5.386294
nghim chnh xc
i x Euler Euler ci tin Runge - Kutta
Nghim chnh
xc
0
0 1 1 1 1
1
0.1 1.1 1.1 1.1142 1.1142
2
0.2 1.2276 1.2276 1.2529 1.2529
3
0.3 1.3761 1.3761 1.4085 1.4085
4
0.4 1.5370 1.5370 1.5712 1.5712
5
0.5 1.6999 1.6999 1.7305 1.7305
6
0.6 1.8536 1.8536 1.8751 1.8751
7
0.7 1.9873 1.9873 1.9943 1.9943
8
0.8 2.0906 2.0906 2.0789 2.0789
9
0.9 2.1552 2.1552 2.1216 2.1216
10
1 2.1752 2.1752 2.1180 2.1180
( )
cos 2 sin3 , 0 1, 0 1, 0.1 y x x x y h
'
= + s s = =
( )
1 1 4
sin 2 cos3
2 3 3
y x x x = +
33
5
i x Euler
Euler ci
tin
Runge -
Kutta
Nghim
chnh xc
0 0 1 1 1 1
1 0.2 0.8 0.872 0.81969 0.81967
2 0.4 0.6464 0.7579 0.67570 0.67568
3 0.6 0.52941 0.65808 0.56182 0.56180
4 0.8 0.43972 0.57172 0.47172 0.47170
5 1 0.37011 0.4975 0.40002 0.4
nghim chnh xc
( ) ( ) 2 . 0 , 1 0 , 1 0 , 0 1
2
= = s s = + +
'
h y x y x y
2 2
2
2
+ +
=
x x
y
33
6
nghim chnh xc
( ) ( ) 25 . 0 , 1 0 , 1 0 , 2 = = s s =
'
h y x y x y
2 3
2
+ =

x e y
x
i x Euler
Euler ci
tin
Runge -
Kutta
Nghim
chnh xc
0 0 1 1 1 1
1 0.25
0.875000 0.890625 0.897491 0.897491
2 0.5
0.796875 0.820557 0.836404 0.836402
3 0.75
0.759766 0.785496 0.811870 0.811868
4 1
0.758545 0.781613 0.819594 0.819592
33
7
H phng trnh vi phn
Bi ton Cauchy cho h m phng trnh vi phn bc nht
( )
( )
( )
1 1 1 2
2 2 1 2
1 2
, , ,...,
, , ,...,
, , ,...,
m
m
m m m
y f x y y y
y f x y y y
y f x y y y
'
=

'
=

'
=


vi a s x s b v tha cc iu kin ban u
( ) ( ) ( )
1 1 2 2
, , ,
m m
y a y a y a = o = o = o
Gi thit: bi ton duy nht nghim
33
8
H phng trnh vi phn (tt)
Chia on [a, b] thnh n on bng nhau
b a
h
n

=
x
0
= a, x
j
= x
0
+ jh, j=0, 1,, n
Gi tr gn ng ca hm y
i
(x) ti im x
j
l y
ij
~ y
i
(x
j
)
Gi thit rng cc gi tr y
1j
, y
2j
,, y
mj
c tnh
i vi phng trnh vi phn bc cao, ta gii hn vic
tm nghim gn ng bng cch chuyn v h phng
trnh vi phn bc nht
33
9
H phng trnh vi phn (tt)
Cng thc Euler
( ) ( )
1 , 1 1 2
, , ,...,
1, 2,..., ; 0,1, 2,..., 1
i j i j ij i j j j mj
y x y y hf x y y y
i m j n
+ +

~ = +

= =

Cng thc Euler ci tin


( )
( )
( ) ( )
1, 1 2
2, 1 1,1 2 1,2 1,
1 , 1 1, 2,
, , ,...,
, , ,...,
2
i i j j j mj
i i j j j mj m
i j i j ij i i
K hf x y y y
K hf x h y K y K y K
y x y y K K
+ +

= + + + +

~ = + +

34
0
H phng trnh vi phn (tt)
Cng thc Runge Kutta bc bn
( )
( )
1, 1 2
1,1 1,2 1,
2, 1 2
2,1 2,2 2,
3, 1 2
4, 1 3,1 2 3,2 3,
, 1 1, 2,
, , ,...,
, , ,...,
2 2 2 2
, , ,...,
2 2 2 2
, , ,...,
1
2 2
6
i i j j j mj
m
i i j j j mj
m
i i j j j mj
i i j j j mj m
i j ij i i
K hf x y y y
K K K
h
K hf x y y y
K K K
h
K hf x y y y
K hf x h y K y K y K
y y K K
+
=
| |
= + + + +
|
\ .
| |
= + + + +
|
\ .
= + + + +
= + + +
( )
3, 4, i i
K K

34
1
V d phng php Euler
( ) ( )
( )
( )
2 2
1 1 2 1
2 2
2 1 2 2
3 2 2 1 , 0 1, 0 1
4 2 4 , 0 1, 0 1
x
x
y y y x e x y
y y y x x e x y

'
= + + s s =

'
= + + s s =

vi h = 0.25
( )
( )
5 2
1
5 2 2
2
1 1
3 3
1 2
3 3
x x x
x x x
y x e e e
y x e e x e

= +
= + +
x y
1
y
2
0 1 1
0.25
0.5
0.75
1
So snh vi nghim chnh xc
2 3.25
24.5946 32.8976
4.6613 7.4794
10.8776 15.8793
34
2
H phng trnh vi phn (tt)
( ) ( ) ( ) ( ) | |
( ) ( ) ( ) ( ) | |
0 2 0 1 0 2 0 2 0 2
0 2 0 1 0 1 0 1 0 1
, ,
, ,
x y x y x hf x y h x y
x y x y x hf x y h x y
+ = +
+ = +
( ) ( )
( )
( )
2 2
1 1 2 1
2 2
2 1 2 2
3 2 2 1 , 0 1, 0 1
4 2 4 , 0 1, 0 1
x
x
y y y x e x y
y y y x x e x y

'
= + + s s =

'
= + + s s =

( ) ( ) ( ) ( ) ( ) ( ) | |
( ) ( ) ( ) ( ) ( ) ( ) | |
0
0
2
0
2
0 0 2 0 1 2 2
2 2
0 0 2 0 1 1 1
4 2 4 25 . 0 0 25 . 0
1 2 2 3 25 . 0 0 25 . 0
x
x
e x x x y x y y y
e x x y x y y y
+ + + =
+ + + =
( ) ( ) ( ) ( ) ( ) ( ) | |
( ) ( ) ( ) ( ) ( ) ( ) | |
1
1
2
1
2
1 1 2 1 1 2 2
2 2
1 1 2 1 1 1 1
4 2 4 25 . 0 25 . 0 5 . 0
1 2 2 3 25 . 0 25 . 0 5 . 0
x
x
e x x x y x y y y
e x x y x y y y
+ + + =
+ + + =
Bi tp
( )
( )
1 1 1 2
2 1 2 2
0 1, 0 1 3 4 ,
3 3 , 0 1, 0 0
x y y y y
y y y x y
' s s = = +

' = s s =

vi h = 0.1
j x
j
y
1
y
2
0 0 1 0
1 0.1 1.3000 0.3000
2 0.2 1.5700 0.6000
3 0.3 1.8010 0.8910
4 0.4 1.9849 1.1640
5 0.5 2.1148 1.4103
6 0.6 2.1851 1.6216
7 0.7 2.1920 1.7907
8 0.8 2.1333 1.9111
9 0.9 2.0089 1.9777
10 1 1.8204 1.9871
34
4
Bi ton Cauchy
Bi ton vi iu kin ban u
( ) ( ) ( )
( )
0
, , y x f x y x a x b
y a y
'
= s s

Mc ch ca li gii s:
Tm tt c cc gi tr y
0
, y
1
, , y
n
ti cc nt li
a = x
0
< x
1
< <x
n
=b, y(x
i
) ~ y
i
Nu x
k
= x
0
+ kh, h=(b a)/n li u
Chia [a, b] lm n on: h=(b a)/n, x
k
= a+kh
Cc phng php gii phng trnh vi phn thng
( )
( )
( )
1
2 1
1 1 2
,
,
2
k
k k
k k
k k
k k
k k
K hf x y
K hf x h y K
y y K K
+
=
= + +
= + +
( ) ( )
( )
0
, y x f x y
y a y
'
=

( )
1
,
k k k k
y y hf x y
+
= +
Tm y(x) trn [a, b]
( )
( )
( )
1
1
2
2
3
4 3
1 1 2 3 4
,
,
2 2
,
2 2
,
1
2 2
6
k
k k
k
k
k k
k
k
k k
k k
k k
k k k k
k k
K hf x y
K
h
K hf x y
K
h
K hf x y
K hf x h y K
y y K K K K
+
=
| |
= + +
|
\ .
| |
= + +
|
\ .
= + +
= + + + +
Bi ton Cauchy
Phng php Euler
Phng php
Euler ci tin
Phng php Runge - Kutta
34
6
H phng trnh vi phn
Bi ton Cauchy cho h m phng trnh vi phn bc nht
( )
( )
( )
1 1 1 2
2 2 1 2
1 2
, , ,...,
, , ,...,
, , ,...,
m
m
m m m
y f x y y y
y f x y y y
y f x y y y
'
=

'
=

'
=


vi a s x s b v tha cc iu kin ban u
( ) ( ) ( )
1 1 2 2
, , ,
m m
y a y a y a = o = o = o
Gi thit: bi ton duy nht nghim
34
7
H phng trnh vi phn (tt)
Cng thc Euler
( ) ( )
1 , 1 1 2
, , ,...,
1, 2,..., ; 0,1, 2,..., 1
i j i j ij i j j j mj
y x y y hf x y y y
i m j n
+ +

~ = +

= =

Cng thc Euler ci tin


( )
( )
( ) ( )
1, 1 2
2, 1 1,1 2 1,2 1,
1 , 1 1, 2,
, , ,...,
, , ,...,
2
i i j j j mj
i i j j j mj m
i j i j ij i i
K hf x y y y
K hf x h y K y K y K
y x y y K K
+ +

= + + + +

~ = + +

34
8
Ni dung
A. Bi ton Cauchy
1/ Cng thc Euler
2/ Cng thc Euler ci tin v Runge Kutta
3/ H phng trnh vi phn thng
4/ Phng trnh vi phn bc cao
B. Bi ton bin:
1/ Phng php sai phn hu hn
34
9
Phng trnh vi phn bc cao
Phng trnh vi phn bc m
( )
( )
( )
( )
1
, , ,..., ,
m m
x b y x f x y y y a

s s
'
=
vi cc iu kin ban u
( ) ( )
( )
( )
1
1 2
, , ,
m
m
y a y a y a

' = o = o = o
S dng php i bin
( ) ( ) ( ) ( ) ( )
( )
( )
1
1 2
, , ,
m
m
y x y x y x y x y x y x

' = = =
35
0
Phng trnh vi phn bc cao (tt)
Khi
( )
( )
( )
( )
( )
( )
1 1 1 2 2
2 2 1 2 3
1 1 1 2
1
1 2
, , , ,
, , , ,
, , , ,
, , , , , , , ,
m
m
m m m m
m
m m m
y f x y y y y
y f x y y y y
y f x y y y y
y f x y y y f x y y y

'
= =

'
= =

'
= =

' ' ''


= =


v tha cc iu kin ban u
( ) ( ) ( ) ( ) ( )
( )
( )
1
1 1 2 2
, , ,
m
m m
y a y a y a y a y a y a

' = = o = = o = = o
35
1
V d
Vi h = 0.1, tnh xp x gi tr y(0.1), y(0.1) ca nghim bi
ton sau bng phng php Euler:
2
2 2 sin
x
y y y e x '' ' + =
iu kin ban u: y(0) = 0.4 , y(0) = 0.6
i bin a v bi ton Cauchy cp 1: y
1
= y(x), y
2
= y(x)
( )
( )
1
2
0 0.4
0 0.6
y
y
=
=
( ) ( )
( ) ( ) ( )
1 2
2
2 1 2
2 2 sin
x
y x y x
y x y x y x e x
'
=

' = + +

v
i x
i
y
1
= y (x
i
) y
2
= y (x
i
)
0 0 0.4000 0.6000
1 0.1
2 0.2
3 0.3
4 0.4
5 0.5
6 0.6
7 0.7
8 0.8
9 0.9
10 1
( )
( )
1
2
0 0.4
0 0.6
y
y
=
=
( ) ( )
( ) ( ) ( )
1 2
2
2 1 2
2 2 sin
x
y x y x
y x y x y x e x
'
=

' = + +

v
0.5904 0.6621
0.4600 0.6400
0.5240 0.6638
0.6566 0.6226
0.7189 0.5292
0.7718 0.3609
0.8079 0.0913
0.8170 0.3133
0.7857 0.8947
0.6962 1.7046
35
3
Bi tp
Gii phng trnh bng phng php Euler vi h = 0.5
y + 0.5y' +sin y =0, y(0) = 1, y' (0) = 0
t y
1
= y, y
2
= y'
( ) ( )
( )
( )
( )
1 2
1
2
2 2 1
,
0 1
0 0
0.5 sin ,
y x y x
y
y
y x y y
'
=
=

= '
=

35
4
Bi tp
Gii phng trnh bng phng php Euler vi h = 0.5
y + 0.5y' +sin y =0, y(0) = 1, y' (0) = 0
t y
1
= y, y
2
= y'
( ) ( )
( )
( )
( )
1 2
1
2
2 2 1
,
0 1
0 0
0.5 sin ,
y x y x
y
y
y x y y
'
=
=

= '
=

i x
i
y
1
= y (x
i
) y
2
= y (x
i
)
0 0 1 0
1 0.5
2 1
1 0.421
0.7896 0.736
35
5
Bi tp (tt)
| |
( ) ( )
2 1, 0,1 , 0.25
0 1, 0 1,
y y xy x x h
y y
'' ' = + + e =

'
= =

( ) | |
( ) ( )
2
2, 0,1 , 0.25
0 8, 0 1
y y xy x h
y y

'' ' = + + e =

'
= =

35
6
Bi tp (tt)
Xt bi ton Cauchy i vi phng trnh vi phn
cp 2:
( ) ( ) ( ) | | ( )
( ) ( )

=
'
=
s +
'
+ =
' '
M x M x
t t t Mx t x M t t x
1 ; 2 1
; 1 , 4
2
Thc hin php i bin y(t) = x(t) v s dng cng
thc Euler, hy xp x gi tr ca hm x(t) v o hm
x(t) ti im t = 1.2 vi bc h = 0.2
M = 1.5
35
7
i x
i
y
1
= y (x
i
) y
2
= y (x
i
)
0 0 1 1
1 0.25
2 0.5
3 0.75
4 1
| |
( ) ( )
2 1, 0,1 , 0.25
0 1, 0 1,
y y xy x x h
y y
'' ' = + + e =

'
= =

t y
1
= y, y
2
= y'
( )
( )
1 2 1
2 2 2 1
0 1
0 1 2 1
y y y
y y y xy x
'
= =

' = = + +

1.25 1
1.500 1.203
1.8008 1.6914
2.2236 2.5770
35
8
( ) | |
( ) ( )
2
2, 0,1 , 0.25
0 8, 0 1
y y xy x h
y y

'' ' = + + e =

'
= =

t y
1
= y, y
2
= y'
( )
( )
( )
1 2
1
2
2
2 2 1
0 8
0 0
2
y y
y
y
y y xy
'
=

= '
= + +

i x
i
y
1
= y (x
i
) y
2
= y (x
i
)
0 0 8 1
1 0.25
2 0.5
3 0.75
4 1
8.250
1.75
8.6875 3.5313
9.5703 8.2346
11.6290 27.4812
35
9
Tnh gi tr ca x(t) v x(t) ti t = 1.2
( ) ( ) ( ) | | ( )
( ) ( )

= =
'
=
s +
'
+ =
' '
2 . 0 , 1 ; 2 1
; 1 , 4
2
h M x M x
t t t Mx t x M t t x
( ) ( )
( ) ( ) ( )

= = =
s + + =
'
=
'
2 . 0 , 5 . 1 ; 3
; 1 , 6 5 . 1
0 0
2
h y x
t t t x y t t y
t y t x
( )( ) | |

+ + + =
+ =
0 0
2
0 0 0 1
0 0 1
6 5 . 1 t x y t h y y
hy x x
x
1
= 3.3; y
1
= -0.775
36
0
Ni dung
A. Bi ton Cauchy
1/ Cng thc Euler
2/ Cng thc Euler ci tin v Runge Kutta
3/ H phng trnh vi phn thng
4/ Phng trnh vi phn bc cao
B. Bi ton bin:
1/ Phng php sai phn hu hn
36
1
Bi ton bin tuyn tnh cp hai
Bi ton Cauchy i vi phng trnh vi phn cp
hai i hi hai gi tr ti thi im ban u: y(x
0
)
v y(x
0
)
Nhiu bi ton trong thc t: cho iu kin gi tr
hm cn tm ti cc thi im khc nhau
Tm nghim gn ng ca bi ton bin
36
2
Bi ton bin tuyn tnh cp hai (tt)
Phng php sai phn hu hn
tng: xp x cc o hm bc nht v bc 2
ca y (x) bng sai phn hu hn ti cc im chia
Chia u on [a, b] thnh n on
( ) ( ) ( ) ( ) ( ) ( ) ( )
( ) ( )
,
,
p x y x q x y x r x y x f x a x b
y a y b
'' '
+ + = s s

= o = |

,
k
b a
h x a kh
n

= = +
36
3
Bi ton bin tuyn tnh cp hai (tt)
Ti cc im nt x
k
, k=1,2,, n1 bn trong on
[a, b] s dng cc cng thc sai phn hng tm
( )
( ) ( )
1 1
1 1
2 2
k k
k k
k
y x y x
y y
y x
h h
+
+


' ~ =
( )
( ) ( ) ( )
1 1
1 1
2 2
2
2
k k k
k k k
k
y x y x y x
y y y
y x
h h
+
+
+
+
'' ~ =
y
k
l gi tr xp x ca hm ti im x
k
Sai s ca cc cng thc xp x o hm O(h)
36
4
Bi ton bin tuyn tnh cp hai (tt)
1 1 1 1
2
2
2
k k k k k
k k k k k
y y y y y
p q r y f
h h
+ +
+
+ + = 1, 2,..., 1 k n =
( ) ( ) ( ) ( )
, , ,
k k k k k k k k
p p x q q x r r x f f x = = = =
B sung vo h phng trnh cc iu kin suy ra t cc iu
kin bin
0
1 1
2 2 2
,
2
,
2 2
1, 2,..., 1
n
k k k k k
k k k k k
y y
p q p p q
y r y y f
h h h h h
k n
+
= o = |

| | | | | |
+ + + =

| | |
\ . \ . \ .

Bi ton bin tuyn tnh cp hai (tt)


y = [y
1
, y
2
, , y
n1
]
T
l
nghim ca h phng trnh
tuyn tnh AY = B vi A l
ma trn 3 ng cho
1 1 1
1
2 2
2 2 2 2 2
2
2 2 2
1
1
2
2
0 0
2
2
0
2 2
2
0 0 0
n
n
p p q
r
h h h
p q p p q
r
A
h h h h h
p
r
h

| |
+
|
|
|
+
|
=
|
|
|

|
\ .

1 1
1 1
1
2
2
2
1
2
2
2
n n
n
n
p q
f
h h
f
B
f
p q
f
h h

| |
| |
o
| |
\ .
|
|
|
=
|
|
|
| |
|
+ |
|
|
\ .
\ .

36
6
V d
Gii bi ton bin sau bng phng php sai phn hu hn vi
bc chia h = 0.25
( )
( ) ( )
2
2 2 sin ln , 1 2
1 1, 2 2
x y xy y x x
y y
'' ' + = s s

= =

h = 0.25 n = 4 5 im chia H phng trnh 3 n


k x
k
p
k
q
k
r
k
f
k
1 1.25 1.5625 2.5 -2 0.2212
2 1.5 2.25 3 -2 0.3944
3 1.75 3.0625 3.5 -2 0.5308
1 1 1
1
2 2
2 2 2 2 2
2
2 2 2
1
1
2
2
0 0
2
2
0
2 2
2
0 0 0
n
n
p p q
r
h h h
p q p p q
r
A
h h h h h
p
r
h

| |
+
|
|
|
+
|
=
|
|
|

|
\ .

1 1 1
1
2 2
2 2 2 2 2
2
2 2 2
3 3 3
3
2 2
2
0
2
2
2 2
2
0
2
p p q
r
h h h
p q p p q
A r
h h h h h
p q p
r
h h h
| |
+
|
|
|
= +
|
|
|

|
\ .
1 1
1 1
1
2
2
2
1
2
2
2
n n
n
n
p q
f
h h
f
B
f
p q
f
h h

| |
| |
o
| |
\ .
|
|
|
=
|
|
|
| |
|
+ |
|
|
\ .
\ .

3 3
1 1
1
2
2
3
2
2
2
p q
f
h h
B f
p q
f
h h
| |
| |
o |
|
\ .
|
|
=
|
|
| |
+ |
| |
\ .
\ .
52 30 0
30 74 42
0 42 100
A

| |
|
=
|
|

\ .
19.7787
0.3944
111.4691
B

| |
|
=
|
|

\ .
1.2347
1.4809
1.7367
y
| |
|
=
|
|
\ .
36
9
V d
Gii bi ton bin sau bng phng php sai phn hu hn vi
bc chia h = 0.2
( )
( ) ( )
2
2 2 sin ln , 1 2
1 1, 2 2
x y xy y x x
y y
'' ' + = s s

= =

h = 0.2 n = 5 6 im chia H phng trnh 4 n


k x
k
p
k
q
k
r
k
f
k
1 1.2 1.44 2.4 2 0.1813
2 1.4 1.96 2.8 2 0.3302
3 1.6 2.56 3.2 2 0.4529
4 1.8 3.24 3.6 2 0.5545
1 1 1
1
2 2
2 2 2 2 2
2
2 2 2
1
1
2
2
0 0
2
2
0
2 2
2
0 0 0
n
n
p p q
r
h h h
p q p p q
r
A
h h h h h
p
r
h

| |
+
|
|
|
+
|
=
|
|
|

|
\ .

1 1 1
1
2 2
2 2 2 2 2
2
2 2 2
3 3 3 3 3
3
2 2 2
4 4 4
4
2 2
2
0 0
2
2
0
2 2
2
0
2 2
2
0 0
2
p p q
r
h h h
p q p p q
r
h h h h h
A
p q p p q
r
h h h h h
p q p
r
h h h
| |
+
|
|
|
+
|
=
|
|
+
|
|
|

\ .
1 1
1 1
1
2
2
2
1
2
2
2
n n
n
n
p q
f
h h
f
B
f
p q
f
h h

| |
| |
o
| |
\ .
|
|
|
=
|
|
|
| |
|
+ |
|
|
\ .
\ .

4 4
1 1
1
2
2
3
4
2
2
2
p q
f
h h
f
B
f
p q
f
h h
| |
| |
o
| |
\ .
|
|
= |
|
|
| |
|
+ |
|
|
\ .
\ .
74 42 0 0
42 100 56 0
0 56 130 72
0 0 72 164
A

| |
|

|
=
|

\ .
29.8187
0.3302
0.4529
179.4455
B

| |
|
|
=
|
|

\ .
1.1869
1.3813
1.5823
1.7888
y
| |
|
|
=
|
|
\ .
37
2
V d
S dng phng php sai phn hu hn gii cc
bi ton bin
( ) ( )
2
ln 1, 1 2
1 2 0
y x y x x
y y
'' = + s s

= =

h = 0.25
( )
( ) ( )
1 1, 0 1
0 1 0
y y x y x x
y y
'' '
+ = s s

= =

h = 0.25
37
3
k x
k
p
k
q
k
r
k
f
k
1 1.25 1 0 1.5625 1.2231
2
1.50 1 0 2.2500 1.4055
3
1.75 1 0 3.0625 1.5596
( ) ( )
2
ln 1, 1 2
1 2 0
y x y x x
y y
'' = + s s

= =

h = 0.25
33.5625 16 0
16 34.25 16
0 16 35.0625
A

| |
|
=
|
|

\ .
1.2231
1.4055
1.5596
B
| |
|
=
|
|
\ .
( )
0.1031, 0.1398, 0.1083
T
y =
37
4
( )
( ) ( )
1 1, 0 1
0 1 0
y y x y x x
y y
'' '
+ = s s

= =

h = 0.25
k x
k
p
k
q
k
r
k
f
k
1 0.25 1 1 1.25 0.75
2
0.50 1
1
1.50 0.50
3
0.75 1
1
1.75 0.25
30.75 14 0
18 30.5 14
0 18 30.25
A

| |
|
=
|
|

\ .
0.75
0.50
0.25
B

| |
|
=
|
|

\ .
( )
0.0588, 0.0755, 0.0532
T
y =
37
5
Bi tp
( ) ( )
2
1, 2 3
2 2, 3 3
y xy x y x x
y y
'' ' + = s s

= =

h = 0.25
k x
k
p
k
q
k
r
k
f
k
1 2.25 1 2.25 5.0625 0.75
2
2.50 1 2.50 6.2500 0.50
3
2.75 1 2.75 7.5625 0.25
37
6
M = 1.5
( ) ( )

= = =
=
'
+
' '
5 . 0 , 2 , 0 0
5 16
2 2
h M y y
x M y y x M y x
k x
k
p
k
q
k
r
k
f
k
1 0. 5 0.25 0.75 -16 -1.875
2
1 1
1.5
-16 -7.5
3
1.5 2.25
2.25
-16 -16.875
37
7
M = 1.5
( ) ( )

= = =
=
'
+
' '
5 . 0 , 2 , 0 0
5 16
2 2
h M y y
x M y y x M y x
k x
k
p
k
q
k
r
k
f
k
1 0. 5 0.25 0.75 -16 -1.875
2
1 1
1.5
-16 -7.5
3
1.5 2.25
2.25
-16 -16.875
|
|
|
.
|

\
|



=
75 . 33 34 75 . 6 0
5 . 7 5 . 5 24 5 . 2
875 . 1 0 75 . 1 18
A
y = (0.1609, 0.5833, 1.1084)
T
V d
Phng trnh chuyn ng
1
z
u u u p
u w k
x z z z x
c c c c c
+ =
c c c c c
Phng trnh truyn nhit
z
u w k
x z z z
0 0 0 c c c c
+ =
c c c c
Phng trnh thy tnh
1
a
p g
z T
0

c
=
c
Phng trnh cn bng ng nng ri
2
2
1
z
z z
a z
c b gk b b b du
u w a k k
x z z z dz T z k
c
0 c c c c c
+ = +
c c c c c
Phng trnh lin tc
0
du dw
dx dz
+ =
H thc Kolmogorov
2
z
c b
k
c
c =
Phng trnh vn ti cht
z y
q q q q
u w k k q
x z z z y y
o
c c c c c c
+ = +
c c c c c c
37
9
26.9375 11.5 0
21 25.75 11
0 21.5 24.4375
A

| |
|
=
|
|

\ .
39.75
1.50
29.75
B

| |
|
=
|
|

\ .
( )
4.0514, 6.0334, 6.5255
T
y =
Chng 6. Gii phng trnh o
hm ring
38
1
Ni dung
1/ Tng quan: Gii thiu 3 bi ton c bn
2/ Phng trnh elliptic
3/ Phng trnh parabolic
4/ Phng trnh hyperbolic: Gii thiu vn tt.
Bi tp n Chng 5 v 6. Tng kt
38
2
Ba dng phng trnh o hm ring
c bn
Phng trnh ny s l:
Elliptic: a
12
a
11
a
22
< 0
Parabolic: a
12
a
11
a
22
= 0
Hyperbolic: a
12
a
11
a
22
> 0
2 2 2
2 2
, , , , , , , 0
u u u u u
F x y u
x y x x y y
| | c c c c c
=
|
c c c c c c
\ .
Phng trnh tuyn tnh i vi cc o hm ring cp 2:
Phng trnh o hm ring bc hai ca hm 2 bin:
2 2 2
11 12 22
2 2
2 , , , , 0
u u u u u
a a a F x y u
x x y y x y
| | c c c c c
+ + + =
|
c c c c c c
\ .
38
3
Ba dng phng trnh o hm ring
c bn (tt)
Phng trnh elliptic
(tnh static):
( ) y x f
y
u
x
u
,
2
2
2
2
=
c
c
+
c
c
Phng trnh parabolic
(truyn nhit):
Phng trnh hyperbolic
(truyn sng):
( )
2
2
2
,
u u
f x t
t x
c c
=
c c
2 2
2
2 2
0
u u
a
t x
c c
=
c c
38
4
Ba dng phng trnh o hm ring
c bn (tt)
Xp x o hm ring:
( )
( ) ( )
t
t x u t t x u
t x
t
u
A
A +
~
c
c , ,
,
( ) ( ) ( ) ( ) ( )
( )
2
4 3 2 1
2
2
2
2
4
x
P u P u P u P u P u
y
u
x
u
A
+ + +
~
c
c
+
c
c
( )
( ) ( ) ( )
( )
2 2
2
, , 2 ,
,
x
y x x u y x u y x x u
y x
x
u
A
A + A +
~
c
c
Phng trnh elliptic
Min ch nht
( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
2 2
2 2
1 2
1 2
( , ), ,
, , [ , ]
, , [ , ]
u u
f x y x y D
x y
u a y y u b y y y c d
u x c x u x d x x a b
c c
+ = e

c c

= = e

= = e

x
0
=a x
1
x
i
x
n
=b
x
y
0
=c
y
1
y
j
y
m
=d
y
D
1 2
2
1
a x b
D
c y d
< <

=
`
< <
)
Tm hm u (x,y) xc nh trn min D
tha phng trnh Poisson v iu
kin bin
Chia u [a, b] thnh n on, [c, d] lm m on.
( )
( )
0 0
0 0
/ , ,
/ , ,
i
j
x b a n x a x x i x
y d c m y c y y j y
A = = = + A
A = = = + A
im c ta (x
i
, y
j
) nt
Tp hp cc nt li ca
min D
x
0
=a x
1
x
i
x
n
=b
x
y
0
=c
y
1
y
j
y
m
=d
y
D
1 2
2
1
38
7
Phng trnh elliptic (tt)
Gi u
ij
~ u (x
i
, y
j
) l gi tr gn ng ca hm ti nt, i =
0,1,n; j = 0,1,,m.
T iu kin bin
Cn xc nh: cc gi tr u
ij
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )

=
)
`

= = =
= = =
=

= = =
= = =
n i
x u y x u d x u
x u y x u c x u
m j
y u y x u y b u
y u y x u y a u
i im m i i
i i i i
j nj j n j
j j j j
,..., 1 , 0
, ,
, ,
,..., 1 , 0
, ,
, ,
2
1 0 0
2
1 0 0

38
8
Phng trnh elliptic (tt)
Xp x o hm ring cp 2
bng cc cng thc sai phn
hng tm:
S hnh ch thp
( )
( )
2
1 , 1 ,
2
2
2
, 1 , 1
2
2
2 ,
2 ,
y
u u u
y
y x u
x
u u u
x
y x u
j i ij j i j i
j i ij j i j i
A
+
~
c
c
A
+
~
c
c
+
+
38
9
Phng trnh elliptic (tt)
t f
ij
~ f (x
i
, y
j
)
1, 1, , 1 , 1
2 2
2 2
1, 2,..., 1, 1, 2,..., 1
i j ij i j i j ij i j
ij
u u u u u u
f
x y
i n j m
+ +
+ +

+ =

A A

= =

Trng hp x =y = h
2
1, 1, , 1 , 1
4
1, 2,..., 1, 1, 2,..., 1
ij i j i j i j i j ij
u u u u u h f
i n j m
+ +
+ + + + =

= =

y l h phng trnh tuyn tnh gm (n1) (m1) phng


trnh, n l u
ij
39
0
Phng trnh elliptic (tt)
thun tin trong cch vit
ma trn h s ca h, ta k
hiu:
P
k
= (x
i
, y
j
) v w
k
= u
ij
k = (i 1) (m 1) + j
x
y
P
1
P
2
P
3
P
5
P
6
P
7
P
9
P
10
P
11
P
13
P
14
P
15
P
17
P
18
P
19
P
4
P
8
P
12
P
16
P
20
nh s th t cc im
nt theo th t t di ln
trn v t tri qua phi
39
1
Phng trnh elliptic V d
Gii bi ton
2 2
2 2
0, 0 1, 0 1
( , 0) 0 ( ,1) 0 1
(0, ) 0 (1, ) 0 1
u u
x y
x y
u x u x x x
u y u y y y
c c
+ = < < < <

c c

= = s s

= = s s

vi li u, h = 1/3
x = y = h = 1/3 n = m = 3,
x
i
= i/3, y
j
= j/3
iu kin bin:
u
0j
= 0, u
3j
= j/3
u
i0
= 0, u
i3
= i/3
0
1/3 2/3
0
1/3
2/3
1
0
0
0 0 0
P
1
P
2
P
3
P
4
x
y
39
2
Phng trnh elliptic V d (tt)
Hm f(x,y) = 0 f
ij
= 0
Theo cch nh s
w
1
= u
11
, w
2
= u
12
,
w
3
= u
21
, w
4
= u
22
0
1/3 2/3
0
1/3
2/3
1
0
0
0 0 0
P
1
P
2
P
3
P
4
x
y
2
1 2 3 11 01 10
2
2 1 4 12 13 02
2
3 1 4 21 31 20
2
4 2 3 22 32 23
4
4
4
4
w w w h f u u
w w w h f u u
w w w h f u u
w w w h f u u
+ + =

+ + =

+ + =

+ + =

( )
4 1 1 0 0
1 4 0 1 1 3
1 0 4 1 1 3
0 1 1 4 4 3
A b

| |
|

|
=
|

|

\ .
u
11
= 0.1111, u
12
= u
21
= 0.2222, u
22
= 0.4444
39
3
Phng trnh elliptic V d (tt)
Gii bi ton vi
li u, h = 1/3
2 2
2 2
2 2
2
2
2 2 , 0 1, 0 1
( , 0) 0 ( ,1) 0 1
(0, ) 0 (1, ) 0 1
u u
x y x y
x y
u x u x x x
u y u y y y
c c
+ = + < < < <

c c

= = s s

= = s s

x=y=h=1/3 n = m = 3,
x
i
= i/3, y
j
= j/3
iu kin bin:
u
0j
= 0, u
3j
= j/9
u
i0
= 0, u
i3
= i/9
0
1/9 4/9
0
1/9
4/9
1
0
0
0 0 0
P
1
P
2
P
3
P
4
x
y
39
4
Phng trnh elliptic V d (tt)
Theo cch nh s
w
1
= u
11
, w
2
= u
12
,
w
3
= u
21
, w
4
= u
22
2
1 2 3 11 01 10
2
2 1 4 12 13 02
2
3 1 4 21 31 20
2
4 2 3 22 32 23
4
4
4
4
w w w h f u u
w w w h f u u
w w w h f u u
w w w h f u u
+ + =

+ + =

+ + =

+ + =

( )
4 1 1 0 4/ 81
1 4 0 1 1 81
1 0 4 1 1 81
0 1 1 4 56 81
A b

| |
|

|
=
|

|

\ .
u
11
= 1/81, u
12
= u
21
= 4/81, u
22
= 16/81
0
1/9 4/9
0
1/9
4/9
1
0
0
0 0 0
P
1
P
2
P
3
P
4
x
y
39
5
Phng trnh elliptic V d (tt)
|
|
|
|
|
.
|

\
|

4 1 1 0
1 4 0 1
1 0 4 1
0 1 1 4
=
|
|
|
|
|
.
|

\
|

1 7 2 15 4 0
0 1 15 1 4 1
0 0 1 4 1
0 0 0 1
-
|
|
|
|
|
.
|

\
|

7 24 0 0 0
15 16 15 56 0 0
1 4 1 4 15 0
0 1 1 4
39
6
Phng trnh elliptic V d (tt)
Gii bi ton vi li u, h = 1/3
2 2
2
2 2
2 2 1
2 , 0 1, 2 3
( , 2) 4 ( , 3) 9 0 1
(0, ) (1, ) 2 3
x x
x x
u u
e y e x y
x y
u x e u x e x
u y y u y y e y

c c
+ = + < < < <

c c

= = s s

= = s s

39
7
Phng trnh elliptic V d (tt)
2 2
2 2
2 2
10 , 0 1, 0 1
( , 0) 5 ( ,1) 5 1 0 1
(0, ) (1, ) 5 0 1
u u
xy x y
x y
u x x u x x x
u y y u y y y
c c
+ = < < < <

c c

= = + s s

= = + s s

Gii bi ton vi li u, h = 1/3


39
8
Phng trnh elliptic V d (tt)
Cho hm hai bin u(x, y) xc nh trong min
( ) ( )
( ) ( ) ( )
( ) ( )

= =
= =
e + =
c
c
+
c
c
0 1 , 0 ,
1 , 1 0 , 0
, , 1
2
2
2
2
2
2
2
2
x u Mx x u
y M y u y u
D y x y Mx
y
u
x
u
tha bi ton bin ca phng trnh elliptic
)
`

s s
s s
=
1 0
1 0
y
x
D
S dng phng php sai phn hu hn, hy xp x u (x, y)
trong min D vi bc Ax = Ay = 1/3; M = 2.0
39
9
( )
|
|
|
|
|
.
|

\
|


=
0802 . 0 4 1 1 0
2099 . 1 1 4 0 1
0309 . 0 1 0 4 1
0988 . 0 0 1 1 4
b A
( ) ( )
( ) ( ) 1258 . 0 , 3665 . 0 ,
5633 . 0 , 1304 . 0 ,
3
2
3
2
3
1
3
2
3
2
3
1
3
1
3
1
= =
= =
u u
u u
40
0
Phng trnh parabolic
Tm hm u (x,t) xc
nh trong min D =
{a < x < b, t > 0}
tha phng trnh
truyn nhit cng
iu kin bin v iu
kin ban u:
( )
( ) ( ) ( ) ( )
( ) ( ) | |
2
2
2
1 2
, ,
, , , 0
, 0 ,
u u
f x t x t D
t x
u a t t u b t t t
u x x x a b
c c
= e

c c

= = >

= e

Chia u [a, b] thnh n on


( )
0 0
/ , ,
i
x b a n x a x x i x A = = = + A
Chn bc thi gian t v t t
j
= j t
Tp cc nt (x
i
, t
j
) to thnh li ca min D
40
1
Phng trnh parabolic li tnh

.
.
40
2
Phng trnh parabolic (tt)
Gi u
ij
~ u (x
i
, t
j
). T iu kin bin v iu kin ban u
Xp x o hm cp 2 theo x bng cng thc sai phn hng tm:
( )
2
1, 1,
2 2
2
,
i j ij i j
i j
u u u
u
x t
x x
+
+
c
~
c A
Xp x o hm cp 1 theo bin thi gian t bng cng thc
sai phn tin hoc li
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )

= = = =
=

= = =
= = =
n i x u t x u x u
j
t u t x u t b u
t u t x u t a u
i i i i
j nj j n j
j j j j
,..., 1 , 0 , 0 ,
,... 1 , 0
, ,
, ,
1 0 0
2
1 0 0
40
3
Phng trnh parabolic s hin
S dng cng thc sai phn tin
x
i
t
j
t
j+1
x
i 1
x
i +1
u
i 1,j u
i ,j
u
i +1,j
u
i ,j +1
x
t
( )
, 1
,
i j ij
i j
u u
u
x t
t t
+

c
~
c A
, 1 1, 1, 2
2
2
,
0,1, 2,...; 1, 2,..., 1
i j ij i j ij i j
ij
u u u u u
f
t x
j i n
+ +
+
=
A A
= =
( )
, 1 1, 1,
1 2
0,1, 2,...; 1, 2,..., 1
i j i j ij i j ij
u u u u t f
j i n
+ +
= + + + A
= =
2
2
t
x
A
=
A
40
4
V d s hin
At = 0.1, Ax = 0.2
n thi im t = 0.2
( ) ( )
( )
2
2
cos , 0 1, 0
0, 0, 1, sin , 0
, 0 0, 0 1
u u
x t x t
t x
u t u t t t
u x x
c c
= < < >

c c

= = >

= s s

( )
, 1 1, 1,
1 2
0,1, 2,...; 1, 2,..., 1
i j i j ij i j ij
u u u u t f
j i n
+ +
= + + + A
= =
2
2
t
x
A
=
A
40
5
V d s hin (tt)
i = 1, j = 0
( ) ( )
( )
2
2
cos , 0 1, 0
0, 0, 1, sin , 0
, 0 0, 0 1
u u
x t x t
t x
u t u t t t
u x x
c c
= < < >

c c

= = >

= s s

( )
, 1 1, 1,
1 2
i j i j ij i j ij
u u u u t f
+ +
= + + + A
2
2 2
0.1
2.5
0.2
t
x
A
= = =
A
( )
1,1 00 10 20 10
1 2 u u u u t f = + + + A
At = 0.1, Ax = 0.2
n thi im t = 0.2
i = 2, j = 0
( )
2,1 10 20 30 20
1 2 u u u u t f = + + + A
= 0.020
= 0.040
i = 3, j = 0
( )
3,1 20 30 40 30
1 2 u u u u t f = + + + A = 0.060
40
6
V d s hin (tt)
i 0 1 2 3 4 5
j
t
x
0 0.2 0.4 0.6 0.8 1
0 0
0 0.0000 0.0000 0.0000 0.0000 0.0000
1 0.1
0 0.0998
2 0.2
0 0.1987
3 0.3
0 0.2955
0.0200 0.0400 0.0600 0.0800
0.0595 0.1190 0.1775 0.2376
0.0399 0.0798 0.1197 0.1592
40
7
V d s hin (tt)
At = 0.2, Ax = 0.5
n thi im t = 0.2
( ) ( )
( ) ( )
2
2
, 0 1.5, 0
0, 0, 1.5, 0, 0
, 0 1.5 , 0 1.5
u u
xt x t
t x
u t u t t
u x x x x
c c
= < < >

c c

= = >

= s s

2
2
t
x
A
=
A
u
11
u
21
u
12
u
22
0.5 0.5 0 0
0 0
0 0
= 0.8
i = 1, j = 0
( )
1,1 00 10 20 10
1 2 u u u u t f = + + + A = 0.1
i = 2, j = 0 ( )
2,1 10 20 30 20
1 2 u u u u t f = + + + A
= 0.1
40
8
Phng trnh parabolic
Tm hm u (x,t) xc
nh trong min D =
{a < x < b, t > 0}
tha phng trnh
truyn nhit cng
iu kin bin v iu
kin ban u:
( )
( ) ( ) ( ) ( )
( ) ( ) | |
2
2
2
1 2
, ,
, , , 0
, 0 ,
u u
f x t x t D
t x
u a t t u b t t t
u x x x a b
c c
= e

c c

= = >

= e

Chia u [a, b] thnh n on


( )
0 0
/ , ,
i
x b a n x a x x i x A = = = + A
Chn bc thi gian t v t t
j
= j t
Tp cc nt (x
i
, t
j
) to thnh li ca min D
40
9
Phng trnh parabolic (tt)
Gi u
ij
~ u (x
i
, t
j
). T iu kin bin v iu kin ban u
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )
0 0 1
2
0 0
, ,
0,1,...,
, ,
, 0 , 0,1,...
j j j j
j n j nj j
i i i i
u a t u x t u t
j n
u b t u x t u t
u x u x t u x i


= = =

=
`

= = =

)

= = = =

Xp x o hm cp 2 theo x bng cng thc sai phn hng tm:


( )
2
1, 1,
2 2
2
,
i j ij i j
i j
u u u
u
x t
x x
+
+
c
~
c A
Xp x o hm cp 1 theo bin thi gian t bng cng thc
sai phn tin hoc li
41
0
Phng trnh parabolic s hin
S dng cng thc sai phn tin
x
i
t
j
t
j+1
x
i 1
x
i +1
u
i 1,j u
i ,j
u
i +1,j
u
i ,j +1
x
t
( )
, 1
,
i j ij
i j
u u
u
x t
t t
+

c
~
c A
, 1 1, 1, 2
2
2
,
0,1, 2,...; 1, 2,..., 1
i j ij i j ij i j
ij
u u u u u
f
t x
j i n
+ +
+
=
A A
= =
( )
, 1 1, 1,
1 2
0,1, 2,...; 1, 2,..., 1
i j i j ij i j ij
u u u u t f
j i n
+ +
= + + + A
= =
2
2
t
x
A
=
A
41
1
Phng trnh parabolic s n
S dng cng thc sai phn li
2
2
t
x
A
=
A
( )
, 1
,
ij i j
i j
u u
u
x t
t t

c
~
c A
, 1 1, 1, 2
2
2
,
1, 2,...; 1, 2,..., 1
ij i j i j ij i j
ij
u u u u u
f
t x
j i n
+
+
=
A A
= =
( )
1, 1, , 1
1 2
1, 2, 3,...; 1, 2,..., 1
i j ij i j ij i j
u u u tf u
j i n
+
+ + = A +
= =
41
2
V d s n
At = 0.1, Ax = 0.2
n thi im t = 0.1
( ) ( )
( )
2
2
cos , 0 1, 0
0, 0, 1, sin , 0
, 0 0, 0 1
u u
x t x t
t x
u t u t t t
u x x
c c
= < < >

c c

= = >

= s s

2
2
t
x
A
=
A
( )
1, 1, , 1
1 2
1, 2, 3,...; 1, 2,..., 1
i j ij i j ij i j
u u u tf u
j i n
+
+ + = A +
= =
41
3
V d s n
At = 0.1, Ax = 0.2
n thi im t = 0.2
( ) ( )
( )
2
2
cos , 0 1, 0
0, 0, 1, sin , 0
, 0 0, 0 1
u u
x t x t
t x
u t u t t t
u x x
c c
= < < >

c c

= = >

= s s

2
2
t
x
A
=
A
( )
1, 1, , 1
1 2
1, 2, 3,...; 1, 2,..., 1
i j ij i j ij i j
u u u tf u
j i n
+
+ + = A +
= =
41
4
V d s n (tt)
i = 1, j =1
( )
01 11 21 10
2, 5 1 2 2, 5 2, 5 0,1 0, 2cos 0,1 u u u u + + = +
11 21
6 2, 5 0.0199 u u =
i = 2, j =1
11 21 31
2, 5 6 2, 5 0.0398 u u u + =
i = 3, j =1
21 31 41
2, 5 6 2, 5 0.0597 u u u + =
i = 4, j =1
31 41 51
2, 5 6 2, 5 0.0796 u u u + =
6 2, 5 0 0 0.0199
2, 5 6 2, 5 0 0.0398
0 2, 5 6 2, 5 0.0597
0 0 2, 5 6 0.3292
A b

| |
|

|
=
|

|

\ .
11
21
31
41
0.0199
0.0399
0.0598
0.0798
u
u
u
u
| | | |
| |
| |
=
| |
| |
\ . \ .
41
5
V d s n
i
0 1 2 3 4 5
j
t x
0 0.2 0.4 0.6 0.8 1
0 0 0 0 0 0 0 0
1 0.1 0 0.0998
2 0.2 0 0.1987
3 0.3 0 0.2955
4 0.4 0 0.3894
5 0.5 0 0.4794
0.0396 0.0792 0.1189 0.1587
0.0588 0.1177 0.1767 0.236
0.0775 0.155 0.2328 0.3109
0.0953 0.1908 0.2865 0.3827
0.0199 0.0399 0.0598 0.0798
41
6
So snh kt qu s hin v n
t x
0 0.2 0.4 0.6 0.8 1
0.1 0 0.02 0.04 0.06 0.08 0.0998 H
0.1 0 0.0199 0.0399 0.0598 0.0798 0.0998 A
0.1 0 0.02 0.0399 0.0599 0.0799 0.0998 CX
0.2
0 0.0399 0.0798 0.1197 0.1592 0.1987 H
0.2 0 0.0396 0.0792 0.1189 0.1587 0.1987 A
0.2 0 0.0397 0.0795 0.1192 0.1589 0.1987 CX
S sai phn vi bi ton parabolic
K hiu
( )
1
1 1
1 2
j j j j j
i i i i i
u u u u t f
+
+
= + + + A
( )
( )
( )
( )
1 1 1 1
,..., , ,...,
T T
j j j j j j
n n
u u u f f f

= =
S hin
( )
2
2
2
,
u u
f x t
t x
c c
=
c c
bit u
(0)
, f
(j)
, u
0
(j)
, u
n
(j)
, vi j >0
Gi s bit u
(j)
, cn tnh u
(j+1)
1 2 0 0
1 2 0
0 1 2 0
0 0 0 1 2
A

| |
|

|
|
=
|
|
|

\ .



2
2
t
x
A
=
A
( ) ( ) ( ) j j j
f t Au u A + =
+1
41
8
S sai phn vi bi ton parabolic (tt)
S n
2
2
t
x
A
=
A
( )
1, 1, , 1
1 2
1, 2, 3,...; 1, 2,..., 1
i j ij i j ij i j
u u u tf u
j i n
+
+ = A +
= =
1 2 0 0 0
1 2 0 0
0 1 2 0
0 0 0 1 2
B
+
| |
|
+
|
|
= +
|
|
|
+
\ .

( ) ( ) ( ) j j j
f t u Bu A + =
+1
S sai phn vi bi ton parabolic tng hp
( )
2
2
2
,
u u
f x t
t x
c c
=
c c
2
2
t
x
A
=
A
( ) ( ) ( ) j j j
f t Au u A + =
+1
S hin S n
1 2 0 0
1 2 0
0 1 2 0
0 0 0 1 2
A

| |
|

|
|
=
|
|
|

\ .

1 2 0 0 0
1 2 0 0
0 1 2 0
0 0 0 1 2
B
+
| |
|
+
|
|
= +
|
|
|
+
\ .

Tnh trc tip: u


(j+1)
t u
(j)
Gii h phng trnh:
t u
(j)
u
(j+1)
A: ma trn cp n 1 B: ma trn cp n 1
( ) ( ) ( ) j j j
f t u Bu A + =
+1
V d
2
2
t
x
A
=
A
= 2.5
4 2.5 0 0
2.5 4 2.5 0
0 2.5 4 2.5
0 0 2.5 4
A

| |
|

|
=
|

\ .
( ) ( )
( )
2
2
cos , 0 1, 0
0, 0, 1, sin , 0
, 0 0, 0 1
u u
x t x t
t x
u t u t t t
u x x
c c
= < < >

c c

= = >

= s s

At = 0.1, Ax = 0.2
n =5 ma trn cp 4
6 2.5 0 0
2.5 6 2.5 0
0 2.5 6 2.5
0 0 2.5 6
B

| |
|

|
=
|

|

\ .
S hin S n
( ) ( ) ( ) j j j
f t Au u A + =
+1 ( ) ( ) ( ) j j j
f t u Bu A + =
+1
42
1
Bng tnh s hin
4 2.5 0 0
2.5 4 2.5 0
0 2.5 4 2.5
0 0 2.5 4
A

| |
|

|
=
|

\ .
j Vect x
1
= 0.2 x
1
= 0.4 x
1
= 0.6 x
1
= 0.8
0 t = 0 u
(0)
0 0 0 0
A u
(0)
t f
(0)
1 t =0. 1 u
(1)
0 0 0 0
0.02 0.04 0.06 0.08
0.02 0.04 0.06 0.08
( ) ( ) ( ) j j j
f t Au u A + =
+1
42
2
Bng tnh s n
j Vect x
1
= 0.2 x
1
= 0.4 x
1
= 0.6 x
1
= 0.8
0 t = 0 u
(0)
0 0 0 0
1 t = 0.1 f
(1)
0.20 0.40 0.60 0.80
b
(1)
0.020 0.040 0.060 0.3296
u
(1)
0.0199 0.0399 0.0598 0.0798
6 2.5 0 0
2.5 6 2.5 0
0 2.5 6 2.5
0 0 2.5 6
B

| |
|

|
=
|

|

\ .
( ) ( ) 1 j j
Bu b
+
=
( ) ( ) ( ) j j j
f t u Bu A + =
+1
42
3
Phng trnh hyperbolic
2 2
2
2 2
0
u u
a
t x
c c
=
c c
Cch gii quyt: tng t phng trnh parabolic v elliptic
42
4
Bi tp n chng 5 6
x = 0.25,
t = 0.2
( ) ( )
( )
2
2
1
0, 0 1, 0 0.4
4
0, 0, 1, 0, 0 0.4
, 0 sin , 0 1
u u
x t
t x
u t u t t
u x x x
c c
= < < < <

c c

= = s s

= t s s

( ) ( )
( )
2
2
9
, 1 2, 0 0.4
16
1, 1, 2, 2, 0 0.4
, 0 , 1 2
u u
x t x t
t x
u t u t t
u x x x
c c
= + < < < <

c c

= = s s

= s s

1)
2)
42
5
Bi tp n chng 5 6 (tt)
Gii bi ton vi li u, x = y = h = 1/3
2 2
2
2 2
2 2 1
2 , 0 1, 2 3
( , 2) 4 ( , 3) 9 0 1
(0, ) (1, ) 2 3
x x
x x
u u
e y e x y
x y
u x e u x e x
u y y u y y e y

c c
+ = + < < < <

c c

= = s s

= = s s

2 2
2 2
2
2 1, 0 1, 0 1
( , 0) 0 ( ,1) 0 1
(0, ) 0 (1, ) 0 1
u u
x x y
x y
u x u x x x
u y u y y y
c c
+ = + < < < <

c c

= = s s

= = s s

3)
4)
42
6
x = 0.0 x = 0.25 x = 0.50 x = 0.75 x = 1.00
t = 0 0 0.7071 1.0000 0.7071 0
t = 0.2 0 0.3757 0.5314 0.3757 0
t = 0.4 0 0.1996 0.2824 0.1996 0
x = 0.0 x = 0.25 x = 0.50 x = 0.75 x = 1.00
t = 0 0 0.7071 1.0000 0.7071 0
t = 0.2 0 0.4815 0.6809 0.4815 0
t = 0.4 0 0.3278 0.4636 0.3278 0
p s bi tp 1
42
7
x = 1.0 x = 1.25 x = 1.50 x = 1.75 x = 2.00
t = 0 1 1.25 1.50 1.75 2
t = 0.2 1 1.50 1.80 2.10 2
t = 0.4 1 1.43 2.14 1.77 2
x = 1.0 x = 1.25 x = 1.50 x = 1.75 x = 2.00
t = 0 1 1.25 1.50 1.75 2
t = 0.2 1 1.387 1.69 1.909 2
t = 0.4 1 1.472 1.808 1.999 2
p s bi tp 2
42
8
( )
4 1 1 0 8.310
1 4 0 1 13.56
1 0 4 1 4.057
0 1 1 4 7.237
A b

| |
|

|
=
|

|

\ .
u
11
= 4.193, u
12
= 5.420,
u
21
= 3.044, u
22
= 3.925
( )
4 1 1 0 0
1 4 0 1 1/ 9
1 0 4 1 1/3
0 1 1 4 1/ 9
A b

| |
|

|
=
|

|

\ .
u
11
= 0.0833, u
12
= 0.1389,
u
21
= 0.1944, u
22
= 0.3611
Nghim chnh xc
u
11
= 0.0796, u
12
= 0.3185,
u
21
= 0.0570, u
22
= 0.2282
p s bi tp 3,4
42
9
Bi tp n chng 5 6 (tt)
Gii bi ton vi li u, x = y = h = 1/3
( ) ( )
( ) ( )

s s = =
s s + = =
< < < < + =
c
c
+
c
c
2 1 , , 1 , 1 , 0
1 0 , 1 3 2 , , 1 1 ,
2 1 , 1 0 , 3 2
2
2
2
2
2
y y y u y u
x x x u x u
y x y x
y
u
x
u
43
0
Mt s sai st ph bin
Khi gii phng trnh phi tuyn thng th nghim s
khng nm ngoi khong cch ly nghim cho
Khi tnh sai s: lu rng sai s khng th m
Gii phng trnh phi tuyn bng phng php Newton:
khng ch n iu kin Fourier;
Trong bi ton xc nh cc tham s 1 a thc cho
trc tr thnh spline t nhin bc 3 khng ch n
iu kin t nhin: o hm bc 2 ti hai u mt ca
spline bc ba bng 0
n tp gia k
Mn hc:
Phng php tnh
432
Sai s - ch s ng tin, c ngha
Sai s tuyt i v tng i
Aa = a oa
Sai s lun lun dng v lun lmtrn ln!
Ch s ng tin: n > log (2 Aa); n l s nguyn
Ch s c ngha: cc ch s khng bn tri th
khng c ngha
433
Sai s ca biu thc
y = f (x
1
, x
2
,, x
n
)
( )

=
A
c
c
= A
n
i
i n
i
x x x x
x
f
y
1
2 1
,..., ,
( )

=
A
c
c
=
A
= o
n
i
i
i
y
x
x
f
y
y
1
ln
( )
n n
x x x x x x f = ... ,..., ,
2 1 2 1
=
A = A
n
i
i
x y
1

=
o = o
n
i
i
x y
1
( )
1 1
2
1
1 2 1
.... . ,..., ,

=
n n
x x x x x x f
434
Phng trnh phi tuyn tng quan
Khong cch ly nghim: Nu hm f(x) lin tc
trn on [a, b] v gi tr ca hm tri du trn hai
u mt th phng trnh f(x) = 0 c nghim trn
[a, b]. Nu f(x) n iu th nghim l duy nht
Cng thc sai s tng qut:
( )
*
*
f x
x x
m
s
| | ( )
, , 0 x a b f x m ' e > >
435
Phng trnh phi tuyn (tt)
Phng php chia i: c
n
= (a
n
+ b
n
)/2; x
n
= c
n
f (a
n
) f (b
n
) < 0; c
n
= (b
n
- a
n
)/2;
Phng php lp n: x
n+1
= g (x
n
)
x e [a, b]: g (x) s q < 1
Phng php Newton: x
n+1
= x
n
f (x
n
)/ f(x
n
)
o hm f , f khng i du trn [a, b]
Gi tr lp ban u tho: f(x
0
) . f(x
0
) > 0
(iu kin Fourier)
Sai s: cng thc sai s tng qut
436
H phng trnh tuyn tnh
Phng php kh Gauss: hng cn bin
i hng cha phn t tr h s kh
Phn t tr a
(i-1)
ii
= 0
H s kh m
ki
= a
(i-1)
ki
/a
(i-1)
ii
437
Phn tch nhn t LU phng php
Doolittle
Nu qu trnh kh Gauss din ra bnh thng
(khng i hng), ma trn A ca h Ax = b phn
tch c thnh tch LU, tc A = LU vi
L (lower): ma trn tam gic di, ng cho
chnh bng 1, cha cc h s kh v tr kh
U (upper): ma trn tamgic trn, cng l ma trn
kt qu nhn c sau qu trnh kh Gauss
Khi vic gii h phng trnh Ax = b s a v
vic gii h phng trnh Ly = b v Ux = y
438
Phn tch Cholesky
Trng hp c bit ca phng php nhn t
LU, khi ma trn A i xng v xc nh dng
Ma trn vung A i xng nu A
T
= A tc a
ij
=a
ji
Ma trn vung A xc nh dng nu tt c cc
nh thc con chnh ca n u dng
nh thc con chnh cp k, 1 k n ca ma trn
l nh thc con thu c t k hng v k ct u
tin ca ma trn
439
Phn tch Cholesky (tt)
nh l: Ma trn A i xng xc nh dng tn ti ma
trn tam gic di B tha mn: A = BB
T
( )
( )
( )

< <
(

=
s < =
s < =
=

=
i j b b a
b
b
n i b a b
n i
b
a
b
a b
j
k
jk ik ij
jj
ii
i
k
ik ii ii
i
i
1
1
1
1
1
1
1
1
2
11
1
1
11 11
440
Chun vct v chun ma trn
1
1
1
max
n
ij
j n
i
A a
s s
=
=

1
1
max
n
ij
i n
j
A a

s s
=
=

1
1
n
k
k
x x
=
=

1,
max
k
k n
x x

=
=
theo hng theo ct
441
S hi t ca dy cc vct
Dy cc vct vi x
(k)
eR
n
hi t v vct
khi k +
x
( )
0
k
x x khi k + (hi t theo chun)
( )
lim
k
k
x x

=
iu kin cn v : dy hi t v
(hi t theo ta )
, 1,
m
x m n =
( )
{ }

=0 k
k
x
( )
{ }
k
m
x
442
Phng php lp gii h tuyn tnh
H Ax = b x = Tx + c = g(x), T: ma trn, c: vect.
Dy lp: x
(k+1)
= T x
(k)
+ c
Nu T <1 th dy lp cc vct ny hi t v nghim
ca h vi mi vect lp ban u x
(0)
Ma trn A l ma trn ng cho tri nghim ngt:
theo hng

= =
>
n
i j j
ij ii
a a
, 1
Phng php lp Jacobi v Gauss-Seidel

= +
= +
= + +
11 10 4
10 10 2
7 10
3 2 1
3 2 1
3 2 1
x x x
x x x
x x x

+ + =
+ + =
+ =
1 . 1 1 . 0 4 . 0
0 . 1 1 . 0 2 . 0
7 . 0 1 . 0 1 . 0
2 1 3
3 1 2
3 2 1
x x x
x x x
x x x
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )

+ + =
+ + =
+ =
+
+
+
1 . 1 1 . 0 4 . 0
0 . 1 1 . 0 2 . 0
7 . 0 1 . 0 1 . 0
2 1
1
3
3 1
1
2
3 2
1
1
k k k
k k k
k k k
x x x
x x x
x x x
Jacobi
Gauss-
Seidel
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( )

+ + =
+ + =
+ =
+ + +
+ +
+
1 . 1 1 . 0 4 . 0
0 . 1 1 . 0 2 . 0
7 . 0 1 . 0 1 . 0
1
2
1
1
1
3
3
1
1
1
2
3 2
1
1
k k k
k k k
k k k
x x x
x x x
x x x
444
S iu kin ca ma trn
Xt h phng trnh Ax = b c nghim x = A
1
b
( )
1
Cond( ) k A A A A

= =
S iu kin ca ma trn A
k(A) cng gn 1 h cng n nh
k(A) cng ln h cng mt n nh h iu kin
xu
445
Ma trn lp trong phng php Jacobi
|
|
|
|
|
.
|

\
|



=
0 ...
... ... ... ...
... 0
... 0
2 1
22 2 22 21
11 1 11 12
nn n nn n
n
n
j
a a a a
a a a a
a a a a
T
Ma trn T
j
c ng cho chnh bng 0
446
Ma trn lp trong phng php
Gauss-Seidel
T
g
= (D L)

U
|
|
|
|
|
.
|

\
|
=
nn n n
a a a
a a
a
L D
...
... ... ... ...
0 ...
0 ... 0
2 1
22 21
11
|
|
|
|
|
.
|

\
|


=
0 ... 0 0
... ... ... ...
... 0 0
... 0
2
1 12
n
n
a
a a
U
Ma trn T
g
c ct th nht bng 0
447
Ma trn lp phng php Gauss-
Seidel cho h hai phng trnh hai n
T
g
= (D L)

U
|
|
.
|

\
|
=
22 21
11
0
a a
a
L D
|
|
.
|

\
|

=
0 0
0
12
a
U
( )
|
|
|
|
.
|

\
|

=

22
22 11
21
11
1
1
0 1
a
a a
a
a
L D
( )
|
|
|
|
.
|

\
|

= =

22 11
21 12
11 12
1
0
0
a a
a a
a a
U L D T
g
448
Sai s
Bit A c gi tr gn ng l a = 12.7 vi sai s
tng i oa = 0.012%. S ch s ng tin trong
cch vit thp phn ca a?
Vy a c 2 ch s ng tin sau du thp phn nn
tng cng a c 3 ch s ng tin
( ) ( )
2
51 , 2 %) 012 . 0 7 . 12 2 log(
2 log 2 log
>
= =
= o = A >
m
a a a m
449
Sai s
Gi s a = 106/39 l gi tr gn ng; A = e l gi
tr chnh xc. Tm sai s tuyt i Aa v sai s
tng i a (lm trn n 4 ch s thp phn).
450
Sai s
a = 0.9951 l gi tr gn ng, A = 0.9949 l gi
tr chnh xc
Trong cch vit thp phn ca a c bao nhiu ch
s ng tin? Bao nhiu ch s c ngha?
451
Khong cch ly nghim
Phng trnh f(x) = 3 cos x x 2x + 7 = 0 c
bao nhiu nghim thc
o hm f(x) = 3 sin x 2x 2
Chuyn phng trnh v dng tng ng
3 cos x = x + 2x 7
R rng nghim ca phng trnh ny phi lm
cho v phi ca phng trnh ny c gi tr trong
khong [-3, 3]
452
Khong cch ly nghim (tt)
Nghim ca phng trnh nu c phi nm trong
khong [-1- 11, -1-5] hoc [-1+5, -1+11]
f(-1- 11) < 0; f(-1- 5) > 0; f(-1+ 5) > 0;
f(-1-+11) < 0 vy cc khong cha nghim
Trong khong [-1- 11, -1-5] th f(x) > 0; Trong
khong [-1- 11, -1-5] th f(x) > 0; f(x) n
iu ti 2 khong trn phng trnh f(x) = 0 c
2 nghim thc
453
Khong cch ly nghim
Phng trnh f(x) = 3 cos x x 2x + 7 = 0 c
khong cch ly nghim no?
Vy phng trnh trn c
KCL nghim l [1.5,1.75]
a) [1,1.25] b) [1.25,1.5] c) [1.5,1.75] d) [1.75,2]
x f(x)
1 5,620907
1,25 3,883467
1,5 1,962212
1,75 -0,09724
2 -2,24844
454
Khong cch ly nghim (tt)
Phng trnh f(x) = x cos x 2 x + 3x 1 = 0 c
bao nhiu nghim thc
Chuyn thnh dng x cos x = 2 x 3x + 1 = g(x)
D thy g(x) > -x x <0
Nu x>0 th g(x) s x 2 x 4x + 1 s 0
2
2
1
2
2
1 + s s x
455
Khong cch ly nghim (tt)
Nghim ch c th c trn on [0, 2]
f(x) = x cos x 2 x + 3x 1
f (x) = cos x x sin x 4 x + 3
V f(0) >0; f(2) < 0 nn f(x) i du trn
[0, 2]
f (x) = 2 sin x x cos x 4 < 0 trn [0, 2]
Nh vy f(x) c mt cc i trn [0, 2]
f (0)
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
-2
0
2
4
6
8
10
12
14
16


2x
2
-3x+1
x
-x
0 0.5 1 1.5 2
-8
-6
-4
-2
0
2
4


g(x)=xcos x-2x
2
+3x-1
g'(x)=cos x-x*sin x-4*x+3
g"(x)=-2*sin x-x *cos x-4
457
Cng thc sai s tng qut
Phng trnh f(x) = x - 3x + 7 = 0 trn khong
cch ly nghim [-1.4, -1.2] c nghim gn ng
x* = -1.28. Sai s nh nht tnh theo cng thc sai
s tng qut ca x* l bao nhiu?
f (x) = 3x - 6x; f (x) = 6x 6.
Trn on [-1.4, -1.2] th f'(x) > 0; f"(x) <0
f'(x) l hm n iu gim, nn m = f(-1.2) =
11.52
( )
0.0011
52 . 11
7 28 . 1 3 28 . 1
2 3 *
*
~
+
= s
m
x f
x x
458
Phng php chia i
Phng trnh f(x) = e
cos x
x +1 = 0 c khong cch
ly nghim l [1.5, 2] Theo phng php chia i
nghim gn ng x
3
l bao nhiu?
n a
n
b
n
x
n
0 1,5 + 2 - 1,75 +
1 1,75 + 2 - 1,875 -
2 1,75 + 1,875 - 1,8125 -
3 1,75 + 1,8125 - 1,78125 -
Vy x
3
= 1,78125
= 114/64
459
Phng php lp n h s co
l hm co trong on [1, 2]. Tm h s co q ca
hmg(x)
( )
3
7 3 + = x x g
( )
( )
3
2
7 3
1
+
=
'
x
x g
Trn on [1, 2] khi x tng th
g'(x) gim v lun dng. Do
g'(x) t gi tr ln nht khi x = 1.
Nh vy
( ) ( ) q g x g = s = ' s ' 216 , 0
100
1
1
3
Ch : q lm trn ln theo quy tc bt ng thc!
460
Phng php lp n (tt)
Cho phng trnh
Chn x
0
= 1 tm nghim
gn ng x
3
theo
phng php lp n
( )
5
ln 1 3 x x x g x + = =
k x
k
0 1.0
1 1.3195
2 1.3617
3 1.3672
( )
5
1
ln 1 3
n n
n n
x x
x g x
+ =
= =
+
461
Phng php lp n (tt)
Xt dy lp n
x
n+1
= 1 + e
xn
Chng minh rng dy lp trn hi t vi mi
x
0
e[1,2].
Vi x
0
=1.5, hy tm s ln lp ti thiu theo cng
thc tin nghim c sai s < 10
4
462
Phng php Newton
Cho phng trnh f(x) = x 2x +2
x
2.5 = 0
Vi x
0
= 2, tm nghim gn ng x
2
tnh theo
phng php Newton
k x
k
0 2.0
1 1.8219
2 1.7979
463
Phng php Newton cng thc sai
s tng qut
Cho phng trnh f(x) = x + 7x 12 = 0 c
khong cch ly nghim [1,2]. Trong phng php
Newton, chn x
0
theo iu kin Fourier, tm sai s
ca nghim gn ng x
2
theo cng thc sai s
tng qut
f(x) = 3x + 7 >0 x ;
f(x) = 6x + 7 >0 x e [1,2].
Vy ta cn chn x0 sao cho f(x
0
) >0
V f (1.0) = 4 ; f (2.0) = 10 nn x
0
= 2
464
Phng php Newton cng thc sai
s tng qut (tt)
Trn [1,2] th f(x) = 3x + 7 l hm n iu tng,
do m = min f'( x) = f'(1.0) = 10
theo cng thc sai s tng qut
( )
m
x f
x x
n
n
s
k x
k
Sai s
0 2.0 1.0000
1 1.4737 0.15163
2 1.3615 0.0055
Vy sai s ca x
2
l
0,0055
465
Phn tch nhn t LU v Cholesky
|
|
|
.
|

\
|
=
|
|
|
.
|

\
|
=
220 / 853 0 0
62 / 1 31 / 55 0
0 . 1 5 . 1 1 . 3
,
1 110 / 1 31 10
0 1 31 15
0 0 1
U L
|
|
|
.
|

\
|
=
2 . 4 5 . 0 0 . 1
5 . 0 5 , 2 5 . 1
0 . 1 5 . 1 1 . 3
A
466
Phn tch nhn t LU v Cholesky
|
|
|
.
|

\
|
=
2 . 4 5 . 0 0 . 1
5 . 0 5 , 2 5 . 1
0 . 1 5 . 1 1 . 3
A
|
|
|
|
|
.
|

\
|
=
46915
110
1
6820 / 1 31 10
0 31 55 62 45
0 0 1 . 3
B
467
Phn tch nhn t LU v Cholesky
A :=
16 -8 -4 0
-8 13 -4 -3
-4 -4 9 0
0 -3 0 3

4 0 0 0
-2 3 0 0
-1 -2 2 0
0 -1 -1 1

16 -8 -4 0
0 9 -6 -3
0 0 4 -2
0 0 0 1

468
Bi tp n chng 2
Tm cc gi tr ca ma trn l xc nh dng
1 1
1 2 1
1 1 4
o
| |
|
|
|

\ .
1 2
4 1
2 1 8
o
| |
|
o
|
|

\ .
1 1
1 3 1
1 5
o
| |
|

|
|
o
\ .
o > 8/7
1 31 1 31
4 4
+
< o <
1 7 1 7
3 3
+
< o <
469
Bi tp n chng 2 (tt)
S dng phng php Cholesky gii h
1 2
1 2 3
2 3
2 2
2 1
2 2
x x
x x x
x x
=

+ =

+ =

1 2 3
1 2 3
1 2 3
3 2 1
3 4 2 4
2 2 3
x x x
x x x
x x x
+ =

+ =

+ =

1 2 3 4
1 2 3 4
1 2 3
1 2 4
4 1
3 0
2 1
2 2
x x x x
x x x x
x x x
x x x
+ + + =

+ + =

+ =

+ + =

470
Bi tp n chng 2 (tt)
1.4142 0 0
0.7071 1.2247 0
0 0.8165 1.1547
B
| |
|
=
|
|
\ .
1 0 0
3 5 0
4 1
2
5 5
B i
i
| |
|
|
=
|
|
|

|
\ .
2 0 0 0
0.5 1.6583 0 0
0.5 0.7538 1.0871 0
0.5 0.4523 0.0836 1.2403
B
| |
|
|
=
|

|
\ .
471
Bi tp n chng 2 (tt)
Tm cc gi tr ca > 0 v > 0 ma trn l
ng cho tri nghim ngt
4 1
2 5 4
2
o
| |
|
|
|
|
| o
\ .
3 2
5
2 1
|
| |
|
o |
|
|
o
\ .
2 4
2
4 1
|
| |
|
o |
|
|
o
\ .
3
0.5
2
o <

| <

o > |+

1
5
3
| <

o+| <

o >

6
2
5
| >

o| >

o >

472
Bi tp n chng 2 (tt)
S dng phng php Jacobi tm nghim gn ng
vi sai s 10
-
. Chn chun v cng
1 2 3
1 2 3
1 2 3
4 1
3 8 2 0
3 3 10 4
x x x
x x x
x x x
+ =

+ + =

+ + =

1 2
1 2 3
2 3
10 9
10 2 7
2 10 6
x x
x x x
x x
=

+ =

+ =

1 2
1 2 3
2 3 4
3 4
10 5 6
5 10 4 25
4 8 11
5 11
x x
x x x
x x x
x x
+ =

+ =

+ =

+ =

1 2 3
1 2 4
1 3 4
2 3 4
4 2
4 1
4 0
4 1
x x x
x x x
x x x
x x x
+ + =

+ =

+ =

473
Cho h phng trnh
Vi x
(0)
= [1, 2, 3]
T
tnh vect x
(1)
theo
phng php Jacobi
1 2 3
1 2 3
1 2 3
25 2 16
2 18 35
2 2 20 58
x x x
x x x
x x x
=

+ =

+ + =

474
V d phng php lp Jacobi (tt)
1 2 3 4
1 2 3 4
1 3 4
2 3 4
7 2 2 3
2 8 3 2
5 2 5
2 4 4
x x x x
x x x x
x x x
x x x
+ + =

+ + + =

+ + =

+ =

Dng phng php lp Jacobi tm x


(1)
lm
trn n 4 ch s
x
(0)
= (0, 1, 1, 1)
T
475
Phng php Newton
Cho phng trnh 2x + Mx 1 = 0 c khong
cch ly nghim [0, 1].
Dng phng php Newton, chn x
0
theo iu
kin Fourier, hy tnh x
2
v x
2

476
Phn r Choleski
S dng phn r Choleski A = BB
T
tm ma trn B
|
|
|
.
|

\
|

=
M
M
M
A
1 . 7 44 . 0 57 . 0
44 . 0 3 . 6 22 . 0
57 . 0 22 . 0 2 . 5
477
Phng php Gauss-Seidel
Cho x
(0)
= (0.25, 0.64, 0.30)
T
, hy tm vector x
(3)
bng phng php Gauss-Seidel

= + +
= +
= + +
M Mx x x
M x Mx x
M x x Mx
27 . 3 11 3 2
12 . 5 3 8 2
45 . 2 5 3 10
3 2 1
3 2 1
3 2 1
478
a thc ni suy Newton
Cho bng s
Dng a thc ni suy Newton tnh gn ng y(x)
ti x = 1.2
x 0 1 2 3
y M 2.5 1.5M 4.2
NI DUNG MN HC
M u: S gn ng v sai s.
Chng 1: Gii phng trnh phi tuyn
Chng 2: Gii h phng trnh i s tuyn tnh
Chng 3: Ni suy v bnh phng cc tiu
Chng 4: Tnh gn ng o hm, tch phn
Chng 5: Gii gn ng phng trnh vi phn
thng
Chng 6: Gii phng trnh o hm ring
Mt s im cn lu
Khi gii phng trnh phi tuyn thng th
nghim s khng nm ngoi khong cch ly
nghim cho
Khi tnh sai s: lu rng sai s khng th m
Gii phng trnh phi tuyn bng phng php
Newton: khng ch n iu kin Fourier;
Khi gii h phng trnh i s tuyn tnh: cn
ch s dng ng phng php u bi yu cu,
c bit l i vi cc phng php lp, cng nh
lu n yu cu ca bi
Mt s im cn lu (tt)
Trong bi ton xc nh cc tham s 1 a thc
cho trc tr thnh spline t nhin bc 3 khng
ch n iu kin t nhin: o hm bc 2 ti
hai u mt ca spline bc ba bng 0
i vi phng php bnh phng cc tiu: nu
u bi cho dng hm s khc vi cc dng
hc th cn vn dng l thuyt chung nhn
c h phng trnh nhm xc nh cc h s
cn thit

You might also like