FDM: Appromato of Frst Order Dervatves Lecture APPROXIMATION OF FIRST ORDER DERIVATIVES. INTRODUCTION Covectve term coservato equatos volve frst order dervatves. The smplest possble approach for dscretzato of these terms would be to use the appromato based o the basc defto of the dervatve. I ths lecture, we lear systematc procedures to obta FD appromatos based o Taylor seres epaso ad polyomal fttg for a geerc fucto f() of a geerc varable.. TAYLOR SERIES EXPANSION A cotuously dfferetable fucto f() ca be epaded Taylor seres about as f f f f f... H (.)!! I seres epaso, symbol H has bee used to deote the hgher order terms whch have ot bee dcated eplctly. Thus, fucto values at grd pots ad ca be epressed as f f f f f H (.)! f f f f f H (.)! Rearragemet of Eq. (.) yelds f f f f H (.4) whch gves us forward dfferece scheme (FDS) formally epressed as f f f O (.5) where. Smlarly, Eq. (.) yelds the backward dfferece scheme (BDS) gve by f f f O (.6) where. Subtractg Eq. (.) from Eq.(.), we obta the cetral dfferece scheme (CDS) gve by the formula Dr K M Sgh, Ida Isttute of Techology Roorkee NPTEL.
FDM: Appromato of Frst Order Dervatves f f f f H (.7) Thus, fte dfferece appromatos based o Taylor seres epaso are: f f f FDS:, Trucato Error ~ O f f f BDS:, Trucato Error ~ O f f f CDS:, Trucato Error ~ O f f f, Trucato Error ~ O o o-uform mesh o uform grd Note that the trucato error of the frst order FDS or BDS s gve by f (.8) The trucato error of the CDS s gve by f f H CDS (.9) 6 Thus, although the trucato error for CDS s formally of the same order as FDS or BDS, the magtude of the trucato error for CDS s much smaller tha FDS/BDS. I fact, o grd refemet, the covergece of CDS becomes secod order asymptotcally (Ferzger ad Perc, 00). Further, let us substtute the value of secod order dervatve from Eq. (.) to Eq. (.4). O rearragemet, we get f f ( ) f ( ) f ( ) ( ) H f 6 (.0) whch has secod order accuracy o ay grd (uform or o-uform). It reduces to the smpler form of CDS o uform grds. A geeral procedure o uform grds Let us defe the dfferece appromato as (Chug, 00) f af bf cfdf ef... (.) Coeffcets a, b, c, d, e,. ca be determed from Taylor seres epaso for the fucto values volved at the RHS aroud pot. We llustrate ts use the followg eample. Dr K M Sgh, Ida Isttute of Techology Roorkee NPTEL.
FDM: Appromato of Frst Order Dervatves Eample. Derve a three pot backward dfferece formula o uform grd usg geeral procedure gve by equato (.). Soluto For three pot backward dfferece formula, Eq. (.) takes the followg form: f af bf cf () Taylor seres epasos for f ad f are f f f f f... 6 ( ) f f f f f... 6 Hece, af bf a b c cf f f f bc b4c f b8 c... 6 Equatos () ad (v) dcate that the followg three codtos must be satsfed: abc 0 (v) bc (v) b4c 0 (v) Solvg Eqs. (v)-(v), we get a /, b, c / (v) The trucato error (TE) s gve by () () (v) f f b8c 6 () Therefore, the desred three-pot backward dfferece formula s f f 4f f, TE ~ O () Smlarly, we ca derve a three-pot forward dfferece formula whch s gve by f f 4f f, TE ~ O () Dr K M Sgh, Ida Isttute of Techology Roorkee NPTEL.
FDM: Appromato of Frst Order Dervatves. POLYNOMIAL FITTING A geerc fucto f() ca be appromated by a polyomal as or f a a a a 0... (.) 0... f a a a a (.) Coeffcets a 0, a, a,.., a are determed by fttg the terpolato curve to fucto values at approprate umber of pots. The secod form gve by Eq. (.) s usually preferred as t drectly provdes the epresso for dervatves at pot,.e.,, 6,... f f f a a a (.4) The order of appromato of the resultg fte dfferece appromato ca obtaed usg Taylor seres epaso. The followg eample llustrates the use of polyomal fttg for dervato of fte dfferece appromato for the frst order dervatve. Eample. Derve a three pot cetral dfferece formula o o-uform grd usg polyomal fttg at pots, ad. Soluto We ca ft the followg quadratc curve through three pots, ad : f a a a () 0 The frst order dervatve at pot s a. To obta the value of a, we ft the terpolato curve () to the fucto values at pots, ad, whch results the followg set of lear equatos: f 0 a () f f a a () f f a a (v) Multply Eq. (v) by ad subtract t from Eq. () to obta a f f f (v) Rearragemet of the precedg equato gves value of coeffcet a, ad thereby a appromato for the frst order dervatve gve by f f f f a (v) Dr K M Sgh, Ida Isttute of Techology Roorkee NPTEL.4
FDM: Appromato of Frst Order Dervatves The precedg formula s detcal to that gve by Eq. (.0) derved earler usg Taylor seres epaso. Further, o a uform grd,, Eq. (v) (or Eq. (.0)) reduces to the stadard CDS formula f f f (v) as epected. Let us ote that other polyomals, sples or shape fuctos ca be used to appromate the fucto, ad thereby obta a appromate formula for the dervatve. Usg the procedure outled above, we ca obta hgher order appromatos. For eample, by fttg a cubc polyomal to four pots, the followg thrd order appromatos ca be obtaed o a uform grd (Ferzger ad Perc, 00): f f f 6f f 6 (( ) ) O (.5) f f 6f f f O(( ) ) 6 (.6) The precedg appromatos are thrd order BDS ad thrd order FDS respectvely. These schemes are very useful covectve trasport problem where these are referred as upwd dfferece schemes (UDS). I geeral, appromato of the frst dervatve obtaed usg polyomal fttg has the trucato error of the same order as the degree of polyomal (Ferzger ad Perc, 00). REFERENCES Chug, T. J. (00). Computatoal Flud Dyamcs. d Ed., Cambrdge Uversty Press, Cambrdge, UK. Ferzger, J. H. Ad Perć, M. (00). Computatoal Methods for Flud Dyamcs. Sprger. Dr K M Sgh, Ida Isttute of Techology Roorkee NPTEL.5