2. Definition 1 ,
Any number r , for which f (r}. =. 0" is called a
root of equation (1) '01' zero of the function f
"1; •
, ",
" .
...
Equation' (1) is called a' transcendentalequation, if
f (x ) contains one (~r more)' transcendenla~function ,
such as:
'it, ~,sinx' '{;coshx , lnx , etc.
:/ .
'.where, n is a pcsitive integer, '. ';~
(2)
Ij
I
of degree n. Equation (1) is. called a polvnomial equatiOll
if f (x) is, a:polynorbial .of degree n in' x. ;
It' has' the form :
where, f (x) is' ahy Continuous [unction.
(1)
f(x). == '0
" "
The .topic of this chapter is finding the solution to an
equation of the forrn :
J.. 111troduction
, i
, ~
. i
',.,~f:',:"
.~.':... "
ttiapter 1·
.~,
.',
-:.
. t.,,: ' .•, ..,
Iif...."
,
.*,~
;'i}1~.
i
~
,~
~
I
..,
~'.
~}~
~
J '
,
,
I .
I
~
~M~
I
kJ
~~, I
m
l
,
l )
3. rU~j
rI"~
r
..
"fi'I
fV~!
Ik<li
:
L'~~
A"
~
I~I
"I,.
·UIt.;;
I
I('i
r"
I~iif
ri~
~;!..
v''''
I
1",;;
f';'~'$1
,
t·
h~
1~~:
~~Ii!
3
. ::,'1;.:
* * * * *.
Property 5 of polynomial equations together with the
fact that most transcendental ,,¢quatiqns cannot b~',-~Qlv.ed
explicitly, show the necessity of' sffi,~yingnumerical methods,
in which ,the rOOIs.,: are, appr~x~m~~~?,)m:~lps~Iy;as desired.
Here, four of these numerical methods are introduced.
* :I; * * *
For equations of higher - degree. it was proved "that
it is impossible to 'find the roots through formulas.
There are formulas for finding the roots of third - and
fourth - degree' polynomial equations. But these
formulas are so complicated, and;.thc), .are rarely used.
the roots arc found by the familiar quadratic formula:
a.~ + b x + C = 0
'~.J
.' ,.
5. For second - degree polynomial equation:
.. ,
2
~
So, in case of real coefficients, equation (2) has an
, even number of complex roots (0 or 2 or 4'.' :,.J;, ~. .' " ,.._.
. ~'; . . " , . . ,t.. »::::
Hence, a polyp.Qjpi~"equatioll. of 04d degree has: at
least one real root. ..,.
4. If the coefficients ' 'Go , al , , an are real .and
!. = a + i b. ~s ,·&"rool: pf' equatiom (2) , .then ,
r = a - i b .is also a 'roof of equation (2).
. ,
If x - r is a factor of f(x ) . then r is a root of
Cqu.~tj~Q:·.(1/k·'· ",~" '.t~<O!:' ~'
3.
2.
, ", '1 :: , ..: ' " , ' , ,
Equation (2)' h~, n 'r<><?~;:.some of which may be
equal, real' ~r complex' numbers.
If r is a r9<?i;.9ff<ll3.~~n:.(2),then x - r is a f~c~or
of f(x). Wlien r, = r;.2' = ... = rm we say-that
rt is repeated m tim~;',9.t~1ff,multipltcity m. .' ,
1.
In ~hat fo~I~1~ft;-.:~',cJist so~~,. well - known properties, of
polynomial equatI<),U,(1) : ..• ':I~. .:.. .' •
Properties of a' polynomial ,equation
or zeros of the .fanction :
fix) ~ ,,~;:. 4 =: 0 .
For example, 2 and, -2 are roots of the equation:
4. 5
bi - at
1 r - C/,', I ~
2
2
If we t~e th~. midpoint c, = 81 + hi .
as
.~,. . . ~:j.~
I}o - ao
=
So, the root r is ill the interval, ral, 'br ) ,
whose le;'lgth is h,alf that of (ao, bo), that is,
~ . .
.','.
",
aJ ',i:, 'c ', 0
If ,·....f( c~) f'(b~) < 0 ,'then' r d is in'
( CoI bot)Hmd, ,wb set ,,":" .'
If f (aD) / (Co) < 0 ,then r is in
(ao, co) and we set
Recall that f (aD) and f (bo) are of opposite
signs:
I( co) f( bs) ,< 0
or
Step 1: Compute f (co).
,If f(c;o.} , = 0, then, r ,= Co: END.
If f (co) ;t; 0 , . then" either
.:.I
i
1
1
1
l
1
!
4
Co- r' b;
ao - bo
2
Ir
as an approximation of r ; we have
a~ +' bo
2
. ~,'.
. . . " "
":Step"O:,, Let" .as: = o. ,-;( "ho =ib,
Algorithm of tlte bisectiolt methoa:
in (a,b)f(x) = 0
" " ." ,,"" .
. , ':Then, / has' at 'l~ast' one zero r in the interval (a, b).
'. , We "suppose' that' r is,.the .oaly.root of .equation :
As before, let f be. a continuous function. Let a. < b
and suppose that f( ay' and f(b) have "opposite signs,
that is, .: !If ) .'"
" Ira) ~~'b) ,'~'.~::-...: ..... ;, ."0, ,dL7~b
(Method of Hmwll/{ The Interval)
2•. B:isectioit: Method
R'~, ::ti
I :
~;
I.§
~~~"1:,
~"]':1uti
I I
hi';i
~~~'1>"
~~:IdO'
q
I I
~~r:
t,[i:! Ii'':~
: I
r.~,:I
h'
':I~
~,~
0'
I
i
~;.
"'t~!
."t'I
t~v,'1,
;l'J.
I
l1~;1":,~1
I
~)"~,~
~.~
~@.Ij';
.'d
/
~~;/.(
5. 7
zz» b-a < rot: 2&
where e is a given error. ... In: this case' we can determine
the number n of steps required .as follows:
From (3)J n must sati~fy -.
'.~
Suppose it is required to find an approximation
en to the root such that: .. ' , .'
Thus. after '!' steps 'OJ the ,"Jisectlon algorithm,
an approximtue: .root <;n wilt have been
computed with error of at most (h. a) /:r.+1
(3)I r - Cn I s
absolute error in this approximation IS:
an + bn
= ,then the
2
If we, take
1
btl - an = (b 1 a )2 n· - n-l
Thus the toot r is now in (an J bl1) I whose
length is half that of (an-I, bn_l) :
i~ij
.. ,·11
~
~I
.1
,
! '
J
I
,j
j
iI
I!
1
1
t
i',:i
I'I
6
If .....f;(e";') .f(l?n-I.J,~,<:- ,q,~, then r is in
( Cn-I , b;"'j rarid. we set ,,' .
. an. ',= Gn-i' • . bll' =: C,,_I
If f (an-I) f(Cn-I ) < 0 ; then the root r
is . in the interval (an-I, en-I) and we set
" -,"
r .
or .
Compute f(cn-l)-
If .:I( Cn-I) = 0, then,' r = Cn-l .- END
If f(c;"'J) :f:. 0·, then, e.i(her
f( qn-J) If en-I) . < 0
bo - ao
bi - ai =
2;
ai. + bi
Ci -- j = 2,3, ... I n-l2
'-,'.
I
bo - ao
Ir - Cj ~
2i + 1
Continuing in this way. we obtain in steps 2,3,_,,~
n-I the successive approximations C2; C3 •••• , Cn-I
for r., where
Step n:
6. 9
=> r In (1 15), .
=->:,~
.
~ 1 (1)/{1:5) < 0
l.. .. ~
f(ee} :':~~f( J,5),. = O.~75 > 0Step 1:
1+2
Co = .:.....;___ "..= 1'5
. 7i::',:·,"
Step 0:
, (':, ,', ,
f(Q,J = ..~i..!;"·'f(I.) ::= -1'.1. /(2) = 5
, .' l.. :.. ,".:.'
Since . :,/(;.f!/I·.f(2) < o ,
the root is in (1 1 2)
Solution: Since 'the...required root is positive.
we. c?mp~tp f (0) : f (l) I f (2) I •,. until
the SIgn ':enanges :, ,. '. ..
Example 2: .Find tl;~,small~st pOSitiv~' root of
. " i! -,x-I. = 0 .
COrrect' to two decimals.
':.~. .' -.
* * * * *
The required' number of steps is
n :;;16
j
I
':
·8
log 0.6' + 5- '= 15.872...
.tog 2
11..>
.:. .' ,',,', :,' .' ', ',"',r':.:::: I i .:'. 1:';- ',:, "i:~.~:.~';.11~?~',:",'~
logO.6 '~;.JQ.g, lP~~r,= )og;:.Q.6,;;ti'~ log 10
11. > log -2 log 2 .
.:If the base of the' :lggarithms is taken to be 10,
then,
. a =, 1,2 b ~ 1.8 1 e = 5 * 10-0
. Co' .,.ApplYi[lg,f~.liffiula:J4)" ~~:·,;p~r.. ., ;~:n,:;'
.'',' ',~"'" ',..J.~..... .:.:'~i, ~ : .We have
.',' .~".'" ...,',"j,',' . " :,::
Solution":
:, ; ';' ,,~'..
* ')j: "* .* *
(4)
. ~ log (b - a) ,:< n log 2 + 1(Jg2 e
0( The log~ithms' ~e with any·base)
.~ n log 2 > 'log (b -a ) ., lo'g 2 e
log (b - a) ~ log 2 e
. 'log 1/' ,.: :.;
,I
II~
"ej .(J
7. '1'>1
r)
!
~j
,.3.A
1 '
.Ii
1
!
I
t
.:':'. ".Vl;r- ~~ld" determine' ';the' needed ~l:lm.b'erof steps by
using: (4) with· a '.=' J....,. b ~=="'2'"an'd'" 'i, = 5 :.:10-3:
Since .a7 and b,7 have the"same first two decimals', the
required approximation 'is': .
C7 = 1.3243
'.' .".
. ::.. : ",
. , .:1.' '..
i . :
aj' "cr'~:L ., bi I( a.)' /ie;)': f(bi}
:·0 1 .'I.5.. 2' -1· +0.9 "+5
1 1 1.25· 1.,5 -1 -0.3' +0.9
2 1.25 1.37~.'.. 1.5·.· ~O} +0.2 +0.9
3
-,
.1.25':: . . "'!11'31~~',.,:~.:1.'375"': -:0.3'
,..
-0:05 +0.2 .. t. .'
'4 .'·'·'i.~312'5. 1 ·)·f:J:;j.B8~·;·' .1.375 ~0:'O5 '+0.08 +0.2
5 . ·1.3125 ];,32$2; , 1:3438 -0.05 +0.01 +0.08
.6' .;.),3125 ! 1.3204' 1.3282 ~0.05 ·-0.02 +0,01
7 1.3204 1.3243 1.3282
I.
It is better to, arrange calculations in a table.
as follows : (k = 2) .
P (X)-= X·~- X -
:. .e •
2.). Since we are interested .only in the signs of
1(<<') ,f(_b,) and I( c.} " round - off these
quantities Ito' the first nonzero decimal.
.-.: ,
10
: ?,,' ,.
G = 5 :$ io:":"
,',. . ~," ..~.~......~~··t~..."
1i If the fool is required to be eeneet to k
.dectmals , . round - ·offthe values of ar, b,
and '.CI to 1r+2 decimols : ....- ,'~~;'.'
In this case
r t::I C7 - 1.3243
IS
To obtain the rool'mIKCt to .two decimals, we
must continue. the aIgori~ .~ the Jrrst two
decimals of an. 'and . b~ me' 1bc same:
These will be Q7 = 1.:3204 and bj = L318.2
so that the rCq~.'oppr.;;m;iimon fbr ·the 1JH1t
t:. :" ...~,:",~!
. ~1t+' LSO ... ···
. z». C2 = , :1:". '-::': =: 13,75
..~..:'!: tit",; I;~. j~...,,':,:.
=> r in ( 1..:25., I..5!J )
=> i( 1.25.) f(1..5)· < 0
Step 2: f(cJ) = f(1.25) = -0.297
. ....
1 + 1.5 = 1.25
.2
Cl =
..
Notes-:
9. 1.J655 -''(-0.2548) ( 11655 1.5
)X4 --
. - 0.2548 1.38.
= .1.1655 + 0.0521 -- 1.2176
15
t: :', " *
= 1.5 - 0.3345, = 1.16~5
Example :.I: "'Apply', regu!fz.., falsi :m~(hqd to find the
..' '.., t.li~ 1'.00/ "'6tili~equilti'on: ...',
~ - 2 sinx = 0
in: the interval ~(J.) 1.S.).;to three decimals.. . ..... .
* *" * * *
This' is' the..'formula of the, secam ; method. Usually it .
converges I~r :~an ,th~bjjett;on ;~;ho'tl.'
.~: ,.
14
: '
(4)_!(x,,) [ Xtt - Xn-l ,]
f( Xn) - f( Xn-l )
Xn+l' .: X"
Continuing this procedure. we find
[
X2 - Xl ]
~ X3 = x] - !(Xl) f( X2) _ f( X2 )
Xl - X2X) - X2
f( X2 )'f( xi ]
=
- f( X2 )
This line intersects x :.iris at (x;. 0) , Hence,
x - X2
f ( Xl) - f ( X2 )
= P' '! . .' I "'}Jl(('
Xl - X2
y ~ f( Xl )
Its equation is:
This .method 'is"also known as',the meth~d of false
position or regula:falsi. " ." ";'" :,'
Suppose that f(XI) , and !(X2) are of opposite sign.
Thecurve : y = f(x} .on (Xt J X2l .. .: '
is, replaced by a', straight line _. " .,;,:'::
~o~gh (x/,!(x[))and1(x),/(x,)). ,: ~~',
__;_~~--:4--;;''-''--
(The, Fatse Position or Regula Fol$;Method)
3. SeeD"t Method,
10. ...
']'7
(a,b)
The sequence i
{ XI, X] •.... , x~...~.}
converges .to r if
Theorem:
, .,' ", . ", ",
n = 0,1,] ..... . '.: '
" .,
xn+l = lJ (:~nJ.. J. ' "
..1 ••• ·•
~ ~ .. . ';'i ; :~.", .. "
, ..
. ,
..: : ."~ ~ jI '"
~.' ..
Xl = s o«)
Xl. = g(x,)
....' . ..., If XC) is an ~flitial..(/fp,ro~n.IQ~lotl for .the e~st
root r , we construct . a sequence of successtve
OJff..roximations .~ foIlqws: .":. ; .
~ = si»): .....• t;
r
. .
Rewrite the given equation in the form:
• ' . • .' • t'
o • ~ •• ~ " • :
where, / is continuoUs and differentiable, has only
one root in the interval ( a, b). .' .
• • I. ~
:!
:'00: ",.; •• 0 r. ..... I, t' ~ OJ, '', ..~.:~.,
It. is,)i1~9 c~~ .th~,fixed P'!!~lf' ip.e.(~od-.".
[et the equation: . :.~I;;.;
f{x) = 9,
. '. : :'" . ';',: '.~.: b.:;i:,~:.'~ .' ','.
.' (The Fixed Point Met"od~h.
,' ..
1.:._ Method of Iteration
I
'-.
16
.:' :
* *' * lie' *
.' ~.
1.2362r =
From X6 and X7 we see that the r~ot r correct to
thre(! decimals is:
- 1.2364 - 0.0002 = 1.2362
(
1.2364 - 1.229 ~
X7 '"" 1.2364 - (-0.0008) 0.0008 + o.'o2~f')
= 1.2290 + 0.0074
. . (;,1.229 + ~..~~;~...:.),X6 = 1.2290 - (-0.028). _0::028
. ':.....
= 1.2176 + 0.0114 = {2290
. / 1.2176 - 1.1655 )
Xs = 1.2176 - (-0.0714)l.;0.0714 + 0.2548
11. 19
",'
'qorollaries:' (1) 'SinCe' x; -J r , as n -;} 00,
the error.
. ..'..' I xf!. ~..r t
can be' made' small' as we 'please
for ~,u~cie.nt1x,4I large n ..
• •..• • !!•.
( '.* * ~, * *
'. . ....'! •
+. .~. .~ '.
" , ,
#I x" ~ r I = 0, ~'., Jim x" '= r
11,-+ ""
lim
n -+ <0
and ( 6) gives:
......
lim m"n .: 0,
n-+oo
m < I . 1
.,,' ::.:~.' : .'
::'.: ':':,,~~,'",:: { .:
.......
(6)
,I XJ - r I ::; m I Xo - 'r I
I X2 - r I S; m 1 xi ~,r I:': ~ m1 ! Xo - r: I
" ., " ' :.", . -':.::~:,~~",~;,~,;,:~:~:.'.~~.
...""~" : : ~""~,i.'.;'~'.~~:;~i'i:~;,..i..,'t;" :. ~ ~ " .
Since ,
Mcnee,
IXn+J - r I =:j~ rgl(~)1 I·(xn - 1')1 ~ m IXJt -r I
for n := 0,/,2, .....
From (5) we have
18
and, consequently,
.
for all x in (a I b)I s'.(x) I .< m < 1
we ,C1:l,n assume that there is a positive number m < 1
such that:
Il (tt) I, < '1
, ' '
on, (a, b),
Since
'x~,+1.- r '= g(xni - str» = reo (x~ -;t),"" (5)
where ~ is some point im (xn, rj, 'th~t i~,,:hi', (a ~'b). '
and we have by using 'the,'" mean - value theorem that ;
r = g.:{ r)
Since r is the exact roof, then
,g(h) - st») ='gl(4J (b - a).
If a. junction g (cc) is continuous and differentiable
on ( a , b). then there is at least one -point ~ .in
(a J b) such that:
Proo[:
'. ,.The .proof is based upon ..the mean':'value theorem 'I :
which states that:
12. r I < 4 *' 10-4
21
z:» - I XII
I x] - r I :$; ,1l (b - aj ''''~.. {(j.672~8l= 0.00038
By (6):
3.78922XJ = 3.5 .+ ~.:5.log.)]Q8,29" " ' 'ii', '('. •
Xl .=: 3.5 + os 'logi5" : .,1. 3.'77203
:Xi = 3.5· + 0.5 [0g"3.f1103 ~- 3.78829
3 + 4 =, 1.5 ° '.
2 . '
Xo =
Note that 'I s' (x) 1 is' md:rliflliiiz'J when x = 3.
'f
on (3,4):I s' (x) 1 < 1
Before applying ~"!e iteration method, we
must verfy that : "J
7 +'.j_ fo~' ~ ~, g ( ;; j
2 . ·2·
...•.:
. X '=:
• .' "',"; .;,~'r' :~. .:"':. .. ' .. '" ',:
Rewrite' the given equation-in the' form':'. -»:•• " " ~.• ,.,,' '. " ,'0j
, :
I " :
20
. t ~ , . ' ". . ' .
'the' real root r is hi (3 J 4) °
::;:; S~nc~o _1(3) I( 4) < 0,.
I(1) 1 - log 4 ~~ 0,
I( 3) = - log 3 - 1 < 0,
,f
~ I(2) = - log 2 - 3 < 0
Jt») c:: 2x - log oX - 7
Solutio" :
Let
Estimate the error. (Round - off all
calculations to five decimal places).
4x - log x =0 7
...._. ' ..
Example 5: By the method of iteration find the third
approximation _to the real root of
* * * * *
IXn ~ r/:$; m" (b-a) (7)
(2) Formula (6) can be used to
estimate the error in Xn:
I ~
I
I~~'
~tl
I ~
-11!
ifI '~
~>~
I
I*i~-..,,~s
r~~!
'''a"~l
I .
1'"
'd'~
1~~
I
t~~!d
I.~~
,~I
~'l~,.,
I
~~
c
~:~
f"l;1~
I
!~~~·t..-;..~r
I~)
I !
.~
~'1
-j
{t1
~''i"
I
I
~4t.:~ A
13. 23
,3(x.+l)213
".' .~
• . .' ' .. • ",', 'I • , ; ..
:; ···x,=: i3,Jx:<.. i" ==.... s (xr": '.;~.
Is' (x) I ; .~':(x '~"// 2///
#. • •• 3 ~ ",.~. :.~I', ' :
. ,I:' ; "
+ 1: • ", '. ,'"
1
......3.
"r' ..~ t , "
Is' (x) I := 3' ? I.
... . '.'
I,' •
'again 'we ·C:~6{:i~Ilpiythe 'meiliod 'to
this fonn. ' ..:
''', .
z:» x = iJ(xj.
x
1
2.
:. .' We.c~~t apply: the method to this form
of the equation.
, . ,
Is' (x) I = 13 ~ -1I» 1 on (1, 2)
1. x = ~~.- 1 6: g(x)
".' ,:
1
'.•1 .'.
22
in" many ways :.',' .,(. '
x ,= g(x)
can be' rewritten in the form :
The equation:
.' f(x) = 0
zz» the root r is in (I, 2) ~
Let' .
f (x ) = ~ - x' _. 1
1(1) f(2) < 0
Solution:
....,':.
correct to two decimal places .
Example, 6 :: By ~~,~method of iteration find the real
positive root of:
r ~x-I '= 0
* * * * *
3.789 278 248 ...r =
rrence , X3. gives me root correct to at':'east three
decimal places. .
The exact value' of the root is:
14. 25
* * * * *
.. .. h 'b2 '. " . b1
f(x +h) = f(x) +'.-' ./1 (x)+'2 ill/xj + - JIll (')
. : 11 21 . 2 !
,,'t.
fOr example. when k = 1 it takes the form :
. .... h .'.. ... 2
f(x + h) = f(x) + -. /1 (xl- +. !_ fll (()
11 . 2!
.:.. ' ~
For example, when Ii = 1 if takes -the forrn :
, ... '.'
for some point ;. in (x I X +h ) .
'I,:,','; .
~<x +. h).= f(x) -f. Ih, jl(X) . + ....
. ..' 'h" hht
... + - ptJ.(x) +. .' .dt+J)(r.)
:... k! ' . .' .···{k+.;O:! J' -. 'p,
If f is continuous" and differentiable (k +1) times
oil the' interval [x, X + h.I·,·. ·'then.
Throughout this course well make' use several.'tiuies of
the well known Taylor Formu/~' whose statement is:
. '
It is also called the Newton - Raphson meihod .
(The Newton - Raphson Method)
5. -->::Newton's Met/lod
'" "
',',..
24
* *
Note that 0.0019 is an upper bound for the
error, an~ not the error itself.
The error: -in. :.X4 ." may: be·.~~~tima~ed,.Qy (6):
I X" - z] ~ ~4 (b:- a) = (0.21l ~ 0.0019
" . ! :. °f.:j '1"','
( The exact root is 1.3~4.J IT 9.§7 ....l)..
;;'("I',
.'.'r
r = 1.3249
: ...... ) .
Since XJ and X4' have the. same first two
·decimals" the ~eqJJjre9~!aJlpr@im41"p;>1J'is :
XJ = g ( 1.5)' = 2.5 JIJ = 1.3514
xz (2.3572) 113 = 1.3309
XJ' = ".(2.330~) il) =' "/J259:
XI = (2.3259) 113 = 1.Jl49: ..:.I.•"
=.. 1.5.
1 + 2
2
Take
The method' maybe: applied td'this form.
. :::; .•.. ;:'.. ..·0,
z:» Iz' (X) I S 0.21 < 1 on (1, 2)
3 * 2213
1
15. 27
(9)I I . M h~
Xn - r <
12 f' ( Xn - 1 )'1
The convergence of Newton .s procedure' is laster
than any of the prevlousmethods, It can be shown that:
"
...... {'..
" i',1
,,-
From here we get formula ' (8)., " .: ':,
.. Xq -. Xn + 1
"= '.:'::f(' ~D )
tan 0
sco
,,'.;:.
, f,Ul(,,)
" "....f.
by its tangent line. at (~n , f(~n).) :
, '
y = I (x)
Geometrically, this means that we replace the curve:t
I
This is Newmn ' s formula ..
";
'j
'j
(8)Xn+l ::. x; f( Xn)
ft ( ?Cn)
26
Now, a better approximation=te >.r is given by:
.. ....
f ( XIl) , :
t:::J Xn - --'--':_:"_
, f" ( Xn ) ,
r
I:i, -h
f(xn} + h fl(Xn) ~ 0
f(~n) ,
f' ( ~n )
: ' ~' .
: I
Where ~"is some point ,in . { Xn , x; + h j. If h is
sufftctently small,' we can neglect the term containing 1t2,
Hence
'I ~ N
o = f (r) = f (x; + h) -.I(Xn) +,h j (x,,) + 2 1 f (~)
By Taylor formula with k == I we 'have
.,
f (r) == 0',
r ,=, Xn' + h,"
r - Xn =: h ,
f (x) O.
an, approximation to the root r of
where,
so that:
.We set
,Let x; be
the equation;
-r
;
16. 2.9··
* * *' * ;.,:*
Of course, ihi~'':is ·a .go~d ,I/rior· for drilY .fwo
iterations of Newton's 'procedure.
fi:t',. 7 * 1{)~
12f"(Xl)1
','!, •
"
on (1,2).
" ,
IfII(x) I :::'r 6x,I < 12
hi ==, Xl ,.: xi = .;OiD2263',
To estimate the error involved in Xl we usc (9):
= ' 1.32520
0.10070
4.449g4
XI 1.34783
1.34783
O~875
5.750
= 1.5 -
I28
Let
I (x) = r-x"-l
I( 1)f(2) < 0 => r In (1,2)
il (x) = 3 xl 1 ,
III (x) = 6 x
Take,,..
.. t
'Xo .i=
1 + 2
1::.5~. ',=
Estimate the error involved.
( ~qund - off to five decimals)
:>?-x-I = 0,
Apply Newton IS· 'method to find the
.second approximation Xl to the positive
root of:
'* * * * *
So/utioll :
Example 7:
and M Is em upper bound for 1/1 («):
hn = XII - Xn-l
where,
17. 31
g ( r 1 s) = 0 = g ( Xn + h , Yn + h )
.~
f (r , s) = 0 = f ( x; +h , Yn+h )
.Using Taylor series for functions of, two variables,
we have
',: .
S = Yn + k.r=xn+h
Let {x; ,Yn) be an approximation to (r, s). Let,
,Newtoll':'s' Method
* * * * .*
in 'il, then' the ..iterations :
Xn+ 1 = F ( Xn , Yn )
}G ( Xn + i , Yn)
'n = 0,1.2, ...
Yn + 1 =
~'..
I,
.will converge to [r i s},:
(12) ,. r F:!.~ IF, I " J}
,.Gx I + 1 Gy·I·< 1 .
" :
If
30 ..·.
(11)
x: =
}
:,'t.! '/' .. ,
F(x,y)
y = O(x e , y) ,
,:,;,~ewri~ ~~4~tiops",(10) , in the. form : .
''
': : .
The Method of Iteration
"
"
which converge to (r , s}, may be obtained by two
major 'methods "
Let {x; ,';16.) ': be 'an' initial approximation in fl
to the exact root (r IS) . Successive approximations
in some region n of the xy - plane. We suppose
that f and g, and their partial derivatives up to the
second order are continuous In n.
y = s (or (r, s) )x = r
Suppose that this system has a single real root
(10)
f(x,y)
g(x,y)
Consider the ,system of two nonlinear equations:
6. Svstelns of Nonlinear Equations
18. 33
I
X:2~1.32+cos 1.6357= 1.2551, Yl=0.85 + sin 1.2551 =1.8006
, x3=1.32 + cos 1.8006= 1.0922, Y3= 0.85 + sin 1.0922 =1.7376
= 0.9039. Yl= 0.85 +sin 0.9039 =1.6357
XJ=/.32 + cos 2'
, in some region .n about the potnt ( r,2)"
,: we cap apply the iteriuion procedure:
,!r: /'+ Jty I = Isin y f <. I
I, Or I ~' lOr I = I cos x I < 1
Since '
" y, =:=. ,O.8~ + sin ~ =,..G (x, y).... , .,' " .
x = 1.32 + cos y = F(x,y)
Rewrite the equations in the form:
SO/lition : (1) By Iteratlon l'ileJilod'
.....
......
sin ~ = y - 0.85; , . ,
cos y = x 1.32
correct to two decimal places.,
..'~
, '::Exo1lJPle 8: ,"',,~!nd,the solutionnear .( 1 I 2) of the
, , ':;ystem:
32
,Yu + 1
(13)
Xo+ I
Hence a better, 4,pqrqx(tnq!.fpn."to " '(r , s ) is:
,Neglecting terms containing h2 1 hk, k2, .•• , we have
h f" + k fy =
- f }
h g" + k Sy = - g
where,
I, g , ,Ix , /y g:r , gy
are evaluated at (x; 1 Yn). By Cramer's rule we find : ' ,
~ (I
fy g - f gy f g" - fx g
h = k =
fx gy fy gx fx gy - fy g"
~~
~,'~j
~!~}
I j;
I~!
.1t I:
lit I"'.~
. 'f>~!
I I
1
I ;
19. 35
"
. "
.:, " t" 't, ,
and so on .
.' .,
"= ':"'1.756.!f··..
::". ,
• I,.
" 1 ' •
".
'o', '
= L'J5il~rl- (-(jO'O~6j{:I).~ (0,4~23'~l
..I:. ." .. ' : _L4248.t
,'.-,
-,
"
= :1.1352
.' •.•.. ., ... -11 - . • '"
= l' 1';2-'11--4- (-1)·.(1>::oQJ)::~'-(~O;OO~.{~.9825)
• >7,. - - .;' -t:42~k.:: _'.
" " . "
...... " W" ., - .
. • I( '.
(-0.3086)(..lJ),',- (0,54fr3.) (-O.0961)!
'" ..-l!-;,;1:49'i:3~,~......• JI
" :.~
'~,
Y I
~.• I
; ,
,,
. "
..j
'.,,' .
. :.:. '
: .
= '],12.17":" .
= '1 +' (-1) (-0.0961) - (-0.3085) (-0.9093)
-1.4913
;. ;.... '.:, . .:~ .. :. ..
.~..
Xl
.......f - cos x f = -1 " g¥ = -1 , gv = - Sl.·'.1Y--.' x - I Y ~.' ~ .r
(2r:-'JJy /NiW1fYl{~s:'~th~tl((jd
f(x,y) = sin x - y + 0.85 , s t»,») = cosy - x + 1.32
"
.y -- .1. 7561
;
The solution correct to two decimals is:.• " ,1 ,t,'. ]. ~.~ .' ~. . .
',I,' • l .:
x7=1,32 + cos 1.7580';''i.1339, Y7~ 0.85'+ sin 1.1339 =1.7561
, .
x,,=1.32 + cos 1.7376=L'15?0 , y~=0,85 + sin). 1540 =1.7644
x5=1.32 + cos 1.7644= I.ii16',·' YS;' 0.85 +sin 1.1276 ~1.7534
·x6=1.32 + cos 1.7534=1.1384, ,Y6=O.85+sinl.13847-1.7580 .!
"1: .:::~, '.
,
.l;~.
r
"
I.i,
:~
I',.
Ir .,.I
r. '.,
.!
20. 37
by using
1Find the positive root correct to 2 D of the
equation
, '
~;' ." , . .
I
, ''Apply the mt..'thod of iteration to find: the root in
problem 2 correct 10 'lD" and estimate the erTOI'.in
the attained value.
'j:
I'
i :,
and estimate the error .
/
Perform three steps of Newton's method to obtain
the smallest positive root of' the equation
Apply 4 stlfPs only, of the. bisection method and
estimate the error,
and how many are needed if this root is required to
be correct 10 8D ?
correct to .four decimal places (4 D) ,
froblems
/ .}jaw many s~s of the: bisection method are needed
to find the smallest positive root of the equation
36
* * * * :;<
x = 1.1353
From the table we see that ,tne s'Qluti:an corsectte
three decimals is:
-/ ,-:1
h = -1 -1 -1 -1, ,
gx = -1f-- . .-:;:...------'-Il----4---....:I---__:....:.j------ll: ..
gy =,: - sin y -0.909.:iJ i .10.9825: ·-0.9828:
"g,.,~P0s.y,~~ + 1.32 ,-0.096il ; ,0.:0'099 {O
. ~:
f= sin x -y + 0.85 '-0.308}· -'[)"O'O66: ,..:Oft){)Offr
, • I
Y 2 J, J.7.~83 : /1.'11567
x
321o, "
n .
-'1
We 'may 'arrange calculations in a table as follows:
21. , "
39
For each of' the following ,systems of nonlinear
equations find correct to 2,D the root that is 'near the
given point by the method of lteratlon and then by
Newton's method :
c
: .
Estimate the error involved in each method".I'
I, .
xl - 5 ~ +) = 0
: '
9. Perform three steps. of the biseaion Newton's.
and the iteration method to find the largest
positive Toot of the equation;, . '" ~
What can this formula 'be used for?
b) Define a sequence'
~1
=::
Xn - tan x,
, , .. :,
.- I":'
with XII = 3.
What is lim ' Xn ?
n .... co
where ,R is a' ,pos;thJ~"cons/tint'; was obtained
by applying Newton's'; method to some function
f(x}. What was f(xJ ?
'''::..
Xn+l = Xn" }: cos x" sin Xn '+ R cos1 xn',
8. aJ The iteration formula
"
1I
i
. ~
~
, :
.. "
,,'(
f'
.. .._1.... .
38
r is the exact root .
where,
Estimate the":error
, .....'..
Perform ,~rw~,steps ,0j"Nf!!t'tQll'S method to find Xl
for the' ,(.oQ~tn .prohi~i!i6" ,.. .. ... ,~. "
7.
. ,...., , .. t,
has a root near .x =.ij and 'lind it correct to>0. ..../~ I,
2 D by' the iteration method and by the secant
method,
Show that the equation
, , ..II! X .(i,t'"fj!~:x). = 1
6.
Find them correct;(0, ,3:P" ,by .Newton's imethod,
. ~' ...._. .
has two positive roots:
Show that the eCJ.uatio¥
x~ + 2xi ~ 7') -+- j',~ 0
5.
(i) the bisection method
(Ii) the secant method ,.:
(iii) the method of iteration
(iv) Newton's method
"Ii".~.
22. I
'i
I
..•.....'.
", ..
.'.
,41
,.'
"', .,
* * ,,* * *
near (1, 1, 1)'.
.',
.
j,
,
x:y z Xl +y'z" = 134'
xi~''Z2 ='. 0.09,,', ..
.1
'J
"
~
'., .
15. Perform one step only of Newton's method to
find the first ajiproXi'inatioi" to ihe solution of the
.'j;: "
system
.'
.40
Ij.Solve the system
Xl +- y2 + f = 9 .xy z = 1" ~ .x + y ~ Z2 = 0
by iteration to obtain the root near (2.5,0.2,1.6 J.
x ~ y]. + 6.9 In x == 0
13. By Newton's method find the root near (3.4,2.2)
of the system
10. x] + x - r' = 1 y - sin r = 0 . (0.5,0.5), ,
y Xl + yJ = ,1 , XZ.+y2 ;:;-""2 x , (0.5,1)
12. Xl + yI _ 4 = 0 e" + y =1 . (0.9, -2)I
,-~};r.
;@
:';.M
-.
"I .
~~t1:
,
I I
i:r;~
,.'".f,
a'~( :,lI
,~'
I
; , If
~;
,
I~~?,{
,'$,
,
~lt;;
I !
Jr~w~j, ..,.
~l;l ;;t;i':
);A
I , .,, .'
~~;o
"l!~,
23. I X = A-I B
X '. = ,tf.-1. ~.t.:··,···
A-I.'1 ,by
.,' tv,
..".' _',
.. '.
':.
::, .,.
':['~'~:~.'g] ,";,' ':.~ • • • I ..
·0' ·0' '0· ··i· .
I .=
IA I :/:.(J, the
4~ .
.it! we get
A-I A X = A-I .'.B ~
.,;,. ~ .
.'
Premultiplying .".
. , .
. (b) Inverse Matrix Met/tod
. Since ..A js ...Q :~q~re..in~!J'i~with
matrix A has an inverse A .
where AI is obtained from' :A' by .replacing: the' column
number i in A by B.
~. < ': • i~1,2.' ". ,n
IA1' .',
," . ..... ,'
. . ~/.
". ' ','~• 'I ',~ •• '
.The' solution is. . ,
.' : -
~..~:.:. t .
(a) .. -Cramer's Rule
In this: case the unique solution. may be. obtal~ed by one
of the following methods: .' . :.
42
(2)fAI 7: O.
. It is well known that such -system may have a unique
solution, infinitely many solutions, Or 110 solutions at all.
We will' be. interested only in systems having a unique
solution. To guarantee this we assume throughout that the .
'determinant of the matrix A of coefficients is 'not equal to
zero, that is,
A X = B.
or, briefly,
:;~J[~:l= [~;l'al)Jl Xn _bn .
[::.: ::.:
ani 801
In matrix notation this system can be rewritten as:
(1)
Throughout this chapter we consider a system of It
algebraic equations in n unknowns ;
1. IlZtroiluction
SY._stemsof Linear Equations
~
1:1
24. 45
Repeating the same process for the obtained determinant,
we get .
~'
. :
:..
IAI = a1/'
is reduced to .i=2 '-2 Hence IA",J •••• J n , J - ""J n.
a determinant of order (n-I) t:
.:~
all
:~."
(./1 31J'
alj ./ = alj - a" ...
where
". ',:',
.} .,;
alII
all ""
o ai"Y ... a~
; .
1 a12 alII
all all
IAI 0 ~21'-
au all)
= a11 a21 3211 - a21
all 311
0 312 all)
an2 - aliI aWl - allJ
all all
"
, .
~
~.
44,
row;Subtract arJ times tile'"fiist row from I"
r=2,3, .,. ,n :
.~. : . ',.:
, ~r~ ~ "1" J '.. •
~ aD! ab2 ann '
= '(1'11'- ' 32t' ~i2i
. , a12
" ,1
'!. all
alII
1. Divide the first row by a11 :
where we assume that an « O. If an = 0, 'we
interchange two: rQWS or columns and the resulting
determinant equals 'Iil ;
, , ',~1.:.:"lr :',
Bll ..a:22
all 312 311l
aln
I A I =
These two me/hods may 'be applied to systems of 2. 3 •
or at most" equations. They are not practical' for
larger systems, because they require a large number of j.
arithmetic operations. For example, in Cramer's rule we
have to evaluate (n+l) determinant of" order n. To
compute a detenninant of order II by factorization. we
must perform 'II!, multiplications. We now introduce all
algorithm for computing an: Ilh' order determinant,
which requires If multiplications:
{(:'~f:I:... :J;:J~'~~:.
Consider the determinant ",
iI,
~, ,
,
25. ~r...r,'.
, "
, '
47
,,' ·5
1 -l "_
2 -3 .:~" :
, . 15
o 3 --
2
",
.; .
2
, , 3
T 0 -1 '-
'2
, " r 5
2,·02 ....~ 2
o 2 -3 9
15
o 0 .-3
3
1 0 -1 -
2
1 2 -3 4
-4 2 1 3
3 0 0 -3
IA! = 2
Solution:
2 0 -2 ,3
1 2 --3 4
-4 2 1 3
3 0 0 -3
IAI -
':J-'.' /.
Example (1): Apply the Gaussian elimination method
to compute
~.
"
, '
,~"
, '
~
~"
,
j
r~"
46
: '
* '" * *- *
The above method is, called Gaussian elimination..
k == 1•2, :" •n-l iii =: k+1, k+2 . .... ,n.
a(~-l)
a (!c) - a (/(-1) a (!c.1) * 2L_ .
If - If - It a li-I) •
where
, '"
I~J ~"
i ,j ""3 , 4 •....• n . Continuing this process, we get
, a~l)
=: a (J) a (/) * _J
fj - 12, a~9'
where
1S3l a34' ,.. aYil
IAI ::::::
~1I * a (1) '" ...11
." ...
ahV art '" a~
26. ••
i"
,
,4Q
'''0 f fA j lJ. ]... :i
.,.
'.i
I '
" .: ';'
~~
:, ..-:l.
.'
~:.'
:~!
.!: It is clear that these operations do not change the
~: s~1~ti0nof' the system The matrix rA /. I BI J obtained
~, :trom {A I Jj I.py elementary row transformations is sale
r} , to be equivalent to [A I B) ~,d" '~e'"write
~: .'" .: ': ..:.' "'
.
(iii) Adding a row multiplied. by a constant to .
another row.
(ii) Multiplying a row by a nonzero constant
(I) interchanging twQ rows
We'll make use of the following -elementary row
transformations:
.Is called the augmented matrix of system (1). Note
that each row represents an equation from system (1). and
the augmented matrix determines ,c<;>mpletely, ,the given
system.
..~: ,.
The matrix
[ all
"
qail '" aln
[A I,:'B] = all a2l a2n
anI anl aM bn
',2. Gauss Elimination Method
48'
* * * * *
;: -48
= 2 • 2 '" (-1) • 12
:;: 2 * 2 '" (-1)
:;: 2 * 2 * (-1)
1 _ J~
2
3 _ 15
2
)ri~l
,(f~
I I
! '~~'
li~~
I -i
5
4
= 2 • 2 o ·1
13
2
0 3
15
--2
'fPJ
I $
I_t·'. I
27. 51
'. .
All elements' in -the first column below the pivot 1 are
made zero by subtracting three times the first row fro.n
the second and two times the ftrst row from the third
I i • . ( rl ;_3 ri , rs -2 rr ) :~..
fA I B 1
[
r 2·,3
::: '3 * 1 2
2 -2 -1
The augmented matrix is
,') ,
Solution:
• r,f
3 Xi - Xl + 2 XJ = 12
x, + 2Xz + 3Xj = 11
Exa~n:ple(2): Use Gaussian elimination method to find
the solution of the system
We illustrate this by means of the following example:
(2) errors caused by the rounding off to a finite
number of declruil places or of significant digits.
(1) the accuracy with which the coefficients and the
constant tenn.s 'are given. ,'.
50
Accuracy or Solution
The accuracy attainable in .~e values of the unkn9~
depends on
* *' * * *
and ~. on .~;we' finally obtain all values of x, by back
substitution.
an-I. not
X,..l -
, I
.an-l 0 ,xu
From: the: (n - l;Sf equation we find
From the nth equation we find"::,
Tf
aG I
b]... aln•. . 1
./ • J .
~.~
a22 •.. a lii
0 I'
b~... ann
. -th eouivalent augmented, matrices haveThus systems WI.. ~" .' . • .
the same solution. We; call them' equivalent systems. -1 ;
~;
Th· G elimination: method is ·consisting of 'j:e auss . _ ,I'
reducing . [A I B] by elementary row transformations to ii
the following eql!ivalent upper triangular form: r :
28. .i,
,
'i
11
It
Ii
II
Ii
i!,
, ., r
, :
"
i:
",
.~
53
'. ,
0.68 -0.24/' .i~05 J' " .
.:t'."7~".....r?~6I",J ··;.1X'" , ."'y-ll.?-I
::'11'.2 '. O:t2 .' '.--.{'1;4. .:~. .., l.iH12J' 'Cl
.....
["~
'0
..
.' ~ ..
[
1 '0.68 ,-G.24.
'~:~q:"::4"'>'[A I Hj == 4 1 1 rz - rr
3 -9.2 -D.5 -8.2 f3 - 3 rr
:'>0
SoluttOfp. :
The augmented matrix. is. .:-:
by Gauss elimination method ..
Round - off all calculations to three
s{gnijic;ant,digits , , " -'. ",',:'
..
3 XJ - 9.2 Xz -.0:5 Xi - 0.2
1.5,
Find the solution of the system
~.:~~.'1.. ~ lI;:.;t , ~·st {~ .
, XJ + 0.68 ;Xl - 0.24 xJ' = 1.05,.
;.
i'
i;
, .
'.~., ,
}. !
} ;
Example (3):
52
* * * * *
Itmay be. .~~rifi~d}~flt..each equ~ti~l' of th~· system is
exactly satiSfied.,., by ,tllis solution. Here .we obtained the
exact solution because no rounding off was made.
n -2 Xl - 3 X3 _- 3Xl =
1
11]:3, " .
20' iT3 - 6 f2
T2 / 7
f3 / (-1)
The solution- is
By' back· substitution :
, 3·· x
, X2 ='J 1 3 = 1
[
1 2 3' 11],... 0 1 1 3 .
0012.
[
1 2 3
o 1 1
067
[
1 2.3
o '-7 -7
o -6 -7
IA IB )
1m,
29. 55
Solution:
The augmented matrix is
Solve, the' system in' example 3 -by Gauss
elimination method, with partial pivoting
, 'and by using the 'same number, of ..
Significant digits. '
..':.,,,
Examele (4);
* * * * *
5. Repeating the same 'procedure for third I forth I ... ,
columns we reduce [A IB J to upper triangular
form , from which the unknowns are obtained by
back substitution. '
4. ' .Suorracting appropriate multiples of the second row
from other rows below, we reduce all elements
under a:zz to ·zero.
" ,
3. Consider rows from the second to nth. The
second pivot element will' be the coefficient of X2
with lar.gest· absolute value placed in· place of a21.
2. Subtracting appropriate multiples of the first row
from .other rows, we reduce all 'elements under all
. . _ t~::"
to zero.
54
.; We ~y :~~t~:~;,rri~i~i,~c~u~~p.solution "by usi~,gmore ; .
sil¢.ifioant ~i~i~" ;' ,9~"by; using .the :so -':called ,partial,:
pivoting n : .,'" '" ~.
1. In the .first ~l?Jurnn we choose the coefficient of xi
with, 14rgeii' dbsoliitti I'vqlue,' and interchanging rows
we pui' .it m.,~~,pl1ice of 'all, . 111is coefficie~t
with' /i/rtgisl hl>SOlure' value 'is called the first pivot ,:.
elemetu ,
* * * * *
. ~.. " ".
.'.... . ~
The, difference .betweea the approximate and exact "
values of the unknowns was caused by rounding • off all 1
calc::uJati~~ "to' three ':slgtJljktint digits .
x, = 0.15
The exact solution of"~:the'gWen' system is
XI ::: 1.05 - 0.68 Xl + 0.24 XJ = 0.145
~ ;',' .
.', .. .'
1:-2:7 .;.'1.96 :x)·· = 1 01.
-1.72
- 0.494
" ','
.Back substitution' gives
i.'J
~;
:,
,
I .
~-,
, '
:j'
,
I
31. ~tJ
r'~l!
Fl
F
J ~
.
"
59
, ..
:."
Interchange the second and 'third rows, and then' divice
the second row by -6.75:
[
1 0.375 -0.125 0,25 ],... 0 ,0.615 >_ 4~125 3.75
0 -6.75 -1.75 4.5
.. >(
0.25 J '" :1'2 -', l'i
4, ,','" "
5: ' '",r) ,.-'2n
O~375 -0.125
'1 ,,'-:' '4
-6 '" ;.2.':; ...,. ..' ":.
To make the first pivot element all the largest in
absolute value in the first column, we interchange the
first and third rows ,and divide the first row by 8 to
make a11 unity (rJ H ''1, and rt 18 ) :
[
2 -6
[A I B 1.= 1:.' 1
. '8 .. 3
.The. augmented matrix is
" '
Since 'the solution is required accurate to two
decimal places, we round off all calculations to four
decimal places, that is, we use tw'o more decimal places.
Solutio" :
.58
by Gauss - Jordan method' with. partial
pivoting.
XJ = 2.8 XI + 3 Xl -
Xl + ;Xl + 4 X3 = 4 ,
EXample .(5) :
Findto two decimal places the sclution
of the system
2 Xl - 6 X2 -' 2 x~ =' 5 ,:, ,
,,
* * * * *
Partial pivoting is normally used to preserve arithmetic ::,
; !
accuracy.
x = C"
so that directly
, "
·t ~
i;
Thus, the main aim of Gauss - Jordan method is to ;:: ;
reduce the matrix A ~~"/t:. 1fri~"'I'J:~~,f,:, :.:: ;::, ;.
'. ,
.. .In this: method .the elements above and below the ,~:.
dittgonat' ar6'made', z~ro~.~';.,)J§d;f:'.,fuei diagonal elements are ; i
made ones .at the. same time that the reduction is performed, ~I .
• : . ..'. • '. ,'( • . ,':t. • :'. '. :. ~ . • •
: I
.,,'1
. ~
.' :
': '
3~,"Gauss',.,-,'Jordan Elimination MeUlod,
32. where
(*)x ::::C - G X
1 '. "';" ',4 I ,'I'
or, by using matrix notation ,
.:
. 1 n
: Xl .-:= . - (. hi - : L .a U, .xJ ). " Iii " i = l,~, ~•.,IZ
,ali :j = 1 ,,'
r " '. ,I. :: j ¢ i
..
or, briefly
(bll - ani XI - '" :- a". n-I Xn-l) = Fn
'1
........................................................................
(l2n xn) -,' F2"'? ::::
(ill
- a lu Xu )
=XI
Fl=(bl - a12 .x~
1
We apply the method of iteration to find the solution
of system (1) . For this we .rewrite system (1) in the form
4. Jacohi and Gauss - Seidel Iteration Methods
60
",
.:.. f Of, • ~ ~':'.
* * *.* *
! , •
x] == 1.OS'== '-0.94
two' declmal places is
XJ = 1.0514,Xl .== - 0.9393,
..
0.7336: J'-0.9393
1.0514
o
o
1
I
)
-0.2222
0.2593
3.9629
",: •..',.,
Xl = 0.7336·
[~
0
1
O· 0
.' .
n' 0
I
0
:1,:'
'The'~6futiozi is
.:,~. .:-, "'.
The solution correct to
:
. .. , ..
Xl = 0.73 Xl
33. .'..
63
.," .
,,(. , r, ) •.
Note
To make condition (*.) satisfied or. nearly
". satisfied, we choose 'all CIS"tire .:l:flfgest' .
coefficient in absolute value of x~·.' The
. , equation with such' all is the first equation.
The coefficient all is taken. as ,the lar1f~ ,
.', .'
•••• '01'
',.....
",. ,.'
. : .....
"
'r_ l..>' ~r: '.' .':r :..' '.1 •
3. '.This method is sd! - .eorrealng ,If an error' is made.:i=l,:J,.....n
62
t 1 aij I < 1
j = 1
j ~ i
1
1 ail ·1
+ 1 a'Fi I' + .•. + 1 a F~'. ,< J ;
a xi . a'x'n .
that is,
I~Ia XI
This is 'Jacobi method, A sufficient condition for
convergence of X( n} to the CX4ct solution is .
The adpantag~ of this' ·w.~od are
;~il"; .: 1.. If the' ~fficl~9.!Q.l~ J:tasI.D~Yzeros (sparse
matrix), the method of iteration may be' more rapid
..':,i " " than 'Gauss and Gauss - 'Jordan methods.
~.
I .,.: .~ " '; 5 . :', f'. /:'.
Mlt~n.this condition is satisfied, x.(") will converge to
exact solution no matter what initial approximation is used.
.. .; .~"'~!j/"":"",'
.: .....
",
',:: i :
I ai, I >
)((n+l) = C - G Jr(~)
.....:'~ , I,'! -:
or
'n=0,1,2, ....,
x(o), ...
2
to the solution, we obtain, successive iterates for the
solution by , ,
'Choosing an: initial approximation
and, "
, '
0
au aln
all 'au
G
.... ....=
ani an2
0-
ann ann'
34. r
'I '
I
6S
.: ' .
So(
'X/I} :::; 0.75 r X:z(l) = 0" (1)
• , X3 == 0.8333 ,
First approximation :
Here we added two guarding decimals to the
required number of decimals in the accuracy.
Where It =0, 1, 2, _ .
0.3333 x/n)A, 1667' (a)'-. XI, _
Rewrite the equations m the form:
X/II+1} = 0.75 + 0.25 xi") - 0.25 x/")
xilf+1) ;:: 0.4 '_ 0.4 Xl("} + 0.2 X/If)
condition ( •• ) is satisfied and we have the
right to choose any tnittal approximation, say
X(o) = (0 0 0) T.
I"f > ." -1I + f 1 J
::.:.
I5 I > (2 j + I-1 J
161'>"11 + la l
64
Since
Soliltion:
.Fitst we; rearrange eq~ati?ns according to the
above note:
. '.:
Use Jacobi method to find, correct to
2 D, the solution of the system
Example (6):
* * * * *
. coefficient in absolute value 0/ X.z in the
remaining equations t and so on.
B'M~~
, I
35. Ij.
I
iI
~]
r
~r'~
j
a.,
.. ~
67
*,* '* '*'*
When this is done.' the method is known as "Gapss-
Seidel" method. Thus in GIlUSS - ~eidd .method we
~fe the most recent approximations to the unknowns:
,.',
!-' . 'and so on.
instead of x/It} and ,X2(ft)" ~:, the third equation,
X/,,+l} is fotmd by substituting
A betterXl (rr ) in the second equation.
approximation
x/n+1) is found as before. A beaer approximation
A modijicaJ1on to JaCObi method is done as
follows :
* '* * '* '*
or (not rounded )
..
66
Xl = 0.26
... .:~
r ,;'~':'
I
Thus correct to 2 D ( rounded)
x/6} = 0.6359I -":
:!,
.. ")' '
.. :, XI (5') ,e ()6S~8:'', 'x'" (5) =
.' , ._J,~" 1
, "
" '
xJ(~) ::::: 0.6350
xiS) = 0.6380
W.e,must continue this prooess until the values
of all unknowns are the same correct to 2 D in
two successive approximations:
Third , approximation :
x/J) == 0.75 + 0.25 * 0.2667 - 0.25 * 0.575 ... 0.6429
xz(J) ::= '0:4 - 0.4 * 0.6417 + 0.2 "0.575 = 0;2583
x/J) =: 0.~333:" 0:1667*0.6417- 0.3333 *0.2667= 0.6374
x/1) = 0.75 + 0.25 I< 0.4 - 0.25,* 0.83333 :0:; '0.6417
x/2) = 0.4 .,:o.« * 0.'75 + 0.2 * 0.83333 == 0.2667
x/2) = 0.8333..r- 0.1667 I< 0.75 - 0.3333 * 0.4= 0.5750
Second approximation:
36. 69
~ '=••
"
* * * * *
TIle solution 2 D ( rounded) is
'XI = 0.66 1 XI = 0.16 1 XJ = 0.64
(3) x/J) =- 0.6645 x/J) = 0.2611 , x/,I) = 0.63551
",'<#. I,
(4) xi"! = 0.6564 x/4) ==' 0.2645 , x/4) :I 0.6357
68
(2) X/2) , .; 0.75+0.25* 0.1 -0.25*0.6749 =0.6063
x/2) = 0.4 - 0•.1 .f 0.6063+0.2 (< 0.,6749=0.2925
x/2)= 0.8333- 0.1667 4< 0.6061- 03131* 0.2925"=0.6347
, ! ':'" •
, '
Xj (I) = 0.8333 - 0.1667 * O.75 • 0.3333 * 0.1:::0.6749
X/I) = 0.4 - 0.4" 0.75 = 0.1
(1) X/I) = 0.75
where It = 0I 1, 2 , •.•
0.3333 x/n+1)Xj(n+l) = 0.8333 _ 0.1667 x/n+1)
X/,,+l) c:: 0.75 + 0.25 X2(n) _ 0.25 X/If)
Solution:
The used equations, are
x( 0) == (0 0 0 ) T.
Solve the system in example (6) by
Gauss - Seidel method with
Example (71:
37. . 8. XI + 3 Xl + X] = 2.0307
3 XI + 6 X, 5 x] + X.( ::: 0.4811
XI - 5 Xl. + 7 X] +.2 X4 =: 2.1659
Xt + 2 X] + 4 X4 = 2.5657
71
6.
Use 5 significant digits ..._i~ your work,
6 Xl + X,
+ X4' =: -7" X l - 3 X,
+
5.
Use " significant' digits in your work.
f.V
~. I·
1.85 XI + 8.78 X, + 1.19 Xl = - 8.74
7.17 Xl - 2.53 Xl - 1.29 x] = 2.62
3.55 Xl - 4.16 Xl + 5.90 X3 = - 2.59
4.
., ....
,
70
2 XI + X2 - 6 X3 = 5
"!:
. I
.xi -.4 'X2 ' + X3 = 4 correct to 3D
5 xr + X2 + 3 X3 = 3,
3.
3.2 x + 7.4 y
correct to 3D
=: 4:8 }.
= 5.3
8.7 x - 2.3 y
2..
Solve each of the following systems by Gauss
elemination :method and then by Gauss- Jordan method
both witlt partial pivoting :
" ..
first without partial pivoting and then witlt partial
pivoting. Comment the results.
3 x, - 4.031 X, - 3.112 X] = - 4.143
. .
- 2 x, + 2.906 X2 - 5.387 XJ = - 4.481
- 0.002 xi + 4 X2 + "X.3 =: 7.998
1. Apply Gauss elimination method' wiih calculations ...
rounded to 3D to find .the' solution of
rruorems
r!,
I
38. ..
73
• • • to",.~
..-. .. > :.~ ')
,."''"I.IIi:lI;e the ranke [a,b], where .it is ceqUired,to tabulate the 'solutibU:oya
,''-'''I.~;.c.~. set of points "
".'
isDot easy to evaluate y for distinct valuesof x, '
2 2 "'( ) 4 0x .. +y +ysm x+y - =
• I ,,"
:It mayuot be possible to find the analytic solution Of the ODE in terms
, standard functions by any of the known analytical methods.
IIZ!;'~:Vlmwhen such an analytical solution Ispossible, its numerical
i~ll'~;:':~ei~aluLati'(in may be more difficult than to 'solve the original IVP
. For-example, when the analytical'solutioa is a complicated
function such as
Numerical methods for 'ODE's are necessary and practical for the
'reasons:
By an initial value problem we mean a differential equation or a's;~t~~of
equations plus initial conditions. Numerical methods for orP,.man'
~lt;;9Jl!lr.~~[ltIlllequations (Ol?W,s) are methods by which we can.construct the solution of
value pooblem'(lVP) in tabular.forin,'Thenumericalsolution of an IVP is
valuesof the ~ytic (exact) solution ofthls IVP.· . . .. . .
1.INTRODUcrrON
, ,
" '
,Numerical Methods for Ordinary Differential Equations
72
* ,* * * *
8. Solve correct. to 2 D, problems 2, 4 ; 6J 7 by
Jacobi method and by' Gauss - Seidel method.
x = 1.45310 'J Y = -1.58919 J Z = - 0.27489
The exact solution rounded off to 5D is
c) Substitute each solution in the original
equations and observe that the left - and right-
hand sides match better with the (b), solution.
7. aJ Solve the system
2.51 x + 1.48 Y + 1/.53.z = '0.05
1.48 x + 0.93 y 1.30 z = 1.03
2.68 x + 3.(U y - 1.48 z = - 0.53
by Gauss, elimination carrying just three
significant' digits and rounding off·
Do not interchange rows.
b) Solve the system again using elimination witk
pivoting .
I
~~I
39. 75
..'. ~ , .
:....,
. ~
:; :..
.,. .J,,
: .-:5!:M" ':'1,
.:' . "
• I ..... " ~
then the error CaD be made ~ a~we lik? by choosing h sufficiently ,smat,. The error
will.tend to zero 35b teads'to O. . .
fd'r~1tte(i.X+h)
· If y(n+l) is bounded, that is, there isa positive constant M such that
74
h h 2' hn ()' (n+1 ( J)
y(x+h)""y(x)+-Y(x)+-y"(x)+ .. .+-y n (x)+-y n+ (l;). (2)
11 2 ! n! (n+1)!
Itfollows from this theorem that ify(x+h)is approXiiriatelby. !
This.simple method is called the Euler or1:he'Euler~caU:chy;melhod.
Throughout this part the well-known Taylor's theorem is used frequently
states that If the function y(x) has n+ 1 derivatives insome interval vVl"ruuw,5lJl.,"-
. then there exists a number ~ e(x,x+h) such'that
(1)v' = f(x.y),
L One-step or stepwise method ifthe determination of y n+1 requires only the
knowledge of yn .
2. multi-step method ifthe determination of yn+1 requires the knowledge of, the
values ofy at more than the previous mesh point, for example, it requires the
knowledge of Yo,y n_land Yn-]'
. To illustrate the concepts and the ideas in numerical methods for ODE's we
shall begin by a very simple one-step method for solving numerically the IVP
.Numerical methods for ODE's are classified' as
lli..~ .
Solve the difference equations.. ~r ·the recurrence relations to
approximations Yn of the exact values )'( x n )of the solution at the mesh
xn~n~,1,2,.."m, .
Step 2.
Approximate the IvP on tJ1C mesh by a set of difference equations or r",,,,,",,,p'niQl~:.;
relations,
(4)
(3)n . J.' ,D,()
T (x) := y(x) + _yt(x) + .»: +:-:-,'. Y . x
· n . '. n.- ". 'n.·' '.
·'thenfhe error inthis .appio~jjn ~
where h is called the step size, the step length or mesh spacing.
x = a, =i:: + h, x =X + 2h, .... "X =x +nh, ...
o 0 2 0 J1 0
40. ,
.·1
77
~r culations are done to five decimal places ina table as follows:
.:: ~
, "
(7)
t ..,
;~~,ter, we'll use this solution to compare apprnximate and exact values of the solution
"J meSh points.
t; I From the Euler ~nnuIa (7) we haw ..
::i Y +J=Yn+hf =Yn+01{J-xn+4Yn),
q ., n, n ,
:t !9ertftrbreVI1y we'll denote f(xu .Yu) by fn. '
: fl.
I ·3 19 4x.
Y:=Y(XF-x--+,-e .
.., 16 16
:.'
" ~.~';
".{ :
"i ~~~ren=o,1,2,... .m. WeuseY~~~Yn+I'.instead of Y(xn) and 1? to
"~ · ;i~ .,' r . •
:~ ifiiicate that an approximation has been made. Formula (7) is known as the Euler
.'~ fi;kula. In this way the IVP is replaced by the set of the recurrence relations (7).,~. ':..:
::~ .. .!..
~L§f.ep3.
iII, Since Yois given, we use (7) with 'n~ to obtain the approximation
'~~r1toy(x J)' Usmg Y, an.~fQnn~O)with n=I, we obtaia the approximation?? 10
1.~~("2)'. and so OD. We wilJ have a table of approximate values of the solution at the
.; I '.
;~~eshpointsxj."2 ..... xm ..
:i ~~m Ie 1:
. ,~ :', ' Apply the Euler metbod with step size b:;().l to find the numerical solution
solution, by a1.flllect to five decimal places oithe IVP
'''1': ,~.
, Y'=I-x+4y '1, y(O)=l
'.....___.,. .
'* ~the interval (0,0.5). Find the '~ytical solation y(x) and compute the error
~~,J:; Y(xn) - ynineach step.
l. :,':. I
76
For x"" xn we Write
Since y'(x) ""f(x,Y(x», we get
y(x +h) ""y(x) + hf(x,y(x».
~
Approximate y(x+h) by TJ(x)(see (3», th.a1is,
y(x + 0) ""y(x) +lIy'(x).
where h is called the step size, the step length or mesh spacing.
called a mesh. Usually these points are equally spaced, so that
x :: a x := X + h x = x + 2h, '" ,x = x + nh, ...
o 'J 0'20 no.
,
3""Xo <xl <Xl <"'<Xm =b
S~pl. , ,
" 'Replace the range [a.b], where it is required to tabulate the
discrete set of points ' .
The Euler m~tbodinvolves the following three steps:
(6)
subject to the initial condition
(5)s'> f(x,y)
.....
Consider the first-order and first-degree differential equation
2.THE EULER METHOD
41. 79.
n~te that ~le erro- .at x=O.2. 0.4, .... 1.0 with steji'Siz,e, 0,1 is approxiiilately.luilf
~th step size 0.2 . For example the error in computing y(l) with h...0.2 is 0.22995
with h=O.t is 0.12453. ..
Without knowing the exact solution, we se/from the.above tables that tJ~~'
". ,~t x=<l.2, 0.4, ..., :.0 differ in the first digit, so it is netpossible to obtain the '
digit correctly wit 1?=O.I. Woe had to repeat computations .Wi~lsmallerh, 'orto '.
InOf7 accur~te ~umcncal method, The reader should remember that the 'Elller
,~",""'''1II1nlS}~9t fccurate 'nollgh because it is a first order meoio'(i since its 'edor is
above by Ch. ."
78
Case 1: h=O.2
where, for brevity. we write fn for f(xn.Yn}·
y. 1 = Yn + hf =Yn +b(x.o +Yn) ; n=O.1.2, ....... ,
tr+ .n
The Euler formula for the given IVP is
y(x)=-e".x-l.
Solution
The given differential equation is linear and .so it is easy to show that the
solution of the given' IVP is
fit
in the interval [0,1] with step sizeh=O.2 and then Withstep size 11=0.1. Find the~Nf{~~-r,~~7-t~2~T-'+--~~~_-f~~~L+-~~~_J
solution of the given IVP. and hence compute the total error in each step in both
What can you say about these errors? .
carry out all computations to five digits, If the six digit is 5 or more. round up,
y' =x+y ; y(O):'=(}
E19lmple'2:
Apply the Euler method to obtain the numerical-solution ofthe initial.
problem
We see from the above table that y5:::6.32416 is the approximate ','>.11.,,....,,,,,, ¥"""'-,"'_'''
y(0.5)=8.7l200, The error in this approximation is 2.38784, which is relatively
Thus the Euler method with step size h=Q,I is unsatisfactory for the given pro U4Cl1lr1MIH",
~ (1'"V·lI'(J'. .....~J''J.J'I.1Ul~
nYJ,T(J' -'" .
t'.'
Yn. Yn+J=Yn+
n Xn Yn fn '" J - xn + 4'yn' 'Yr:+-J'= y,?- +01fn Y(?<,{+'J) 'Bn+i
~'., :. "
0 0 ' '1.0 5;0 '
..... 1.5 1.60904
1 0.1 1.5 6.9 2.19 2'.50533
2 0.2 2.[9 9.56 3.146 3.83014
3 0.3 3.146 13.284 4.4744 5.79423
4 0.4 4.4744 18.4976 6.32416 8.71200
42. '. i
1
,
i,I
"
"
81,80
Thus YI"i~':ili~approximation of Y(XI~ ~Ccor~g to the Euler fo~ula, Note,that the~ii
error m~e ISw.ve~by A.B. ~ that ~s error gets smaller as h gets smaller, !~ ;
One: YI IS .determined, we can compute Y;=f(x"y,), which appro~!-Ill~te~~i i1
Y•(x,),' the slope of the tangent line to Y=y(x} at the point (x I,y(XI), Moving aJo~g~;
theJine'passingthrough (x"y,) with slope f(x"yl) to (x,.Y,). we find that {;
, ,
!; {
', '
"
Yl'= v,+ l(x",y,,}(x1 -x.,)
= Yo +hl(x".yo),
y":"Yo= f(Xo.Yo)(X-Xo),
Moving&o~g,this tangentlineto thepoint (x/s,). we &d
..~... '
Hence, the equation oflhe tangent line at ("o.Yo) is
~ig(l)
o
1
I"
i
1
'j
,L:J :
.'
.~:...j i
,'I·
,,:~!
':,j:
l'J I
...• '
x
y
.~.
,
...... .
, The:,geom~t:ri~ .interpretatlon of the Euler method is shown infig, (1), ~herej: ,
the exact :SO)UtJOIl IS represented ,by the dashed curve, The CUIVe of y=y(x) on] ,
xo,xo+h'is replaced by the tangent line to thiscurveatthepoint(x ..,yJ,Since[; so that y" is tht( approximation of y(x,) obtained from the Euler formula (7) with
x.and Yoare known, we can compute the slope by using the ODE as follows : I, n=l. We may oontinue in this manner to,obtain Ym• which is the approximation to
, the slope= Y'(xo)=f(xo.Y J. I' y(XIlI)=y(b)· It is easy to see that . ,
!
','
0,
Geometrical Interpretation of1he' Euler Me1hod
43. 83.
. '.'~'.
. .: The Euler method is used to solve numerically on IO 1] each of t1 c. II .lVP'lI: . .rj eacnor rnc ro owrng
9. y' ~2y-I ; y(O)=:l .
10. y' = f-X+2Y ; y(O)=l.
(a) Estimate the local formula error in terms ofy(x)
(b) Obtain a uniform bound for «1t+l on [0,1]
(0) Find the exact solution and usc it to obtain a more accurate bound I:
(d If
lor en+1
) ,h=O.l compute bounds for e1 and e4., ,',
11, Given Y.'?(x+y) ; y(Of:=O.5,find y(0.5) by Euler method with hOC{)"05..
C~mpare with the exact solution. What accuracy is 'obtained by using
h-O.Q2S.
, "jo'
" I,
"., ._.
82,
7. y' ...Lx+2y; y(O)=1
:2
, 8. y' _.x1+yl ;y(O}=l
Firstusc onlythree'digits and1h~nuse four digits. ' .
Col11pa're the results rounded to, three digits in both cases. Note tbM the
differences between them are due'tothe rouocJ..offerror. The round-off error
beCOmeimportant ifthe calculation requires m3uy steps.
Apply the Euler method with 'step :si7~h=O.05 on the interva1[O.O.2]to .......~.........
numerical solution of each oftbe following IVP's :
2. v' =x../Y ;y(2}'=4. Find y(2.5); use n=5.
3. y' """,2-y;y(I}=O. Find y(L6); use n=6.
4. v' =(y+l)1x; y(2)=3. Findy(2.8); usen~ andrS.
5. y'=-.JX+Y ;'y(4r2.Findy(3);use n=5.
6. s'» xl +y2 ; y(tr2:Find y(O.5); use 0=:5 and D""lO.
Use the Euler method to determine the indicated value of y for eachof
thefollowingIVP's byta~ the indicated numberof subdivisions n. If
possible compare with the exact value:
1. Consider the IyP
v' =2y-1 ; y(O)'"1.
(i) Find the exact soluJion y(x). '
(ii) Apply the Euler method with step size iF'O.l inthe interval[O,05).
Compute the error En =y(xn}-Yn ineach step.
Use four digits cnl.y inall your computations.1fthe fifth digit is5 or
more. round up.
(iii) Repeat (:Ii) with stepsize h=O,05.Compare tllC errors in (il) and (iii).
(iv) Repeat (ii) with <i digits 1D all computationS. Co~are the errors in
(1i) and {iv}. . '
Froblems
,
1 'I.
!,
I
I
I
Ii
1'1I
I:
Ii
I
I
I
44. . 85 .
(3)
. , . .,.
We-set fn==i(xo.Yn)andjf n+J==i(xn+bY n+'): S?).
improved Euler formula is
.. ,~terval[0,0.5}. ·COQlPu.tj: 'the ~q.oi17 .in each step ahdcompare with that
:~lIi~}!!'''''''''''''''before in example (1) .in.the previous section.(2)
y'=I-l).+4y ; y(O)=l
the Improved Euler meili,i;>o .with stJ::psize h,;"o.l to. solve numerically
,0 ..'
"
h· .'y n+J=Yn+'2[f(xnSn)+f(xn+l>Y n+l)J
84.
Itis not difficult to see that the corresponding value of Yis
~--------~~----------~--------------~xn . h xn+l X
xn·+-
2
..
y
Then we correct this value as follows:
We, approximate the exa~t solution y= y(x) on [Xn•.lCu+i] by the straight line
(xl"Yn) with slope ttxn'YTl)~'and then we continue along the straight line with
. f(xil+J,y* D+'I )uutU x reaches "n+I'
We· want to approximate the solution at the mesh points 7? +nh ; n=l,2;· ....
. the interval [Xo,bl.
'In each step'we first use the Euler method.to predict the auxiliary value
y' = f(x,y) ; y(xo) = Yo'
. ".,
As before we consider the IVP
'is;.the required improved El4~t formula. It,is sometimes 'l&llcd die improved
:c........ u•.,u,Y method or Heun's inethdd. '.' '. . .' •. . .
method is predictor-corrector method, because 'in each step we first
approximate value for y(~n+ /) by (2)and Jh.en w~ correct it by (3). It is also
ori~":step method, .because .at! th<- information. at .xJl'+J. .i~obtained from the
'In: tb,is section we make. an improvement of the Euler method which
more 'accurate. It will become a second order method, that is, the IOca!l,,,;wwliS.cmm
will. be .of order?? , and consequently the accumulated formula error will be
. 1 .
h .
(1)
3~11IEIMPROVED EULER METI{OD
45. ....
; y(O)=!
'1
"'}")(+2y ; y(O)= I
37
Case 2 :h=().05
•... ..y +0.1 fn and y =Yo+O·OS(. fn+ f n+'})'
Y n+1 Q n+l· .
the improved Euler method to the IVP
. y'::: (x.+yr2 ;yel)=-} .' ','~.
,y(2) numerically by choosing h=O.5, 0.2 and 0.1. '
--~~~-~-T~T~r-4~~-~~~r--r~~~~~~M~s~e~aro~tioo~aoo~~'~~Od~~~~~a?
the differential equation by using the transformation x+y=v, and
compare with the obtained values.
iinprpved Euler method find y(1) correct to at least two decimal
for the IVP .
y' ::!i(:e- xy ; y()=1.
~~~~~~~~~~~~~~~~~~~-~~~~~~~~~~~:e~h~thefu~wfugI~~fudthe~a~scl~o~and~n~u~
ffi~~~W~_l .L _J _L__ -:-_~~_:"":,,,~~/ Qetennille. the error when the improved Euler formula is used on [0;1].
l'roblems
Casel:h=O.l
!I
I
'.' The exact solution is y(x)=e" -x-I, so that y(0.5)=O.1487. The error when b=O.l
112 and when h=O.05 is 0.0003. Hence, the reduction of h from 0.1 to O.OS
the error by a factor of 114.
the two obtained values are 0.1475 and 0.1484, we arc sure of the accuracy of
two digits. The required approximation is ~.1484.
Exampte2.·· . '.,: . ' ..
.' AppJy.ihe Improved Ealer method.to the IVP
y' =x+y ; y(O)=O
to find y(O.5)correct to at least two digits from the J~ft:
Soltation . dtJ Iv i . ith hI2,.~u!-:'+:":=-+-"':":";=~+-~==-I--=~:'=""-+-~:'::'::":~""':'=::",:",,-+-_:::,:,,::,;:,,:,,::,::,_~We must apply the method with a suitable h. an len app y It agam WI .
~~~~~~~~fub~~~~~~~~~~~~~~~~~~~~~~fr+~ffi~-~~ffi~~~~~-~~~~
to at least'two dig;t.s. Ifiiot, we ~v? to appl~ ~~. ~elhod agam Wl!hsmaUe: h, say
and so OD. We must also use at Ieast twomore digits than are ~ed.
Since the improved Euler method is a 'sec:ondorder oD.e,.It JS reasonable to
with b=O.I; where we round up all our computations to four digits.
For the given IVP we have
~e~~~~~~~~D~.~a~CYci~~ro~~~~~k~~r~Y~n~'-~f~n-r~~-~7-~-~~r~'~Y~~~l-'
is better than that of the Euler method. '. . .... . . .' ..' .
46. 0,
I.
89
88.
on [0,0.5]. Use six digits. Compare the error inevaluatingy(O.5) with those
earlier by the Euler and the improved Euler methOds.
", ~:"', .....
l(
IVP
.', ','
Example!:
Apply the second order Taylor method' Y.ith h=O.l to solve numerically
..' ',:' ..
. ',..-,
'; ...
", ".'.
. . .; .,' ...where fn = f(xnSn). (fx)n::: fx(xnSn) and (fy>n =fy(xn.Jn).
This is the three-term Taylor series formula .or the second Order Taylor formuia.
'The three-term Taylor series method is a second order method just like
improved EuJe~me~lod.that is', th~'errorin Yriis~fthesam.e order h2: En =
"
error in evaluating y(O.5)' by this method and ~e imprOveq'EU1~llm~thod.jS'tAe.
Note that f is a linea; function. Of course! the.acCw:ciGy.fP(:~e second qrd~~.
·"." ..... 1_- method is mucb better than that of the Euler method.
(2)
, ,1,
where 17 . Approximating 11 by the sum of Ole first three
only, 'where we replace n 'and expressing y'(Xn)8Dd Y"(xn) interms ~~~,:",-:-+-.;;.;..;.~..:;_+-__;;:.;:..:..;..::..::....:;...._-t--~~;;"-'-___,~~:;;":";;'-l-:~";';;;';~
1{x,y) and its partial derivatives. So we get
"'Yn+OJ2f -OiJ05
I)
" :
(b=O.I)
As ',- th Eul th d based •. () By ~ect differentiation ,we"k,ve 'we xnow, e er me 0 was on approxunatmg y xp+J
T,(xn);"y(xn)+ hy'(xn) 0 and then replacing Y'(Xn),hYYn. More accurate -x+sy ; fx(x,y) = -1 ; and fy(x,y) =,4.
can be derived by approximating y(xll+/) by Tk(~) with k >1, that,is byblkiinl!~1IF:I1.pPl)(lIlg'fo~ula (2) to the giveu IyP, we get, '
or more terms of the Taylor series of y(xu+J) about x=~ .
.In this section we derive the fonnula co~ to t.aJcing three tams
Taylor series of y(x~,). This method is calledthe three-term Taylor series mdhod
the second order Taylor method. "
Assuming that y=y(x) has continuous derivatives up to order three (or that
continuous partial derivatives up to order 'two) on the intervaJ [xo .b], then we
write·
y(xu+)=Y(xn)+ hy'(xu) + ~~y"(xn)+ ~~y'''~n)· (1)
4.1HE SECOND ORDER TAnOR METHOD
,~}~,
,I }
II .
~, ., '
47. I
I{
I I
II·"~ r
,
I .
... ",
.. " .
91
....
4. ?? =~; y(O)=l. Find y(O.S);use b=<1.lanfh~.05. What i~th~accuracy' oltIie
I +x. .
one can sure of?
1 ' .
2. y' ='2"X+2y; y(O)=t. Find y(O.4);use h=O.2.
, 3. Y',.,.,.:?+yi; y(I)=2. Find y(Q.5); use h=O.1.
.'
Use (i) the secondorder Taylor method
(ii) the modified EUler method todetermine the indicated value ofy fo~
.. e.a~hof the following IVP's by takingtbe indicat~ step si~e : ',>
1. v' =x'1.; y(O)-=O.F~d y(C, ~; use h-<l.l.
"
90
on the interval (O.O.5].Compare with the results obtained 'by the improved Euler
the second order Taytormethods.
y'=l-x~y; y(Orl
Example!: ,
Apply the modified EulC1' melbod with b=O.l to solve numerically the IVP
Note
We say that two onmcricaJ methods an; equivalent if they have the same
Thus. the improwd Euler. the Ihree-reon Taylor series and the modified EulermetJllOdS
are eqoivaleol, because each of :tb~ isof the second order. The results obtained
any of these melllods will s1igb~ differ 1iom tlJatobmin"<l by another o~e of them.
, , .
-From this table we see that tM results are the same obtained by the improved Euler
~e~od and by the' second order Taylor method. Ifmore digits are used, then slight
differences may appear. .
Yn fn xn +0.05 Yn +O.o.5fn fn y n+1 '
1.00000 5.00000 0.05 1.25000. 5:9500' ;1.59.500
1.59500 7.28000 0.15 1.95~00 . 8.6860 2.46360
2.46360 10.6544 0.25 2.99632 12.7353 3.73?13
15.6485 0.35 4.51956 18.n8Z'" 5';'60995
23.0398 0,45' 6.76194 27.5978 8.36973
This isthe m.odifed Euler'furmula.
The-modified Eoler method is a second ordecmetbod.
. .
Hence, "(xn +r~Yn +k)is ~ximate1y ~ to the expression in(3) betweendie
. . h II _. .. ',
braces {... ), whetll""i andk='2fn'_
This suggests thcfunnula ~I
,.~
'YD+J"'Yn+hf(xn..f.1.Yn+'}fn)' (4)
On the other band, by using the Taylor formula for functions of two variables, we }l~ge
We apply formula (4), where f{x.y)=1~X+4Yand h=O.1. We will also write
for t ('-x. v) - 71
~~n ~:~~5~:~n+~.o~~D).:::' ~'" .
.,.:• J ••
Solution
(3)
The second order Taylor formula em be rewrittm iqthe form
.5.nmMODIFIED EULER. METHOD .
48. .! .'
w=h(lrX.f:4y)...
:
.."A;y·,n x y "
,',.'.
"',. J.OQrQ9.0. ":0':500000'" . 'O,5,OQ,OO
I,
0 O~OO:
. ():S9£6d6'" ,.
. '.' ",.
0.05 ···.i.~S090.: ,. 1.19000' "~
'0:12$0'0' .. 0.05 1.29750 ~ 0'6t~6oo;' .
0.10. (1.61400) O~7j5QOO' .. 0',73560
'If
'-'~' , ..' . '. ,. ....'J'b5360 ".
~.,";""",<, "" .'" ."" • • '
{Jd(j~O-!-~ (3.O'5;6ii);'1.6b~9~.
/' I •.
, 93
So .:
..• ', '1,.
,
For the given problem we have,
..
.; ;';
AND so ON.
.1
1 '
Yj =Yo +-sum
, .6
sum
. "
.. .~., ',...:.'~..,,' '" .,.... ......
'w/0)':
2wi?) .
o
n
. ." .. :
. ". : ,,' r .' . ~ .~~. . ..'
We' arrange calc~~~nS, in a tableas follows ':
. .: ,.1- •
Soiuti.on
.:' "y'=l-xit4y'~ y(O)=)
Example 1: "";' ...:':'C. ,.
Apply. ~e Ruage-Kntta method to the lVP, '
• • ,,1', ••','.*t,',' 'I•., .:.:,', t·.)
tPis is the classical Rwige-Kuua'formula. It isequivalent to (1) and hence It is a fourth
ozder~ethod,ic. En :;OOf') ,,"'~ "
-" ~9" lb 1)w2~-XD+- ,Yn+-w,.
2 2
.J, :;,' l~" .': :, ' •'••• :" '
,where
(2)
49. 95
, 'Y'=X+Y;y(~)=O.Find y(O.4)~use-,h=O.2.
For each of the following IVP's determine the indicated value of y by using the
!1F.i~In~:'e-Kutta 'I~ethod withthe indicated step size. Ifpossible compare with the values
~I1,~.l1fa[nedby solving the IVP exactly: '
,r....oblems
, The Runge-Kutta method is an accurate and practical method and itis frequently
solve IVP's nwne<,ocaUy.-,
Note that the error in evaluating y(O.S) by the Runge-Kutta,ni-cthod witli h=O." is
1200~8.7092~-:=O.00275, while by any of the second order inethoitS it was'O.34227,
by the Euler method it was 2.38784'. ' . ';. ":. " .'
'. " ."
, !
/ '"0.1172-0.122933xn +1.491,73Yn-
• it is easy tofind the numerical solution asfollows ~
the Runge-Kutta formula
94
;; .
"w./~hlt~~+:h~Yn+W3>" :'
, ~=(trp~Xn+o.l)+4(Yo+().11~.124xn +O.496,Yn)}
=0:1372..:Q.1496xil +0.598:1-Y~"
I
Ii!{
'1x,'Y"'Hc+4y;;'h=O.1.
wJ=lifn ::rO.l(1-~+4y)=OJ~.l XutoAYn'
'., -J. ••• '.
1,', ;, O~IO 1.60893, "O}133S72, 0'.733572
",,'oiH 1.9tS12' (f87S2S8 1.75058
',',:':,,·g~~6:'':';~~~~~~"":~~:~:"" ,,' ~:~~~~~,,
""'J~,:,.: 5.37643
, ..," , ,: 1 ':' ,:' ,
,!-2:::'}~08~3+'"6(537643)=2.50500, '
The' eXact' 'Vai~eSto six digits ofilie solution are y(o.l)",i ,60904 and y(O
ThiS SH6W.!i;thchl~ aceiiraey ofthb Rurige-Kuttanictbod.
",(,'. 'Wemay solve thi!i:problem i.n aDotiier way asfQllows :
We'firSf..exprcs~ the..w~~in t~ of?1 and Yn.:and then express Yn+ / in ten:ns;oll~'
'xn~d:"'Yn~Thei 'obtainedformula is used to compute rapidly the succe~siveva!ll,esli;illtr;:-r-7::-T---Y::;:-,
y.
For the given problem wehave
50. 97
:, . .
.For example. the second order equation x" = f(t.x,x') is reduced to the system' of two
::',~t order equations ' ', .
,J"
.v ,
Xn-z::> xn_,
xn-l(t.x.x"x2.···,xn_ 2)
x'= x,.:
. x} = Xl
" can be reduced to asystem of-first order equations as follows:
.. . . . ',"':,
(n) - f(t ' "" (n":'1))x - .x.x,'x ,...•x ,
A differential equation of order 0, where n >1, of Ole form
where t denotes the independent variable and x,y,;z., ... denote tbe unknown dependent
,variables. this system is accompanied by the initial conditions
, A system of first order equations has, ingeneral, the form
All nwnericaJ methods preseated-beforc for solving IVP's associated with a
single first order differential equation canbe generalized in a very simple way to solve
systems offirst order di.ffere~tial equations or equations of higher orders. '
7.Introduction to Systems of First OnJer Differential Equations
.'. ,
: r ;
I :
t·· '
VJ.'!
6. The Runge-Kuttamethod is applied to the IVP
y'-ftx) ; y(xoryo'
Show that the Runge-Kuna formula in this case is reduced to
. h' J
Y.n+'J co Yn+,-[f(xn) +:4f(xn+-h)+ f(xc +h)].
, ", . 6 .t • 2
This is Simpson's rule used for evaluating definite integrals.
Use this r;osulttQsolve, .
;;";V(l~~h~.y(O)=O
for y(l) with b=O.2. Compare with the true value.
."
5. Given y,,,,,,,2 -y; y(l)=O. Use the Runge-Kutta method to find
(i) y(1.2) with b=O.2.
(ii) yeLl) with 11=0.1.
(iii) Use the result in (ii) to compute y(1.2). ,
(iv).Compare the accuracies in(iii) and (I). Compare also with the exact
solution.
1 ' ,
2, Y'=Tx+2y; y(O)""L Find y(O.2); use h...O.L
3. y'=x-y·;Y(-lY;2. Find y(O.5); use h=O.2S. (1)
4. Find y(O.S)for theJVP y" =2x+y; y(O)"'1 by applyingthe Runge-Kutta method
with b=O.25 and with b=O.l. Discuss the results.
,ti.'&"
.
51. '_ .
t" .:
,i
,
98
.1:
Equations (1) can be used to express x'(tn).andy'(tn) in terms offand g.After
'x(tn) and y(tn)are replaced by xnand Yn ' Wehave the Euler fonnuia
x(tn.+ 1) 10: x(tn)+ hx'(tn)
y(tn+ j) ~ y(tn) +'hy~(tii-)
'f' • • ~," • •• •
THE EULER METHOD
Our' PWPQse is the determination of approximate'values X/xl,,,· an~?7
exact solution x=x{t),.y=y(t) of the above problem-atthe mesh points tk = to +
k=1,2,: ...
Throughout this chapter, it. will be assumed that the considered system has a
solution.
'fn'...,
gn xn+l Yn+lxn Yn
1.00000 2.0000 -1.0000 -2.0000 0.90000 . . .i.sooo..
0.1 0.90000 1.8000 .0,8000 -1.6000 : "'o'~«ioO'.' l'1~64(fO'IJ
0.2 0.82000 1.6400 -0.6200 _-1.240G. ' 0)58"0 '.' /:,"1: 'lf6(V'.
0.3 0.75800 . 1.5160 .-0.4580 -0.9.160 0..712~O ,; 1'.; '2.!f4'·'-,
0.4 0.71220 1.4,244 .0.3122. :-O':~244 . 0.68Q98 " 1;3620
, ",,'_' ...: . ' )' ,I' ;",.
0.68098 1.3620
.:' f',.,
• ·t
.' ." "y •• ' - ~, .~. <", ':'• ' : '~':'I' 'r, .: /.! I ~. '. "
,'(~.
(2)
with the initial conditions
(1) } n=O,1....,4.. ',
.. .:'i~ •: I!,: .,
Xn+1=x.n +hfn =xn +O.l(xn -Yn+tn_)
Yn+i =Yn -:hgn =Yn +O.l(~~n t;y.Jt~2tn)
We arrange calculations ~ a tableas f6U~ws :
x.' = f(t,x,y) }
y' ,;"'g(t,x~y) , .
• ',:', I
.: .
.' .
;': : ..",
§olution .
Eulerformula give
Thus, we will consider only systems of first order equations.
Moreover, we win for simplicityconsider only systems of two equations
,~ :.!.~...;
U five digits. Compar~ the:~~ili~;W{t1rlh~V~~~Sof ~& J~isdol~ti.g~..so ., " .. '
. :.:.
x'=y )
y'=z
z' == f(t,x,y,z).
Ej(a~Uj~s!:theEuler,methodwith ~~..1 to find ~(0!5}.~d:y(j:5j(¥~;:~~ 'tyP
;.':..... : ·:,.'·r~,:,.~:)':.': ~..
.x' = x-y+t, y'= -4'l(+y+2t;
x(O~1 ,)'(0)=2. '
Also the third order equation xII, = f'(t.x.x' .x") is reduced to the system of three
order equations .
Using Taylor formulawith n=I, we can write
I
I
Xn+l~xn+hf(tn,xn.Yn} .. ,' .. (3).
Yo+ 1~ Yn +hg(tn,xn,rn)" .~, . t:·:;·i:·! I-... ~: ....
. " ' .:.: th th ,,;,,..,,It·' ;..:, 'atm'" g" "~j '1'o/y", .. J~b·Y.':"";5method i~O(h).'. It is clear at, e euu ·1Jl.eV'dlU =u+.: ' n + ~ ~ .: .: . . .
x'=y }
s'» f'(t.x.y),
52. 10I.
, ,.1
..-,
.' .'.
The s~cond order numerical methods can be generalized ina similar manner as
previous section. Here we only give formula corresponding to different methods
IVP (1) & (2).. .
reader should remember that 111e local formula error in each of these methods is
The exact solution of the given IVP cannot be expressed in terms of
; elementary functions. However, we can find its series solution:
_ 1J J J J 7
. x-t+-t +-t + -t +...,
3 3.5 3.5J
from whi<1b we see that x(D.5) to five digits is0.543,83.
, .The error incomputing x(O.5)-,bythe Euler method is 0.07355 ...
Without knowing the exact solution we can be sure of the digits, which
. do not change when using smaller step size.,
j5.KWlCU'""" that the values of y in this t~ble are approximate values of the derivative x'
mesh points.
(4)
'.
100
,.tij.
nl(t ii)
..
. xn Y'n'
'.
fn
..
Yn gn . xn+1 Yn+1
o .0.0' O~OOOo.o. 1.00.00 t.eooo 0..00000 0.10000. 1.0.000
1 .0.1' .0.10000 1.0.00.0 1.0000 0.200.00 0.20000
2,,0.2'
1.0200
·0.20000 1.0200.. .d.0200. 0.4.0400 0.30200 1.0604;: ;I'
3.0.3 0.30200 1.0604.' 1.0604 0:62012 .0.40804 1.1224 . ,
4. DA' ,0.40804 1.1224:.. 1.1224 0:8570'0' . 0:52028
5· 0.5' 0.520.28 1.2081
1.2081
"
}
..... . .......
, xn + I=xn +. IUn-xn ·~:O.IYn
"'Yn+l =Yn +hgn =Y[i+O.l(xn+tnyn).~
~~~J!
~I
•I
li~f~,
I
:' .
The iWtialcondiuonsbecome-" '.
. 'x(O)=O, y(O)=x.i (0):;=1. .. : .
Euler. formula are ., '.
x'=y }
y'=x+.ty.
X." -tx' - X =0; x(O) = 0, x'(O):;: 1
on the interval [0,0.5] with step size h=O.1.Use five digits.
Solution
The equivalent system of first order equations is
Example 2:
Use the Buler method to ~:o~V<inumerically the IVP
. .
y(0.5)-y J= 1.4261.1.3620=0.06410.
and inevaluating y(O.5) is'. . .
]he total error i.e evaluating x(0.5) is
)«0.5)-xJ= O.71306-0.68098~.03208
53. 103
..:•. i
.. ,:;
. ~,
Example 4j :, ' , '
B~ethe three-term Taylor formula to fui~,x(O.5)fot)~hIVP
x:"~tX~·~x::=0 ; ;x(O)=o~'~.(o,~1.
, .Take 11=0.1and use,five digits inyotica1cut4tidbS~
~
r
~
~
~I~
~1
I'
If~s',
r
'I',
:
I I
~
II
"
'.-.
n 0 1 2 ' :,~ 3' 4
,tn 0.0 ,9.1 0.2 ·0.3 Ok
.xn LOOOOO 0.91000 0,83805 0.78244 0.74161
Yn 2.0000 1.8200 ' 1.6761 1.5649 ,1.4832,; . "
fn -1.00000 -O.8HlOO -0.63805 -0.48246 -0.34159
gn -2.00000 -1.62000 -1.21610 -0.96486 -0.6832;4,:
• 0.90000 0.82900 0.77425 0.73419 0.70745.
xn+l
,. 1.80000 1.65800 1.54850 1.46840 1.41490.
Yn+1
fn+l
-0.80000 -0,62990 -0.47425 -0.33'f21 -0.20745
• -1.60000 -1.25800 -0.94850 -0.66836 ,-0.41490 '
gn+Z
xnH 0.91000 0.83805 0.78244 0.74161 ' 0..71416
Yn+l 1.8200 1.6761 1.5649 1.4832 " l.4283 '
The total error in computing x(O.5) is
x(0.5)-x;=O.71306-0.71416=0.001 1
,and in computing y(O.5) is
y(O.5)-y,5"" 1.4261-1.4283=-0.0022:
Here h=O.I.
Since the number of calculation is too big to he arranged ina horizontal table, ,it is,
reasonable to use a vertical table. ' ',
The calculations in the nth step will be done in a column as shown.
,,'
102
The corrected values are
" '
.. .'
,, "'n:+1 :=xn of:h(xn - Yn+tu) and Yu+ J = Yn+ b(-4xn +Yn~}tn)'.
, " 4< •'. .'....' '" ' ",
, , fn+ i=xn+ l-Yn+l +tn+i" gn +1'7 -4xo.'+1 +Yn+ 1+,2tn+1'
'" ,
Solution ,
The predicted values are
. Compare the error with that in tile Euler method, Use five digits.
Example 3:
Use the improved Euler' method with h==O,l"to find x(0.5) and y(O.5),
initial value problem " ' , :.. ' ' ,
x=x-y+t , y'=4x+y+2t;
x(Orl ,y(O)~2. ,
1 I i. "
'Yn+/'= Yn+hf(tn +-h,xn +-hfn.Yn +-hgn)·
'-2 '2 ,",2.:""
(6)
I } J ,,' -:
xn+1 == xn +h.f(tn +-h,xn +-hfn.Yn +-bgn),
2 2 J,' ' ,I
The Modified Euler method '
Xo := (ft)n + (fx)n xn+(fy )n'Yn' '
Yo -:::(gt)n +(gx)nxn +(gy)nYn'
, '
xn ee fn ' Y n=gn'
where
, , J'
x 'I = x +hx' +_h1x"n+ ' n n 2 n >
The three-term. Taylor method
54. .. 1.;......."I : •
x=·~·
~" ,,,:::~
!j' - t: ~ -x }~~
1'-~F;-;Xi~~3,
x.....~ 'j .. i (.>-
104
five digits,
., .. ', : ., '.
EXample 5 : . .'
. . Y-seRunge-Kutta method. with step s.@ 19).25 to compute x(O·.5)for the IvP ..
x" - txi~x =0 ;.x(O) = 0, x'(O).=.L·
it tn xn Yn O.OOStn O.OOStn2+.
+0.1 O.ltn +1/)1
a 0.0 0.00000 : .LOP.OQ· .0.1000 1.0100
1 0.1 0.10000 1.0ibO 0.1005 1.0201
2 0.2 0.2020'1 1.0404 0.1010 1.0302.
3 0.3 0.30810 1.0922 0.101'5 1.0405
4 0.4 0.42050 1.1677 0.1020 . };0508
5.0.5 0.54171 1.2699
·A3befor~ the local formula error is 0(h5). so that th~a~~u1at~d fonn~:;~crr~; is
·O(h4). This method issufficiently accurate.. ' . .
We may arrange calculations ina table as follows:
Substituting expressions of x',x",y' and y" in terms oft,x andy in these formulas, we
get
are
. I(
xn+1 ~ ~D +6' vl +2v2+.2vJ+v-/).
'. . . J
. Yn+ 1== Yo+'6(w1+'2~2'+~wj +w4)
vv.here .
Th.eRunge-Kutta formulas for'the system .:
x'''''ftt.x.y). y'''''g(t,x,y); X(0)=' x~,y(0)= Y9'
Differentiating these equations with respect to t, we find
x" ::;y'=ty+x, .
y" = ty' + y+x' =t(ty+x)+y+y
=tx+(e+2)y.
Three-term Taylor formulas are
· We see before that the error in computing x(O.S}by the Eu1~r'method was 0.02355.
RUNGF....KUITA METIlOD
0.54383-O.54171=O.0021i.x'==y } x(~:F<l,yeO)=:;x' (0)= 1.
y'::::x+ty ..
From this table we see that:?? r.:().54171, while the exact value is 0.54383. Hence the
error made iacalculating x(0.5) is . . .' .
Solution
The equivalent 'system of first order equations is
Xn+ I"'" xn + 0.1~n +~(O}i.(tnY~.+xn)
-I.OQ5xn +(O.005tn+OJ)Yn .
Yn+1 =Yn +Ol(tn;1 +Xn) +.!.(O.I)2[tnXo.+(tn2+2)Ynl
. 2
=(O.005tn+ OJ)xn +(0.005102 +0.1 In+1.01)yu,'
, ,..l ,"
~
!!
I":'
. ;1'
t.(~I '
55. ;-
4. x"+t2 x'+3x=t;x(O)=I, x' (0)=2. x(O:2),h=O.1.
5. x" -tx' -x=2;~(O,:o, x' (0)=1..;(0.4), b...o.2.
6. Find,x(O.2) correct to three digits for the IVP
x"-tx' +3x=O~x(O)=1, X' (0)=02.
L x/=x+y+t, y'=4x-2y; x(O)=l, y(O)=9.:···
x(02),y(O.2). h=O.1 '~'. "
2. x'=2x+ty, y'=xy; x(O)=l,y(O)=l.
x(O.4),y(O.4). h=O.2
3~x'=-tx-y-l. y'=x; x(O)=l.y(O}=1.
x(O.2),y(O.2).~.1
,'
"
106
For each of the following ivp's flndthe indicated values of the solutions
the Euler method (ii) one of the second order methods (use different methods
different problems) (ill) Runge-Kutta method: (use 5 digits)
i>roblems .: '. .:
Although we took ri=2 only, the total error niIlt1e ID'cbri1putingx(0.5) is 0.000041 .
which is much better than any of the second order methods with 1l=5.
x(O.S).. x2'" 0.25526+0.28853=0.54379,',
x' (0.5)=y(0.5) ::::0 Y2=1.0638+O.20813""1.2719.
1 0.250 0.25526 1.0638 0.26595. 0.13030 0.26595 0.13030
0.375 0.38824 1.1290 0.28225 0.20290 0.56450 0.40580
0.375 0.39639 1.1653 0.29133 0.20848 '0.58166 0.41696
0.500 0.54659 1.2723 0.31808 0.29569 ' 0.31808 0.29569
0.28853 0.20813.1
'>(t'I+:." 6
xl=0+0.25526=O.25526 I yJ=1+0.063815=1.0638.
0.OOO'~0.(j000.0 1-:990Q·" O.~~QO.o --0.00000
0.125 ·0..125Qa....' £'.0000' o.zsooo , 0.06250, . '. ..~,.:
0.125 0.12500 ... 1.0313 '0.2$7830 0.063478
0.250 0.25783 1:0635 J '.26588 0.13093
v,
; x(O},{), y(O)=1.
/.
'1<'
x'''''y=f }
v'> x+ty= g,
)< --:..)(0 'r ~
:;
~.,.ia ~ r:Solufion:
As before, the equivalent system is
70. 135.
III - 1 . ·'i· '.,.
(2) (2)
- 61~'91,4 . ::&,(2) 62.207
lt2 ~ 86.914 lt3· 4,
III ,,'2
(3) . (3)
62.3S~
(3) .. 6;.427... 87.:354 , It,3 ::&'4 ,"
x2.
solution of th·~·8i';eQ SJsteas'is
Note that t.he exact
134.
- 0.25 ~2 - 0.25 x3 ...
+-0.25 'Xl
- 0.25 x4- SO
.r3 -·p.,25 x,- 25
-0.25 'x l +
- 50
EX8111ple
Apply the Gauss-Seidel iteration to t'he Eolloving
system starting vith 100, 100, SO, SO. (Perform 3
steps)
sol u t10n.. t0.,1'
. (0)'
x2. " ., •••
C1 is obtll;inei!. Und'er ce rtain c on dI tions, t he
(0) (0) (0) (0) ..50.. 100 an d :&3 .. x4
we haye Xl Xl
..
-
m ..0
(0)
+ 0.25
(0)
+ 50 87.50..0.25 x2 ' x3
(1)' ... o'.2.5.xio) 4- 50 84.3~S- 0.25 Xl
, (1)
0.2.5
(0)
+ 2.5" .:53.3750.25 X l + :14
0~2S 'x.il)
(1)
+ 25 61.719+ 0.25 xJ
+ 25
+ 25
+ 0.25 xi·)
+ 0.25 xlIII)
+ 50
tbe system in the for~ :
(.) + 0.25 :1:3(.)
0.25 Xl
'..:, (,
...
(11+1)
- 0.25 Xl
(.+1)
- 0.25 Xl
O. 2~X~·+1)"'0.25xr+l)
or until a spe~if~etvalues of thejllccnt
I
t'I'tt- 1Il0'st n;cent 8p'pr~xim8t~p'DS fot: ,xi, t?" The proc,,,.,,,r.,,••,,,,,,,.
of sUcct;:<.sive,oPplic8,t~~flS of the last equa~10ns is c
nued· un~ll there is 0 li~tle o~ no Yariation
·ho.te t!la ,t ve sub.1ltitute. :on 'the righ t "of these
' , "
- a '. x-(lII+l)
.D,o-1 1l -1 }
.-~... .. , ; . ~i
r- II .x(III) }·
,2D 11
. (lIl+l)
~1l2:1'2 .-
....... .. ..
71. .,
137
2 ' .
3 Q. , ,'
~·'-o
CIt.
+' _----,.1~_
r2sin2,e
" ., '
~o~~es :
~ + '1k + _L ~ ;;~l~'_"~aJ? 'r Clr l' 3t2' '...'~~2
." .. :.
eel and sp~~~ical coor~~nates. l 't' "takes th.se respecihe
..• Jf,.
" '
s5~~1~ flu~ds. The form of Laplace"s equation, : "i'
, ,', "aboye 8 Pp,lie's, to rectangul,ar c:'oord1D~tes. I ~ "~yi:iDdri-
',' -;
....
: tra1'itoCional. electric, and magnetic. potentiols and,
" 'f'e~9.~1.~",potentials i n: irrot.ati'on~,l flo':'s of 1.n'c.olII;~~~
'cbarg,e in a , bod; ~ Laplif.c.e' s' ,equa~i-onelso B~·erIlB,
electJ;1.cal': ., .. ':
It SQ1'e rns.'the' stead7-B~ate distribution of heat ,1.II',a
'" '.:'., " . . . .
, "Laplace's eqaation 1s
ita ,~' ~~
-r.+' 2 +.~ ... 0
ax, ' aJ ~
The function II represents die 'tf!.peratu~e" ~t i:i.~ t-~'ftt,
(
the poiDt vhos:e" c:oordin~tes are (.~;1.%)
Tbe heat, equation 1.8
~2u
;
.l2a . i':
, '
+ +,.LL tla )
--r -:--r ~
.h:2 tit'
..
~ , ax 31
of a particle vhose position at rest is (~.Y.%)·,
lIlth appr,opr1ate boundary cotldir:.i.o~s. .this ~q1lati~n
gO~'erns1'ibratio.lls ot a t.hree-dilDens10ul elastic body.
136.
.The function 0 represents the disp~acement at
in t~re. spatial ysriables
the physical phenome~8 thot they goyerri ar~ listed here.
1.': The V8'f'e e'quation
important partial differential equations
your results vith the exact solution 2 3, .4.
0000000
2.' Compare
ANSlIERS
1. 0.2251 • ~.30S6 • - 0.4939
'000000000
2. lOx - J - Z - 13 , x + lOy + 2 - 36 • -x-y + 10% ~
::r (0) .. ',y (0)
x1(0) • 0.125 (0) ( )
• X2 -- 0 .4 • x3° '- - 0.6
~. 8x1'- ~2 +,%' -'i 2x + 10 •_ ,,', _ 3 ' • .' 1 x2 - x3 ....
xi + X2 - 5x3 - 3
"Appl~.tbe Gauss-Seidel iteration to th~ !ollowfog
(Perform 3 steps) :
P.ROBLEHS
::;',
iI"
,.:.
J
I
,;..
.:~
i
l
,Ii,
,i!-:
,
..
! I
! :
,
r.
1, '1
r .,. ,
f' .
.! I
'j ~
, I; !
; ~
,: ~~
72. 139
The equation is paro'olic.·
+ 5u - .sin '1~
2 . ~
x 11.7 - e u,
4J2:1.2 - 0
abe elli'ptic , Parabdic,' .IT hrper'b?lic' a'~
»i - 4A~ is ..negot.iYe, -,i·ero·.·.o·r posi'tiTe.
138,
• It
a f1:u·id.flo{. .Th'e functi on P is. the pressure. a nd the.>: ij is said to
• I " :.~~:'i:~'"
flu'id -,··is ass'umed 1:0 be incompressible but v iscous. ::~...:~'.point (x, J) it
':;":; ~.):
::::::::al e:;::::;.::::.:u:::::,:: ::~.: s .; "::::i'~:::~:::"olY'
also. be given. B ut the [lye partial 'differential eq~~~ '~~a) .... u _ £(;,;,y)
:.i~;:.~: . xx· n "
tions shovn already exhibit II great diversity. The Nav~.~";'.' Here A" 1 • B .. 0 • C _ 1 . ' »2. ·...:;.~4A·C.. -4 < 0".
~:::::;:::::::n:: ::::'::'::~,:~::::r::::1:,:::~sc;:~t:e.c:. :0':':: .: U:::0: :~_.:d..,<tctj ,:.
tial diffe·ren.tial equations. y {;:. ;u 7J . It
To specify a' unique so~ution to a partial differen~: it ,82 - 4AC .. 4 ) O. The equation is hype rbolic
;;:' .;,:, ..2 ,ii'
tlan cqu~t10D e . additional conditions must be imposed uP~i'·;:t.C) "1 un h1UXY +
the solution functio.n. TYPica;ly. t he s e. conditions O{$ J':. .82_ 4,AC -{-2xy)Z
in the fOTIII of boundary value:> tbat n r e pres.cribed on am -eli.
~'.:.f~:
r,;_;;
The equa~ionare functions o f x and y
;,'
,J
~
ilj: F,.v}u:re .A. B':~.'.: C:are components of the velocity vector1I'ere u and y
a2u D·_3u +' .E _3u+ C --- + + Fa .. G •
3J2 ih : ar
the form
A second order linear P.DE vitb tvo variables viII have
CJ8ss1r1carion of PfEs
I·
roximate soljtion~
or part of the peri.llleterof the region in''''hich the 80-
~'. I·
lutioJi. i$ $ought. T be nature of the houndary and the boun-
dary yalae~ are ~suall~ the deterJQ1ning factors in sett.ill8
up aD. appropriate cumerica l schem~ for obtaining the app-
for an e,lastic body. "
5. The Ha ....ter-Stokes eq.ua 'I: 1.01)8 are
3u + (lP ...
'2
aZao!!!+ 30.+ ~+at dX
,. CIT dX
ax2
--2-
a,.
ch+ ih + a,. + ap _ 2
a2a...L!_+
at a
ax v 3y dy 2 --2-
ax. 31
'solution the.,shearing. and no r ea I stresses can be
. It occurs io the study Qf ~18s~ic stress. a~d from
'.,Th~ bihar1ll9nic eqoation is
4 '4 4
-L.!L+ 2 au + ~-o
ar4 3x2 a ,2 3.J~
73. .141
(x., - k)]
1 [ ( .:)uT(x''')~T Ii It,y + J< - U
~ A [uex.,. + ~) - u
(~.,.) , J
ux(x,,.)~ ~ (u.(r+h.,.) - u (x.,.>] :(,forltlrd-diUe:::-cn,ce)
UX(1.,):::;: ~h (x+h.y) - u(x-h',J)]' (central-difference.)
u (x.y)z ~ [u(x+h.,,)- 211(x',y) + u(x-h.7)] ••• (1)
xx h
can deduce the ~oll~vi&8 :
I •
tvo "lIriobles
~e nov exten~ the finite-differenee approximations t o
partial de rivatives., UsiDg t'he Taylor series e.xp8Dsioll in
f"(x)~ -- [ r(x + II,) - 2f(x) + f(x - h) J
, h
of f"(1):
Addin8. ve obtain the central-difference approximation
I
I,
.
I,
~~""
to
<
I '
f>':1l
~I
:2.
f(x. - h):::: f(x) - hfl(lt) + h2 f"(lt) :::.
Ilnd
h2
f(x + h)Z f.(;':) + bfl(;,:) + T f"(x)
If Ie truncate"Taylor series after three te rms.
we
'~:.....
140
.:.
f(x,- h)]-L.. [ f(x, + h)
21t
ft(r)
"e obtain the cebtral~dlfferen~eap~roxi.ation
f(x' '+ b) ~ f(s) + hf"(z')
£roll
'f(x - h) == fe,_' - ~ii°(x)
SubtractiIlg
f(x) - fC;'; h)
f' (x) Z -:'~~- h""_=--"'::"<<-
8rrl.'"e at the back"ard-difference al!p;ro~l.ation
vhich' i~: .eli'lled the forvard -dlfference appro%hloti.oo to fl(x),;'
The h is repla c~d b,.,:-b in the Ta,lo r series.
f'(x) ~ l(x ~~) l(x)
Hence. we can sol~e for ftCx).
f(x + h) ~ ,f(x)+ hfo.(x)
the approximation
1£ ~e truncate this series af~er two,ter~s. we hayc
f"(x)
21
f(x + h) - f(x) + f~(x)h +
Re~Al1 tbe To~lor series expansion of a function fez):
4. Fjn1ee-Dif£e~cnce Approxi.stlons
F
;'I!" ,
,II'; .:
r
"
;1'
! .