Top Banner
METODE NUMERIK Kuliah 4, 26 FEBRUARI 2014 SISTEM PERSAMAAN LINEAR Dr. Ir. Mochammad Afifuddin, M.Eng Jurusan Teknik Sipil
112

Kuliah-4 METNUM 26022014

May 09, 2017

Download

Documents

Kamal Mirza
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Kuliah-4 METNUM 26022014

METODE NUMERIKKuliah 4, 26 FEBRUARI 2014

SISTEM PERSAMAAN LINEAR

Dr. Ir. Mochammad Afifuddin, M.Eng

Page 2: Kuliah-4 METNUM 26022014

Jurusan Teknik Sipil Universitas Syiah Kuala

Page 3: Kuliah-4 METNUM 26022014

OUTLINE• METODE LANGSUNG:

– METODE SAPUAN GANDA CHOLESKI

• METODE ITERASI:– METODE JACOBI– METODE GAUSS SEIDEL

Page 4: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

Kuliah 4 Metode Numerik

"2

'

Deekkoompoass}i•si• LU

• Thiel upper trianqular matrix Cian bedenoted as U and iit 'is giiv'eln [by'

n. :U~]2 ~xtB 'll,~

10 n. U23 'U

0 0. 1 u3',i':I' (8),OJ

~ " "co,"

10 0 0, 0 m

Page 5: Kuliah-4 METNUM 26022014

dl2 dn1 a

~

;':'1

s, d .

~

.

Deekkoompoass}i• si LU

• Dari metode eliminasi Gauss kita memiliki:

'm d, Ie]In

0 e,~,~

~ 0 0 m j'J'1 €J'" " '" co,

'" " '" co,

'" '" m

0 0 0 0 1 e

Page 6: Kuliah-4 METNUM 26022014

.1

DeekkoompoOSs}i• si LU

',1~'J'r,fi - .d' if l,l_o.,·,.rIl

,:ib1 =-

1,-', 2 ",.","Inr;

an .d_ J,' - 1..!1I.., 2''., "." , r;J;CI1:'

In 0 (~I e 1 U12 u~]. U'lii' all an. {I.u alii'

.l2! In, ()I 10 I~) 1 i'iltj u1m ll:n a'2.J .a;n; aili:i

tJ~ tu lr 10 101 0 m ''!\l1i'l .rJ .l! ~3J an a'1i'l

~

l:li;~ Ii'lL " ]; l 0 0 0

'" '" '"',"" c'o", ,'""

a11]; a'ml11 i'l1I

L U .A.

. m. a:lii~ t:ilJI!~

(12)

Page 7: Kuliah-4 METNUM 26022014

lr;0e 0 01 'n UJli:

o to o 1

lllU12

lUll11 + 11:1lnun

J'Jl un + t2'Ju 2:3

lllUbJ

l ~l.<U~~+l l'l.'Ju ~

,.:I

Deekkoompoass}i• si LU

• Hasil kali LU:

In 0 o to ] U]J; U]'" U1Kl

(n I12

.In 1.;;,0'J

10 to 0 '1 u2:3 ~;~'2.n (13)

In U1ill +l32un'J +l3';U'j1J

Page 8: Kuliah-4 METNUM 26022014

a .

Deekoomposisi LUu• Hasil kali LU:

[0

In 11l~l.11 l~_ IUl1i!

InIII

l2.:! '&i!'ll + ~'21

I .J:"_ ,&i!_',,..... + l~,lI..-...)

r2.:!~i,bj + l21J~i 2~,

lj,],'U'bl. + 11:;J;U~1 + l,n~'IJ'iiJ

e {li"! I fl12 aj'! aliiJ

a::n tlIn. a'"l',l ,a'b~

all a i2 arOJ" ..l,n,

(]4)

Page 9: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

Dekomposisi LUu

In111

J11U1l

12M'tf!2 + l:tJ

I

li_l~~l,J",- J.~l~,ll

l:II~bJ +l22;U2~1

l11 J ?,~'~~',~.

+,

llj l3.{&~"::ti + lnU~2 + i:nUj,jlJ,:;I••• _; ~

,arn an "',:';Ii.j all\!

a'll tij'~, a23 (J, ]:n

all a"2 a3], til'j.n :il. ,~ ~ _ n: ,----:..'.il1_,~ _

a~'J"~,,JI ,••

.:I' ~ 1 E'['JII~U- u.31 ,

,r iM. 13 - --.ill

Page 10: Kuliah-4 METNUM 26022014

=

L

L

Deekompoosisi LU

J.J] =a·IIs: _. 1)..ItOr 1 .I!. ........ , •• I ,

j-I

l~ = Oij - L,likUtt for j = 23, ... , n -1. andz = i.i + ]~.....n

1.:=1j-I

aii - j J"'j.u. Ii

(15)

UJ1 = ~= for j = 2,3, ... ,n-l and r = j + 1,j + 2" ••• ,1'1

JJ

~-t: = t1J'1fl. - ('1k~·I.m

k"=1

Page 11: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

2

+

Coontoh SSooaal:

• Selesaikan Persamaan berikut denganmetode Dekomposisi LU

Xl +3X2 + 2X3 == 15 1 3 2 X] 15

2X'.··].'.T-

L'4,1LlV +I

3 X'3"

= 2.".2

2 4 3 .¥2 - 22

",.",X [+ 41L1T. 2

7.·X"3

· -

3,'

9.

3 4 7 X] 39

A X C

Page 12: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

= a

Ccontooh Sooal:

• Examp~e1 (cont'd)u ~irn IE _ 4l~:

liL = Ql~:

~= 22 and 3: t~ere ere

III = all =1I,:!" = a~l = 2:r -"]I,);'1: 3L 3

.A.- 2 4 313 4 "7

Page 13: Kuliah-4 METNUM 26022014

Contoh Soal:

• Exam ple 1 (cont'd)US.ifii; E~" 4 ::

(1.J[~gJ = .~

~'l.L

) =, .and 3, tuherefore

1 3 'J

.4.= ') 4 3J 4 '7

Page 14: Kuliah-4 METNUM 26022014

~

:2-1

Ccontooh Sooal:

• Example 1 (cont'd) ,.....----------IJJIsifil; Eq ..4!c:

A= 2 ." 3

1:21 = :2J.~IJ = J

~! = !i•.- Ll~u~

I: ~

j = J ~and ~= _ :amr.u.il,3,:,

therefere1-1 L

] ." 7 .B!I~ =]

l~ = i2]:2 - L.,l~til~" = G'21 - ~ I u~ = QJ:2 -1:u ~Ll =4 - (2) 3) = -~.I ~

~~= a~n- ~l H~~ = [.1~ - LJ~~~= t1~ -~:J.lHIJ: =4-(3)(3) =-5il:-.1 .!:-1

Page 15: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

Ccontooh

• Example 1 (cont'd) ,....-----------,IIJIsirng E(j., 4d:: ], j; 1: r~~= 2

A= ,4- j l....."_. =-,,4- riu =2

Page 16: Kuliah-4 METNUM 26022014

~

l~ ~

loon. = ElJJ - Y 'lll~~-J.= i!7:l::J _. Y llj ~~ld:-I 1;-.1

= Qi!3 - ~~.H~~I] +lll~~i3]l= 7 .-(3)(l) - (-)){O_)) = 3_);

Page 17: Kuliah-4 METNUM 26022014

• Example 1 (cont'c)-, IUsi Iilg Eq. ·4I 1tle [e~efJlfllents of' f_ 3~~l d U werle

fot~nd to be~'ll =]eI' .,E~I --

Jl _. ~.JCfj:1 -

12:t = -2~':ti: := -5

~'t.!l = .:1.5

[l! I~ =:1[l! I:!; =: ,

[l!'t!: = IItS

Page 18: Kuliah-4 METNUM 26022014

-0

,

• Example 1 (cont'd)_, Hen ce, the lowef tria~~TIglusr r1I12t1Jrix l

r[esll.Jl~~ngfrom A i~l:

~'il =],

(I!i -.- 1 o 0~l:!:i =1 L _.~l~ =-2

?l _)1.=0..1 _I

~:l!::'.: ,_.-_.

5 31 -5 33_5~ {~ = J ..5

Page 19: Kuliah-4 METNUM 26022014

I:!

• Example 1 (cont'd)-, All d 1trte upper llJi~~lgu~am,ar trix t~r[e~,IJ~til1lg

from A USl:

[1! I::: =3 n 3 2[1! -, U·- 0 ] osJ'j tl =llD.j

0 OJ 1~,

Page 20: Kuliah-4 METNUM 26022014

for the lUIPPer and ~owew 1TIri.ilRlIgular matricesU and It eomputeu in [lExanlple 11s. how that'Ihe multiplication of ttl will result iITlJ ths coefflci ent m.atrix A.

Page 21: Kuliah-4 METNUM 26022014

= 2 ] ~.-'llii---

A

J

0 0

.3 4l

1

- O-J!

EI l .~ :2

D 0 1 1),5,""' .,.. ~'-,) ,!IJ

2{1i) (-2}® 2(2) T ( -1}(O.5)1 1(1)+ ( - 5~tLg 1(23 + (-5}(@..5) + ~3_:i}{l)

1 ]i :24l

------------------------------------a~~

Page 22: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

equafions wuth constants c; i = 1,,2,,no-

• Once the coefficient matrix iisd ecomposed into L and U" the:se malrices can be used tc :sotVlea sysltem of...•

• The solution can be obtai ned iiIl1 tw'o steps, fOIIlW,ard pass and ba ck sulbsltiltllJ1tionl.

Page 23: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

X

X1i1!n :t

• Recall that the matrix form for thesimultaneous linear equations is

Gil t71! o 0 0 Q1n .r; C1

'tlaL 1i1l2 II t I,

1I

raJ! rill!~ " I I t'i'J;.., .:.r.~,-- rC

J I

(5)

•• "• • , •

"• "

i1",1 Q",l

" • •• •

o 0 0 IQ" .n

~r

Page 24: Kuliah-4 METNUM 26022014

t

• Or in terms of the lower and uppertrianpular matrices Land U the systemof eq uations can be rep resented by

ill 0 0 o 11 lII1Jl lin ilIl.. '''Y"I C;,l:u, l ll: 0 (Ii 0 1 U:zJ U_,

.I XJ C1 (6)

1'1 l;u In (Ii 0 0 1 :It ~¥J - c,_ _ :1'1 __ _ _

·j

aI l.~ i: l_ 0 0 0 1 _Y~

A c.

Page 25: Kuliah-4 METNUM 26022014

~

"

1

.1 Re,ca,1Ithe fOM,aJrd pass of lhe IGallJslsiane~ilmlil~ation tnat resuned in the fonowingIJ pper ~r~aln:gu~ar mamx

1 (/'1'2- al] • • •

al", ~

_.... -110 1 d'B•

i() 0 1

• • •

• • •

,d2A,

d'3.i'J

'1i;?

:'2 (7)i~

I " " " ') n II •" " " " " "

~ 110 0 0

tlUtl

') n II•• "

~,I

Page 26: Kuliah-4 METNUM 26022014

fur .. 2 -

• FOlMaJd PassThe forward pass produces 1lheej valuesforr =1,2, ...., n of equation 1 as follows:

61. = C:L;_l"~~

i' = .,.),,".. '"itJ'

Page 27: Kuliah-4 METNUM 26022014

L

• Salek Substitution- The back substitution results in the ~li

val ues for i = 1:2:-. _,n as follows:

II

"'¥J = e, - uJJXJ for t = n -l,lJ - 2~.._~1(9b)j..,+1

Page 28: Kuliah-4 METNUM 26022014

,

-._-- .,... ......... ----_.. -• Example 3

Solve the system of equations of Example1 using the LU decomposition approach

_.... -~~

The system of equation in a matrix fran) is

1 3 2 Xl 1152 4 3 X, - 122

,

3 4 7 Xl 39

Page 29: Kuliah-4 METNUM 26022014

• Examlpille .3 (cont'd)The deeempesed lowelf' and upper~rialngulaf' rnatriees were found OIFl [Examplile1 as

1 4) 0. :L ..... .,.

l= 2. _.,_.... - .j,

"'"'0. U'- 0 1 o..:-;il

[3 -5 3.5.~~

0 0 ].

Page 30: Kuliah-4 METNUM 26022014

~A i< .... ~'''''''- ._ ...ill =1 'U 2 =3

• Example 3 (cont'd)UsJng Eq_ 6a:

ce~=l -

laaTherefore,

15

I:tl -- '-J 'U S

=2

ill =:3 U:u = 0.5I -_'l:ti - -

l:l::z =-5lJil = 3,.5

15e_, =-1 =15

,C= 2')

39

Page 31: Kuliah-4 METNUM 26022014

lo

-

• Example 3 (cont'd) I~ =2 u.,=2Using Eq. 8b:• I I, =3 Uu =0.5

C - II,l'(/=---J;i---• I.

i = .2 and 3. therefore.:--1 II,I~'''J C, - I./~IJ"

I~!=-2 15

In =-5 c= 22I'J = s.s 39

- C\ -

I...J ,,,, 22 -In'" 22 - (2)(1 5)11, -

1%1 f

%,1

III - -2 -4

C) - Lilt". C, - L,I"",", ,.1 C, -Ill', -1n(/. 39-l(15) -(-5)(4)

4in 4u In 3.>

Page 32: Kuliah-4 METNUM 26022014

• Example 3 (cont'd)I. = 1 U•• = 3

Using Eq. 93:I• = 2 UIJ

-')--

I =3 u:1 = 0.5

Therefore ..¥} = 4

~I

l~ =-2 15I,: =-5 C= 22I" =3.5 39 I

". -15": 4f' 4

Page 33: Kuliah-4 METNUM 26022014

~

=e .

.. ,..----- ...~----_._--• Example 3 (cont'd) ~,=15

I, = 1I• = 2

u. =3U ,--_")

Using Eq. 9b: ~: =4

.r, = 6, - L".uf.rJ •I, = 3Ia --_")

uz, = 0.5

15J ' ,

i = 2 and L therefore,

.1'-, = 4 'll =-5i; =3.5

C= 2239

.r.;.=<1- ,- 'JC'u.,.J.Y,, I

1 .. 'IXj =~-O.5(~)=1

.r =SI-L.U'J.f,=el-u ..Y:-ul.Y =15-(3X2)-(2)(4)=1I

Page 34: Kuliah-4 METNUM 26022014

• Example 3 (cont'd)- Therefore, the solution for fhe system or

equ ations is

Page 35: Kuliah-4 METNUM 26022014

_.As a result" ti"l,e t,t} decernposition can becorn puted more ,effectiv'sly_

• iClho!llesky Deco mlp,osnuilonMlethod_,This nlelfhod US1eEl a, recurrence procedure

tOI decompose a synlll1le!1ric rBlal1lrixinto!Upper and ~;j)werlJri,aJ~lglula.rmatrices ..

-

Page 36: Kuliah-4 METNUM 26022014

for i =, 2,,3, .". ",P\l (llD)

-

Page 37: Kuliah-4 METNUM 26022014

,

• Exa If1flIPI~e:Deeempose the fol~O'INi~lgmatrix into, its IO"i'ie,r an ell up'p e r tria ngu la II matri ees usung the Cho!esky metrJod:

1 ,'..-..

,_.... -

~~

.OII,':' - 7. s ],0

,3, 10 "2

Page 38: Kuliah-4 METNUM 26022014

• Example (cont'd]Using Eq_ 1a:

1 1 ];

~= :2 s 10

a, I--- 1

a,1 -- '---a "11

a,t =3 = a"

'II ="!/~I=.Ii =1

U siirng Eq_ 1c;

i=2,j =1

_~

,

10 22 ~=g~ = 1Q =1131!1

~Oj = 22

aza _2_,>- 111 - .! --

Page 39: Kuliah-4 METNUM 26022014

- 12

l-

~ ... i- .._. ..,. .. a .. ~ ,.,_ ~ _

Q,,- .• Example (cont'd)

u~jfilg Eq. 1b:

1 , 3 ill =~=a

.i= 2 g 10 Q,J=3=a"

3 III !.2 ~=g

a". = 1(1= aaIJI - .,.,

I Ul - _-"

t -.-,L 31 --

In = t1:u - L I~ = JQ:= -J~ = ~/8_(1')'1 = 2t:1

Page 40: Kuliah-4 METNUM 26022014

J-

.

-.,.

•............ ~·l~"'_.._ _

-..,a,•::.1

.1 IExalmlplle (coll1ltl;d) 1 :& 1 a.. =2=12' ..

U~il'ilg E.q. 1e:Z= l.i = l,ruLoiI.2

a', - I..i..,~·..,~. = :bd.1 ~

it

-

04.= 2.!i

:B lif}1

.(it 121

a =3 ='aII II

D:It =S

ai. ='11) =,Il\..~WlIJ - -.-

I.. =2l:It = '2

Page 41: Kuliah-4 METNUM 26022014

~

a

..

• Example (cont'd) 1 2 1Clll = 1Clu = 2 = fl::1

Using EQ_ 1b: A--

2 a 10." 1(1 22

ClII = 3 =€I",

;i = 3:a", =:g

an = 10= Q."

11-1 ,I =?

-"- ,

1~: .= '\ iIiIJJ -'

2:J~~~

l21 = 2~'==.~I" =3la = 2

Page 42: Kuliah-4 METNUM 26022014

12.

~

~

• Example (cont'd) III = 1- Th elJlefOT,e I21 --_'J

1 0 0 l = '}L - 1 2: 0 lJ;1 = :3

3 2: .3 lJil = 2] 2 3, lJJ =3

IT = 0 ') ')

0 0 '."J

Page 43: Kuliah-4 METNUM 26022014

....

• Example (cont'd)• Note that the validity of LL;r = A

~. 0 0 ~. .oJ' 3 1 2 .ju.l'

=~4.=:2 2 0 0 2, 2: - 2 () UO

3 2 3 0 0 3 3 10 22~I

Page 44: Kuliah-4 METNUM 26022014

Iterative Equation-SolvingMethods

• Simultaneous equations can also be solved using trial-and error procedure.

• In this procedure, a solution can be assumed, that is, a set of estimates for the unknowns.

• Then, these estimates can be revised through some set of rules.

Page 45: Kuliah-4 METNUM 26022014

Iterative Equation-SolvingMethods

• This approach is the basis for iterative methods for solving simultaneous equations .

• Among these iterative methods, two procedures are considered:- Jacobi Iteration, and- Gauss-Seidel Iteration

Page 46: Kuliah-4 METNUM 26022014

Iterative Equation-SolvingMethods

• Jacobi Iteration- Consider the following general set of

simultaneous equation:ClllX1 + Cl12X2 + Cl13X3 + 0 0 0 + Cl1nXn = C1

Cl21X1 + Cl22X2 + a23 X3 +ooo+Cl2nXn = C2

Cl31X1 + Cl32X2 + Cl33X3 +ooo+Cl3nXn = C3

(2)

Page 47: Kuliah-4 METNUM 26022014

Kul_ia

rh 4Metode Numerik

Iterative Equation-SolvingMethods

• Jacobi Iteration- The first step in this method is rearrange

each equation in Eq. 2 to produce an expression for a single unknown.

- To start the iterative calculations, an initial solution estimate for ~ unknowns is required.

Page 48: Kuliah-4 METNUM 26022014

1

2

Kul_ia

rh 4Metode Numerik

Iterative Equation-SolvingMethods

• Jacobi Iterationx - C

1--a12X2 -a13X3 -ooo-a1nXn

all

X = C2 -a21X1 -a23X3 -ooo-a2nXn (3)a22

Page 49: Kuliah-4 METNUM 26022014

Kuliah 4 Metode Numerik

Iterative Equation-SolvingMethods

• Jacobi Iteration- The initial estimates for all the X, are

substituted into the right sides of Eq. 3 to obtain a new set of calculated (left side) values for the ~'s.

- These new values are substituted into the right side of Eq. 3 and a new set of values for the ~'s is obtained.

- This iterative process continues until the calculated values for ~'s converge to an acceptable solution.

Page 50: Kuliah-4 METNUM 26022014

Kuliah 4 Metode Numerik

Iterative Equation-SolvingMethods.il.iUM.f :;:;0: _oIm~.....S..t2..2 nii::._== _• Example: Jacobi Iteration

Solve the following set of equations using the jacobi iterative method:

3X1+X2-2X3=9

-X+4X2-3X3=-8

Xl - X2 + 4X3 = 1

Page 51: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

Iterative Equation-SolvingMethods

• Example (cont'd): Jacobi IterationThe first step is to rearrange each equation as

follows:

3X1 + X2 -2X3 =9

- X + 4"<Y2 - 3"<Y3 = -8X1- X2 +4X3 =1

Page 52: Kuliah-4 METNUM 26022014

PERSAMAAN LINEARKul_iarh 4 Metode Numerik

Page 53: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

Iterative Equation-SolvingMethods

• Example (cont'd): Jacobi IterationLet an estimate of the solution be Xl = X2 = X3 =

1, therefore,

X = 9-X2 +2X3 = 9-1+2(1) =.!.Q=3.333I .., ..,..,

;) ;);)

X = -8+XI +3X3 = -8+1+3(1) =-1244

X3 = I-XI +X? = 1-1+1 =_!_=O.2504 4 4

Page 54: Kuliah-4 METNUM 26022014

PERSAMAAN LINEARKuliah 4 Metode Numerik

Page 55: Kuliah-4 METNUM 26022014

Kul_iarh 4

Metode Numerik

PERSAMAAN LINEAR

Iterative Equation-SolvingMethods

• Example (cont'd): Jacobi Iteration

Revised values for XI :

XI = 3.333

X2 =-1

X3 =0.25

"'\"1= 9 - "'\"2 + 2"'\"3= 9 - (-1) + 2(0.25) = 3.53 3

"'\"2 = -8+"'\"1 +3X3 = -8+3.3333+3(0.25) =-0.97924 4

"'\"3 = 1- "'\"1+ X2 = 1- (3.3333) + (-1) = -0.83334 4

Page 56: Kuliah-4 METNUM 26022014

X3 = 1- .IYI+ X2 (3.5) + (-0.9792) = -0.8698

,-----.,

Iterative Equation-SolvingMethods.1.1. eta sl: orEiiI'll••nns· DiP_,.,l! 012.£ lO,l £,,,.......3. llWMnns "::ii::W_==.• Example (cont'd): Jacobi Iteration

Revised values for XI :

Xl =3.5

X2 =-0.9792X =-0.8333 XI = 9-X2 +2X3 = 9-(-0.9792)+2(-0.8333) = 2.7709

J~---~ 3 3

X = -8+XI +3X3 = -8+3.5+3(-0.8333) = -1.75002 4 4

= 1-4 4

Page 57: Kuliah-4 METNUM 26022014

Kuliah 4 Metode Numerik

Iterative Equation-SolvingMethods

• Example (cont'd): Jacobi IterationIteration XI 16.-1:11 Xl 16,,\'11 Xl IAXII

0 I - I - I -I 3.3333 2.3333 -1.0000 2.0000 0.2500 0.7500

The solution convergesto:.IYI= 3.IY2 = -2.IY3=-1

2 3.5000 0.1667 -0.9792 0.0208 -0.8333 1.08333 2.7708 0.7292 -1.7500 0.7708 -0.8698 0.03654 3.0035 0.2326 -1.9596 0.2096 -0.8802 0.01045 3.0664 0.0629 -1.9093 0.0503 -0.9908 0.11066 2.9759 0.0905 -1.9765 0.0672 -0.9939 0.00317 2.9962 0.0203 -2.0015 0.0250 -0.9881 0.00588 3.0084 0.0122 -1.9920 0.0094 -0.9994 0.01139 2.9977 0.0107 -1.9975 0.0054 -1.0001 0.000710 2.9991 0.0014 -2.0007 0.0032 -0.9988 0.001311 3.0010 0.0019 -1.9993 0.0013 -0.9999 0.001112 2.9998 0.0012 -1.9997 0.0004 -1.0001 0.000213 2.9998 0.0000 -2.0001 0.0004 -0.9999 0.000214 0.0003IS 3.0000 I) 0.0001 ~

0.0002 _ nnnn 0.0001~ 0.0000 -1.0000 I) 0.0000

Page 58: Kuliah-4 METNUM 26022014

Iterative Equation-SolvingMethods

• Gauss-Seidel Iteration- Like in the Jacobi iteration, the first step in

this method is rearrange each equation in Eq. 2 to produce an expression for a single unknown.

- To start the iterative calculations, an initial solution estimate for X; unknowns is required.

Page 59: Kuliah-4 METNUM 26022014

Kul_iarh 4

Metode Numerik

Iterative Equation-SolvingMethods

• Gauss-Seidel IterationV'" _ C1 -(/12X2 -(/13X3 -···-(/IIlXn

-"1. 1 -(111

V· _ C2 - (/21Xl - (l23X3 _ ... - (/211Xn-"1. 2 -

(/22 (4)

-"Y II = CII -(l/1X2 -(/1I2X3 -···-all_l.II-"Yn_l _;. ;...:;. ;;_--=--_; _ ;._; ;_

Olin

Page 60: Kuliah-4 METNUM 26022014

Iterative Equation-SolvingMethods• Gauss-Seidel Iteration

- In jacobi iteration a full cycle is completed over all the equations before updating the solutions estimates.

- In Gauss-Seidel procedure, each unknown is updated as soon as a new estimate of that unknown is completed.

- The notion here is that the most recent estimate is the best estimate, and therefore, should be used as soon it is available.

Page 61: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

Iterative Equation-SolvingMethods

• Example: Gauss-Seidel IterationSolve the following system of equations using the Gauss-Seidel Iteration procedure with initial estimates of Xl = X2 = X3 = 1:

4X-2Y +3Z =15.7-2X +4Y- Z = -14.1

3X + Y-3Z = -4.2

Page 62: Kuliah-4 METNUM 26022014

PERSAMAAN LINEARKuliah 4 Metode Numerik

Page 63: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

Iterative Equation-SolvingMethods• Example (cont'd): Gauss-Seidel Iteration

4.;.r-2Y+3Z=IS.7-2X +4Y - Z = -14.1

3X + Y - 3Z = -4.2

X=lS.7+2Y-3Z4

Y = -14.l+2X +Z4

Z = -4.2-3X -Y..,

-,)

Page 64: Kuliah-4 METNUM 26022014

PERSAMAAN LINEARKul_iarh 4 Metode Numerik

Page 65: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

Y= -14.1+2X+Z4

= -14.1+2(3.6750)+(1) =-l.43754

Iterative Equation-SolvingMethods

• Example (cont'd): Gauss-Seidel IterationAn estimate of the solution is "'¥l = Xz = X3 = 1,

therefore,

X= IS.7+2Y-3Z = 15.7+2(1)-3(1) =3.67504 4

Z = - 4.2 - 3.1¥ - Y = - 4.2 - 3(3.6750) - (-l.4375) = 4.5958-3 -3

Page 66: Kuliah-4 METNUM 26022014

PERSAMAAN LINEARKuliah 4 Metode Numerik

Page 67: Kuliah-4 METNUM 26022014

Kul_iarh 4

Metode Numerik

PERSAMAAN LINEAR

Iterative Equation-SolvingMethods

• Example (cont'd): Gauss-Seidel IterationRevised values for Xi :

X=3.6750Y=-1.4375

Z = 4.5958

",Y= 15.7+2(-1.4375)-3(4.5958) = -0.24064

y= -14.1+2X+Z4

= -14.1+2(-0.2406)+4.5958)4

=-2.4964

Z= -4.2-3X-Y-3

= -4.2-3(-0.2406)-(-2.4964)-3

=0.3273

Page 68: Kuliah-4 METNUM 26022014

Kul_iarh 4

Metode Numerik

PERSAMAAN LINEAR

Iterative Equation-SolvingMethods

• Example (cont'd): Gauss-Seidel IterationRevised values for X, :X =-0.2406

Y=-2.4964Z = 0.3273

x = 15.7 + 2Y -32 = 15.7 +2(-2.4964) -3(0.3273) = 2.43134 4

Y= -14.l+2X+2 = -14.1+2(2.4313)+0.3273 =-2.22754 4

2 = - 4.2 - 3.1Y - Y = - 4.2 - 3(2.4313) - (-2.2275) = 3.0888-3 -3

Page 69: Kuliah-4 METNUM 26022014

PERSAMAAN LINEAR

Iterative Equation-SolvingMethods• Example (cont'd): Gauss-Seidel Iteration

Iteration X I IlKI y I~YI z I~I0 1 - 1 - 1 -

The solution convergesto:X= 1.3y= -2.4Z= 1.9

1 3.6750 2.6750 -1.4375 2.4375 4.5958 3.59582 -0.2406 3.9156 -2.4964 1.0589 0.3273 4.26863 2.4314 2.6720 -2.2275 0.2689 3.0889 2.76164 0.4946 1.9368 -2.5055 0.2780 1.0594 2.02955 1.8777 1.3831 -2.3213 0.1842 2.5039 1.44456 0.8864 0.9913 -2.4558 0.1345 1.4678 1.0361

30 1.2999 0.0003 -2.4000 0.0000 1.8999 0.000331 1.3001 0.0002 -2.4000 0.0000 1.9001 0.000232 1.2999 0.0002 -2.4000 0.0000 1.8999 0.000233 1.3001 0.0001 -2.4000 0.0000 1.9001 0.000134 1.3000 0.0001 -2.4000 0.0000 1.9000 0.000135 1 0.0001 0.0000 0.000136 I ~ 1.3000 2 0.0000 -2.4000 0.0000 .." 1.9000 0.0000

Page 70: Kuliah-4 METNUM 26022014

PERSAMAAN LINEARKuliah 4 Metode Numerik

Page 71: Kuliah-4 METNUM 26022014

Kul_iarh 4

Metode Numerik

A sufficient condition for a solution to be found is that the absolute value of thediagonal coefficient in any equation must greater than the sum of the absolute values

Iterative Equation-SolvingMethods

• Convergence Consideration for the IterativeMethods

For these iterative techniques of Jacobi and Gauss-Seidel to work, certain additional conditions must be considered:1. The set of equations must possess a strong

diagonal.2.

of all other coefficients appearing in that

Page 72: Kuliah-4 METNUM 26022014

Kul_iarh 4

Metode Numerik

Iterative Equation-SolvingMethods

~

• Convergence Consideration for theIterative Methods- Before solving a set of equations using the

iterative methods, do the following:• Rearrange the set of n x n equations so that the

diagonal coefficient is the largest in any equation.

Page 73: Kuliah-4 METNUM 26022014

Kul_iarh 4

Metode Numerik

Iterative Equation-SolvingMethods

• Example: ConvergenceCheck the following set of equations for convergence. If they do not meet the condition for convergence, try to rearrange the equation so that they meet the requirement.

Xl +4X2 -2X3 =3

5Xl -2X2 + X3 = 4Xl +2X2 +4X3 =17

Page 74: Kuliah-4 METNUM 26022014

Kul_iarh 4

Metode Numerik

Iterative Equation-SolvingMethods

.l'YI + 4X2 - 2X3 = 3

5X1 - 2X2 + X3 = 4.l'YI +2X2 +4X3 =17

III < 141+1-21 ~ 1 < 6 N.GTty rearrange the equations.

5X1 -2X2 + X3 =4

.l'YI + 4X2 - 2X3 = 3

.l'YI + 2X2 + 4.1'Y3= 17

151> 1-21+111 ~ 5 > 3 O.K

141> 111+1-21 ~ 4 > 3 O.K.

141> 111+121~ 4> 3 O.K.Therefore. use the above set in iterative methods,

Page 75: Kuliah-4 METNUM 26022014

SEKIANAny Question ???