CS57 Numerical Aalysis ad Computig Lecture Locatig Roots o Equatios Proessor Ju Zhag Departmet o Computer Sciece Uiversity o Ketucky Leigto KY 456-6 Jauary 9 9
What is the Root May physical system ca be writte i the orm o a equatio This equatio represets the relatioship betwee the depedet variables ad idepedet variables The root o a oliear equatio is the solutio o that equatio It ca also be said to solve or the solutio o a oliear system Most oliear equatios are too complicated to have a aalytical solutio I practice we are more iterested i idig some umerical solutios They are eplicit umbers approimate solutios
Roots o a Fuctios Let be a uctio that has values o opposite sigs at the two eds o a give iterval [ab] with a < b i.e. a b <. I is cotiuous o [ab] the there eists a umber c i [ab] such that c c is called a root o uctio Eample. The uctio has a root i the iterval []. It has two roots i the iterval [-5] Remark: roots are ot ecessarily uique i a give iterval Need some root idig algorithms or geeral uctios
A Root o a Fuctio 4
A Fuctio with Four Roots 5
Bisectio Method Give a iterval [ab] ad a cotiuous uctio i a b < the must have a root i [ab]. How to id it? We suppose a > ad b < b a b a Step. Compute the midpoit c stop i is small ad take c as the root Step. Evaluate c i c a root is oud Step. I c the either c > or c < Step 4. I c < a root must be i [ac] Step 5. Let b c b c go to Step. 6
Bisectio Process 7
Bisectio Process 8
Covergece Aalysis 9 Let r be a root o i the iterval [a b ]. Let c be the midpoit the I we use the bisectio algorithm we compute ad have a b c a b c the Sice the iterval is halved at each step we have Hece which is the maimum error i we take c as a approimate to the root r a b a b c r a b c r a b a b a b a b c r
Liear Covergece A sequece { } has liear covergece to a limit i there eists a costat C i the iterval [ such that By recursio we have Or equivaletly a liear covergece satisies or some positive umber A C C The bisectio algorithm has a liear covergece rate with C ½ ad A b -a C C C AC <
Stoppig Criterio What is our goal? Whe to stop? How may iteratios? Our goal is to id r Є [ab] such that r With the bisectio algorithm we geerate a sequece such that r c < ε or some prescribed umber ε > i.e. we id a poit c iside the iterval [ab] that is very close to the root r. We the use c as a approimate value to r It is ot guarateed however that c is very close to
How May Iteratios I we wat the approimate root c to be close to the true root r i.e. we wat r c < ε the the umber o bisectio steps satisies or b a < ε log b a logε > log Eample. Fid a root i [67] up to machie sigle precisio a. b. so r must have a biary orm r.***. We have a total o 4 bits 5 is already ied. The accuracy will be up to aother 9 bits which is betwee -9 ad -. We choose є -. Sice b a we eed > yieldig
Newto s Method Give a uctio ad a poit i we kow the derivative o at we ca costruct a liear uctio that passes through with a slope as l ' Sice l is close to at i is close to r we ca use the root o l as a approimate to r the root o ' may ot be close to r eough we repeat the procedure to id Uder certai coditios { } coverges to r '
Newto s Method 4
From Taylor Series I but is close to r we may assume that they dier by h i.e. h r or h r Usig Taylor series epasios h h ' " Igorig the higher order terms we have Or h ' h ' Sice h does ot satisy h we use h ' as a approimate to r ad repeat the process 5
First Few Approimatios 6
Fast Covergece 7 Fid a root or the ollowig uctio startig at 4 4 ' Each iteratio gais double digits o accuracy ad decreases quadratically to
Eample 8
Covergece Aalysis Let the uctio have cotiuous irst ad secod derivatives ad ad r be a simple root o with r. I is suicietly close to r the Newto s method coverges to r quadratically. r c r I diers rom r by at most oe uit i the kth decimal place i.e. The or c we have r r The umber o correct decimal digits doubles ater aother iteratio k k 9
Covergece Proo Let e r. Newto s method gives a sequece { } such that Usig Taylor s epasio there eists a poit betwee ad r or which It ollows that ' ' ' ' e e r r e " ' e e e r ξ " ' e e ξ
Covergece Proo Cot. We thus have Deie a upper boud We ca choose δ small so that This is to guaratee that is close to r withi a distace o δ ' " e e ξ ' mi " ma > δ δ δ δ c r r ξ δ r ad δ r e
For very small δ > we have Covergece Proo Cot. With ρ δcδ < i δ is small eough thereore is also close to r withi a distace o δ. By recursio i is close to r the e Sice ρ < this is to say e " ξ e c δ e ' δ c δ e r e ρ e ρ e e δ ρ e ρ e ρ e lim e as
Weakess o Newto s Method Newto s method coverges ast oly whe is chose close to r. I practice there might also be a umber o problems. eeds derivative value ad availability. startig poit must be close to r. lose quadratic covergece i multiple root 4. iterates may ruaway ot i covergece domai 5. lat spot with 6. cyclig iterates aroud r
Problems o Newto s Method 4
Newto s Method Cyclig 5
6 Systems o Noliear Equatios Newto s method is really useul or idig zero o a system o oliear equatios Writte i vector orm as Where We have k J k is the Jacobia matri T T ] [' k k k k
7 A Equatio Eample Usig Taylor epasio Let be a approimate solutio ad the computed correctio be. Hece h h h h h h i i i i i T T h h h h h ' h
8 Eample Cot. The Jacobia matri is It ollows that Hece the ew iterate is I practice we solve the Jacobia matri i So that J ] -[' h ] [' ]h [J k k k h k k k
9 Secat Method I Newto s method We eed to evaluate ad at each iteratio We ca approimate the derivative at by Thus the secat method geerates iterates Oly oe uctioal evaluatio at each iteratio ' '
Secat Method
Commets Secat method eeds two iterates to start with we ca use Bisectio method to geerate the secod iterate Secat method does ot eed to kow the derivative o I - is small the computatio may lose sigiicat digits ad becomes ustable The covergece rate o the secat method is superliear e C e With α 5.6. Its covergece rate is betwee that o the bisectio method ad the Newto s method α
False Positio Method False Positio method combies the eatures o the bisectio method ad the secat method. For a iterval [ab] with < a straight lie passes through the two poits will itercept the -ais at c b a a a b b We eed to check i c doe or i < choose the iterval [ac] or i > choose the iterval [cb] ad proceed like the bisectio method
False Positio Method
False Positio Method False Positio method may have superliear covergece It is a bisectio with additioal iormatio at a ad b beig used It may be cosidered as a combiatio o bisectio ad secat methods 4
Hybrid Approaches I practice hybrid methods are usually used For eample we ca use Bisectio Method to geerate iitial iterates that are close to the root so that Newto s method ca be applied Whe the evaluatio o derivative is epesive the Secat Method should be used to replace the Newto s method The trade-os betwee Bisectio Method ad Newto s Method are robustess ad covergece rate The Secat Method is supposed to come betwee these two methods to take the advatages o both ad avoid the disadvatages o either 5