School of Mathematcs ad Systems Egeerg Reports from MSI - Rapporter frå MSI Valdato ad verfcato of a thrd degree optmzato method Aders Lev Jörge Johaesso Jul 004 MSI Report 04075 Växö Uversty ISSN 650-647 SE-5 95 VÄXJÖ ISRN VXU/MSI/DA/E/--04075/--SE
Abstract Ths combed master thess Mathematcs ad Computer Scece deals wth a method for fdg the local mmum of a umodal fucto sde a gve terval by usg a ffth degree polyomal. Ths ffth degree polyomal s created from the fucto value ad the frst ad secod dervatve values the ed-pots of the terval. I ths report the preseted method s derved mathematcally to coverge ad t s the prove that the method has a covergece rate of three. Last s the method tested agast two referece methods to see the usefulless of the method. To do ths some software developmet methods are descrbed the report ad some test strateges are gve. The tests are doe wth sx dfferet fuctos ad wth three dfferet mplemetatos of the method. The coclusos from the tests are that t s ofte better to use oe of the referece methods stead of the preseted method, eve f the preseted method has a better covergece rate, ad that the method eeds to hadle whe the foud approxmato always s o oe sde of the terval. We could also see from the tests that oe of the methods were good o fdg a correct approxmato. Therefore, there exst eeds for more secure methods. It s therefore suggested the report that a search for other terpolatg fuctos ought to be carred out order to mprove the method. Also, t could be terestg to test agast aother method wth eve hgher covergece rate. To do that, aother umercal represetato s eeded ad t would be terestg to see f that chages the outcome. Keywords: Optmzato, Covergece rate, Software developmet Sammafattg Dea komberade magsteruppsats matematk och datalog hadlar om e metod för att htta ett lokalt mmum för e umodal fukto om ett tervall geom avädg av ett femtegradspolyom. Femtegradspolyomet skapas med hälp av terpolato baserad på fuktosvärdea samt första och adra dervatas värde tervallets ädpukter. I rapporte härleds matematskt att metode kovergerar, fölt av ett bevs för att metode kovergerar med e kovergeshastghet av tre. Slutlge testas metode mot två referesmetoder för att se avädgsbarhete. För detta beskrvs vssa mukvaruutvecklgsmetoder och ågra teststrateger. Teste utförs med sex olka fuktoer och med tre olka versoer av metode. Slutsatsera frå teste vsar att metode te är bättre att aväda ä referesmetodera äve om de har högre kovergeshastghet samt att metode måste ta häsy tll är de bara httar ya approxmatoer på ea sda av tervallet. V kude äve se frå testera att ge av metodera var bra på att ge e korrekt approxmato, uta det fs behov av säkrare metoder för detta. Det är därför föreslaget uppsatse att ma borde försöka att htta ett aat terpolatos-polyom för att förbättra metode. Ma borde äve testa mot e metod som har högre kovergeshastghet. För att kua göra det behöver ma ttta på adra sätt att represetera umerska värde och det skulle kua vara tressat för att se om ma då skulle få ett aat resultat. Nyckelord: Optmerg, kovergeshastghet, mukvaruutvecklg
INTRODUCTION.... BACKGROUND.... AIMS.... PROBLEM....4 REPORT STRUCTURE... DESCRIPTION OF THE METHOD...4 PRELIMINARY THEORY...7. THE PROBLEM REVISITED...7. DIVIDED DIFFERENCES AND INTERPOLATION POLYNOMIALS...9 4 CONVERGENCE AND RATE OF CONVERGENCE...4 4. INTERPOLATION ERROR...4 4. THE CONVERGENCE...5 5 SYSTEM DEVELOPMENT...4 5. SYSTEM DEVELOPMENT METHOD...4 5.. Methods...4 5.. Method choce...9 5. SYSTEM DEVELOPMENT...0 5.. System requremets...0 5.. System specfcato... 5.. System desg... 5..4 Scearos...5 5..5 Fucto-part...9 5..6 Method part...4 5..7 Framework ad data part...4 5..8 Adust the system to a calculato method...4 5. SYSTEM DEVELOPMENT RESULTS...44 5.. Requremet verfcato...44 5.. Geeral commets...45 6 NUMERICAL RESULTS...46 6. TEST STRATEGIES...46 6.. Effcecy...46 6.. Correctess...48 6. TEST CASES...49 6. NUMERICAL METHOD IMPLEMENTATIONS...5 6.. Newto-Raphso...5 6.. Secat Method...5 6.. Method mplemetato...5 6..4 Method mplemetato...5 6..5 Method mplemetato...5 6.4 TEST RESULT...5 6.4. Executo tme...54 6.4. Iteratos...54 6.4. Fucto evaluatos...55 6.4.4 Correctess...56 6.4.5 Covergece rate...57 6.4.6 Restrctos...57 6.5 CONCLUSIONS...58
7 SUMMARY AND FINAL CONCLUSIONS...59 8 ACKNOWLEDGEMENT...6 9 REFERENCES...6 9. BOOKS...6 9. PAPERS...6 9. INTERNET RESOURCES...6
Itroducto. Backgroud Fdg zeros of equatos s a mportat mathematcal problem. There are oly a few classes of equatos of the form f(x) = 0 that ca be solved exactly. It s for stace possble to solve lear, quadratc, cubc ad quartc equatos exactly. Oe of the most used umercal methods to fd a root of a equato s Newto- Raphso s method, whch requres that f s dfferetable. Ths method s usually very effcet. Aother method that s somewhat less effcet, but stead t does ot use ay dervatves of f, s the secat method. These two methods coverge wth the rates ad ( + 5) respectvely. There are of course a great deal of other umercal methods to solve equatos, some of whch are preseted by Traub (964), Ostrowsk (966) ad Ortega & Rheboldt (970). I ther dfferet works, they gve examples of a umber of methods for solvg these types of problems. It s however sometmes desrable to fd the optmal soluto to a problem. The kd of problems whch a optmal soluto s requred ca stem from egeerg or ecoomcs, for stace how to select equpmet ad operatg codtos for the producto of a gve materal so that the proft wll be at maxmum. Aother example of a optmzato problem s how to desg a factory ad a parkg lot so that the walkg dstace from the car to the desk s mmzed. Ths problem of fdg the mmum or maxmum pot of fuctos s closely related to the problem of fdg the zeroes of a fucto. The soluto of these optmzato problems s lked to the soluto of f (x) = 0. There are may methods to solve mmzato problems of a fucto f(x) of oe varable. Ths type of optmzato problems s a specal case of mult-varable optmzato problems. For a troducto to these problems, see Des & Schabel (98). Some of the methods are so called hll-clmbg techques. They all use some sort of search procedure. That s, a tal estmato of the soluto s made ad tested. Depedg o the result a search s made to mprove the tal estmato. Ths procedure s repeated utl a local optmum s foud. Some methods use dervatves ad others do ot. Aother dfferece betwee methods s the umber of pots that they use. For a example of a method, that mmzes a fucto of oe varable ad uses oly fucto, but ot dervatve, values see Bret (97) or Mffl & Strodot (99). Sce we ca approach ths optmzato problem so may dfferet ways, t s atural that the rates of covergece of these methods dffer. The most commo methods for fdg the mmum of a fucto use low order terpolato polyomals for the sequetal fttg of the obectve fucto, that s they use quadratc or cubc polyomals. I ths work however we use a polyomal of degree fve. Ths polyomal s used because t has the hghest degree whe t s stll possble to exactly calculate the zeros of the dfferetated polyomal. The exact soluto s the used as a approxmato of the mmum pot of the obect fucto. There are a large umber of dfferet aalysed methods for optmzato. Some of these methods use o-polyomal terpolatg fuctos. Barzla & Be-Tal (98) meto a few such methods. The algorthms they fd to be the most terestg use the followg terpolatg fuctos: ax + b + r log( x c), Page
ax + bx + c + r log( x d), ax + bx + c ( dx +) ad ax + bx + c. dx These methods have ther ow advatages ad dsadvatages. For the frst two, for stace, the coeffcets are dffcult to calculate, but o the other had, the mmum pots of these equatos are ot too dffcult to calculate. I ther work, Barzla & Be-Tal have also cluded umercal examples of dfferet methods mmzg two dfferet fuctos. These tests make them draw the cocluso that algorthms based o more tha two terpolatg pots are effcet ad that two pot algorthms are faster tha oe- pot algorthms. The results of ther studes are the bass of our optmzato algorthm. We wll thus study a algorthm usg two terpolato pots.. Ams The am of ths master thess s to vestgate a method that fds the mmum of a fucto o a terval. The studed fucto attas ts mmum exactly oce the terval ad the fucto s mootoously decreasg before ths pot ad mootoously creasg after. The method uses two pots,.e. the edpots of a terval, ad a terpolato polyomal. To determe the terpolato polyomal we use the fucto values ad the values of the frst ad secod dervatves at the two pots. The terpolato polyomal, P(x), thus s of the ffth degree. For the terpolato polyomal, t s also assumed that the secod dervatve of P(x) s ot zero at ay pot the terval. It s crtcal for the method to have a hgh covergece rate. A hgh rate of covergece dcates that t wll oly eed a few umber of teratos to get a good approxmato.. Problem Therefore, the ma questos are: Does the method coverge wth a covergece rate of three theory? Does the method have practcal use?.4 Report structure We start wth a geeral descrpto of the vestgated method chapter. The, more detals of the method ad some prelmary theory are gve chapter. I chapter 4 the covergece rate s dscussed ad prove for the vestgated method. At the ed of chapter 4 the frst of our problem questos s aswered. Page
I chapter 5, some software developmet methods are descrbed before the software program s developed. The terfaces of the software system s located appedx A. The, chapter 6, the results from the tests of the method are gve. These test results wll tell us f the method has a practcal use. The test program output ad covergece rate calculatos are located appedx B ad C. Last, the fal dscusso s chapter 7 followed by a ackowledgemet chapter 8 ad the referece lst chapter 9. Page
Descrpto of the method The algorthm preseted ths work determes the pot µ at whch a fucto f(x) attas ts mmum. From start we kow that f has oly oe mmum pot sde the terval [α,β] ad o maxmum or flexo pots. Let P(x) be the polyomal of degree fve that terpolates f(x) at the ed pots α ad β such that ( r) ( r ) ( r) ( r) f ( α) = P ( α) ad f ( β ) = P ( β ) for r = 0,,. Deote the terpolato polyomal as 5 4 P ( x) = a5x + a4x + ax + a x + ax + a0. To determe a approxmate value of µ, solve the fourth degree equato attaed whe P s dfferetated. Sce we kow that the studed fucto has oly oe mmum ad o other extreme pots the terval (α,β) the terpolato polyomal we costruct has oe or three extreme values ths terval. Ths s a cosequece of how we has costructed the terpolato polyomal, that s f ( α) = P ( α) < 0 ad f ( β ) = P ( β ) > 0. Ths tur meas that the quartc equato we get whe dfferetatg P has oe or three roots (α,β). I the case there s more tha oe root foud (α,β) we wll use a rule to determe whch oe of them that shall be used. The estmato of µ ths work s deoted ξ, that s P (ξ) = 0 ad ξ (α,β). To determe whch sde of µ the root ξ s located we calculate f (ξ). If f (ξ) > 0, we coclude that f s creasg ad thus ξ (µ,β). If o the other had f (ξ) < 0, f must be decreasg ad therefore ξ (α,µ). Wth the ad of these observatos, we ca get a ew terval o whch to study f. The ew terval lmts are the determed such that f ξ (α,µ) the left lmt s ξ ad the rght s β, ad f o the other had ξ (µ,β) the left lmt s α ad the rght s ξ. These ew lmts wll be used to derve a ew terpolato polyomal ad a ew approxmate value of µ. Ths s repeated utl a suffcetly good estmato ξ of µ has bee foud. 5 4 The equato attaed whe P ( x) = a5x + a4x + ax + a x + ax + a0 s dfferetated ca be solved ether wth the Newto-Raphso method or the kow method for fdg solutos of a quartc equato (Beyer, 987). We show how to fd the roots of a quartc or bquadratc equato sce t s eeded our method. However, we observe that to solve a quartc equato t s also ecessary to solve a cubc equato. Therefore, we frst study the cubc equato y + py + qy + r = 0. To beg wth make the substtuto y = x p/, whch yelds x + ax + b = 0, where ( p a = q ) ad b = ( p 9 pq + 7 r ). To fd the soluto of the cubc 7 equato put Page 4
b b a A = + + ad b b a B = +. 4 7 4 7 The solutos are ow x = A + B x A + B A B = + x A + B A B =. The solutos to the orgal equato are foud by subtractg p/ from these solutos. If p, q ad r are real, the followg ca be sad about the solutos: If b + a > 0 there s oe real root ad two complex. 4 7 If b + a = 0 there are three real roots ad at least two are equal. 4 7 If b + a < 0 there are three dfferet real roots. 4 7 Ths soluto s kow as the Carda soluto after the Mlaese doctor Grolamo Cardao. The soluto of the quartc equato was foud by Ludovco Ferrar. For more o these getleme ad others see Struk (987). To kow the soluto of the cubc equato s a vtal pot solvg the quartc equato. Havg foud ths soluto, we ca thus tur our atteto to solve the 4 quartc equato. The quartc equato o the form x + ax + bx + cx + d = 0 has the followg resolvet cubc equato y + by + ( ac 4d) y ad + 4bd c = 0. Let y be oe of the roots to ths equato ad furthermore put a R = b + y. 4 We observe that R could be a complex umber ad f R 0 we the put D = a 4 R 4ab 8c a b + 4R ad Page 5
Page 6. 4 8 4 4 R a c ab b R a E = If o the other had R = 0 we put d y b a D 4 4 + = ad. 4 4 d y b a E = The roots to the quartc equato are ow. 4 4,4, E R a x D R a x ± = ± + = I the ext chapter more detals of the algorthm are gve, especally how the terpolato polyomal s costructed.
Prelmary theory I ths chapter, we wll state some theorems ad deftos cocerg terpolato polyomals ad dvded dffereces, whch later are used to determe a terpolato polyomal of the obect fucto. We wll show how to dfferetate dvded dffereces. To beg wth, however, we gve a clearer descrpto of the algorthm, ad the fuctos we study ths work.. The problem revsted Here, we defe the kd of fuctos that we are studyg. Some of the pots made the prevous chapter are also further explaed. However, we beg by gvg a defto of a umodal fucto. These fuctos play a maor part our cotued work. Defto. f s umodal o [α,β] f, for all x 0, x ad x [α,β], x 0 < x < x ( f ( x0 ) f ( x) f ( x) < f ( x )) ad ( f ( x) f ( x ) f ( x0) > f ( x )). (Bret, 97) The defto says that f has a uque mmum [α,β], or more loosely speakg f caot have a hump betwee ay two pots x 0 ad x. Fgure. shows a example of a umodal fucto. If we were to study fuctos, f(x), whch has a maxmum pot [α,β], we ca stead choose to fd the mmum pot of the fucto f(x). x 0 x x Fgure.: Umodal fucto The above defto has the advatage that t does ot use dervatves of f. That s, we ca apply ths defto eve whe cosderg methods that do ot use dervatves. I the followg work, f(x) s assumed to be umodal. We also assume that f(x) s dfferetable as may tmes as ecessary. Now we are terested fdg a local mmum of f(x) the terval α x β ad we have that f ( α) < 0 ad f ( β ) > 0. Let µ be the pot at whch f(x) attas ts mmum value [α,β]. I the terato method that we are about to aalyse, the dex deotes the th terato. The terval lmts are deoted α ad β. The terpolato polyomal o [α,β ] s cosequetly deoted P (x). For practcal reasos the terval (α,β ) s usually scaled to (0,) to make the calculatos easer. Whe a approxmate mmum pot (t) has bee foud, we the make a trasformato back to the x-axs: x = t( β α ) + α. Page 7
Ths re-scalg makes the computato of the coeffcets of the terpolato polyomal faster. Thus, the method s speeded up, sce each oe of the terato steps profts from ths re-scalg. Ths meas that we have foud a ew mmum pot the terval [α,β]. To crease the uderstadg of what ths re-scalg meas see Fgure.. α β 0 Fgure.: The re-scalg x t Lettg f ( t( β α ) + α ) = fˆ( t) we costruct a terpolato polyomal, P ˆ ( t ), of degree fve, such that ˆ ( r) (0) ˆ ( r) P = f (0) ad ˆ ( r ) () ˆ ( r) P = f () for r = 0,,. I dog ths we use all the formato we presetly eed for the umodal fucto. Ths wll gve us a terpolato polyomal that s of the ffth degree. Ths eables us to calculate the coeffcets to the followg terpolato polyomal. P $ () t a t 5 a t 4 a t a t = 5 + 4 + + + a t + a 0. (.) It s here that we see why we dd the re-scalg above. The coeffcets a 0, a, ad a are easly calculated, ad a, a 4 ad a 5 ca be determed wthout too much work. We ca see that the coeffcets wll chage wth each terato. The depedece of $ f s suppressed. Thus, we get the followg expresso for the coeffcets a a a a a a 0 4 5 = = fˆ (0) = fˆ(0) fˆ (0) = 0 fˆ() 4 fˆ () + = 5 fˆ() + 7 fˆ () fˆ () + 5 fˆ(0) + 8 fˆ (0) + = 6 fˆ() fˆ () + fˆ () 0 fˆ(0) 6 fˆ (0) fˆ () 6 fˆ(0) fˆ (0) fˆ (0) fˆ (0) fˆ (0). (.) I order to fd the mmum of f, we use the terpolato polyomal ad locate the mmum of t. Thus we cosder Sˆ ( ) ˆ t = P ( t) ad fd the roots to ths fucto. S ˆ ( t ) s a polyomal of degree four ad t s possble to fd a exact soluto to the equato S ˆ ( ) = t 0. If S ˆ ( t ) has more tha oe root wth the terval (0,), the we use a rule to select oe of them roots, ad we call ths root t +. We thus fd a ew edpot to our terval at x+ ( α, β ) where Sˆ ( t + ) = 0 ad x + = t + ( β α ) + α The edpot that s o the same sde of µ as x + s replaced by x +. To check ths we calculate f x ). If the dervatve f ( ) > 0 we kow that x + s to the rght of µ, ( + x + f x +. sce f s umodal, o the other had f ( ) < 0, x + s to the left of µ. We have: Page 8
α + α f = x+ f x + x + > µ < µ ad β + x+ f = β f x x + + > µ < µ, where α 0 ad β 0 are the startg pots.. Dvded dffereces ad terpolato polyomals To eable us to cotue, we frst have to study other ways of dervg terpolato polyomals. To beg wth, we look at Lagrage s formula. A defto of dvded dffereces s also stated ad we wll see how these ca be used to costruct terpolato polyomals. From ow o we deote t(a,b,c, ) the smallest terval cotag the real umbers a, b, c,... Whe terpolatg, the umbers a, b, c,... are called ode pots or terpolatg pots. All ths wll be used the ext chapter to fd a expresso for the error betwee the approxmated pot x + ad the optmal pot µ. Theorem. Let x 0, x,, x be dstct real umbers, ad let f be a gve real valued fucto wth + cotuous dervatves o the terval I x = t(x, x 0, x,, x ) where x s some gve real umber. Also let p be the terpolato polyomal of degree, such that p (x ) = f(x ) for = 0,,,. The there exsts a ξ I x wth ( x x0 )...( x x ) ( + ) f ( x) p ( x) = f ( x) f ( x ) l ( x) = f ( ξ ) (.) ( )! = 0 + x x where l ( x) = = 0,,,. x x A proof of ths theorem s preseted by Atkso (989). Before we cotue to study terpolatg polyomals, we gve the defto of dvded dffereces. Defto. The dvded dfferece (of the order ) of the fucto f(x) s gve by [ x ] f ( ) f = f x [ x,..., x ] 0 f [ x,..., x ] f [ x,..., x ] 0 =. x x 0 The followg theorem s useful whe studyg terpolato polyomals. Page 9
Theorem. The terpolato problem of determg a th degree polyomal whch agrees wth the values of a gve fucto o a set of + pots always has a uque soluto whch ca be expressed the form f ( x) c0 + c( x x0) +... + c ( x x0 )...( x x ). = A proof of ths theorem ca be foud Börck & Dahlqust (974). From theorem. we have f ( x) = c0 + c ( x x0 ) +... + c ( x x0 )...( x x ) + C( x)( x x0)...( x x ), where accordg to equato (.) C( x) = ( + ) f ( ξ ). ( + )! ( Note that C(x) s bouded whe f + ) ( x) s cotuous o t( x 0,..., x, x). For x = x 0 we get f(x 0 ) = c 0. Sce f [ x0, x] = ( f ( x) f ( x0 )) ( x x0 ), we get the followg expresso f [ x x] 0, = c + c ( x x ) +... + c ( x x )...( x x ) + C( x)( x x )...( x x ). We ow see that f [ x, x 0 ] = c. Cotug ths way we get c f [ x0,..., ] = for all k k x k = 0,,,. I our cotued work, we wat to study the error formula terms of dvded dffereces. We kow that our terpolato polyomal ca be wrtte p ( x) c0 + c( x x0) +... + c ( x x0 )...( x x ). = Let s be a real umber dstct from the ode pots x 0, x,, x. We ow costruct a terpolato polyomal p +, of degree +, such that p + (x ) = f(x ) for = 0,,, ad p + (s) = f(s). We get p + ( s) = p ( s) + ( s x0 )...( s x ) f [ x0,... x, s], where p (s) s the th degree polyomal terpolatg f at x 0, x,, x - ad s, ad where (s x 0 ) (s x )f[x 0, x,, x, s] oly depeds o the values f attas at the pots x 0, x,, x ad s. Sce p + (s) = f(s), let x = s ad move p (x) to the left had sde of the equato to obta f ( x) p ( x) g ( x) f [ x0,..., x, x], = where g x) = ( x x )...( x x ). Comparg ths wth equato (.) we see that ( 0 f [ x 0,... x, x] = ( + ) f ( ξ ), ( + )! (.4) Page 0
for some ξ t( x 0, x,, x, x). Ths relato wll be used whe we study the problem of how to dfferetate a dvded dfferece. The followg theorem exteds the defto of dvded dffereces to the case whch some or all of the odes cocde. Theorem. (Hermte-Geoch) Let x 0,..., x be dstct, ad let f(x) be -tmes cotuously dfferetable o the terval t( x 0,..., x ). The f ( ) [ x x ] =... f ( y x +... y x ) 0 0 0 +,..., dy... dy τ where the tegrato s carred out over the -dmesoal rego τ = ( y,..., y ); all y 0, y, = ad y 0 s gve by y 0 = = y. For a proof of ths theorem, see Atkso (989). I the followg, we study how to dfferetate a dvded dfferece. Ths wll be very useful later our work, whe we wsh to fd a recursve expresso for the errors of our method. For more detals o ths see Kelly (967). We may wrte f f [ x ] f [ x] x x 0 [ x, x] = f [ x, x ] =. 0 Lettg x 0 0 0 = x+ε we have f [ x + ε, x ] = ( f [ x + ε ] f [ x ] ) ε ad takg the lmt as f x = f x, x Therefore more geerally ε approaches zero gves us [] [ ]. [ c, x] = f [ c, x x] f,. (.5) Also wth c x x are fuctos of x, f 0,..., = 0,. Lkewse f u,...,u = 0,..., we have f [ x x, x] f [ x,..., x, x x] = [ c, u,..., u ] = f [ c, u,..., u, u ]. du dx It follows that f u = x the we have the relato f [ c, x,..., x] = f [ c, x,..., x]. (.6) tmes + tmes Page
Also from equato (.5) ad equato (.6) we have the followg expresso for the rth dervatve of a dvded dfferece [ c, x] = r! f [ c, x,..., x]. ( r ) f (.7) r+ tmes Now we tur our atteto to the error fucto RT ( x) = f ( x) p ( x) = g ( x) f [ x0,... x, x], where g ( x) = ( x x0)...( x x ), wthout cosderg ay rescalg. We wsh to fd a way to calculate r ( r ) d RT ( x) = { g ( x) f [ x0,..., x, x] }. (.8) r dx We wrte the rth dervatve of a product as, wth D = d/dr, r r D ( uv) = ud v + rdud r r v +... + vd u = The error fucto (.8) therefore takes the form R ( r ) T r = 0 r D ud r r r ( ) d ( x) = g ( x) f [ x x ] r 0,...,, x (.9) = 0 dx ad f we the use expresso (.7) for the rth dervatve of a dvded dfferece we get r v. R ( r ) T ( x) = r = 0 r! g! ( ) ( x) f [ x 0,..., x, x,..., x ]. r+ tmes (.0) I order to fd a expresso for the error wthout dvded dffereces we eed to use Rolle s theorem ad for clarty we state ths theorem. Theorem. (Rolle) Let f be dfferetable (a,b) ad cotuous [a,b]. If f(a) = f(b) the there exsts at least oe pot ξ (a,b) such that f (ξ) = 0. A proof of ths basc theorem ca be foud ay stadard textbook calculus, such as Hellström et al (99). We kow from earler that RT ( x) = f ( x) p ( x). We dfferetate ths expresso r tmes ad form a fucto G(x) such that G( x) = f ( r ) ( x) p ( r ) ( x) R ( r ) T ( x). The fucto G(x) has zeroes at the + pots x,..., x,. Accordg to Rolle s 0 x theorem G (x) has + zeroes the terval t( x 0,..., x, x). Cotug lke ths we ( + fd that G ) ( x) = 0 at oe pot the terval t( x 0,..., x, x). Dfferetatg G(x) + tmes usg equato (.0) yelds Page
G ( + ) ( x) = f ( + r+ ) ( + r + )! g ( x) f [ x ( + r + )! ( + )! f [ x ( + )! ( x) (( + r + )! g 0,..., x 0,..., x, x,..., x ] +... + + r+ tmes, x,..., x]. r+ tmes ( x) f [ x 0,..., x, x,..., x ] + + r+ tmes From Rolle s theorem we have that there exst a ξ t( x 0,..., x, x) such that G ( + ) ( ξ ) = f ( + r+ ) ( ξ ) ( + r + )! f [ x 0,..., x, x,..., x] = 0. r+ tmes Rewrtg ths expresso, we fd that f [ x 0,... x, x,..., x] = r+ tmes ( + r+ ) f ( ξ ). ( + r + )! Hece, we ca rewrte (.9) ad get a expresso for the error wthout dvded dffereces r ( r ) r! ( ) ( + r+ ) RT ( x) = g ( x) f ( ξ ).! = 0 ( + r + )! The above formula s most cases ot partcularly ce to wrte a expaded form, but the case r = we have R ( + ) f x) = g ( x) ( + )! ( + ) ( ξ) f ( ξ ) + g ( x). 0 T ( ( + )! (.) We have ths chapter gve some more detals about the terpolato polyomal we use ths work. The method tself has also bee further explaed. Fally some theory cocerg terpolato polyomals ad dvded dffereces has bee gve. Page
4 Covergece ad rate of covergece I ths chapter, we study the covergece ad the rate of covergece of our method. To beg wth, we gve a expresso for the terpolato error. Ths expresso s the used to fd a recurrece formula for the error betwee the optmal pot ad the approxmated pot. By usg the recurrece formula t wll be possble to show that the method coverges ad at what rate. 4. Iterpolato error To beg wth, we study the error betwee our terpolato polyomal ad the obect fucto. Ths wll be very useful our cotued work. The depedece of P wll the followg theorems be suppressed. I the more commo case of terpolato, where each pot s oly cosdered oce, the error has a somewhat dfferet expresso. However, the proof of our theorem s based o the proof of the more commo case. For a proof of ths error, see Johasso (995). Our proof use theorem. Theorem 4. Let f be at least sx tmes dfferetable. I addto, let P be a terpolato ( r ) ( r) polyomal o the terval [α,β], such that f ( α) = P ( α) ad ( r) ( r ) f ( β ) = P ( β ) for r = 0,,. The error R T ( x) = f ( x) P( x) has the followg form: (6) f ( ξ ) f ( x) P( x) = w( x) (4.) 6! where w ( x) = ( x α) ( x β ). Proof Frst we costruct a fucto F such that F( x) = f ( x) P( x) Kw( x), where f (x) s the fucto we are terpolatg, P (x) s the terpolato polyomal ad K s a costat. Take a arbtrary η (α,β). It s ow possble to costruct K such that F ( η) = 0. Accordg to Rolle s theorem there are umbers ξ ( α, η) ad ξ ( η, β ) such that F ( ξ ) = F ( ξ) = 0. Sce we also have F ( α) = F ( β ) = 0 there exst umbers ξ ( ξ, ξ, + ) such that F ( ξ ) = 0 for = 0,, whereξ 0 = α adξ = β. Furthermore F ( α) = F ( β ) = 0 so there are umbers ξ ( ξ, ξ, + ) such that ˆ () F ( ξ ) = 0 for = 0,,, where ξ 0 = α (4) adξ 4 = β. Ths mples that there are ξ 4 ( ξ, ξ, + ) such that F ( ξ 4 ) = 0 for (5) = 0,, ad therefore there exst umbers ξ5 ( ξ 4, ξ 4, + ) such that F ( ξ 5 ) = 0 (6) for = 0,. Fally we ca fd a ξ ( ξ 50, ξ5) such that F ( ξ ) = 0. Thus, we have F that s (6) (6) ( ξ ) = f ( ξ ) K6! = 0, Page 4
K = f (6) ( ξ ). 6! Theorem 4. s proved. Now we are a posto where we ca study the covergece of the method ad the rate of covergece. Ths wll be doe the followg secto. 4. The covergece The goal of the followg secto s to show that our method coverges wth the thrd rate of covergece. The depedece of P wll o loger be suppressed. We also assume that the terpolato polyomal P (x) has the two followg propertes. Frst P ( α ) ad P ( β ) are o-zero, secod P ( x) K < for all x (α,β ) for some postve costat K. The basc deas behd the followg theorems come from Barzla & Be-Tal (98). We start by defg the rate of covergece. Defto 4. Let x0, x, x,... be a sequece covergg to µ, ad let ε = x µ. The rate of covergece s defed as the supremum of the oegatve umbers p satsfyg ε 0 lm ε + p = C <. Barzla & Be-Tal (98) use the largest umber stead of supremum. However, ths s ot correct to use for ths kd of problem. If we were to use ther defto, we would later have dffcultes provg the rate of covergece. Tamr (979) use the above defto of covergece rate. To beg wth, we show that the errors of our method satsfy a recurrece formula. I the proof of the followg theorem, we use the mea value theorem, ad for clarty, we therefore state ths theorem here. Theorem 4. (Mea Value) Let f(x) be cotuous [a,b], ad let t be dfferetable (a,b). The there s at least oe pot ξ (a,b) for whch f(b) f(a) =f (ξ)(b a). A proof of ths basc theorem ca be foud ay stadard textbook calculus such as Hellström et al (99). Theorem 4. Let µ be the mmum pot of a umodal fucto f(x) ad let P ( x)be the ffth ( k ) ( k ) ( k ) ( k ) degree polyomal such that P ( α ) = f ( α ) ad P ( β ) = f ( β ) where k = 0,, ad α ad β are the two edpots of our terval at terato step. Also let w( x) = ( xα) ( xβ) be the weght fucto defed for the terval (α,β ). Moreover let x 0 = α 0 ad x = β 0 ad let x + be the mmum pot of P ( x) (α,β ). If P 0o( α0, β0 ) the the errors, ε = x µ satsfy the recurso formula ( ) ε = M ε ε + ε ε + N ε ε + (4.) Page 5
where M ( ξ ( µ )) θ( x ) Y = P + ( ), N = Z ( η ( µ )) ( x ) ( θ ) P +, ad Y( x) = f 6 ( x), Zx ( ) = 6! ( ) f 7 ( x) 7! ( ) ad where α+ = α ad β + = x or α + + = x ad β β + + = ξ ( x), η ( x) t( x0,..., x, x) ad θ ( x ) t( µ, x ). + +, Proof Dfferetatg equato (4.) ad usg formula (.) we get ( ξ () x ) w ( x) + Z( η ( x ) w( ), f ( x) = P ( x) + Y x (4.) where Y ad Z are defed as above. Now put x = µ (4.) ad use the fact that P ( µ ) = P ( µ ) P ( x + ) = ε + P ( θ( x + )). Hece 0 = + Y + Z f ( µ ) = ε P + ( θ ( x+ ) ( ξ ( µ ))( µ x ) ( µ x ) + ( µ x ) ( µ x ) ( η ( µ ))( µ x ) ( µ x ). ( ) Lettg M ad N be as stated above, we have ow proved the theorem. The above theorem wll be used whe provg the covergece of the method. To beg wth, we study a specal case for the covergece ad therefore make the followg defto. Defto 4. A optmzato process where the approxmated values ted to the optmum pot from oly oe sde s called a oe-sded optmzato process (OSOP). We wat to kow f our method coverges, that s, does the sequece {x } coverge to µ. Thus, we wat to kow f the recurso formula of the error foud theorem 4. teds to zero whe the umber of teratos ted to fty. To beg wth, we prove the covergece of the method f t s a OSOP. Later ths chapter, we wll gve a more geeral proof of the covergece. To prove that the method coverges we assume that the OSOP geerates values to the left of µ. Ths meas that we get a mootoous creasg sequece. Ths assumpto s made for smplcty ad the case where the OSOP geerates values to the rght of µ s treated smlarly, but the the sequece s mootoous decreasg. To beg wth, we state the followg theorem. Theorem 4.4 If a sequece a, =,,,, s bouded ad mootoous for > 0 the lm exsts. a A proof of ths theorem ca be foud Hylté-Cavallus & Sadgre (966). We ca ow prove the followg theorem. Page 6
Theorem 4.5 α = 0 The mootoous sequece { } that s geerated by the OSOP coverges to µ. Proof Accordg to theorem 4.4 we kow that the lmt exsts, ad we assume that lmα = ρ where ρ µ. The case where ρ > µ s ot possble sce µ s a upper α = 0 boud for { }. Thus, we ca assume that ρ µ. If ρ < µ we have that µ ρ = a > 0. We assume that for each ε > 0 exsts a postve umber N such that for > N, ρ ε α ρ < µ, s true. We also assume that P ( x) K < for all x (α,β ) for some postve costat K. Theorem 4. ow yelds P ( α ) P ( α ) = P ( ξ)( α α ), + + for some ξ (α, α + ). Sce ( α ) = 0 ad P α ) = f ( α ) for > N we have P + ( f ( α ) K < ( α + α ) < ε, (4.4) where the last equalty s a cosequece of that α ad α + [ρ ε, ρ]. Sce f s umodal wth mmum at the pot x = µ ad sce f s cotuous o (α 0,β 0 ) there exsts a ε > 0 such that f ( x) > ε whe ρ ε α ρ. But accordg to (4.4) we must have f ( α ) < Kε ad choosg ε = ε / (K) we have a cotradcto. Ths meas that we have ρ µ ad therefore ρ = µ, whch shows that the OSOP coverges to µ. It has ow bee show that the method coverges f t s a OSOP. For a more geeral proof of the covergece, the assumpto of a OSOP wll o loger be ecessary. We also remd ourselves that the sequece {x } cotas the chose zeros x + of P ( x ), that les the terval (α,β ). To prove the covergece the followg defto s useful. Defto 4. f, gve ε > 0 ad gve N, > N such that l s a cluster pot of { } x x = 0 l <ε. (Royde, 988) It wll also be ecessary to use the followg theorems, ad proofs ca be foud Hylté-Cavallus & Sadgre (968). Theorem 4.6 A sequece s coverget f ad oly f t s bouded ad t has oly oe cluster pot. The theorem says that f a sequece has a lmt l, the l s a cluster pot, but the coverse s usually ot true. Page 7
Theorem 4.7 From every fte bouded sequece, t s possble to pck a coverget subsequece. The covergece of the method wthout the assumpto of a OSOP ca ow be show wth the ad of the two theorems above. Theorem 4.8 The sequece {x } geerated as above coverges to µ. Proof The terval [α 0,β 0 ] s compact ad we have that [α 0,β 0 ] [α,β ],.e. {x } s a sequece o a compact terval. It s thus possble to pck a coverget subsequece from {x }. Let {δ } be the elemets of {x } that les the terval [α 0, µ] ad let {ϕ } be the elemets the terval [µ,β 0 ]. The sequece {δ } s mootoously creasg ad {ϕ } s mootoously decreasg. These sequeces coverge, accordg to theorem 4.5, sce they are mootoous ad bouded. Assume that lmδ = δ ad lm ϕ = ϕ. Ths meas that there are four dfferet cases whch ca occur. These are: I. δ < µ < ϕ II. δ < µ = ϕ III. δ = µ < ϕ IV. δ = µ = ϕ. Case I: Let ε > 0 ad assume that N s suffcetly large so that δ I ad ϕ J for > N where I = (δ ε, δ + ε) ad J = (ϕ ε, ϕ + ε). Let x + be the chose zero of P ( x) = 0 o the terval [α,β ]. We have P ( x) K o the terval [α,β ] where K s a postve costat. If we let K be aother postve costat, the 0 K P ϕ ε P ϕ ε P x+ < ( + ) = ( + ) ( ) = ( ϕ + ε x ) P ( ξ) ( ϕ + ε x ) K, + + where ξ (x +, ϕ + ε). Now pck ε < K / (K). Ths yelds x + < ϕ ε. Thus x + s outsde the terval J ad must therefore be the terval I sce the sequeces {δ } ad {ϕ } together cota all the pots of {x }. We have that P ( α) > k > 0 ad k < P ( x) < k < o [α,β ], where k, k ad k are postve costats. We ow have k < P ( α ) = P ( x ) P ( α ) = ( x α ) P ( η) < k ( x α ) + + + where η I = (δ ε, δ + ε). Sce also x + ad α I t s possble to do yet aother estmato k ( x α ) < k ( δ + ε δ + ε) = k ε. + Ths meas that ε > k / k. But, sce t s possble for us to pck ε the terval 0 < ε < K / (K) we get a cotradcto. So the assumpto that δ < µ < ϕ s false. Page 8
Case II: Now assume δ < µ = ϕ. Just lke above we let δ I ad ϕ J for > N. We also have that P ( α) > k > 0 ad k < P ( x) < k < where k, k ad k are postve costats. If x + I we get as above for each ε, 0 < ε < K /(K): k < P ( x ) P ( α ) < k ε. + Just lke above t s possble to get a cotradcto by choosg a suffcetly small ε. Ths meas that x + I ad therefore δ caot be a cluster pot. The assumpto that δ < µ = ϕ s false. Case III: Ths case s show false a smlar way as case II. Case IV: Sce the three prevous assumptos all are false, the oly case that remas must be true. Thus, the oly possblty remag s δ = µ = ϕ. We have ow show that the sequece {x } coverges to µ. Above we have show that our terpolato algorthm coverges to µ. Now we wat to exame wth what rate the algorthm coverges. To do ths we cotue to study (4.). However, the way whch (4.) presetly looks t s o good to us, t eeds to be re-wrtte. After ths re-wrtg, we wll theorem 4.0 show that our algorthm has a covergece rate of three. To beg wth, we replace (4.) by a more useful dfferece equato. Theorem 4.9 Let f be a umodal fucto wth mmum at µ ad let P be the ffth degree polyomal terpolatg f wth mmum at x +. Furthermore let M ad N be ( 6 defed as theorem 4.. If P > K o [α 0,β 0 ] ad f f ) ( 7 ( x) ad f ) ( x) are cotuous ad f M M 0 whe the wth ε = x µ, where ε = + Aε ε, (4.5) ε A = M + + Nε. ε Furthermore A M. Proof ( 6 Sce P > K ad f ) ( 7 ( x) ad f ) ( x) are cotuous the sequeces M ad N are bouded. Equato (4.) ow gves ε+ ε ( ) = M ε ε + ε ε + N ε ε 0, (4.6) whe, sce the sequece {x } coverges to µ. Rewrtg (4.) the form Page 9
ε ε = ε ε M + M + N ε ε, + we see by (4.6) that (4.5) holds wth ε A = M + + Nε, ε ad t follows that A M. Thus theorem 4.9 s proved. We are ow a posto where we are able to state ad prove the followg theorem about the rate of covergece of our algorthm. Theorem 4.0 Let f be a umodal fucto wth mmum at µ (α 0,β 0 ) ad let P be the ffth degree polyomal terpolatg f wth mmum at x +. If P > K > 0 o [α 0,β 0 ] ( 6 ad f f ) ( 7 ( x) ad f ) ( x) are cotuous ad f M M whe, the sequece {x } geerated by our terpolato algorthm coverges to the soluto µ wth the rate of covergece equals three. Proof We start by re-scalg (4.5) by lettg δ = ε / a ad B = A / a 4, where a = β 0 α 0. Takg logarthms ths re-scaled verso of (4.5) yelds wth y = log δ ad C =log B y + y y = C, =,, (4.7) ad we assume that M 0. The case whe M 0 wll ot be studed here. It s clear that that the method wll coverge faster f M 0. The expresso log B does ot exst f B = 0 for some. Ths case s ot terestg to study, sce f B = 0 the from (4.5) we have ε + = 0 ad the the exact soluto would have bee foud. Due to the fact that C log M / a 4 whe, we have that for all M / a 4 > ε > 0 there exsts a 0 such that for > 0, we have log M / a 4 ε < C < log( M / a 4 + ε). For 0 we have a fte umber of bouded C, C max C. Re-scale equato (4.7) ad let 0 y u = ad 4 S + log Ma D C = S + log Ma 4 where S = f M / a 4 < ad S = otherwse. We have from (4.7) u + u u = D, =,, (4.8) Page 0
Page wth the startg codtos u 0 ad u. The homogeous problem of (4.8), 0, = + u u u has the soluto c c u ) ( + =. For the partcular soluto we let. 0 = = D k u Usg ths expresso (4.8) yelds. 0 0 0 D D k D k D k = = = = Re-wrtg ad chagg the dces, we get, ) ( ) ( 0 0 0 D D k k k D k k D k = + + = + + =,, It s easly see that k 0 = ad k = ad that 0 = + + k k k gves a soluto. By usg the z-trasform o the above expresso, we fd that, ) ( 4 4 k + = where s a atural umber. A partcular soluto s the, ) ( 4 4 0 = + = D u ad thus whe we add the homogeous ad partcular soluto we fd that (4.8) has the geeral soluto. ) ( 4 4 ) ( 0 = + + + = D c c u (4.9) To show that the method coverges we have to study D a bt more closely. Assumg that M / a 4 > we have. log log 4 + = Ma B D (4.0) From the earler argumets above, we have for (4.0) that
4 4 log B log Ma + ε log Ma + ε < =. 4 4 4 + log Ma + log Ma log ema Sce log s a creasg fucto we have that log( M / a 4 + ε) < log em/ a 4 f ε < ε = (e) M / a 4. We have assumed that ε < M/ a 4, so we kow that all ε are smaller tha ε ad we thus have log B + log Ma < 4. We ca also make the followg estmato 4 log B log Ma ε >. 4 4 + log Ma + log Ma Sce log x < x for all x > we have that + log M / a 4 < M / a 4. Furthermore log M / a 4 ε > 0 f ε < ε = M / a 4, whch s a postve quatty by assumpto. Thus for all ε < ε we have log B + log Ma 4 log Ma > Ma 4 4 ε > 0. We have thus show that for a suffcetly large, 0 < D < whe M / a 4 >. I a smlar way we see that whe M / a 4 < we have log B + log Ma 4 4 log Ma + ε > 4 + log Ma > 0 ad log B + log Ma 4 4 log Ma ε < 4 + log Ma < for all suffcetly small ε. The fal case that eeds to be examed s whe M / a 4 =. We have wth S = log B + log Ma 4 = log+ ε <, f ε < e. O the other had, we also have Page
Page log log log 4 4 > > + ε Ma Ma B We have thus show that D < for all > 0. We ca retur to (4.9) ad dvde u wth, whch yelds. ) ( 4 4 ) ( 0 0 = = + + + = D D c c u Re-wrtg ths expresso ad takg absolute values yelds. ) ( 4 4 ) ( 0 0 = = + + c c u (4.) Studyg the frst of the two terms the rght-had expresso, we see that ths ca be calculated as, ) ( 4 4 0 = = + (4.) that teds to / 8 as. Sce the estmated seres (4.) s coverget the = + 0 4 D s also coverget. From the secod term (4.) we have 0, 4 ) ( 4 0 = whe. The the sequece u / coverges whe. Thus there exsts a costat c such that that y / c whe. Furthermore, we have ( ) ( ), ε ε + < < c y c for all ε > 0 f >. Sce we kow that y whe, we see that c < 0. To determe the covergece rate we recall from defto 4. that the rate of covergece p s the supremum of the oegatve umbers p such that p ε lm ε 0 + s a fte costat. Therefore we study y p y - ad try to fd a p such that y p y - <. We ca do the followg approxmato ( ). ) ( ) ( ) ( ) ( p p c c p c py y + + = + < ε ε ε We see that the supremum of the umbers p s at least. The rate of covergece for our method the s at least three. We have proved that the method coverges ad that t does so wth rate at least three. Thus, we have show what we set out to do ths chapter.
5 System Developmet I the prevous chapters, we have prove that the method descrbed chapter coverges ad that t does so wth a covergece rate of three. To test the method real lfe we created a test mplemetato. I ths chapter, we frst descrbe some software developmet methods ad the the test system that was mplemeted. The ext chapter wll descrbe the results from rug the test mplemetato for some fuctos. 5. System Developmet Method Ths part starts wth some descrptos of software developmet methods. It s followed by a descrpto of the software developmet method we used for our system mplemetato. 5.. Methods Software developmet s a egeerg dscple ad s ot oly about creatg a software system that solves a specfc problem. Software developmet s also about producg the software system a well-egeered fasho ad a cost-effcet way. For a software system to be well-egeered, Sommervlle (99) state these four key-attrbutes that the software system should have:. The software system should be mataable.. The software system should be relable.. The software system should be effcet. 4. The software system should offer a approprate terface. To comply wth all these attrbutes s ot easy, as some of the pots are exclusve. Optmsg the balace betwee these attrbutes depeds o the software system use. A software system for a cell phoe may be restrcted to small memory. The t may be ecessary to optmse effcecy wth trade-offs for mataablty ad terface. To help creatg cost-effcet ad well-egeered software systems dfferet software developmet methods have bee created. These are for example Exploratory Programmg, Prototypg ad Formal trasformato (Sommervlle 99). Kag et al (99) says that a software developmet method should detfy:. The developmet actvtes.. The artefacts that should be created.. The avalable resources. 4. A developmet pla (process) lkg the actvtes, artefacts ad resources together. The Waterfall method The frst software developmet method a software developer usually meets s the Waterfall method. It s based o the hypothess that all system developmet s a documet drve lear step-by-step method. The steps the Waterfall software developmet method are: Software system wll be used for a computer program or a set of computer programs solvg a problem. Kruchte (000, page 4) defes artefact as a pece of formato that s produced, modfed, or used by a process. Page 4
. Requremets Idetfy ad descrbe the requremets of the software system a way that both system developer ad ed-user ca uderstad. Defes what the software system developed should do a requremet specfcato documet.. System ad software desg System desg defes the evromet for the system (hardware, operatg system, protocols, etc.) ad creates program archtecture of executable programs. The result s a software desg that spread the requremets over program uts executable programs.. Implemetato ad ut testg Realsato of the software desg. Each ut s tested to follow ts desg specfcato before t s complete. 4. Itegrato ad system testg Test that the dfferet executable programs the program archtecture work together the way the system desg wated. Also, test to make sure that all of the requremets are fulflled. 5. Operato ad mateace Updatg the system for ew ed-user demads, correctg errors foud durg the system operato. Ths also cludes keepg the system avalable ad rug. The lear structure of the Waterfall method s to complete oe step before movg o to the ext step. Ths makes t easy to defe where the developmet curretly s the software developmet process. However, ths does ot work real lfe practce. The requremets may chage durg the desg, the desg may chage because of mplemetato ssues, the mplemetato may chage cause of a tegrato fault, etc. Software developmet s therefore ot lear but cremetal ad volves sequece of steps (Sommervlle 99). The Ratoal Ufed Process method Both Booch (994) ad Rumbaugh (00) have descrbed cremetal obect-oreted software developmet methods. These methods has bee merged ad further developed to oe software developmet method framework called The Ratoal Ufed Process (RUP) as descrbed Kruchte (000). The actvtes a RUP method are grouped together to the followg workflows or actvty groups: Page 5
. Proect maagemet.. Busess Egeerg.. Requremets. 4. Aalyss ad desg. 5. Implemetato. 6. Test. 7. Cofgurato ad chage maagemet. 8. Evromet. 9. Deploymet. These actvtes are ot separated over tme. Istead, all actvtes are cluded each cremetal, kow as a terato. The legth ad umber of teratos may vary depedg o the sze of the software developmet effort ad the developmet teams experece the problem area. I oe terato, the tme dstrbuto betwee the actvtes depeds o where the developmet process the terato exsts. I the frst teratos the testg may oly be % whle the last costructo teratos the testg may be 95% or more. The busess egeerg actvtes coects the real world wth the software that shall be developed. From the busess actvtes, the eed of a software system comes ad the requremets for such a system. I the requremet actvtes the busess requremets are aalysed ad trasformed to a system vew, where the requremets are dstrbuted over a set of software compoets. I the aalyss actvtes the doma aalyss ad scearo plag s doe. Doma aalyss tres to detfy the mportat classes ad obects for the doma area. These actvtes could also clude exame already exstg systems ad ther solutos. Scearo plag s the ma acto amog the aalyss actvtes. I the scearo plag the essetal scearos, or use cases, s detfed ad aalysed. Scearos are based o a storyboardg techque smlar to practces televso ad move dustry. The use of scearos for aalyss was frst formalsed by Jacobse (Booch 994). The purpose of scearos s to establsh the behavour for each class ad to llustrate how the systems elemets co-operate together as a team. The desg actvtes cosst of the hgh-level ad low-level desg. The hgh-level desg cludes dvdg a software compoet to layers, modules etc. Archtecture patters ca be helpful lke for example the ppe-flter archtecture patter as descrbed by Shaw & Garla (996). The low-level desg cossts of desgg the dvdual compoets the archtecture. Ths cludes desg of the classes ad the teracto amog them as descrbed by Kruchte (995). Gamma et al (995) descrbes several desg patters that ca be used ths actvty. More problem specfc desg patter also exsts, for example for dstrbuted systems. The mplemetato actvtes are to realse the desg by mplemetg the classes ad test them. What s realsed a terato s decded the pla actvtes. As dfferet requremets are cluded each terato, some classes may eed to be reworked. The test actvtes tests the archtecture compoets together to verfy that the system does what t was teded for ad wth the requremets. Page 6
The proect maagemet actvtes hadles what order fuctos should be mplemeted, who should do t ad whe. The cofgurato ad chage maagemet actvtes keep track of the releases ad the chages betwee them. Fgure 5.: Actvtes durg software developmet (Kruchte 000, page 65) A RUP software developmet process have four dfferet phases. These phases dcate the progress of the software developmet process. Each phase have etry ad ext crtera that must be acheved that s called a mlestoe. Whe all four phases are completed, the software system wll ether be termated or exteded ad updated by repeatg over the four phases aga. Each of the phases s dvded to oe or several teratos as Fgure 5.. The maagemet phases are the followg (Kruchte 000 ad Booch 994):. Icepto The vso of a product or a eed s trasformed to a software developmet proect. The cepto seeks to establsh the core requremets for the software system.. Elaborato The target for ths phase s to aalyse the problem ad create a desg a archtecture that shall solve the problem. The aalyss also allows beg able to create a pla for the two ext phases.. Costructo Buld the system cremets. Each cremet shall cota more fuctoalty the the prevous cremet. 4. Trasto Put the software system to work by trag the ed-user, marketg, stallg ad mata the software system. Extreme programmg Jeffres et al (000) descrbes a software developmet method called Extreme programmg (XP) developed by Ket Beck. It s a smple cremetal method based o a set of commo-sese rules. The essetal deas for XP are: Page 7
User stores User stores are used to create a descrpto of what shall happe dfferet stuatos ad to state the requremets. The user stores are also easer to uderstad for a o-techcal perso tha a techcal requremet specfcato, as they are wrtte the ed-users vocabulary. Because the user stores hold the requremets, they are the foudato for how the system s expaded ad evolved, as user story s raked mportace. User stores are related to the scearos RUP as both ecapsulate requremets. Neverless, the user stores dffer from RUP scearos, as they do ot show how a problem s solved. Istead, they oly descrbe the problem. The user stores do ot cover aythg related to algorthm or database layout or the teracto betwee classes. Test frst phlosophy From the user stores, test cases ad test mplemetatos s created. The dea s to emphases the tests ad to make sure that all mplemeted user stores stll works. The tests frst phlosophy also helps wth the requremet aalyss, as a user story that s added ca geerate more user stores. To further mply the test frst phlosophy, test mplemetato should be created before the mplemetato of what the test case cover. Par programmg The dea wth par programmg s that two persos workg together ca wrte more ad better mplemetatos the whe workg each o there ow. Oe result from workg together s that both programmers kow what the mplemetato does. Ths makes t easer to replace a member of the team. Cotuously Itegrato To dscover faults early betwee dfferet parts, tegrato s eeded all the tme. Ths also helps to test the system regularly. The commo soluto to ths s Nghtly bulds ad automated testg wth the help of a scrpt laguage etc. Commucato All commucato should be drect face to face XP. The software developmet team cossts of developers ad at least oe busess expert. The busess expert creates the use cases ad s the developmet teams cotact perso for all questos regardg the requremets ad the fuctoalty of the system. Also XP there exst teratos. Oe terato cossts of a selecto of the user stores created. These user stores are graded mportace where the most mportat shall be mplemeted frst. Mart (000) descrbes XP as the mmal mplemetato of RUP wth add-os. Smth (00) pots out some smlartes betwee RUP ad XP, but he also pots out several dffereces. The ma dfferece s that XP s ot desged to scale for large proects. To support ths dfferece Smth reasos that to be able to scale, ot all code ca be maaged by all developers. If the proect scales eough, the commucato would be a maor dffculty. Other reasos he gves are refactorg, where XP msses the archtectural overvew of the system. Oe other maor dfferece betwee XP ad RUP s that XP oly cocers the software developmet whle RUP looks also at the busess case. Page 8