IOSR Joural of Matheatcs (IOSR-JM) e-issn: 78-578, p-issn: 39-765X. Volue 4, Issue 3 Ver.I (May - Jue 8), PP -8 www.osrourals.org Abdellatf Bettayeb Departet of Geeral Studes, Jubal Idustral College, Jubal Idustral Cty, Kgdo of Saud Araba Correspodg Author: Abdellatf Bettayeb Abstract: he proble of Fttg coc sectos to gve data the plae s oe whch s of great terest ad arses ay applcatos, e.g. coputer graphcs, statstcs, coordate etrology, arcraft dustry, etrology, astrooy, refractoetry, ad petroleu egeerg [7,, 3]. I ths paper, we preset several ethods whch have bee suggested for Fttg ellpses to data the plae. We wll loo partcularly at oe ethod, by gvg exaples ad usg Matlab to solve these proble. --------------------------------------------------------------------------------------------------------------------------------------- Date of Subsso: 6-4-8 Date of acceptace: 4-5-8 --------------------------------------------------------------------------------------------------------------------------------------- I. Itroducto Let a relatoshp betwee varables x ad y be gve by f ( x, y; p), where of paraeters. For exaple, ths could be a ellpse or ay coc the x,y plae. Let data pots ( x, y ),,..., be gve. he deally we wsh to choose p so that f ( x, y ; p),,.... p R s a vector However, ths s ulely to be possble, so we eed soe other ways of choosg p. hs ethod s ow as geoetrc fttg ad uses the paraetrc represetato of the ellpse such that the su of the squared orthogoal dstaces fro each data pots to the ellpse s al, ad ths s dscussed by Helut Spath [4]. I the other sectos we troduces dfferet uercal dfferet uercal exaples, wth relevat fgures ad results. II. Geoetrc Fttg Gve the odel f ( x, y; ), (.) ad the data pots ( x, y ),,..., the plae, aother possblty s as follows: We ca choose the su of the squares of the dstaces fro the data pots x, y ) to the curve ( f ( x, y; ) to be zed. We cosder the specal case whe t s possble to gve a paraeterzato of the curve, usg x x(, y y(. he we exae here a specal algorth proposed by Helut Spath. A ore geeral Gauss-Newto ethod s cosdered also to be copared wth t. Both ethods are appled for ellpses. III. he ethod of Spat for a ellpse Let the data pots ( x, y ),,..., be gve the plae, ad x x(, y y( be the paraetrc represetato of a ellpse x( a pcost, y( b qs t. We have to ze wth respect to ad t S(, [( x x( t )) ( y y( t )) ], where [a b p q] s the paraeter vector whch ust be detered. Also t ) (3.) ( t,..., t has to be detered, represetg the postos of the pots o the curve whose dstaces to the data pots are zed.e. the dstaces are orthogoal. Notce that t oly appears the -th ter.e. S(, s separable wth DOI:.979/578-438 www.osrourals.org Page
respect to the uows t,..., t. Codtos for a u are (,, (,..., ). t (,, (,..., ). (3.) If s fxed, the (3.) correspods to equatos, each of whch ca be solved for t. If t s fxed, the (3.3) s (3.3) a lear least squares proble for. We ca obta a soluto by a alterato procedure, updatg t ad systeatcally. Frst we fx ad we ust detere the u t whch satsfes (3.). hat s ( x x( t ))( x( t )) ( y y( t ))( y( t )), (,..., ). (3.4) For each, the we could select the t that globally ses the -th ter of S. hus, for gve, we could atta a global u of S(, S wth respect to t. Now for the ellpse t turs out that the equatos (3.4) already are or ca be trasfored to polyoal equatos of low degree less tha or equal to four. hs s explaed below. For the ellpse we have four roots (zeros), but ether two or four are real zeros. Next we fx t at these values ad satsfy (3.3), whch ca be terpreted as a lear squares proble, because appears learly. hs delvers the global u for S(β, as desred, for ths t. Each step gves a reducto of the value of S utl o further reducto s possble, whe a u of (3.) has see foud. Cosder the calculato for β. Let r be the resdual vector: each copoet of r s: r x = r = [r x r y ], x a p cost x a p cost, r y = y b q cost y b q cost, we ca wrte the -th copoet of r as follows c d r (,, ), f we troduce the resduals r, atrx for, we ca wrte the error equato C d r, C R, R, d, r R, (3.5) where C s a x, atrx, wth ths case equals to 4, ad d s a vector of legth. C cost cost s t s t, d x x, y y DOI:.979/578-438 www.osrourals.org 3 Page
IOSR Joural of Matheatcs (IOSR-JM) e-issn: 78-578, p-issn: 39-765X. Volue 4, Issue 3 Ver.I (May - Jue 8), PP -8 www.osrourals.org we assued that the atrx C has the axal ra,.e. ts colu vectors are learly depedet. he uows of the error equatos are to be detered accordg to the Gaussa prcple, such that S the su of squares of the resduals r s al. Ad ths s equvalet to sg the square of the Eucldea or of the resdual vector. Fro (3.5) we obta r r ( C d) C C ( C ( C d) C d) d C C d. d d C d We put A C C b C d A R, b R. As C has axal ra, the syetrc atrx A s postve defte. hus d S S(, : r r A b d d M! (3.6). A ecessary codto for sg S( β) at the pot, s the gradet ( ). he -th copoet of the gradet S( ) s obtaed fro the explct represetato of (3.6). (, a b (,,..., ) (3.7) After dvso by fro (3.7), we obta the lear syste of equatos: A b, (3.8) for the uows,,...,. We call ths syste of equatos the Noral equatos of the error equatos (3.8). he Matrx A s postve defte, thus fro the assupto o C, the uows are uquely detered by the oral equatos (3.8). he fucto S(β) s deed sed by these values, because the Hessa atrx of S( ), the atrx of the secod partal dervatves, s equal to the postve defte atrx A (see [6] page 94-96). here are a lot of ways to solve the oral equatos (3.8). Because the drect ethod used by MALAB s faster, we solve the oral equato by ths ethod A \ ( b). here s also the possblty that (3.5) ca be solved drectly usg the (\) MALAB coad. 3. he geeral Algorth Mse S( β, w.r.t t, let S be the result for ths stage. Step : Gve tal guess, toleracetol. Step : Copute by (Maple) the dervatve of S w.r.t. (. S : ( x a p cos( t )) ( y b q s( t )) ;. eq : ( x a p cos( t )) ( y b q s( t )) ; 3. sol : solve( eq, ; sol 4 3 : * arcta( RootOf (( q * b q * y ) * Z (* p * x * p * a * p * q ) * Z (* p * x * p * a * p * q ) * z q * b q * y )) DOI:.979/578-438 www.osrourals.org 4 Page
B [ q * b q * y( ); * p * x( ) * p * a * p * q ;; * p * x( ) * p * a * p * q ; q * b q * y( )]; for :. Alpha roots(b); a ta( Alpha); ( MALAB). 4. ae oly the real values of 5. Substtute ths real values S, ad choose the u of S ad the correspodet. S 6. he al S s, equals to S. Step 3: Fx t ad fd S the u of S w.r.t. β. Solve the lear least square proble A*β = b as we saw above such that = A\ - b.. S r*, where r s the resdual defed before. r 3. Copute S ad S utl we get the u value of the wth tolerace proposed. At each terato, there ust be a decrease the value of S. Rear: Drect ethods are usually faster ad ore geerally applcable, the usual way to access drect ethods MALAB s ot through the LU or Cholesy factorsato, but rather wth the atrx dvso operator / ad \. If A s square, the result of X = A\B s the soluto to the lear syste AX = B. If A s ot square, the a least squares soluto s coputed ( see [5] ad MALAB verso 4.c, 994). IV. Gauss-Newto ethod O cosderg the olear least squares proble: XR S r ( X ). For the ellpse X [, t] r ] [ r r r, S r r., where Dfferetatg w.r.t., (,..., ) X [a b p q] ad t [ t t ],, =4, X r r X. (4.) S( X ) J r, where J s the Jacoba atrx assocated wth S ad s a x atrx of the for: rp J pq. X q Hece the p-th row s the dervatve vector of the p-th sub-fucto r X w.r.t. each eleet of X. Dfferetate aga: S r { [ X X X S( X ) ( J J B), r. X r r X X ]}, (4.) DOI:.979/578-438 www.osrourals.org 5 Page
Where S B r r, s the x syetrc Hessa atrx of S. he x atrx B whch the error atrx s: where S syetrc ad postve defte J J postve se-defte because z J J z y y, thus we eglect B []. 4. he geeral algorth for Gauss-Newto Method he the G-N Algorth s: Step : Choose x tal approxato to x ad a axu value of S let be S = 8, ad a tolerace tol, set =. Step : Copute r, J, thus J J ad J r. If J r tol, stop. S r * r ; d abs( S S); If d < tol, brea, ed Step 3: Solve the equatos by J J J r. fdg, here s the correcto vector Step 4: If tol, retur. Otherwse set x x,. dapg factor equals to (for the ellpse ad the crcle). Step 5: If S S S S retur to step. where We put here the step legth or the S r r. Otherwse set..e. halve the step-legth, utl we get the retur to step 4, (ths case appears clearly for the parabola). he correcto vector s based o local forato, the ew approxato ay have udesrable propertes. For exaple, eve though s ot uphll at x, we ay stll fd that S S (the case of the parabola). It s ecessary, therefore, to troduce a factor, whch odfes the or of the correcto vector; t becoes coveet to refer to the latter as a " search drecto ". Ad s usually called a step legth, or the preset cotext, a " dapg factor " (see []). V. Exaples Wth dfferet set of pots, we appled here the geoetrc ethods (Spath, Gauss-Newto) for a ellpse. MALAB was used here, because t s easy to pleet agast aother pacage or laguage le Fortra, ad we save a lot of te too. 5.Fttg Ellpses Cosder the 'Spath' data set gve fro [4] able (4.) whch s used for all exaples of ellpses. x 8 3 7 6 6 4 y 6 3 7 DOI:.979/578-438 www.osrourals.org 6 Page
5. Exaple : Geoetrc ethod wth Spath Algorth Fgure shows the ellpse geerated fro the data usg the Spath ethod wth tal guess = [5.64 4.4887.954 4.84]'.. Ad s=.479 uber of teratos =. he ellpse geerated s x = 5.46+.665cos y = 4.795+ 5.35467s Fgure : Ellpse fts wth Spath Method 5.3 Exaple : Geoetrc ethod wth Gauss-Newto We get the sae Fgure as Fgure ad we got the results as follow. s=.479 uber of teratos =. he ellpse geerated s: x = 5.463+.6554cos y = 4.78997+ 5.36559s DOI:.979/578-438 www.osrourals.org 7 Page
Bblography [] Dxo, L. C. W., Spedcato, E. ad Szego, G. P., Nolear Optzato: theory ad algorths, Brhauser Bosto, 98. ISBN 3-7643-3-. pp. 9-. [] Fletcher, R. G., Practcal Methods of Optzato, Joh Wley ad Sos, 995. ISBN 47 9547 5 pp. -36. [3] Gader, W., Golub, G. H. ad Strebel, R., Fttg of crcles ad ellpses: least square soluto,bi, 34(994), pp. 556-577. [4] Huffel Sabe Va, Recet Advaces total least squares techques ad errors varables odelg, " Orthogoal Least Squares Fttg by Coc Sectos " by Heluth Spath pp. 59-64, Lbrary of Cogress, USA, 997. ISBN -8987-393-5. [5] Kola, B., Eleetary lear algebra, 99. ISBN --36645-7. [6] Schwarz, H. R., Nuercal Aalyss: A coprehesve troducto, Great Brta, 989. ISBN 47 964 9 pp. 94-39. [7] he MathWors, Ic. MALAB REFERENCE GUIDE, 99. PP. 5. Abdellatf Bettayeb ".IOSR Joural of Matheatcs (IOSR-JM) 4.3 (8): -8. DOI:.979/578-438 www.osrourals.org 8 Page