51
King Saud University College of Science Department of Mathematics 254 Math Exercises System of Linear Equations Ch. (3) Khaled A Tanash ,---------; e-mail, [email protected],sa uri: http://fac.ksu.edu.sa/ktanash

254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

King Saud University College of Science Department of Mathematics

254 Math Exercises System of Linear Equations

Ch. (3)

Khaled A Tanash

~~\..:;. w~L)I~ ·~ ~ ~ ,---------; ~

e-mail, [email protected],sa

uri: http://fac.ksu.edu.sa/ktanash

Page 2: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Gaussian Elimination Method

Example: Use simple Gaussian Elimination Method to find the values for a for which the following linear system is consistent

x1 + 2x2 - 3x3 = 4

3x1 - x2 + Sx3 = 2

4x1 + x2 + (a 2 - 14)x3 =a+ 2

Also write the solution for a =1

Solution

\ " -3 lf I ~ -3 '-f .............................. h ............................................................................ ~ ..................................... .

............... ... .:1. ....... ::.~ ........ ~ .................. ~ .......... :. ........... P .......... ~.l. ......... t~ ....... :-:J.9. .......... . 2 ~

................ .~ .......... L ...... ~--~~.t ...... ~.~~--- ................ C?. ........ :.!.. ... ~ .. -::2 ... .. ~.-:~..!.}.. . .. - Jfl, +Rt -~R, + R..s .................................................................................... :.1 ..................................................................... .

·····~········································································································································

-::.R~ ... ±.R3. ....... .. 1 ................. 2 ............. ~!. ......... ········j_········· .................................................. .

.............................. .. 9. .............. -.--:.t ............ ~.~-········· ... -:: .. \.9. ........ .................................................. . 0 0 !i2-\6 ol..-li .......................................................................................................................................................

'2. ······~······~····~ . .\ .. 6. ..... :::: .... 9 .......... : ..... .... : .. ' ... ..... .- ··- ... : ... ~.: ..................................................... . ~ o( ::- ± Lt . ~ :Li

.... ~~-·················································································································································

............ ~ ..... ::; .... ~ .......... ~ ..... .in.fir.r.if.I~ .. ~;}..J9t4..~~-r! .......... 9 .... 9. ... 9. .. J ... 9. ............ .

~ :: - '4 9 f)O JoW.Jion o CJ d f_g ..........................................................................................................................................................

Page 3: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

...... ~ .... ~ .... F..±. ':1. ... :111~. s~rkrr! )11!{ .&.u j/g: .. S.<:~.~r! ........................ .

.... ~ .... 1.f. .... ~ .. # ... ~Y ..... fh~ .. ~~.~ .. i.~.CP.l1~!~.~····························

.. Naft'!. .... l.f. .. ~ .:=:=:.~ .................................................................................... .

\ ~ -"1 L{ .................................................................................................................

. . . . . . . . . . . . 9. ....... -~ l ....... /':f ....... ":":l.C?. ............................................................. .

0 6 f()-16 -J ..................................................................................................................

···························································/························································

....... . --:-:l.'i. .. 't.!J .. ~- .-:-: J .... ~- .. P..1 .. -~ .... ~- .................................................... .

·······~;·;~····~····~-~~···~··i"4j""""~"""+"£~··················································

................................................ iii ............. . .!J.I!i ................................................ .

. . . . . . t..J. ... :::: .. q. ·*· J.;-6·· .. . -: .. -~- ...... = .... lJ ................................................. . '3-5 31)

Page 4: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Use simple Gaussian Elimination Method to find the values for a such that the linear system

x1 + x2 + ax3 = 1

x1 + ax2 + x3 = 1

ax1 + x2 + Sx3 = -3

Is singular, use the smallest positive integer value of constant a to find the solution.

Solution:

' \ P( ' \ 0( ····· ................................................................................................................................................. .

..... .... \. ............. ~ .......... ~ .................... ~ ................................... 9. .......... ~::-:~ ....... J.:::~ ...... q ..

..... .~ .......... .J. ........... ?. ... ... -:-:.!.. .:#..'.~.g~.J..:::.~.~t±R~.. .P ........ .\..~.~ ..... :5. .. :-:-;. .. :::.!..~t>{

... R2..::1::R3 ..... .... t ........... J ........... ~ ......... ~ ..................................................................................... . ························· .P. .......... ~~-~ ..... \.:::.~ ..... 9. ............................................................................... .

'2. 0 0 ---'.-41{+6 -3 -0(

••••• •••• •• •••••••••• •••• • ••••••••••••••••••••••• -:\... •• • ••• • •• • ••••• •• • •• • ••• ••• • •••••••••••••••••••••••• 0 ••••••••••••••••••• 000 0 •••••••••••••• 000 •••••

.... .Rt ... : ............ 9.{ ... :::: . .\ .......... s .... l12 ... if...?...~) ................ o.. ..... Q ... o ... ~ .. 9 .................... .

......................... :!k. .. .s~r~ ... !.!..Ji!J~(b':1l~i/n!.f~ .. ~~~-.f.e!Jkr.i.J. ........ .

.... R.J..: ................ :-:: .. ~~.-:-:-.~ .. ±6..::7.g ....... ~ .... .(~ .... ± .. "3. .... llK .. ::::.~ ... J. .... :; .. 9. ........... .

. . . . . . . . . . . . . -~-. .;: .. :::1 ... 9. r. .. ~- ... :-:-:-: .l .............................................................................................. .

Page 5: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

······························································:····························,····················\····

...... i l .. ~ ... ::. ~3. ....... s il!!fl-!kr. ( io /,(!(!.~ f!l.~ .s.44. io.11. J. ...... o.. .. o. . .<?. .. o.

···········~--~·i········5~~···;w···i~-~--~-~;;;J;~~-"'"··············~--~---~·r·~·~······ ................................... ;. .................................... ) ......................................... .

. . . . . . . N.ow. ...... bhe. ... SlY~~.t ... P~-~ltiYY.. in~ .... iJ. ... ~-. ~- .3 ................... .

l \ :3 ............................................... ····································································

0 2 _'l 0 ............................ ~ ................................................................................ .

o o -o _/ ........................................ 0 ....................................................................... .

. . . . . . ~ -~- XJ .. ::::: ... :-If. ... ~- .... ~.1 .... =: .. 1: .............................................................. .

. . . . . . 2. .. ~t ..... :::; .. l .. .... :~ ...... ~-~. :=::.1 ............................................................ .

%l ::: l -I -J ~ It = -3 • • • • • • • • • • • • • • • • • • • •••••• 0 0 ••• 0 •••••••• r:-/. . ............. 0 0 ••••• 0 ••••• 0 •••••••••••••••••• 0 •• 0 ••••••••••••••••••••••••

Page 6: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Use simple Gaussian Elimination Method to find all values of a and b for which the following linear system is consistent or inconsistent. Find the solution when the system is consistent.

Solution:

x1 - 2x2 + 3x3 == 4

2x1 - 3x2 + ax 3 == 5

3x1 - 4x2 + Sx3 == b

..... ..... ~ ........ ::-::2 ............ ~ ..... .... ~ ................................................ -:.~ ............... ?..... . .. j ............... .

..... ... 2. ...... :-:.:.~ ........... ~ ........... ? ............................... ~ ............... ~ ............. P.::-::~ ... .. -:::.~ ........ .... ..

..... ..} ....... :.} ......... ?.. ...... ····~···· ....... ~ ............ 9. ............ f.: ............ ~.~ .......... h. .. ~.!2 ...... . -2 /la t R.-z.; -1 R.t tR.J

.....................................................................................................................................................

..... ~ .................. J .............. :.~ ............ ,;;! .................. ~ ........................................................... . -2 R1,tR c l a.--6 -'1 ...................... 3 .............................................................................................................................. ..

0 0 s -.2.o... ~-6' ••••••••••• 0 •••• 0 0. 0 •• 0 0. 0 0 0. 0. 0 0 0 0 0 0 0 0 0 ••••• 0. 0 0 0. 0 ••••• 0 0 •••••••••••••• 0 0 ••• 0 0 •• 0 0. 0 0 0 0 0 0 0 0. 0 •• 0 0. 0 •• ~. • ••••• 0 0 0. 0 0. 0 0. 0 0 0. 0 0 0 0. 0 •• 0 ••• 0 0 ••••••••••••

.. ~ .. !.r..CAtJ..~!St~~.P..lf .. ~ ...... ~ ... ~.g.~ ... ~ .. 9. ....... ~':!:: ...... P ... ~ .. 9.. .. 1. .. 9. ................... .

...... ... .. ...... ....... ..... ..... ... . . ........ . ~ ......... 9.:-... ;7. ... ~ ............. ~. 4.. ...... b .. -F.-. .. 6. ... ........................... .

.... ~ .... C9.n.Ji.~ .. f.~t .... ~ .. t. .......................................................................................................... . Q - ~ CL :: o ONtcl. b -6 :-o ............................................. P. ............................................................................................................ .

a. :::- li o.-ri~ b .:: 0 ............................................................................................................................................................

. .. ........ .. ..... .... .... ........ .. . . .......... :-b:li.~~. ,,(P.i,~ .. .... f'-i~~ ..... i.~f.t:rJ.(#.}t.~~t···f~~~ ..

Page 7: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

......... o.-rJt!. ....... . 1 .. f. ..... fl..:. .. :1: .. Y ....... ~.!. .... , _. . . , .. .' .... b.~-.fl ........................ .

. . . . . . . . . . . . . . . . . . . . . . . . . t.h.'.J ..... CM.~ ..... -~~·.v~ ..... ~~~. -~~!#:.~ !~~: ...................... .

. . . . . . N..C?.~ ....... t.h ~ ... -~ _q_/p.f( ~~ ..... J .i. .... Ch .. :::: -~- ... -~~- ... -~ ::: .. ~- ............... .

-2 3 L{ ..................................................................................................................

o I -2 -3 ...................................................................................................................

0 0 0 0 .................................................................................................................

. ~1..: ... .. 1.-. 2 ... . ~ 2. X 1 .. ::: . .-:!. ........ 9 ..... ~.2 .. :: .. 2.. Xj .. J. J. ................................. .

. ~l : ..... ~( ... -:-:2. ~2 ... :':-.1.. ~l ... ::: .. ':1. .. ............................................................... .

........... ~ ...... ~.J ... :-:-.. 'j .. ~j .. +.t. ... t.?...r...J.~.'1 ............................................. . X l -= -2.. + X3 ....................................................................................................................

. . . . . . . Ld.. .... t. 1 .... :::. :/; .... .J.· .... t.. ~ .. /fl.: .............................................................. .

...... X../ ... ~ .. -:.2. . .t.t ... .) .... ~.~ .... :;: .. 2 .. t .. ~.l.. .... J!· .• ;t.J..~ .. t.;.t.§.fR. ........... .

Page 8: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Use simple Gaussian Elimination Method to find all values of a and fJ for which the following linear system is consistent or inconsistent. Find the solution when the system is consistent.

Solution:

2x1 - x 2 + 3x3 = 1

4x1 + 2x2 + 2x3 = 2a

2x1 + x 2 + x3 = f3

2 _, 3 ' I) -1 1 \ ........................................................................... & ................................................................ .

't 2 f) 2o< -4 CJ l{ -t.t 2D< -2 ....... ............................ ti?... ..... ........................................................................................................ .

2 I I Q cJ 2 -2 ° -l ................................................ ~..... .................. . .............................. . rl:. ................ ................. .

.................................................. ~ .. -:.~&.~.R1-:; .. ::-:.8.~.±f?.1 ..................................................... . - J;··k~··+··R·~······ ·2··········~·i···········;···· ········i··········· ............................................................ .

1'!! .. 0 •••• 0 00 0. 0 0 •• 0 •••••••••••• 0 0. 0 •• 0 ••• 0 0 •••••• 0 0 0 0 0 •••• 0 ••••• 0 •••• 0 ••••• 0 •• 0 0 0 •• 0 0 ••• 0 0 0. 0 0 •• 0 0 0 0 0 0 •• 0. 0. 0 ••••••• 0 0 0. 0. 0 •••••• 0. 0 •• 0. 0 ••••••• 0 •••••••

............................... .. 9. ........... ~ ....... ~.~······ ... 2..~:::.:? ................................................................ .

.................................. 9 ........... 9. ......... 9 .......... 2. .. :~ ................................................................... .

... .. .. ..... R."J. .... :Z~o..~ ....................................................................................................................... .

.. ~ ..... ii1Ct!.~~~!.~.t.. .... .t..l .. fi .. :-::.~ ... t ... c: ........ ~ ..... P. .... t..~ ...................................... .

.... ~ ..... ~.IJ.$.~~~.~r!.P. .. .l.t ....... fl. .. ::::.~ .. ~ .. '?. ........ ~ .... P. ... ~ .. ~ ......................................... .

:::::::N:~~:::::::::~~:::::t:~;,~::::i.h~:::;.~:t;A.~~:::::J.t.::ft.::~:~::::::::::::::::::::::::::::::::::::::::·

Page 9: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

. . . . . . . . . . .. 2 ........ -:: \ ...... J.... . .... \........... . ........................................................... .

. . . . . . . . . . . 0 ....... -~ ..... . -:. ~ ....... . 2.. ~-:: ~- ............................................................. . 0 Q 0 0

....................................................... ·····························································

.... -~. -~-~- ... ::=: .. 2. ~- .. -:: .. Z .. +.'f .~J. ................................................................. .

. . . . . . . . . . . . _l)f .'L .... = ... I; .2 .. ~ .. -~ .. '!. 2 .... ~. ~-'. ....................................................... .

2 N.J = 1 -1 x 1 + 1111 rX. - 1;2 + ~, ......... ~ ................................. H ...................................................................... .

= 1/~ + Y" o< -2X '3 ••••••••••••••••••••••• .11-t ••••••••• A. .............................................................................. .

............. ~~ .. =:: .. ~~ ... t .. ~4 .. ~ ... -:: .. ~.~·····························································

....... (~ ..... ~ 7. .. -~- .. P. .... J. ... t. ~- .f?: ................................................................... .

X.t ";: !!" ~ Y~o~ ~ -t n/ = vi) P{ - 1/2 +i .......................................................... ..J ... N-2.. ........ -J. .................................... .

Page 10: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Solve the following linear system using the Gaussian Elimination Method with partial pivoting

x1 + 3x2 - x3 = 4

Sx1 - 2x2 - x3 = -2

2x1 + 2x2 + x3 = 9

Solution: ..... ~k .... tf.\ .. ! :.~ .. ~.~ .... ~~~W.t. .. G.~ .. ~ .. l..ll=J..I. ... ~.i..~ ..... ·~ - -............................................................................. J.. .. ~~~ .... Al.~."W.\ ... c..i. ...... ~I .... J ..... ~ . ... 5.x.~ .. -::: .. 2.X.:?: ... ~ .. ~J .... ::: .... ::.2 ............................................................................................ . ... ~.\ ...... t .... i. .. ~2 ....... ::: .. ~.]. .... ~ .... ~ ......... ~ ............................................................................. . ... 2.X.1 .... +..2.%.:~ .... ±:.%.J ...... ::: ... ~ ............................................................................................. .

. . . . . . . . . . 5 ................ ~ 2 ....... :::.1 .......... ~ .2..... . .. .. .. .. .. .. .. ..b. ........... :::.l.. .......... ::. t ..... -::: l ..... .......... .

........ .. ~ ................. '3. ........... :::-.~ ......... ~ ......................... Q ............. Ll. ......... :.~ .... ... 2..g .... .......... .

....... ..~ ............ 2. ................ ~ ......... 4... ................ 9. ............ 1.~ ............ 1 ..... .. ~ .. ~ ............. .

........ -:::.R~\ .. t. .. ~.R.2 ... ;')·····--::.~.&.• .. +. .. ?..&~ ..... :::! ........................................................................... .

... ).......................... ....................................... ................ .. ............................................. .

. :.~.'h:r..R.~ .... t .. H~ .......... 6. ............. ~2 ......... :-::~ ....... :~ ..................................................... .

.............................................. .. Q ............ ~.1. ....... :.~ ..... .... 2 .. 4. ..... ............................................... . 0 0 l.1§ J)2?

............................................. ································t'j,···········\-g_····· ............................................... .

Page 11: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

.... ldf. 'tJ . ·"'· ... /i. 2.1; ...... ~· ... . X.J. :;; .. . 5.2.6. .... :.,;.f. 3 .... =·.X J. ............... . \%. l'l 11Ji>

..... .1 . . i.. X1 ... ~ .. g . .z. .. -:1:'. ~.(.!. ) ......................................................................... .

............ 21.?-..... :;~ ; ... ~l'2···" x~J .......................................................... .

. . :5. .~ ....... ::: ... -:. &. .. ·* .~ .. ! !. ............................................................................. .

............ 1.~ .. l ... = \ \ .................................................................................... .

Page 12: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: compute the inverse A-1 ,where

A=[! ~ ~] By solving the system AB = I, using Gauss elimination by partial pivoting where B = A-1 .then use it to solve the system Ax = [1,1,2]T

Solution:

Page 13: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Page 14: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Page 15: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

LU Decomposition Method

AX = b linear system

A= L. U,

L: lower matrix U: upper matrix

AX= b => L. U.X = b

ux = y => LY = b

ux = y Doolittle's Method:

~] Crout's Method:

l~J U= [~

Page 16: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: consider the linear system Ax = b where

A = [; = i ~ ] , b = [ 2,4,3] T

2 -2 -1

Find the L.U decomposition of matrix A using Doolittle's method (lu = 1) and then solve the system

Solution: ............ R .. :; ... L •.. U... ....................................................................................................................... . ................................................................................................... ~ .. ...:~ .. L ...... ~.~--~~---.................................................... { .. ~.~-~.1-~) ... fl .... ~ .. ti~.\ .. ~\rl. .. ' .... ~.\ ... ~ \ -· ~\ (...) ·~, A1z. \·. 5~ ..... ........................... .. ............................ ~... . .... ~ .... ~ ..... ~............. ...r. ... ~ .... : ..... . ; ...... ~ ....... ~ .. ~ ....... ~ ................................. lJ. ....... ~ .... ~.!.\} ... ~.\J.\ ... ~ .. ~~-~ ... :::.S ..

....... ... & ..... .-.-:~ ...... \ .... ............................ 1R.Jf..k .. ~ .. \ .... L ......... ~ ... ~.t.>~.~ .... ~~ .. .

....... ... 2. ..... ~.~ ... ~.~... .. ...................... \L~ ... ~?. .... ~ ..... ~~ .. ~ .... ~~ .. .

...................................................................................................... ~P.\ ... Q..j.,.f. .... a .. .~...~\ .

..... ~~.R.~.:tR2.; ... ~.2..&t.tR.J ..................................................................... ~ ............................ .

\ -\ 0 \ -\ 0 ............ ~ ............. ~ ........... \'""' ............ ~ ..... v:, ... :.;;. ...... ~ .......... ~ ......... , ....................................... . • • 0 0 ••• 0. 0 •• 0 ••••••••••••••••••••••••••• 0 ••••••• 0. • •••••• ~ 0. 0 ••• 0. 0 ••••• 0 0 ••• 0. 0.... 0 ••••••••• 0 •••••••••••• 0 0. 0 •• 0 0 0..... • •• 0 0 ••••• 0 0 •••••• 0 •• 0 •••• 0 0 •• 0

.. . .. .. .. . .0........ . .. 9. ......... ~ ·'·............. .. ......................... ?. ........ ?. ......... ~- -~... .. ........................... .. \ 0 0 ..........................................................................................................................................................

........... L .... = ......... ~ ............. \ .......... 9.... . ........................................................................................ .

.......................... . ~ ........... 9 ........... \ ........................................................................................... .

Page 17: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

... N a .w. ... iP .... flflt. ... :/M .. ~.t!ld ia.>1 .. d. ... ~t.~ .... ....................................... .

.. L~ .. ~.b. ..... ~) ..... ' ........ C? ........ c:? ..... ) ...................................................... .

····························· ··~·······'·········~···· .. ~ ..... ·················································

~ 0 \ J ··································································· ·················································

· · · · .j · ·~·I· · · · "· · if · · · .. ~ ..... 't. t:J 'l. ... T< .. '-f ... ..... ""~ l '} .1. ... "'?. . 9./ .................. .

. . . . . . . . . 2. .'}.t. +.·'A-. J. .... ?: .. $. ...... ::c>. ... '} t .... :';' .. J .. ::j ..................................... .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ~ . '3:=: .. "':" .\ . . . .................................... .

. . ~- .. _(}.._ .'k ... ~ .. ~ ....................................................................................... .

\ -\ 0 :2 ...................................................................................................................

0 \ \ 0 ..................................................................................................................

0 0 -\ -'

•• •t ;.: ; •.... \1• •. : •••...•. : .•....•.••.••.. ' ........ : .. ·1· ...•..•.. :· •••••••••• · .•..••••••••••.••••••••••..••• .......... ~~ ... ::::. ... ::-.. ~..1. .... ~.1~.~ .. ~.7.~ .................................................... .

···························································· ] .................................................. . . . . . . . ·~·'· .. :::. ~ .. ~ .. ~ .~ .......... .-:::::>. 1~ .l. ... -::: .. ~ ~· ................................................. .

Page 18: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Use L.U decomposition of matrix A using Doolittle's method (lu = 1) to find the values of a for which the following system has unique solution, and infinitely many solution. Write down the solution for both cases.

Solution:

x1 + O.Sx2 + ax3 = 0.5

2x1 - 3x2 + x 3 = -1

-x1 - l.Sx2 + 2.5x3 = -1

..................................................... B. .... ::r. ... L ..... ~ ............................................................................ .

. .. .. .\ ............... ~ .'. 6: .......... c!.:..... .. . .. . . . .. . .. . . . . . .. . .. . . . . . .. ~ ............... 9.. ~.?. ........ ~................... .. ............. .. 2 -3 ' ~ 0 -4 \ -.20( .................................................. .......... : .... ::J. ..... ........................................................................ .

-\ -l·fl 2·Ji 0 -\ -1,r'+o( ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• ~ ••• :""'".1. •••••••••••••••••••••••••••••

............................................. "::. .. ~ .. &t.+.R.1-: . ..) .. R.~ .. t.RJ .............................................................. .

. ~ ............................ I .............. Q.~.'!i. ............ I?S............................ . ........................................ ..

... ::-.Y':1 .. & .. t.R.')...... ...Q ............. :::-.. ~ ............ ~ ... :::.~.~··············· ........................................... .

....................................... ..Q .............. 9. ............ 2.~,2.!>. .. +.J:.!i..~.. . .......................................... .

.. ~ .. U··=·· ... t ............. ~ .. :.5 ................ ~ ........................................ , ............ P .............. 9. ......... .

..................... .. Q ............ ~.~ ................ t.::--J..~ ............ ~ .... ~ ... ~ ...... 2 ............ l .................. O ...... .

.................... .9 ................ 0 ........... 2.~.2 .. 5..±1·.§.~ ................... ~., ....... o..~2.I ............ ).... ..

Page 19: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

.... N.o.ft.:l.. .. . .. ... . .. ... . .. . ...... .. . ...... .. . .. . ......... ..... .. ... . ................................. .

. . . . . . L~ ... ::;::;., b ..... ·~· .... ... \. ......... P ...... ,tp, .... ... ~.~ .~ .................................... . I] \ 0 -\

····························~········· --~·-······················· .............................................. .

-\ 0 ·2r; \ _, ······································ ........................................................................ .

····~······-;:;: .. O..-.F;'. ........................................................................................... .

. . . . . . . . . }· .~ .... ::; .. . ~ .\. .. ~. ~ .......... ~ ... }.. 2 .... ::: .. -:. Z .......................................... . ············~·'3····;:;' .... 0 ..................................................................................... .

. . ~ .... l!.:.x .... ;;}. ... =9 ...... 1. ........ . ~:.6. ... ... ~ ............... . <? .~ !{ ... ........................ .

o -~ I - 11 o( -2 ................................................................ ~ ............................................... .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 ...... :4.:2..6. .ti:~C?< ..... f?...... . ....................... .

. . . R.}: ........ a?. 2 5 ... ~.l·. 5 .. ~ .. . :::. .. S? ...... ·9· ... ~ ... :;;--:-.t ~. r. .................................. .

... J..f.~ .... :::: .. :-:.\~.~ ... .t.~ ... ~{}~.~~ . .h~.J~t~(/kt.rfJ.~'j-.J~~: ....................... .

....... ... \ ........... ~.· .. ~ ....... ~~.~-...... ~.:!i. ........... ~.~ ... ~.9.~.~ .. t..~l ... ~ .. ~J.;; .. rrl.

. . . . . . . . .. '?. .......... -:-: .~ ........ ~.... . . :-: ~..... . ... ~ ..... :::: .. P :~ .~ ... ~.~X 1 .................... .

. . . . . . . . .G ........... ~ .......... ~.... . . 9....... . ... ~ .. Z. 2.. -z.a! .;, .+./!)/. .. X-. J.. ?.'9 :2.6.:: 1. !'!!..). rt16f{

... 1 .. t. .. ~ .. +. .. ~! ... J5 ..... fh.~ .. ~~J~~.~ ... ~f'J,~ .. f~~: ........................... .

. ~~ .. ~~ ... ~.C?. ........ .J. .... x.~ .... ?. .. l?:.~ ......... ~.~ ... ~ .. ~:2Ji. ............................... .

Page 20: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Find a which the following matrix A singular using the LU decomposition method by Doolittle's method

A=(~ ; 3:) a 3a 4

Use the smallest positive integer value of a to find the solution of the system Ax = [l,0,3]T using Doolittle's method

Solution: ..................................................... 8. .. ~ .. ~.~ .. f.l:.. ................................................................................ .

. fl..~ ... ... J ......... .. k ....... ~...... . ......................... 1 ............ ~ ...... ~ .................................................. .

. .. .. .. .. .. .. . ~ .......... ::1;, ......... : ~- ... ... -~...... .. 9 ............ ~ ........ ~ .................................................. . 1..

.............. ~ .......... ~~--- .... -~··· ........................ 9. ......... ~ ... ... ':i .. ::-.~..... . ..................................... . - :;.R,I +Rt -o< R, +R.l ................................................................ .>. ......................................................................................... .

-~~······················ ···'············~········~································· .. ·························· .. ····················· .. . :.~~ .. R.~.t .. R.l ....... 9 .......... ""]. ....... ~ ..................................................................................... .

1. 0 Ll ·'4~

.................................................... Q ......... .l ...... "-:7:.~ ..................................................................... .

{).. -= ' ~ o<. \ 0 0 ................................................................................. [ .... -:... ........................................................... .. 0 1 c( ' - l \ 0 ..................................................................... ~ .............................................................................. ..

D 0 '"i _'1;10( ~ o(;.., \ ............................................................................................................... ~ ............................... .

Page 21: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

... N a.w. ....... . .fl .. ;; .. k. ~. ~ ....... ~t~. ..... mCIM'J ... -/-kd. ... f! .. ~'f9 ~ .............. .

. . . . . . ~ .... dd..C!J.. J ... =F. . . 9 ............................................................................. .

::::~::::dd.:i&i:::;:::!.4:<:t.:~:0J:::::::;,::M.:<~:y~::#.c~J::::::::::::: ................ d .. cL···~·············:···JJca)··~···\·i·1···x··('4···~~·~·t-y· ....... ~ .................... 1 ....... 1 ...... .). ................................................................. . ............................................................... 1 ................................ 1 ................ .

. ~-. M&. J.. 7; ..... "1. (. l,t. ~ L.~,.,J .o( ... .). ... :;;; . .t ~- !!"!': 4 ~: ................ .

. . . . . . . ,( 2. ~ Y. .~~ ... ~ .. . c? .9 .... ~~ ... ~ .......... ~ .................................................. .

........................... ~ ..... :-:-: ... + .. 0. ............................................................... .

... t:!~~ ..... t~.t .... pan·~;'!~ .. ir!f.~~ ... f~.. . ...... ~ .. ~<~ .................. ..

. . . L ~·.:::..b .. ~ .... \ .......... 9. ..... 9. ....... ~ ..... ~ .. l ... ~ .. ·'· .................................... .

... ... ... ... ... ... ... ... ... .. ~ ......... \ ....... 5?. ..... ?. .... ~ .1-: .. :~ .. .. ~.~ ............................... .

.. . .. . .. . .. . .. . . . . .. . . .. . .. .\ .......... ~!~ ....... \ ..... ~ ..... }. 1 .... ::: .. .. ~!.~ ............................ .

.. u..~.:: ~ ...... \ ......... ~ ....... \ ....... J ............... ~1. .. ::: .. J. .. .......................... . o 7 \ -2 X - -\ .............................................................. ............. 2. .. :·: ................................ .

. . . . . . . . . . . . . . . . . . . . . . Q ......... ?. ...... ~1 ..... ~(7.. . ........ . ?!!. 'J .. ::; .. \ ............................. .

Page 22: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Find all values of a that make the following matrix singular using the LU decomposition method by Doolittle's method

A=G 2 8

2a

Use the smallest positive integer value of a to find the unique solution of the system Ax = [1,2,3]T using Doolittle's method

Solution:

Page 23: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: consider the linear system Ax = b where

A = [~S _;0 ~ ] , b = [-3,27,4]T 1 1 -4

Solve the linear system by L.U decomposition method using crout's method (uii = 1)

Solution: -\ o\' ... ]I .... - L ......................................................................................................................... ~ ......... ~.~ .... .

................................... ~\Jt~~.c..1 .. ~ .. ~~ .... B .. ~~~ .... ~ ........ .

............... .C~.t .. ).~ ... ~Je.) ..... ~ .... ~l;. .. )0..~.J.f..~ ... ~ ...... ~ .. ~ ...... .

............ .C~'k~ ... ~.~.~ .... ~~.~J. ...... ~.~ .... ~.1.).f.~ ... i.?.~ .... ~ .. s .... .

......................................................................... ~ .. ~) ... ~.~~ .... ~.~~ . .r/1.. .. ~ ........ . J' .. / L ~~

•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 1"1'\ ••••• ~ •••••••••••••••••••••••••••••••••••••••••

......................................................................... ~.~.~ .. ~.~~ ... ~.~.d..~ .... ::.~ ... ..

................................................. ~~~~ .. ~.~ ... ~E. ... df.~~ .. ~ .... ~.~ .... . ~I···················· ··············:·~~·········~·~~·· ......................... ·i··········~t;~··········:~··· .. . .. s .. R..~ ... ~··· ... \ .............................................. ···~············· ............................................... . ........................... ... t .............. ~.~.~ ................. t ...... :.gt.t.Rt. ....... .9.. ....... ~.:% ............ ~ ........ . ........................... .L ................. ~ ................ ::::.~. ..:.g.~.~.ft.~.... 9. ........... ~1! .......... ~.~:.~ ..

-2;i) - * L -2;&; - Y.-; .~.............. ............................................. ... "~··············· ................................................ .

:.~a..R~ ..... .9. ............. .J. ............. : .. V.~ .. .. ~:?.n.~R,. ... . .9.. .............. 1 ............. ;~~---· ..

......................... .9. ............ ~'?. ............ ~.~~ ····························· .. 9. ............. 9. ......... ~ .... !.'8. ..

Page 24: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

. . . . -"t ... '"'· -~ .. ·R' . . . . . . .1 ......... ~ ~1.~ ....... ~ .' t,;, . . . . . ...................................... .

.................... ~} ............. 9 ............. !. ........... ~.~~ ...... ~ ... ~ ...................... .. 0 0 \ .............................. ······ ............................................................................. .

.... N.C?.~ ............ ~~ .......... 9 .......... 9. ......................................................... . L -=- 1 -Ci% o ........................................... '!i. .................................................................... .

............ ......... ........ 1 .......... .. ~(~ ........ ~~~ .... ······ ......................................... .

... A. .. ;-.. L.~ .. U ............................................................ ~.~.~ .. ~.)?.····· 0 .• . z:;. 0 .... 0 0 ......•. 0................ . ... 0 0 . 0 ..... 0 0 .••••.. 0. 0 ..• 0 0...... 0. 0 .. 0 .. 0 0 •. 0 ... 0. 0 •............

.. . .. . .. . .. 4!.'. ........ 0 ........ 9 .... ......... ~ ......... ~. ~~ ...... l!:.•.? .................................. .

......... . ~2- ........ t.u ....... 0 ....... ~ ..... 9. ......... ~ ......... ~~.~ ................................ .

... ... ... .~ ...... .. ~.2 .. ... .. ¢'11... ... ... . .~ ........ 9 ... ........ ~ ... . ............................. .

A ·~ ...... ~~ .................... e.~! .. t!.:~ ~ ......................................... 0~ .. !!:.'.!. .............. . ....... .. (2.J ............... t.'2.t .. (4J2.:+f..u ............. ............ t'2.1 .. 4.1.4 .. t..~l..lt.2.:3. ······ ........... ¢l! ........... ... C3.t.4J.2- .t..f.J.~ ................ ~~L<4 '-. t:. f.1~. U-2.'1.. *"· .fP.. .

-~ 2 1 ... (:1 .. -z ... ...................................................................................................... .

. . . . . . . . . . . . . . . . . . . . . .1 ........... ~ ~ ~ ........... 1 ......... ~ ...... . 0r .. :~ .. -:. ?. ........................... .

... ...... ... ... ... ... .. ~ ............. ~ ........... ~ ~ .. . ....... .. ¢:~~ ... ~ .. \ ....... ,),,, .~3 ~ ... ~ .. \ ..... .

. . . -:-:. 5.. u..~.1 .... ;;: 2. . . . . . . . . :9. ... .[ U.J .2 .. ;;: .... 7: 4.' ~ ........................................ .

Page 25: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

···~· ~··~;·· ...... ·~··; ......... ·~·· ···l: ·u_; ·; ... ·~ ... ~· ·~;~· J:··· .................. . . . . . . . . . . . . . . . . . . 3 .. ..................... ~ .... ·-. . ..................... ·_:_ .................................... .

. -~.~I. ?.t t2.2. .. =:. ""·' .0 ..... =) \ t'~2 .. = ... ::- ~ ~1· .......................... . ~-j~~ :~:: ~-~~. -~;_;·:;. ·,_ .. : .;.: .[ 4. ~~- .·. ~: .. ~:.i!;.J : ... : : .. ·:: : .. :.:: ·: ::. ·: ::~:~(.~:::+.:::?;~::::;:\::::::::::::~>.:::\ ... (3..2 .... ; ..... ~i:r::::::::::::::::::::::::::::: ................................ .,. ................................... ······ .................. ······2.······· ........ .

.. ~ .. ~~ .. ~ ... ~ .. ~ ... ~.~ .... ~ .. ~"J.:t ...... ~ ... ~.~······~···~'···~······~···~~··········

' -2/'j -1;~ -;; 0 0 ~· .. ./:).. ... -;.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ·,. . . . . . . . . . . . ................................... .

. . . . . . . . . . . . . . . . . . . . . 9. .............. .\.. ........... ~. ~~~ .... ~ ... ~ .. ~ ...... ~ ........ ~ ~. ~1?. ...... <? .... . 0 \ \ z;;- -2);~ ................... 0 ........................................................................................ ..

... Na.~ .. . L.»·· ::;;.b ... :;} ..... . ::.f. ...... . 9. ..... ~ ............ .. -:-: .. ~ .. .......................... .

... ... ... ... ... ... ... ... ... ... ... ... ... ... .. .. .' ... ..... ~~%. .. ... 9 ... ........ ~ i: .. ....................... . , ~- -lex '~ ............................................................... )') ........... :B. . . . . . . . . . . . . ...................... .

. . . ='> .. ·l}· , .. ~ .... ~ ........ ; .... ~i· ·~· ...... ~. ·lYq .... .j· .. ·~"j. ~· ...... ~2... .............. .

1 I 1 - ~ -l.1. '1/ ... ~."X..;:; .. ~· .. ·~· ................................. !f... . ..... !i..... . ................................ .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 ............. ·'· ......... ~. ~~S ... ~ ~~ ~ .................................... . 0 0 l -2..

~ ..... ?t. .'J ... :: ... . 7.2 ..... ·;; ....... 'X .2 .. :¥ .... :-:-.3 ........ J. .... X., ... ;:: ... ~ .l ........................ .

Page 26: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: for what value b the following matrix is singular using crout's method

A=[; ~4 ~] 4 -2 5

Solution: I I L . ~·~I . .\) J o/J

........................................................................ ~····~············~··················4--······;).··············· J\ Y-i> .- - -"' .......................... ........................................... . ........................................... )?.\ ... ~.r.. .... ~ ....... .

• 1;1) R, \ - 2 ~2 -............ lfJ ..... .1 ................................................................................................................................... .

1- L{ 3 ···························· ............................................................................................................................. .

~ -2. ; .................................................................... ····················································································

··:_·i!C.i4·tt·i::······· ·····································f,·;········ ................................................................. .

l -1- /2,. ----+7············· ............................................................................................................................ ..

.. -:::.~ .. rt..l .. ±.R>. ........... 9 ................. :??. ........... 1...~.~---· .................................................................. . 0 6 ~-.2b

.,..... .. .... .. .... . .. .... .. .. . . . .. .... .. .. ....... .. ...... .... .. . .... .... .. ....... .... .. .... .. . ...... . ........................................ . If> R, \ - 2 b;2 J -2 b~ . )····· ................................................................................................................................... .

0 \ "'/g - b/B ) o I 3_-g _hA ............................................................................... ........ 6/l·····R:···· .......................................... S .. . 0 b 6 - 2.b - t.+- ~ 0 0 J! - 2]!,

....................................................................................................... ····························~······'i·····

I - ~ b/ -""""~ ................................................................. 2:. ... "1) ................................................................. .

"' o I }'B - ~ -::: {).. -----···12··········· ............................................................................................................................. . Jl-l;h } 0 0 \

Page 27: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

... L ... :::; ..... 2 .......... G ........ q ........................................................................ . 2 8 0 ............. '''4'' ········;s········l~··~·'1'' ............................................... ········· ..... .

............. ···································~··· ·····························································

........................................................................ ~.l.~)e..).) ... ~} ... :f. ....

. . fJ.~ ... ~.~. ~ .... ~ ........ ¢.;1. ............. ,(;,~ .lh 2. .................. 0.t. .. .1!:: /.J. ................ .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . tlJ ........... 621. lf.J.1. i-&2 ............ ?tt .. ~~1. -!::~~.~!. ... .

.. . .. . .. . .. . . . . . . . .. . . . . . . . . . . . (;J. .......... ~~ .. U1 i. .. t .t.12 .......... 0t. IJ.:JJ. r6.t.l/..z1. .f4

.No.w. ........ ............................................................................................. .

... ... ... A .... : ..... .. 2 .. ....... ~ .. ':1 .. ...... P. ................................................................. . 2 4 '3 ...................................................................................................................

~ -2 r;

. ~· ...................................... ;;:~· .......................... ')::! ..................................... .

C11 =I) vgt ::Z v1' -='1 ........... ._. ........... ~................ ················'········· .......................... .

. 2.~11.;: ... ~.~ .......... ~ .... u,b = -2 ....................................................... .

. . '2 ... ~ ~ 3 ... ~ ... ~ ....... ~ ....... ~1.1 ... ~ ..... ~(.2. .................................................... .

. . ~ .. '1 .. +.. . .. . !.2.2 .... :=. ... '1 ....... ~ ..... (.u ... s. .. 8.. ........ b .. ............................. .

. . . . . h .... :':" .. ~ .. U.'l.~ .... ~ .. "J. ........ 9. .. «~ '· .... 7: ...... ~ .. ~ ... ~s ............................ .

. . . -::.g ... + ... e.12..· ... ;; .. :-:-: 2 .......... ~ ..... ,(J, 2. ... ~ .. 6. ........................................ .

... 2b ....... +. .. .1.~ ... ~ .. ~ ... -+··~J.·.::: .. ~ ..... ,;;')., .. e.1·1··~· ... J!... .. ·'""··l§l .. ........ . ~ g ~ ~

Page 28: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

.... . l.. ... :;. ........ -~- ........ 9 ...... 9 .................................... ~- ....... -~ 7... ............ -~~~ ..

. . . . . . . . . . . . . . . . . . 2 ........ -~ ....... ~- ............... ?. .. C!. ... -~ ..... 9 .......... ·'· ........... -~-~ .% q 6 _!l - 5'_3. o I ··············· ........................ ~ ......... ~ ....................... c.J. ............................... .

. . . . .r!. <J'~ ........ fl. ... Jitl'}~ ... tf ... ckfl fl.) .. :-: .. CJ .......................... .

::::?i!.?1.J:::~::~:c:L:;:v.;y::::::~:::?i!.(~)::~::~<0.):::::::~: ....................... :: ... ·2·. X· .. 8 ... ).. ... 1.1 .. ~.!;b .... ·X· .... l ...... -: .. (!) .............. ........... .

~ .....................................................................................................................

. . . . . ··~··· ... 16.{ II ~ 6"b }·· .-z:.O. ........... ......... H ••••••••

..................... ...... ............ ......... ......... ...... ... ... ............... ... ... ... ......... ............ .. .

.................. ~) ...... u .. ~ ... ~.b .... ;;. .. o. ........ ~ ....... b ... ~ ..... lL .................... . n

Page 29: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Find determinant of the coefficient matrix A of the following linear system using L.U decomposition by crout's method. If det(A) = lA I = -1, then find the unique solution of the following system.

Solution:

-x3 = 1

x2 + x 3 = 1

-x1 + x2 + ax3 = -1

fJ- J 0 -l ..................... ~ ............................................................................................................................... .

........................... ... 9 ............. .1 ................ ~ ......................................................................................... . -\ \ r:{ a_.) _'ll \\ -;w. \..

····································································· ·····················································~········~,;.··.:f.':. ... . ..... f.J.::; ..... L .. ., .... U. ............................................................................................................................ .

-·········~········ ············································· .............................................................................. .

. . . . . .. . . . . . . . . . . . . . . . . t..c, ............. 0. ............. . 9 ...... .............. \ .......... ~~-2 ....... .CJ:l. 3 ................................. .

.................... . (~.1.. ........ ¢.'~~ ........... 9. .......... ~ ........ 9. ............... \ ........... ~2.3 ............................. .

.................... _.(~~ ........ ~2 .......... (3:3.. ........... ..0 ........... ~ ............... \..... . ........................ .

..... :=.. .......... ({l ................................... ~(.lt.J.2. .............................................. ~ ... ~J1 ................ .

............... ... f21 ......................... 0.l.~J.2..±.t.2.2. ............................. (2.\.Y.:I."l .. ~.~~--f:!:.~3 .

............... . f.J.J ........................ ¢.'3l..IJI.l.t. .. C.32. .................... C.'-J .. f!:J.3.±.~2.U2.'3 . .+ .. ~3

......... t.., .\ ...... ;;; .. \ ....... -.................... ~..2 . .\ .... -;;: .... 0. ...................... ~:J.l ... ;;, ... :-::-. ~- .............................. .

. . . . . . . . . . . . . . . . u. J.!).. ..... ;:: ... 0. ....................................... U.13 ... =· .... -:-:.\ ................................................ .

Page 30: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

....... ~~ ... ;; J ................................. U.;;.. ~ ....... ;;::: . L .............. ~ ... f.3.2 ... ;, ... .1.. .. .

···················································r ··············!································· .... J.± .. \ .. ± ... ~3. .. ;:;:-... ~ ...... .;:;:) ... ~.~1 ... ;; .. P.( .. 7:2 .. ~ ................................ .

:~ .. . L. -w:..... . .. ~ ............ 0. ........ 0...... . .... "f:.J.:,. ~... . . L ...... . 9. ..... . ~. ~ ................. . I -' o \ \ ................... 0. ..................... 0 ........................ ······························ ·············

. . . . . . . . . . . . . . . . . . ~ .1 ........... .1. ....... ~.-:!..:.. . . . . . . . . . . . . . . . . . . .~ ....... ~ .......... \.. . ........... .

............. ............................. . .......................................... ~\~.))\.~} .. . A I 0 -\

...... T:I..-:::. ........•...............•...••...•.. •···••····•·••··•••······••··•··•··•·•··••••·•····••·•···••··••······

0 ' l ············· ································· .................................................................... . -l 0( .....................................................................................................................

. . A., .. t. ~l .. .,.,. . . . ... ~ ........... 9. ....... ~.'....... . .. ~· .......................................... .

.......................... .... 9 ........... ~ ..................................................................... . 0 I ~- \ .......................... . .................................................................................... .

··~································································································

.--:: RL.t R.-:;.. . . . . .\.. ......... o ....... ::-.'. . . . .. . .. . . } . . . . . . J. . . . . ... o. ...... :-: .1. . . . . .... (;{

....................... 9. ........... \ .......... ~ ....... . ~2, .. R-3 ..... 0. ........ ·'· .......... ~ ...... ~ ..... .

........... . ....... 9 ......... 0.. . .. ~":'":?.. . .................. 9 ........ 0 .......... ~ ........... .

............ ... 1 ........ 0 ...... 0. ....... ·········································································

.. ~:::: ....... 0 ...... ~ ........ 0 ............................................................................... .

............ . --:-.~ ...... ) ....... ~.~2. ........................................................................... .

Page 31: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

...... A .. ~ .. L .... U ...... ~ .... r4A.C.r9J. .. ~ ... rM!..<.~.:.~} ... -;-.. 4d.C~J ... r!.d{u)

.. $ ...... &.t.CL.1.~ .dd.(~} ... :;; .. :: J ....................................................... . ·9 ...... .c ~.:::~ . .) ... · ... ~ ......... ;::" ..... ~. ~ .......... i:) .. .. D(. ... -:-:.2 .... ;; .. -:-J .. ................. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . :::=>. . ... I?.<. ... .;:;:-. ~ .................................................... .

. N aw. ..... p .t4. .. ~ ... :::d ........ . ~r!-: ... fq. f.*.: ... :th~ .. li!J~t;:!1(J~r(~ ............... .

... L~ .. : .. b ... ~ ....... .\ ........ q ...... 9. .... .... 1 .................................................... .

................................. Q. ........ ~ ....... O ........ 1 ...... ··············································· -l ' -1 -J ...............................................................................................................

. . . ~>· .. ·~·t .. ~ .. 1,. .......... ~ ... ·~:2· ... -:: .. 1. ........ . ~4: .... ~·1· .. . ~ .. ~ ...................... .

. . . . U..% ... 'F. .. ~ ... ~·... . . ) ......... . <?. ...... . ~. ~ ........ ~..... . ....................................... .

0 l \ l ...................................................................................................................

................................. . 9 ........ q ....... J ........ .l ........................................... . ~. ····~·1····;;:;.1 ............................................................................................... .

. . . . . ~.~ .. +. .. ~ ....... ~ ... I. ....... :~> ..... ~.2. .... :: .. . Q. ............................................... .

.... ~J .... :-:-.~ ....... -;.J ............ ::::-.?. ..... ~ .. 1 ... :; .. 2 ................................................ .

Page 32: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Iterative Method

a11X1 + a12X2 + a13X3 = b1

a21 X1 +azzXz + az3X3 = bz

a31 X1 + a32Xz + a33X3 = b3

Ax= b, where A= L + D + U

Jacobi Iterative Method:

7J = -D-1 (L + U), convergent if II7J II < 1

(k+l) - 1 [ (k) (k)] xl - - b1 - alzXz - a13x3

a11

(k+l) - 1 [ (k) (k)] Xz -- bz - azlXl - az3X3

azz

(k+l) - 1 [ (k) (k)] x3 -- b3 - a31x1 - a3zXz

a33

Page 33: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Gauss - seidel Iterative Method:

T9 = -(D + L)-1U, convergent if IIT9 II < 1

(k+l) - 1 [ (k) (k)] xl - - bl - a12x2 - a13x3

a11

(k+l) - 1 [ (k+l) (k)] x2 -- b2- a21xl - a23x3

a22

(k+l) _ _2._ [b _ (k+l) _ a x(k+l)] X3 - 3 a31X1 32 2

a33

xCk+l) = T9 x(k) + c9 , c9 = (D + L)-1b

Error Bound

II kll < IITIIk II 1 oil X- X - 1- IITII X -X

Note: If matrix A is Strictly Diagonally Dominant (SDD) the iterative method is convergent.

Page 34: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Show that for the Ax = b where,

A= [-;.S -~0 ~ ] 1 1 -3

The Gauss -seidel method convergent faster than the Jacobi.

Solution:

................................. .:.:.·1""[""""'""""""]'''''''''''''''''''''''''''''''''''''"'''''''''''''''"'''''''''''''"'''''"''''''"

7: = -0 L + u. ......... ~ ......................................................................................................................................... .

...... A ... ~ .... L .... +. ... O .... ±.~ ..... :: .... ... 9. ........... 9. ..... ~ ........... ~~ ..... ~ .... ~ .......... 9 ..... ~ ......... '

................................................................... ' ............. <:?.. ..... ? ..... :. .... 9. ..... ~~.~ ... ~ .... ~ ... 9. .... 9 .... J

, .................................................................. ~ ............. ~ ........ 9. ............... <:?. ...... ~ ... ~.!... . . .. . . 9. ...... ~ ..... o

.......... :.:.: t·....... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...................................................................................... .

JJ - - y£" 0 0 ............... ,., ................. a .................................................................................................................... .

Q -~0 0 0 ••••••••••••••••••••••••••••••••••••••••••••••• '· •••••••••••••••••••••••••••••••••••••••••••••••••• 0 •••••••••••••••••••••••••••••••••••••••••••••••••••••

o a - YJ ........................................................................................................................................................

. . JS .... ::.. . . .::::. ~ ~- ... .9 ....... 9.. ............ .<?. .......... L ...... I.... . .......... <:> .......... ~- . . ...... Y-5 .......... .

................... .... ~ ....... ~.~·'·~ ....... ~ ............. } ............ t?.. ....... L .... ~ ........ t9. ........ 9 ............. KQ ....... .

....................... ~ ........... 9. ....... ~.~'-·· .... . .. \ ............ ~ ....... 9... ........ ..~ ......... ~1 ............ 9.... .. .. .

Page 35: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

··········································-1········································································

. Ig ... -;; ..... -cc. (Q .. *:t.) ...... u. .............................................................. . -I ... ............ ... . ..... ····················· .... .. ... . .. ......... ... ... ... ...... . ...................... .

. . . . ~ .... - ..... . -::. 5' .......... Q ....... 0 .............. 9. ......... ~ ....... J. ............................ .

.. . .. . .. . .. . .. . .. . .. . J ......... -:-:-. L<?. ....... o. ...... ~ ...... 0 ....... o ....... '- ............................ .

............ ...... .. .1. ........... J ......... ~J ............ 0 ........ ~ ...... 0 .......................... .

:;: .. -· ........ ~. P.. ~ 2 .................... Q ..... ................ 9...... . ...... 0 ......... \ ....... .l.. . . .. . ... ... ... ... ... . -:-.9~.0.2.. ............ ~ .. 9.~l ... .................. 0 ........ ~ .. .. 0. .. ...... 9. ....... 1.. .... .

. . . . . . . . . . . . . . . ":". 9..·.91.3 ......... . ':":. 9. .". P. .3.3 .......... :-:-.0.~ .~3. . . . . . . 9. ....... P. ..... Q. . .. .

.. . .. . .. . :·:: ......... 0. ............ o.~ :;_ ..... ...... o.~2. .................................................. .

. . . . . . . . . . . . . . . . . . . . . 0. ......... . 0.. ~ .02 ......... 0.·.11 ...... ............................................. .

................... 9. ......... P..~.ol3. ....... o~.J.o6. . ............................................ .

.. . . !!. ~.If .. ~ ... m ~ .. 1. o ~ .tj .. ~·. o. ~.l.':() ... o.. ~ 1.1~ .. ( .. . ;:. o .... 'i .. .<. ~ ... (.~n~ ....

............... ... .. ~1 ... T.~.~.l .... ~ ... \l .. JJ.~~ ........................................ ········· ············ ········~········································································································· .............. ~~f. .... fa..r.i.CIC .. ~ .... J.~.b.i.! ....................................... .

Page 36: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Find the value of a such that the convergent of Jacobi method for the following system is

2x1 + ax 2 + ax3 = 1

ax1 + 2x2 + ax3 = -1

ax1 + ax2 + 2x3 = 1

If a =!,and xCo) = [-1,2,3]T then compute the number of 4

iterative needed to get accuracy within 10-4 .

Solution:

..... A .. :; ..... .... 2. ........... ~ ......... ~ ..... ····························································································

....................... ~ ........... 2 ........... 9-: ..... ····························································································

...................... 0.: .......... 0. .......... 2 ............................................................................................... . ·································:.:.:,···c·················································································································

... J":l .... ;; ...... :-::: .. 0 ............ ~ ... t -~· ) ............................................................................................ .

........................ ................................. ....... ............................... . ......................................... .

' :: - 12. 0 0 a> 0- Q. 0 cy, ~, ....................................................................................................... ····························~·-··········""-··

.............................. 9. ........ ~~ ....... <?. ......... ~ ...... a ...... 9. ....... ~ ........ : ..... ~b ........ o ........ ??.'2. ... .

.......................... .. 9. ........ ~ ........... ~ .............. ~ ...... ~ ...... 9..... ........ .~.2. ....... ~ .......... 9 ..

... .lt.:t.lf ..... ?. .... r!J.~ .. i. .. P.::.I .... ~/ ... ~.1.. ... ?. .. 1. .. ~.~-······························································

............... u.nx~t ...... J.t. ... l! .. EJ~ .. < ... , ................................................................ .

......... ~) ............ .I ... 0-:.1. .. <. .. ~ .......... 75>.. ...... :.~ ..... ~ ..... ~ ... ~ ... ~ ................................................ .

Page 37: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

..................................... i' ........................ c oJ ........................ ] ::r: .. ................. .

... N.().Y:! .... l.f. .... ~.;;: .. X':i ...... ~ ..... X ..... ~.[.-:-:-: 1.!.~.t..?.. ....................... .

.. · .. · .. · .. · .. · .. · r.c:.,. · .. · .. · .. · .. · .. · .. · .. · · .. K .... · .. · · "l; r .... · "lo1 .. · .. · .. · .. · .. · · ..-y .. · .. · .. · .. · .. · .. · .. ·

.... l/ .. X .. :: .. ~ ... J.l .. ~.. II T II .... JJ .. i ... ~ .. t. .... 0 ... :~ .. ..\ .. 9 ...................... .. 1 - 1iTII

...... ·( ,, ........ i' .... ·r ................................ ·~·· .................................................... . :.1~ : ~~: ~-: t\ ;-. ~~~(~;:(.: ~]iJ.d ~--··!~~· :·:: : .... :·· :· :·· :·· .:· :·· : ... ·: .... ~~ .... ~ ..... ~2.I .. t .... ~ ... ~~J.~.1.) .... -...~.<~)J. .... ~ .... ~~8. ............................... .

-~· ~i1 . ~-£1 :u.:;:: ii. (~: ~i. :~ ... ~:~~-.~~Pit _1] .. ~: ·:·~~- :.: ·:· :·:: :::: ·.·

.. N o.w. .......... ~ .. :::: ..... ~ ~ ... ::=:. o. :.l.Ji ............................................................ .

.......................... 1( ....................................................................................... .

~•uu, •• {9.:,2 f)} ••••··-tf•••••~•~•Q~.~••••u••u•••••••••u•u••uu•••••u•••••••u•••u•••• I - 0 ·2.~ ......................................... 'M' ............................ "\ ............................................ .

. . . . . . . . (.a .... ~.J.;.l.~ .... ~ ....... ~.1. ... ~ ... ~ ... ~ .. 1. ~ ................................................ .

... ... ... ... ... .. . ... .. . . .. .. . . .. .. . . .. .. . . .. . 1 . ......... --liJ ................................................ .

........ ~ . .J~.<.~:~.~.J .... ~.~.~.(.0~ .. ~ .. ~.~·························································

......... k ..... -~·· ...... i~ ·c ·· 1~·~·· -~-, u[ \l .. ) ......... ~- ............. -~·· .................... .

.. . .. . .. . .. . ... .. . .. . ... ... ... . . ......... -· ... ""];.!. 8.h ... .................... . l,.V'\( 0·2h")

.......... k ..... :;::; ... 3 .......................................................................................... .

Page 38: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Rearrange the linear system such that convergent of Jacobi method guaranteed

x1 + 6x2 - 3x3 = 4

2x1 + 2x2 + 6x3 = 7

Sx1 + 2x2 - x3 = 6

Use the Jacobi method to find the first two iteration using xC0) = [O,O,O]T, compute the error bound.

Solution: ........................ ~~(J.e. ..... ~)./. ... ; ... b ......... ~ ........ ~.: .. P: .. O .......................................... . ~''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''"'''''

............. !.?.~.! ... ± .. ~ .. ~.~ ... :-:-.. ~1 .... ::::..~ ................................................................................... . ~I f b X 2 - ] z ;; q $. j). Q .=::) Conv. ................................................................. 1 ........................................................................................ .

............ ;;? .. ,~! ...... !. .... ~.~.:?.. ..... ±.4..1!.3 ..... ::. ... 1... ....................................................................... .

..... ~~~ll"''"""'''""[''''''''''''''''''''('l<~···········.{.K.l. .. ] ............................................................ .

........ ~J ............ ::: .... ~ ..... ~.::: .. 2..%.~ ..... T. .. ~;!.,,,,,, ............................................................. .

. : .. ::·:~;:~~;: .. :::1.:I~.:.~:::i.~~:'::.:t>.~:.~J::::·: .. ::.::.::·:.:.:.:::::.::::····:::::::::·::::::::.:··· ......... (·K~d ............ r .... ·r························tKJ·············t·KJ·J·································· ..................... .

~., = 6 1: -2 X -1X.t ....••••... ,..1 ................................................... ./ ...................................................................................... .

····~········(·o···········r···[ ......................... J ..... 6, ........................................................................... . ;(., == 6 6-r, -o v~ .................. fj i .............. ,. .. "["...................... ']' ............ 'L{ .............. '1.:; .............................................. . N : y6 lf - 0 f 0 = /0 :: /'3 ............... 1!':'.2 ...................................................................................................................................... .

Page 39: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

... ·ttt·· ...... r· ... [ .......................... ] .......... ?-................................................... . x=/6 71-o-o =-/'o-

..... ) .............. ... "!":' ........................................................................................ .

"''(2..1''""'''''''["'"'"'"'"'"'"'"'"'"'"'"]'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'

X = Yt; b - 2 · 2r:~ + 7~ = I ·16' 6 l:

::~::::;.::~.E~:~~I::-~;:::·z~:£!·:~~::;:;;:::::::::: :::::: :::::: "'ow ................................................. 'l<' ............ ( j} ....... 'l(:j) .................................. .

... J! .. ~.~.~~.u ..... '-··· ...... ~tT.. ~~ ........ u ... tX.. _ .. ~ .. 't. ..... I .f. .............................. . . \ - u-ru .................... .:..:;· ............................................................................................ .

. T3· ·=·-D-{t +-{;,!:)··:!. .. . i/~ ... ;;· ··~ ...... -~ .. ~-· . -~ ;·· ... .

o I~ <?J \ 0 - 3 .................................................................................................................

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....... ~ .......... . <?. ....... ~(~. . ....... ~ ....... ~ ...... 9... . .. . - o ~s; -v,; ...................... ·················· ............................................................................ .

'h 0 -~ ........... ~ ..................................................................................................... .

. . . . . . . . .~~ ....... ~(4' ........ ,c;? ............................................................................. .

·II·· T 3 H· ·· ·· .::. ·· m.~ .. ~- · -~!i "· ·· .'Yt :;~-· ~6- -1· .. ;; ... D.' O'Q. · ·· ··· · ·· ··· · ·· · ·· ·· · ·· · ......... '(il ........ ra) ............................................................... =-f ......................... .

... . ~! ... '¥: .... ~ ... ~ ... !~ ... ,;;,,,~ .. . r. .. ~:. ?. ... /.. .. 9..:.{~:) .. !.: .!.({!..J. .. J.~ .. ~ ... J.~ 2 .. ........ .

... ......... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... '1; ........................................................ .

~ . .l .. t..~.:.t:J..H .. ~....... (o. tfJ.. .... (.J.~2. .. ) ..... = .. .J. ..... 6 .. J~~ ............ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \ .. ::: .. . C?.:. ~ 6. ......................................................... .

Page 40: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Consider the following nonhomogeneous linear system Ax = b, where

A= [ ~ -1

-1 0 3

Rearrangement the given system such that the convergent of Gauss-Seidel iterative method is guaranteed. Then find upper

bound for the error llx- xCS) II using Gauss-Seidel iterative

method if xC0) = [0.3,0.5,l.O]T

Solution: ............... ~~~~.~.~ ....... & .. ~ ... ~ ... k ............................................................................ .

IJ :: F) 0 .. , '

~::::::::::::::: ::;:\:::::::::::~:::::::::::?.:: ::::::~::::~::~::::. ·:::i::::. ·::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 0 -\ 'i 'i

...................................... ,........................ ............................ .~J... ............................... .. .............. ..

~ ... :;; .. -:: .. C.O.tkl ..... ~ ... ~ ...... ~ ... Ji ........ ~ ....... ~ .... .......... <:?. ........ ~ ....... ~.~ ...................... . ............................................................... .. ::-.' ........ ! ....... ~ ............... Q ......... 9.. ....... 9. ..................... .

0 -\ t.t 0 0 0 ............................................................................................. ·········································· ................ .

~..... "\;~"""""'~"""';""" ... '~""""'~"""~'~" ........ '~"""""~""""'y~"" ............ . ......... ........................................... ... ................................. ......... ....................................... ............ .

.... ~ ...... t~ ............. ~:!. ...... 9. ............ 0. ......... ~ ........ 9. ....... ~ ..... 9. ......... ~ ......... ~1~ ................. . ~ 0 y~ Y,J 0 0 0 0 () ~ 0 ......... ..... ~ ................. l ........... ':l... .... ........................................ .. ................................................. .

Page 41: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Now ........ '( .,~ , .............. ·r· .................. ·t 1<') .. J ...................................................... . .. . .. . . .t.~ ...... :::: ...... ~S?... . .. ~ ....... i .. .. ~.:!.. .. . . ..................................................... . ·······r~-~~····~·· ~···r·········~··JK~··J··J ....................................................... . .......... 2.. .................. .. 2 ........... 1 ........ ....................................................... .

... ... ... t.K~.\ ............... [ ............... lKt-.ll. ] ...................................................... .

... ... ~3 ... ... ::::: .... ~~<:1 .... ~ .. .. * .... ~f:.. ... .. . ..................................................... . k':o ....... i.,.f ... ·~ ... ·~· '[" .. , .. + .. 'i "]' ... ·~ .. '2/~ .. ·~· .. ~· ~· ·~· ........................................ .

. . . . . . . . . . J.... . . . . . . . . . . . . . . . . . . . . . . . . . . . ....................................................................... .

") : L.'l [ 2 + 0 ·l41 :: . 8 ....... ~::z, ................... [ ............................. O. ..................................................... .

xu) ':: v "i "l + 0 ' Q 1 = l· I) .......... 3 ...................................... a ............... 4 .............................................. .

............................................................................. 1 ..................................... .

. . . . . tY. .~ ~ .... H. Tg.\ ~ ... ~. ~. ~ .. f .1/fi. J ... ~ ~'· ~ .J .... ~.Q .... . ~ ... ~~ ... ~ .. ~ :. ~ ............. . · · · · · · · · · · · · (tl · ·······tel'}···········~··············································· .T. · · .. ·. · · · ............... .

. . . .. . !.1 .. X .... ~ ... ~ .. J ~ .... ;:: ............. ·'~· .k.9.: J .. . ) .. r:l.: ."J .. /. .o.~t J. ... ! .~ .. ~ .. ?..~~ ....... ..

... ·······················/)·· .................. ······r;· .................................... ··:..··~········· ······ .. .

. ~) .... J.L%. .. ~ ... ~.~.1 ... ~ ..... ( 0, 2) .... (. 0 ~.].) ..... ~ .. 1.~.1-. .. X.l.~ .................... . l - 0·1.

Page 42: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Find the matrix form of the Jacobi method xCk+l) == T·x(k) + c· k > 0 of the following system 1 ]' -

6x1 - 3x2 + x 3 == 11

x1 - 7 x2 + x3 == 10

2x1 + x 2 - 8x3 == -15

Then use it to find the second approximation xC2) of the solution x using the initial approximation xCo) == [O,O,O]T .Compute an

error bound for the error llx- xClO) II· Solution:

Page 43: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Page 44: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Page 45: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Relative Error and Residual Vector

Ax= b

condition number k(A) = IIAIIIIAII-1

residual vector r = b - Ax*, x* approximation solution

. llx - x* II < llrll relattve error llxll _ k(A) 1fbif

well condtion k(A) > 1 ( k(A) < 10)

ill condtion k(A) >>> 1 ( k(A) > 10)

Page 46: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Consider the following matrix and inverse as follows:

[ 1 o -1 o ] [48 I 4 7 5 1 I 9 5 1 I 4 7 5 ]

A= -1 10 -2 and A-1 = 1195 2119 2195 0 -2 10 11475 2195 991950

Show that Gauss-Seidel method convergent faster than Jacobi method for linear system Ax= [9,7,6]T.Ifan approximate solution for system is x* = [0.97,0.91,0.74]T, then find the relative error.

Solution: _\

···························:.::r··························· ....................................................................... .

... 7; ... "/F. ••• ~.JJ. .... (.L. .. +..tb.J..~ ....... \ .. ~ ......... ~ ..... ?. ................ ~ ....... ::J. ........ ~ .................. . - 0 \ 0 (l) • ..\ 0 -2.

• 0 0 0 ••• 0 •••••••••••••••• 0. 0 •••••••••••• 0 •••••••• 0 ••• 0 0 ~.... 0 ••• 0 •••• 0 ••••• 0 0 •••• 0. 0 0 •••••• 0 0.... • • 0 0 0 0.. • ••• 0. 0 •••• 0 ••• 0. 0 ••••• 0 0 0 •• 0 •• 0 •• 0.. • •••••• 0 0 0

0 0 \0 0 -2 0 ~ ••• 0 ••••••••••••••••••••• 0. 0 ••••• 0. 0 0 0 0 •••••••• 0. 0. 0 ••• 0 0 0. 0 0. 0 0 ••••• 0 •• 0 0 0................... • •• 0. 0 ••• 0 • 0 •• 0. 0 ••• 0. 0. 0 •• 0 0 0 ••• 0 0. • 0.... • ••• 0 0. 0. 0

- 0 Y,o o ······ ···~·~····················2~·~···· ··~··;ii .. ii·~··d1~·r·~~··;··~·~·~···2~~l·~··3/.·····~··~·~1 < 1 ............ 1. .......... 0 ..................................... :r .................................................................. .lQ .............. .

0 2"!o Cl .......................................................................................................................................................

-I ................................ ·.:.: ... ,.............. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................. .

. JG ... :; .. -;::(O.±L.) .. U .... :; ...... ! . .9. ......... 0 ...... 9 ...... ........ o ........ ~.L. ... Q ............................. .

. .. ... . .. .. . ... .. ... .... .... .. . .... .. .. . . . . .. ....... . ::-} .. ......... t .9. .. .... . 9... .. . ....... Q .......... 9. ...... :-:-4. ..... . .................. .

.................................................... . 9 ........... ~~ ..... ..1.9. .......... 0 .......... 9. ........ 0.... . .................. .

Page 47: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

.......... ;-···························· .. ...................... . ................. ;-················

.. :: ...... -~ q ........ 0 ........ 0 ... .... Q ..... :-:! ...... 0. ........... 9. .......... [9 .......... 9. ...... .

........ .. kao ..... }k. 0 ..... . G ....... <?. .... :-:-2 ... ~ ... .9. .. ~9 ...... ~ .. .

........ .. !fi.o.9. ...... ~.o ...... {a. .. 9 ..... 9 ...... 9 ......... . 9. ........ *-9.9. ....... 1:.? .. .

::!!::J;;.:i;:::~:::~~::i::h:~:~:::9.f.~~::~::~%:~:~:r::::;:::~s:~~:::::~::~~zj:<, .... s.i.~.(~ ... . rJi:!.. < .. .u .TJ" . .\.\ ....... r. .... t;i.~x r .. o.mv.~. :f.~f!IY: .. J" q.ca hJ:

· ·w~;;; · · ~-· · · ;; -~· · · · · · · · · -~······~~·A· j~ ~ · · -~· · · · · · · · · · · · · i);, · · · · · · · · · · ·,· ·1 ;· · · · · · · · · i ·o/a · ~ ~ ............. .!fl ... ~ .. I. 3 ........ 4 ............... ~. f!J.~. r. ..... fi-i6 .. :)- ....... . 9,.6: . .;) ...... g ~- .. 1 - f./\- 111-' 3/ . -:> ... .I .. n ........ ::-: ........ ~ !l. .......................................................................... .

............ ...... ... ··················.:..~················ ........................................................... . K(A) = Jlf)llllflll ~ 11 ('kn-) =l ."f189 ............................................................... 9 ................................................... .

............ ......... """""If"".... ... .. ..... .. ... ... ... ... .......... .. . ... ... ... . ............... .

. . . C :=:; ... h..~.&..~ ... ~- .. . -~ .......... ..'. .C?. ..... ~ _L_ .... ~ ......... ~ ... ~.t ... ........ ?:~L ... .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . f .... ~ .... ~~ ...... -~ ~- ... ~-~ ....... Q.:. ~.l. .... -~- ... q ~.!.!f .. .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . -~ . . . ......... ¢) .. .... :-:: .? ..... ~ -~- . . . .. -~ ~ .1..~. . ........ . 9:. ~ ~ .. .

... Jl.r:-.t\ ... ~ ... o!'.~.Z ...... ~ ... ~~-~-~! ... ~ ... 9 ..................................................... .

. ~ .. Jh~ .... . CelaJJVI:$ .... ~9..~ ........ ........................................................... . ~ .. u. -~ .. ~-~ ... o ... ~- .. K (.A) .......• J.l.r U ........................................................... .

"X:IJ \\\)\\ •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 000 ••••••••••••••••••••••••••••••••••••••••••••••••

... ...... ...... ...... ~ ... (.l . .-.. 1. .t...B.9) ....... .C~.~ .4 2.) .. ::: .... a ..... o.8.J.Q ...... ........ . 9

Page 48: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Find the condition number of the matrix

An= [~ 1 ~ ~l n=1,2,3, ...

If n=2 and x* = [ -1.99,2.99]Tbe approximation solution of linear system Ax = [1, -O.S]r, find the relative error

Solution: _1

......... K (.A). .... :~ ....... l.l A. f J .. ~-J l.A .... ~ .1 ............................................................................................. .

II All = 111 ~ l Z ~ - ~ 1 = fJ · f1 ~ t, 2.,1., ~- . ...................................... J···········;;)·································&. ................. .) ............................................. .

···········::·r······r···································]·····················································[··························J····· /) - ' - Yt1 -I l - - r1 , - \ltl - I ...... J?. ..... -...... ...................................... ....... . ................................................................... .

. .. .. .. .... .. ..... .... . ... :-::. ·'· ..................... ! . .. . . ....... ~ ... : .. ~~~ --~--~···· ............. ······ ... . .. :-:-.. ~ .............. J.. .. . .... .

···························r······························J···························································································

..... ~ ..... e.~·-~ ... .... ::-; .. +.'. ... ·······~·· ........ ...... . ................... ·····~· :;:~.:-:-·'···".::~-!~.~ -~~!..= I

........................... ................................ ····························:···············y·o:.::V\·················i4-·· ... ·t············

.... olJ .. ~.'.t.t ...... ;; ..... m~ ... l..l~~.t~.) ... :t. .. ~ .. J .. 2.n.l ............................................................. .

....................... :; ....... r!!.~ .. l ... ~ ... ~ .. !? ... ! .. r..:t. .... 2, .. ~ .. l ....... ::r. .... 2.lt ........................................... .

. . . K( -1!.) ... ;; .... 2 .. f ••• 2..11 ..... :::: .. ... -~ .. ~ ........................................................................................... .

tJ \ l d -\·'19 I h I ... N..o .. ¥.! ..... 1 .. f. .... (! ... ~ .. 2 .... 1 ........................... Ii ....... [ ................... 1 .................. [ ............ ] . ........ ,2 .... ;:;... . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . ....... .an ........... % .... ::.... . . . . . . . . . . . . . . . . . . . . . . . ... :1·... . .::. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . L. . . . . . . . . . . . .0.. :5. . . .......................................... ~ .' ... '1 j. . . . . . . . . . . . . . . . . . . . . . ::-.. CJ. . : ,;__ . . .

Page 49: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

• . . ,. -·X. .. ::~ .. H ... ~ ... /((.¥4} .~ .. .lt.V'.I\. ............................................................... .

. . . . . ·'~· .~.t.l ............................... \'. P. ~~ .................................................................. .

... ... ... ... ... ... ... ... ... ... ... ... '["" """]"" ""'["" ...... ""']"" ""[" ............ "]' .. .

.. .. C.;; .. .. b .. ~ !11.. ~ .... :... .. .. . ~......... .. ... ~.. .. ... ! .. .. .. .. .. .. . .. .. :=.. .. . 9............ .. .. .

...... ...... ...... ...... ...... ...... .... ~.~.:~ .............. ~.~.: .~ ~.~ .. ...... . .-:: .<?.:.~.'?..'?. .... .

. .. . I\ .Y. .l L;:; ... 0.-:. 0. .0 5. ... .... j .... !.1. b.! .l. .. . ::. J ..... .J .. . k. (~ .~) ... ,:( .... 8 ... .. lt!.tr-Jk.CPAt:i.·

....................... ~ .......................................................................................... .

. ~ ... .}rX. ... :-:.P,. IL .. ~ .. ~ ...... Q.· o.ob ....... :: ..... o ..... o.4 .......................... . U"l\l \

Page 50: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

Example: Discuss the condition number of linear system

1 1 1 2 xl + 3 Xz = 63

1 1 1 3 x 1 + 4 Xz = 168

If x* = [0.142, -0.166]Tis an approximation solution of system then estimate the relative error

Solution:

···············r····················]················I··r···· .... J ......................................... . y2 ~ . 'i3 ..... /)~··· ... i···········i······· ····~·b . ., ... ···z······ ......................................... . ............... ... ~:! .......... ~~---· ....................... !~.~--- .......................................... .

. . . . ~- ~-~'-. -~ ... f!l. -~ ... ~ .... . G:. g_1_~ ... 0..: .6 .. 8.. (. ..... ::: . .<?.:. 8 ."3. ........................... .

. . .. . . . . .. . ":"":" ..................... . :!. ... ·'>'... . ..... --12 .. ..... ~ .......... . 1. ................. . ····A·~·~ ... [ .. ~ ......... ~.L"··]· .. ·········i·············~·····~···j;.········~-~-·1···· .......... . ............... -~-~;! ........... ~.. . ...... t .. ~ .. ~ ................. :-:-.~J ...... x~ .................. .

:: :~>: :: ~~:~~:(,: ::;,:: :~:;:: :r:: ~:~;: :i:i~ :: :i: :~: :~: 1c..: i.::::::: :::::::::::::::::::::::::::: ............................................. :.;r .................................................................... .

. . . . . . . . K (~). ... ::: ... ) ·'· ~ ·~'-. .' .. -'~.A .. ·'-~ ... -~- ... ~ .. ·. 8..!.. X .. ? .'1 .... 1-f... ;, .. 1.'1 .. 6.~~ ~ .> >> I

.................. i U .. CP.n~P.i~r? ........................................................................... .

....... Nc..~ ..................... ._ ............................................................................. . ('z: b-,Q~

·····················································································································

Page 51: 254 Math Exercises System of Linear Equations Ch. (3) · Math 254 Khaled A Tanash Gaussian Elimination Method Example: Use simple Gaussian Elimination Method to find the values for

Math 254 Khaled A Tanash

.................... ['2""']""""'["'''"'"'"''''"'"'"''""'"''"'"'' ...................... .

... . :F.) .. f:.;:; .... .... ~, . . :t. ......... - ...... .. P.: .. ~.l..' ..... 1: .. ~: .. 0. .r:.i<-i t J ~ ................................ ..

.,.,.,.,.,.,.,.,.,.,.,.,,l~.8. ... """"" Oo 0 ~686 - 0 I ~~6 ...................................................................

.................. [························.;.:.·q···J ............................................................. .

... ... ... .. :::. .... .. -:-:.4.1l.2.6'.8.X~~.l.\ .. ................................................................ . J).9,2J X\o .................................................................................................................

- - - .... "\ . \ I/ -3 .. ~ ... u .y:·.,.\ .. ·~ ... ·}':)·•·9·2·-J··X \·O· ......... ·:;;·· .... \l.~J ... :: ..... ~1 ... ~ .. lfi·.8.1.X lo

........................ * ......................................................................................... ..

. ~ .... }1 .. ~.:-:-.. 'X; 11 .. ~ •. \<(~.). .. Jl.~!L ........................................................ .

.. . .. . .. . .. . .. 1.1 .. ~J~ ............................ ~~. ~ ~ .\ .......................... :..:.: "\ ........................... .

........................ ~ ..... ~.q .. ../.. 0 .0.~ .. v 6 ·Cf2'?X'\O -l·OC"/Il ~· ._,..,. • c:r .. "" .................. ./ .... , ............. -.. .. D .r.-1. ..t... -J

.................................................................. '.~ ... ·. ~ .1. .. X.l.'! .......................... ..