Ordinry Differentil Equtions- Boundry Vlue Problem Shooting method Runge Kutt method Computer-bsed solutions o BVPFD subroutine (Fortrn IMSL subroutine tht Solves (prmeterized) system of differentil equtions with boundry conditions t two points, using vrible order, vrible step size finite difference method with deferred corrections) o MALAB solution of boundry vlue problems for ordinry differentil equtions (bvp4c ) Differentil Equtions Ordinry Differentil Equtions d dt v 6 tv involve one or more Ordinry derivtives of unknown functions Differentil Equtions Prtil Differentil Equtions u u y x involve one or more prtil derivtives of unknown functions King Sud University ١ King Sud University ٢ Auxiliry conditions Initil Conditions ll conditions re t one point of the independent vrible uxiliry conditions Boundry Conditions he conditions re not t one point of the independent vrible Initil vlue nd Boundry-Vlue Problems Initil-Vlue Problems he uxiliry conditions re t one point of the independent vrible x x x e t x(), x ().5 Boundry-Vlue Problems he uxiliry conditions re not t one point of the independent vrible More difficult to solve thn initil vlue problem t x x x e x ( ), x ( ).5 sme different King Sud University ٣ King Sud University ٤
Clssifiction of ODE Clssifiction of the Methods ODE cn be clssified in different wys Order First order ODE Second order ODE N th order ODE Linerity Liner ODE Nonliner ODE Auxiliry conditions Initil vlue problems Boundry vlue problems Single-Step Methods Estimtes of the solution t prticulr step re entirely bsed on informtion on the previous step Numericl Methods for solving ODE Multiple-Step Methods Estimtes of the solution t prticulr step re bsed on informtion on more thn one step Euler, Runge-Kutt: single step methods & Adm-Moulton method: multi-step method King Sud University ٥ King Sud University ٦ Conversion of High Order ODE s to System of First Order ODE s A rod is being heded t its two ends nd the rod is exposed to the outside temperture. Conversion of High Order ODE s to System of First Order ODE s At the stedy stte, the temperture of the rod is given by the differentil eqution h ( ) Here, h is the het trnsfer coefficient. he boundry conditions re: (x ) n(x L) Wht is the stedy stte temperture for < x < L? King Sud University ٧ King Sud University ٨
Conversion of High Order ODE s to System of First Order ODE s he nlyticl solution of h ( ) For m rod with, () 4, () nd h.. is s follows e e.x.x 7.45 5.45 Conversion of High Order ODE s to System of First Order ODE s o be ble to solve this second order ODE, we hve to convert it into system of first order ODE s. Define z s hen, dz d z h( ) he system becomes d z dz h ( ) o solve the system, the initil vlue for z (i.e. z ) is needed! King Sud University ٩ King Sud University ١٠ Conversion of High Order ODE s to System of First Order ODE s Higher order ODE s cn be solved by converting them to system of first order ODE s. he conversion works by introducing new vribles. For the following second order ODE: with the initil vlues s y y.5 d y dy y sin x Introduce new vrible z s dy z Conversion of High Order ODE s to System of First Order ODE s d y dy y sin Introduce new vrible z which is defined s z From the definition of z, dz d y Now we cn write the following system he initil conditions now re y nd z.5. x dy dz z y sin x dy z King Sud University ١١ King Sud University ١٢
he finite divided difference pproximtion for the nd derivtive cn be substituted into the governing eqution, e.g consider the temperture distribution in the rod i i i ( ) h i i i h ( ) Collect terms i i h ( ) h x h ( ) i i i We cn now pply this eqution to ech interior node on the rod. Divide the rod into grid, nd consider node to be t ech division. i.e.. x m x m L m King Sud University ١٣ King Sud University ١٤ ( h ) i i h ( h ) i i h () x m L m () () x 4 6 8 i 4 5 () Consider the previous problem: L m () 4 () h. We need to solve for the temperture t the interior nodes (4 unknowns). Apply the governing eqution t these nodes (4 equtions). Wht is the mtrix? Notice the lbeling for numbering nd i King Sud University ١٥ King Sud University ١٦
( h ) i i h () x 4 6 8 i 4 5 () ( h ) i i h () x 4 6 8 i 4 5 () 4 Note lso tht the dependent vlues re known t the boundries (hence the term boundry vlue problem) 4 Apply the governing eqution t node ( h x ) h x 4 (.4 ).8.4 4.8 King Sud University ١٧ King Sud University ١٨ ( h ) i i h () x 4 6 8 i 4 5 () ( h ) i i h () x 4 6 8 i 4 5 () Apply the eqution t node 4 ( h ).4.8 h We get similr eqution t node 4 ( h ).4 4 4.8 h King Sud University ١٩ King Sud University ٢٠
( h ) i i h () x 4 6 8 i 4 5 At node 4, we consider the boundry t the right. ( h ).4 4.4 4 4.8.8 5 h () 4 For the four interior nodes, we get the following 4 x 4 mtrix.4 he solution is: ().4.4 4.8.8.8.4 4.8 { } [ 65.97 9.78 4.54 59.48] 4 4 i 4 5 () King Sud University ٢١ King Sud University ٢٢ Mtlb exmple Exmple.. Solve the nonliner boundry vlue problem d y dy ( x y ) 8 for <x<, where y()7 nd y()4/ Crete the function f s seprte m-file nd sve it in the current working directory. function f f(x,y,yp) f (/8)*(*x^-y*yp); %Note tht ypy In the commnd window type >> Y nonlinerbvp_fdm(,,7,4/); Note tht Y(:,) represents x nd Y(:,) is vector y(x) >> yexct (Y(:,)).^6./Y(:,); plot(y(:,),yexct,c) Mtlb exmple d y dy rnge <x<, ( x y ) 8 B.C. y()7 nd y()4/. 7..5 6.446579659. 5.7557547697.5 5.5874949..85.7646668.9.9796757555.95 4.6484948. 4. Exct solution 6 y ( x ) x x 7 6 5 4 Numericl Solution y() lph y(b) bet..4.6.8..4.6.8 King Sud University ٢٣ King Sud University ٢٤
Solution of Boundry-Vlue Problems Shooting method Shooting method for Boundry-Vlue Problems. Guess vlues for the uxiliry conditions t one point of time.. Solve the initil vlue problem using Euler,Runge-Kutt,. Check if the boundry conditions is stisfied otherwise modify the guess nd resolve the problem. Use interpoltion in updting the guess. It is n itertive procedure nd cn be efficient in solving the BVP King Sud University ٢٥ King Sud University ٢٦ Solution of Boundry-Vlue Problems - Shooting method Shooting method - Exmple Boundry-Vlue Problem convert Initil-vlue problem ẏ 4y 4x y(), y() Originl BVP Find y ( x ) to solve BVP y y y x y ( )., y ().8. Convert the ODE to system of first order ODE. guess the initil conditions tht re not vilble.. Solve the Initil-vlue problem 4. Check if the known boundry conditions re stisfied 5. If needed modify the guess nd resolve the problem gin x King Sud University ٢٧ King Sud University ٢٨
Shooting method - Exmple Shooting method - Exmple ẏ 4y 4x y(), y() Originl BVP ẏ 4y 4x y(), y() Originl BVP.. to be determined x x King Sud University ٢٩ King Sud University ٣٠ Shooting method - Exmple Step: convert to systems of first order ODE y 4y 4x y(), y() Convert to system of y y, y 4(y ) x first order Equtions y() y()?. dy y y, y y. d y y 4( y x ) Shooting method - Exmple Guess # he problem will be solved using RK with h for different vlues of y () until we hve y(). King Sud University ٣١ King Sud University ٣٢
Shooting method - Exmple Guess # Shooting method - Exmple Interpoltion for Guess # King Sud University ٣٣ King Sud University ٣٤ Shooting method - Exmple Interpoltion for Guess # Shooting method - Exmple Guess # Guess.574 King Sud University ٣٥ King Sud University ٣٦
Shooting method Exmple - Given: h ( ) d z dz h ( ) We need n initil vlue of z. For the shooting method, guess n initil vlue. Guessing z() Shooting method Exmple - dz ( ) h Using fourth-order RK method with step size of, () 68.8 his differs from the BC () Mking nother guess, z() () 85.9 Guessing z() Becuse the originl ODE is liner, the estimtes of z() re linerly relted. King Sud University ٣٧ King Sud University ٣٨ Shooting method Exmple - Using liner interpoltion formul between the vlues of z(), determine new vlue of z() Recll: first estimte z() () 68.8 second estimte z() () 85.9 Wht is z() tht would give us ()? Shooting method Exmple - z( ) ( 68. 8). 69 85. 9 68. 8 () 5 5 5 5 5 z() () 5 5 5 5 5 z() We cn now use this to solve the first order ODE h ( ) d z dz h ( ) King Sud University ٣٩ King Sud University ٤٠
5 5 5 A n ly tic l Solu t ion Sh ootin g Meth od 5 distnce (m ) 5 5 5 A n ly ticl Solu tion Sh ooting Met h od Finite Differ ence 5 distnce (m ) Summry of Shooting method. Guess the unvilble vlues for the uxiliry conditions t one point of independent vrible.. Solve the initil vlue problem. Check if the boundry conditions is stisfied otherwise modify the guess nd resolve the problem. 4. Repet () until the boundry conditions re stisfied For nonliner boundry vlue problems, liner interpoltion will not necessrily result in n ccurte estimtion. One lterntive is to pply three pplictions of the shooting method nd use qudrtic interpoltion.. King Sud University ٤١ King Sud University ٤٢ Properties of Shooting method. Using interpoltion to updte the guess often results in few itertions before reching the solution. he method cn be cumbersome for high order BVP becuse of the need to guess the initil condition for more thn one vrible. Runge-Kutt Method Sme s discussed before King Sud University ٤٣ King Sud University ٤٤
Computer-bsed solutions Computer-bsed solutions o o BVPFD subroutine (Fortrn IMSL subroutine tht Solves (prmeterized) system of differentil equtions with boundry conditions t two points, using vrible order, vrible step size finite difference method with deferred corrections). MALAB solution of boundry vlue problems for ordinry differentil equtions (bvp4c ) See the IMSL document for detiled description of this subroutine See Exmple of using BVPFD subroutine King Sud University ٤٥ King Sud University ٤٦ Computer-bsed solutions Computer-bsed solutions o MALAB solution of boundry vlue problems for ordinry differentil equtions (bvp4c ) bvp4c - Solve boundry vlue problems for ordinry differentil equtions Syntx sol bvp4c(odefun,bcfun,solinit) sol bvp4c(odefun,bcfun,solinit,options) solinit bvpinit(x, yinit, prms) Arguments.. etc See: http://www.mthworks.com/ccess/helpdesk/help/techdoc/ref/bvp4c.html King Sud University ٤٧ King Sud University ٤٨
Computer-bsed solutions King Sud University ٤٩ King Sud University ٥٠