0% found this document useful (0 votes)
28 views

Numerical Sol of ODE

Uploaded by

Sahil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
28 views

Numerical Sol of ODE

Uploaded by

Sahil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 25
fF te iene —cun-qen is 4a salve the GPE_agh. 7 [ e- 4 Os) = oI. Rackion P Gey) ts Vea vew_difficalk or even Mevenciate then the Too. of topics like hea mropsfinsa gaas_dynanpica i a solution of’ the af, ech occured io alls ee a day latest sothaare Ore “ls available cabivh ase numerical _techsi ' eto get_a i fet Le olution i Hess ethod = Lai Stes dy os Fey) By legg Mitnge dx Peng kg ey : = Fey) da vali, ee, By ™ j (™ wuindig wth SU Peay ri Zit yl de: Ties slopelaab danger ls al cate ah feck Pail ae, yetaod and: 0.0 Carls all sting ich ey i izake olution: + 2 ; QUT ie nlediod. method. tne_sy-slope Son y Yo [Prony PCa gL (dof 4 is Rube PM Cor Se lest Ba. oh by Euless method a 0 z (x sede I 5 = 42 i Abe inital Guess is ; 4 a bh f(x, .y,) =----. @ TR Ces, yt Plea ee Deore ©. i Ceayy me fs “enn esta = eg oct D abject. Fy) =o Gary) n, [se oe aes b Rady, Py it by LR Ce, yas ete fds ®@ | aes + 0.9 og on Tip taal i = 24+ 32Th CS IRIATE Hg) | PS ahaa ex { Mse Eales cmiaihad Seed Ge sy t bfx yg) 7 ® = oat 6.2 [In (2 + 2.330) _ Y= 2.4798 Pt skin modal Culer’ method se = yf, +b EP Guy) + Poe udp = =. ---@ 1 = 0.283 +(02) [InGc+ 2.2932) +40 C-G42.4798) | y® = 2.492) 1 Tt oa, fy = aftr 26 1 fi ‘na Scien Pa G@= | Ove"e 924. rn er ee : te Q TSawe the DE (Ay/a5 Sx yCd=e1 at 2=04 Phe . : | ogee : 3 =), Plays ye ey 2 O4 ye Bene = OD to Pind i boy Culess % nethod Yi =o + he Ea Becki hee = 4 + Co.2)(%- y) ie sh 0.2) [0-17] 10 __MeM_[-Heuos O8u8 + (0. ies =. [xere aa Je o.gun + (omo2 = 0-848) 3: T, M College Of Engineering Faizpur,Dist-Jalgaon. i yt [ Ca,q04 Pw Oo Ht. if t 20.8 t (SE Vee omua) A COG = omar). = O.7801 2 0775) 7 ae Sete. gc Otter Tar Sire ro of ( Lt Cx = 0.4) = 0.1758, Sores oe = 2+ Col) (0) by, TT _ 5, Ge, I = Qu 4,8 De E Tout tt in MEM [Heants 1s “iy Sie Pan, a, Up ORS uct Tepes: ee fee =, + 1 P(air.y 15808 COIs Ee wt tl = at ot T- Eye, = eh. =e Foe] \.9800. 1.9803. = _|-9863 Fee = 1.9803+ COD EF 1x Ct son. = 1.9410. io MEM Tease yo sy, eae [Peay +Plety gadelta: 9803 + St Scots =X “4 } 19808 + SET Go. x 1.9803%) — (0-2 K-94 103) 5 \.9230 [Ws 1.9237, ST MRD vets Lea AS end ot Asin sla J.T.M. College Of f Engineering rDist=Jalgj 4h t tt ey) —— © Ene sto_-H y (ats) = Yu st “he chide b obtained by a ce Following * de Rule = yay Fivst Step i [Pegs tee me Oe fy Yet hots class=ses “In! x. 1 ie s_closs- Sae—io_y ta be calculated. akin as a b pL kK. =h LP [eB Ce ER] = hie, Gre fi NE Ee ai dot al step. Pie acpla ie use ae papcedckne as ee =U +k. Ye “G@ ean i) UThe ems. \ of pT onder "bet ‘oot ayy 40 ‘track ee iS) Tess etl feat ‘solve the DE of wae ie ceifidlioneous DF. qa he condition See ei TY j °C pet Goon! 7S yee \ s <= ee = | M202 Y= : . aT i Step O oI 4 [ky = hf (ey) Lie At 20-2) SET pi 0.2 lesa in Pay 1 ts " ing, wim "taggly ze Kk, = piles lagioth Peo a | ar oe a ds it Fe st (0. sh =0.2 = N16 gs. Pepuidistaigaon ad k= bh: ea Kiel le oles 1169S = a a AEST i K.= O.146 bP Ga BG, ER. pais BLP Scat) > Gtk) dis \ | [C0.4) + C1695 + 0.1303) [Kg oe O. NIC « Kos Le Lk + ait a ke tg “k_= 0180s. openl che big iy (e,=0.4) = ytk Cole Set, | [1693S x O.1305 i Seige: 13000. i ip)_or h (common difference) Ber 4 = marks ~single Ro € ee Jao step. Flowchart. for Modified EiMe=e ie a calla 4 — : Read oVo,300,6)/ 22a ieee \anite Cee pues \ (eee [SP= 0+ bce. 83] Roexth ) [SPS yee Ce od + Fe 8D | = —qranie Woy] S| ' Da” Pa] [ are 2 [cent + FCO J i 5 Yor | a [e==| Soe : “#_Bloeo=charct for Method seat ee (eart) ) ; Ki = FCx Yo) a Ka = Fl +l Yo DKig) + Ke = Fc Mo Yot key) } Kas fF Goth, Yoths) [Ace ne i [LATE 12-10-09) * Picards Method —+ ——— au = £Gyy) Sx) = Yo paseaf? | C,Y) doe aude tufted ro) i S 4+-{#Gete) de ee xe ca Betas Sob ett eh MS so Yl = Cz,") 2) aed wo fo Es “Remarks! = st eet ee Ae D Ib te practical chlFRRut _ty_Hni's__cmethod_'s_ tobe _tnte grate _tne | fanehion.. -Fes4)- many. hines ot _Somehmes.. Tan 38. feemutnte_algor! Hh tS cliff Bes WD Th's merhod_provides_a semi _=numewndtal_theovoritad __ Naiue__aot_so_acutrate___ ae gfe Og ie EE ee as = *— See tne teat ex3y) Eh Paes eee Yiotix = 25 = Ne. Y(o) = 1 _ustth—_ step size of h =o for the Interval x =0+0 2% =O NEB om a Mie _have_to_apply two steps step 1 — %o=9_, 4Co) =j bh = 0-01, £.Cx,¥) ate? ast Soe By Ra Ke trem = Slope srep = step it = Fore Ye). Bane o-} O2103 LB oe Ne PHY) 2 ocjotles oi. Hh19Re t ky = Gage ble Yat Me) atone ___otosas_ Lk = £ Geoth_, Yet ba). 0.- 10304 O-1OR16__ ae ee pe Ky r2kt2k + « ia OVO). ener! zn OS, a =A + 010} ss mage SS - SU" alot eee 2 AS elep aL = Roh ey Og My: Olol a be ol | i ' t t t i ‘ | Met tne OS BK: ~~ Repeating above..pwroced tre, Liptn. Waals : Hod ore Wwe. ge Ke oc, K_by Usting. neu \4 _3¢0-9). ae as = hol. +.0-010S H2™ 1110206.25 Seteogy OMNIS. Bee 2678S vols. _ Show the _ eFFect_ of step size. using MEO _ Sfep@) (Ans. = 9.9330 2.092) a oe ). SM lacey, Gy Ts. Jer Em Mats “4 90203) i —ellentn setles aa tact puke Ye =0.)) 4 Cans ~P 2ase (MED) a 5 a ; | | 4 dlve oly =x SC | | t 1 Co-t}-=4+ 1 | dz Ste J h_=0-4 am | | Soe fox x = 0.0 - \ Ye. compute—y and zat 250.9 [= Soe ne_aiPhrentl eq? eS | yy! aye = 2 : = = at ac =t_,ye2 and Yet \— Compute YY ab x=: 2 h=0:0 by. both. ee m = Sees Ce = ity” ak _¥ ©) =< 0_ __Find 9 0-@)_by_h: ping Adam _- Bash - 10. dye ty 3 Ods4 sl SF. frag yb sed gh = on by Mitens Method. AE GE i) 4 b Milengem Num. Solution of Ordinary Dit ey, Lit, Computer Oriented Numerical Methods 9.49) : 9.8 x 10° - 0.121287. _ 9.91096 * 2 at x = 0,25 Example 2:16 2 ai increment in t as 1 using Runge Kutta 4'" order method. Solution : r " Now, foes r " 4 xatt = Now, bo k k 1 1 y = 0.9801 = 0.01096 = 0.96913 GX yx and x = 3 for t = 0, tabulate values of Cand x fort = 0193, = Kit 2k, + 2ky + ky _ 6 ec. 2049 fQ,x)=t-x % 23 Hig.) = 10-3)=-3 nr(eds m8) [O+2)-C-D]-- nt thm e®) ~fs-G-)] 2 HFG, +h, x) + kj) =10-G-2- + 2k, + 2k, +k, -3-2-4+0 -15 1=3-15815 1x 215 10-15) =-05 i[1s-(Gs- P| 025 ifs Gs+2 ]--0325 1(2-(.5 - 0,125)] = 0.625 ky + 2k, + 2k, +k, 12 6 205 +2 0,25 —2 x 0.125 + 0.625 6 0.0625, 2= 1.5 + 0.0625 = 1.5625 2 X= 1.5625 : 1 (2 - 1.5625) = 0.4375 112.5 ~ (1.5625 + 0.4375/2)] = 0.71879 ater Oriented Numerical Methods ple 3 : Solve the following aimee ae = 1,5625 + 0.6484375 = 2,2109375 ae dx 7 Xty+xy use (i) Modified Euler Method with he solution : (i) Modified Euler Method : First Iteration : x 1 © Yi in V1 To achive more accuracy. Cy yi y 0.05 bas © Yo a Y2 ie. | Second Iteration : @ y2 y@1) i) Runge Kutta 4 Order : h m m, ms my y (0.1) “Example 4 : Using fourth yidx = x2 + y2, Assuming y (0 ~ "Solution + Let, order Runge-Kutta method solve the differential equation O estiamte y (0.2) and y (0.4). 1.11597 = 0,¥9 = 1 FG, Yo) = 1 ae = {sobre BY - § 0.05, 1.05) = 1.1525 {x +3 B+ EY. 50.05, 1.0576) = 1.16048 vs 9. ion of Ordinary Diff. Equation Ky = 1125 ~* 1.5625 + 0.71875/2)1 = 0.57125 kom 1 ~ (1.5625 + 0.578125)] = 0.859375 i375 + 2 (0.71875) + 2 (0.578125) + 0.859375 6 = 0.6484375 Xatt = k = ion to get y (0.1). y@=1 0.05, Gi) Runge-Kutta 4" order with h = 0.1 h = 0.05, x) = 0, yy =1 = x +h=0.05 Yo + HE (xq, yo) = 1.05 (May 01) bh +7 Mf Gp, Yo) + FG, y,) O) = 1.05381 h +7 UF Ops Yo) + FOG, YD)! 1.05391 x, +h=01 yy + h£Gx,, y,) = 1.05783 Jy +B HE Gy, ) + FQ ADI 1.11441 +Btayp+ f(x, 2)! fq +h ye * Ben £ @.1, 1.11605) =.1.32765 m+ 2m, + 2my + mg) +f 4 Jn=iaises Yo (ec. 2001) h 02 fay) = ety 9.52 Num, Solution of Ordinary Diff. Equation 2 7 FMA. ey) = -2+0.1 £11, 0.8, = 2) = -24+ 01115 x01x-2-45.%08 + 4.5] = -19%4 Yom yy + hg Guy, 2) = yy +hg 11, 08, - 2) = 08+01x-2 = 06 23 = % + hf GO, y2, 2) ™ 2 + hf (0.2, 0.6, - 1.94 = ~1944+0.1x[15%0.2%- 194-45 x06 + 4.5] =.= 1.5182 Ys = Ya * hg Gx, yp, 23) = 06+01%2, = 06+01x-194 a= = 0.406 al x 01 02 (p3 i 08 06 0.406 a -2 =194 ~ 1.8182 Example 6 : Solve a = x + y Taylors series method to find y at x = 3.0. Given x= 2,y = 2 take = 0.5; accuracy upto third term of the Taylors series. (Dee. 2002) Solution : Given differential equation, Wexsy x=2, y=2 h=05 Vee ee y, yry-x 70 Yo = Yot% = 2+2=4 5 Yo = 4| differentiating | ster Oriented Numerical Methods 9.46 Num. Solution of Ordinary Diff, Equation wf gous, Runge-Kutta method of fou th order with step size. h = 0.001 produces accurate ith decimal place, 0 result “éing = 0.01 Cncrement in 1, lo" to 0 k Kr ~ N05, 4) = 0.01 Go 200 x0) = 04, ” Zz 702 a ky W k, me Gest) - ool n't G+, = 0.01 (40-200 0 +0) = 0.4 ke hfe & 2 k, = 0.01 (40- 200 (0+ 0.2)) = 0, Ey =0 3» 'o*h) = 0.01 40-2000 +04) =-04 k= dik 1 Gr * Aka + 2ky +l = 3 104+ 0+2%04-04) = 0.134 Yh=o01 ~ lo* K=0+4 01340 0.134 Analytical solution at t = 0,01 js 0.172933, Thus with increment in step size there is Significant rise in the error, xercise 9.1 Using Taylor's series, solve the equation dy Fe = x+y, y@=0 to tabulate the solution for x = 0 1) ©5) 8. ¥ ) = 0.0, y (0.1) = 0.005005, y 2) = 0.020016, y (0.3) = 0.0451215, y (0.4) = 0.080512, y (0.5) = 0.1265625 Use Euler’s method to solve the equation dy subject to the condition x = 0, y = 1 and tabulate the solution forx = 0.1) 5) %y¥O=1,y O11 =11, y ©.2) = 1.211, y (0.3) = 1.3361, y @.4) =1 A787, y (0.5) = 1.64257, Use modified Euler’s method to solve the above problem and find yatx= * 1) = 1.1058, y (0.2) = 1.2245, y (0.3) = 1.3606 Solve by Runge-Kutta method of 4"" oder dy | y-x "yey % 7G =I ‘ofind the value of y at x = 0.2 taking h = 0.2, 8. 1.16787 0.1, 0.2 and 0.3, Solve the problet of above exercise to find yat x = 0.4 taking h = 0.2, 12995, _ _ tor Orlontod Numerical Methods + 9.44 Num. Solution of Ordinary Diff, Equation ce of 100 ohms, an inductance of 0.5 henry are connected in series with ample 6+ A resistan ly the current in the cifcuit is zero, find the current in the circuit at t = | Gi Analytical method compare the approximate values with exact values. : Voltage drops across inductance L and resistance R are respectively, a and Rl {im of these voltgae drops = Applied e.mé. | this gives differential equation of the circuit as al Lat Rk (= Oatt=0) | @ Analytical method | aR, LE dt iL L This is a linear equation with Integrating Factor. R In =e" | Multiplying the equation by LF. , it can be written as R idee Ec aoe orpe i R R R R “Integrating lel = fee dt+c | PEE E, ¢ j i i E fe mE} aL or I R reo | E [a= 0; 1-0 gives C= -R R Eq ett Te Rd-e) Putting E= 20; R= 100; L=0.5 r= da-em _=— Or a ° Num. Solution of Ord Computer Oriented Numerical Methods 9.45 “Sinary bit, att= 0.001 ;1 = 0.036254 att=0.01 ; 1 = 0.172933 ‘These are the analytical solutions: Gi) Euler’s Method a lel a7 rk = 40-2001" £0, 0 Taking h = 0.001 [increment in t) T= 1, thf dy, t) I= 0, t)=0 1 = 0,001 x 40 = 0.04 1 at t= 0.001 is 0.04 Taking h = 0.01 [increment in d I = 1,+ 0.01 Fd, t) 1 = 0.01% 40 =04 Comparison with analytical solution shows that at t = 0.01, Euler’s solution = 04, sty analytical solution = 0.172933. Thus error is substantial. At t= 0.01, Euler’s solution = 0.4, analytical solution = 0.036254 at t = 0.001. Thus error is much reduced, with reduction in step size, iii) Runge-Kutta Method of fourth order dl a 7 {0,0 = 40-2001 Taking h = 0.001 [increment in), I, = 0,t,=0 = h Fy ty) = 0.001 (40-200 x 0) = 0.04, 4 = 0.02. keen Ke coo ne G,+ .14+4) = 001 40-200 0.02) = 0.036 Te k h ngs Zi lot ) = 0.001 (40 ~ 200 (0.0182) = 0.0364 HE, + ky, ty +h) = 0.001 (40 - 200 (0.0364) = 0.03272 ke gtk, + 2k, + 2ky +k = 210.05 + 2(0.036 + 0.0364) +0.032721 = 0.036254 Th-obot = Iyt k = 04 0.036254 = 0.036254 which is same as analytical solution, puter Orionted Numorical Mothods 9.46 Num. Solution of Ordinary Ditt. Equation k ky = HE y ty) = 0.01 (40 ~ 200 x 0) = 0.4, Zn 02 k, h k, ne at tied) = 0.01 (40- 200 (0+ 0.2)) = .zeo k, ne G +B to )- 0.01 (40 - 200 (0 + 0)) = 0.4 hf Cyt ky, t +h) = 0.01 (40-200 0 + 0.4) == OA 1 kom Glky + 2k) + 2ks +k) = Z 104 40+ 2x04—-0.4) = 0.134 yheoor * lot k= 0+ 0.134 = 0.134 Analytical solution at t = 0.01 is 0.172933. ‘Thus with increment in step size there is significant ri in the error, 2 ercise 9.1 Using Taylor’s series, solve the equation 2 =xty,y@-0 to tabulate the solution for x = 0 (0.1) (0.5) | y 0) = 00, y @.1) = 0.005005, y 0.2) = 0.020016, y (0.5) = 0.0451215, y (0.4) = 0.080512, y (0.5) = 0.1265625 Use Euler’s method to solve the equation dy ot. toy subject to the condition x = 0, y = 1 and tabulate the solution for x = 0 (0.1) (0.5) 2 yO = Ly OW = 1A, yO2) = 1211, y OS = 1 3361, y (0.4) = 1.4787, y (0.5) = 1.64257. Use modified Euler’s method to solve the above problem and find y at x = 0.1, 0.2 and 0.3. - y (0.1) = 1.1058, ¥ (0.2) = 1.2245, y (0.3) = 1.3606 Solve by Runge-Kutta method of ath oder dy -x Se TE 0G od to find the value of y at x = 0.2 taking h = 0.2. . 1.16787 Solve the problem of above exercise to find y at x = 0.4 taking h + 0.2. ss 1.2925. role sahystty to = 3 [01891 + 2 (0-1795) + 2 (0-1793) + 0-1688] = 0-1792 Hence y (0-4) =y; +k = 1-196 + 0-1792 = 13752. Example 31-18. Apply Runge-Kutta method to find an approximate value of y for x =02in steps of 0-1, if dy/dx = x+y’, given that y = 1, where x =0. (V.7.U,, 2006 ; Osmania, 2002 ; Madras, 2000) Sol. Here we take i = 0-1 and carry out the calculations in two steps. Step I. x9=0,y9=1,h=01 é ky = Af (€o,¥0) = 01 F 0, 1) =0:1000 si hey = hf (eo + 3h, yo + HED = O1F (008, 11) =0-1152 kg =hf (0+ 3h, 90 +H) =0-1F (005, 11-1152) =0-1168 eg = hf (eo + hy Yo + hg) =0-1f 0-1, 11168) = 01847 f= Mhy + Dhg + 2ky + ha) -= 10-1000 + 02304 + 0:2336 + 0-1347) =0-1165 giving (0-1) = + 8 = 1-1165. StepIL. xy =29+h=0-1,y,=1-1165,h=01 ‘ ky =hf @yy)=0-1f 01, 11165) =0-1347 he = hf (a1 + 3h, 1 + $e) = 01 f (0-15, 1.1838) =0-1551 hg =hf 1 +h, 91 + Yea) = 0-1 f (0-15, 1-194) =0-1576 y= hf Ge +h, yo + hg) = 0-1 f (0-2, 1:1576) = 0-1823 b ha Nby +2hy + Bhgt hy) =0-1571 Hence (0-2) =91 + & = 12736. 1. Use Runge’s method to approximate y when x=14, given that y=12 when x=1 and dy/dz=324y7, Give taal ae Y= 2ay/y?+s)andy=1 atz=0; find fe = 01, 02,08, 04nd OF 00 a Using Runge-Kutta ‘method of order 4, compute y(2) and (4) from seater, (0)= 1, 18 heOL Rofak, 209; Bhopal 2? 4. Use Runge-Kutta method to find y when x = 1-2 in steps of 0-1, given that > dy/dx=2? +? and y(1)=15 5. Using Runge-Kutta method of order 4, find 0.2 fr th equation = ate. 1O= 1 Take =0% wr. _ |

You might also like