grd ponts x = mesh sze = X NÜÆ Fnte dfference method Prncple: dervatves n the partal dfferental eqaton are approxmated by lnear combnatons of fncton vales at the grd ponts 1D: Ω = (0, X), (x ), = 0,1,..., N Frst-order dervatves ½ ¼ Ü Ü¼ ܽ ( x) = lm 0 = lm 0 ( x + ) ( x) Ü Ü ½ = lm ( x + ) ( x ) 0 ½ ( x) ( x ) ÜÆ (by defnton)
Geometrc nterpretaton Approxmaton of frst-order dervatves ( ) +1 ( ) 1 ( ) +1 1 forward dfference backward dfference central dfference Ù Taylor seres expanson ÒØÖ Ð ÓÖÛ Ö Û Ö Ü Ü ½ Ü Ü Ü ½ T 1 : T : +1 = + 1 = (x) = ( ) ) Ü Ø Ü ( n=0 (x x ) n n! + () + () ( n n ), C ([0, X]) + ()3 6 ()3 6 ( 3 ) 3 ( 3 ) 3 +... +...
Analyss of trncaton errors Accracy of fnte dfference approxmatons T 1 T T 1 T ( ) ( ) ( ) = +1 forward dfference = 1 + () 6 ( 3 ) 3 trncaton error O() ( () 3 ) 6 3 backward dfference trncaton error O() = ( +1 1 () 3 ) 6 3 +... central dfference trncaton error O() +... +... Leadng trncaton error ǫ τ = α m () m + α m+1 () m+1 +... α m () m
Central dfference scheme Approxmaton of second-order dervatves T 1 + T Alternatve dervaton = [ ( )] = +1 + 1 () + O() = lm 0 ( ) +1/ ( ) 1/ +1 1 = +1 + 1 () Varable coeffcents ( ) f f(x) = d(x) f +1/ f 1/ dffsve flx = d +1/ +1 d 1 1/ = d +1/ +1 (d +1/ + d 1/ ) + d 1/ 1 ()
Ü Approxmaton of mxed dervatves D: = «,j «+1,j «1,j = ( ) +1,j = ( ) = +1,j+1 +1,j 1 y = 1,j+1 1,j 1 y 1,j + O() + O( y) + O( y) Ü ½ Ý ½ Ý ½ Ý Ü ½ Ü Second-order dfference approxmaton = +1,j+1 +1,j 1 1,j+1 + 1,j 1 4 y,j + O[(),( y) ]
ܽ ܾ Polynomal fttng ܼ (x) = 0 + x One-sded fnte dfferences ( ) 0 = 1 0 + O() forward dfference backward/central dfference approxmatons wold need 1 whch s not avalable ( ) 0 (x) a + bx + cx, + x 0 + x3 6 b + cx, ( 3 ) 3 +... 0 ( ) b approxmate by a polynomal and dfferentate t to obtan the dervatves 0 0 = a 1 = a + b + c = a + b + 4c c = 1 0 b b = 3 0 + 4 1
One-sded approxmaton ( ) +1 = + ( ) + = + α +β +1 +γ + Analyss of the trncaton error = α+β+γ ( ) + () + () α + β +1 + γ + + ()3 6 + ()3 6 ( 3 ) 3 + (β + γ) ( ) ( + (β + 4γ) ( 3 ) 3 +... +... ) + O( ) Second-order accrate f α + β + γ = 0, β + γ = 1, β + 4γ = 0 α = 3, β =, γ = 1 ( ) = 3 +4 +1 + + O( )
One-sded approxmaton Applcaton to second-order dervatves ( ) +1 = + ( ) + = + α +β +1 +γ + = α+β+γ + () + () + β+γ α + β +1 + γ + + ()3 6 ( ) + β+4γ + ()3 6 ( 3 ) 3 ( 3 ) 3 +... ( ) + O() +... Frst-order accrate f α + β + γ = 0, β + γ = 0, β + 4γ = α = 1, β =, γ = 1 ( ) = +1 + + + O()
( ) ( ) ( ) Hgh-order approxmatons = +1 + 3 6 1 + 6 = + + 6 +1 3 1 6 = + + 8 +1 8 1 + 1 + O() 3 backward dfference + O() 3 forward dfference + O() 4 central dfference = + + 16 +1 30 + 16 1 1() + O() 4 central dfference Pros and cons of hgh-order dfference schemes more grd ponts, fll-n, consderable overhead cost hgh resolton, reasonable accracy on coarse grds Crteron: total comptatonal cost to acheve a prescrbed accracy
Bondary vale problem Example: 1D Posson eqaton = f n Ω = (0,1), (0) = (1) = 0 One-dmensonal mesh ½ (x ), f = f(x ) x =, = 1 N, = 0,1,..., N ܼ Ü ½ ¼ Central dfference approxmaton O() ܽ Ü ½ Ü ÜÆ ½ 1 ÜÆ + +1 () = f, = 1,..., N 1 0 = N = 0 Drchlet bondary condtons Reslt: the orgnal PDE s replaced by a lnear system for nodal vales
Example: 1D Posson eqaton Lnear system for the central dfference scheme = 1 0 1 + () = f 1 = 1 + 3 () = f = 3 3 + 4 () = f 3 = N 1... N N 1 + N () = f N 1 Matrx form A = F A R N 1 N 1, F R N 1 A = 1 () 1 1 1 1 1..., = 1 1 3 N 1, F = f 1 f f 3 f N 1 The matrx A s trdagonal and symmetrc postve defnte nvertble.
Other types of bondary condtons Drchlet-Nemann BC (0) = (1) = 0 0 = 0, N+1 N 1 = 0 N+1 = N 1 central dfference Extra eqaton for the last node N 1 N + N+1 () = f N N 1 + N () = 1 f N Extended lnear system A = F A R N N, F R N A = 1 () 1 1 1 1 1... 1 1 1 1, = 1 3 N 1 N, F = The matrx A remans trdagonal and symmetrc postve defnte. f 1 f f 3 f N 1 1 f N
Other types of bondary condtons Non-homogeneos Drchlet BC (0) = g 0 only F changes 0 = g 0 1 () = f 1 + g 0 () frst eqaton Non-homogeneos Nemann BC (1) = g 1 only F changes N+1 N 1 = g 1 N+1 = N 1 + g 1 N 1 N + N+1 () = f N N 1 + N () = 1 f N + g 1 Non-homogeneos Robn BC (1) + α(1) = g A and F change N+1 N 1 + α N = g N+1 = N 1 α N + g N 1 N + N+1 () = f N N 1 + (1 + α) N () = 1 f N + g
Unform mesh: = y = h, N = 1 h Ü ½ Ú ¹ÔÓ ÒØ Ø Ò Ð Ü Example: D Posson eqaton Bondary vale problem = f n Ω = (0,1) (0,1) = 0 on Γ = Ω Ý ½ Ý ½ Ý ½ ½ Ü ½ ¼ Ü,j (x, y j ), f,j = f(x, y j ), (x, y j ) = (h, jh),, j = 0,1,..., N Central dfference approxmaton O(h ) 1,j+,j 1 4,j + +1,j +,j+1 h = f,j,, j = 1,..., N 1,0 =,N = 0,j = N,j = 0, j = 0,1,..., N
Example: D Posson eqaton Lnear system A = F A R (N 1) (N 1), F R (N 1) row-by-row node nmberng A = I = B I I B I...... I 1 1 = [ 1,1... N 1,1 1,... N 1, 1,3... N 1,N 1 ] T F = [f 1,1... f N 1,1 f 1,... f N 1, f 1,3... f N 1,N 1 ] T 1 1 B I I B, B = 4 1 1 4 1...... 1 4 1 1 4 The matrx A s sparse, block-trdagonal (for the above nmberng) and SPD. cond (A) = λ max λ mn = O(h ) Caton: convergence of teratve solvers deterorates as the mesh s refned
Treatment of complex geometres D Posson eqaton = f = g 0 n Ω on Γ Q Ω Γ 4 Γ δ R h 0 3 Q Ω Dfference eqaton 1 + 4 0 + 3 + 4 h = f 0 crvlnear bondary P 1 stencl of Q Lnear nterpolaton (R) = 4(h δ) + 0 δ δ = g 0 (R) 4 = 0 h h δ + g h 0(R) h δ ( ) Sbsttton yelds 1 + 4 + δ h δ 0 + 3 = h f 0 + g 0 (R) h h δ Nemann and Robn BC are even more dffclt to mplement
Ö ØÑ ÔÔ Ò ÒÓÞÞÐ Ö Ø Ò Ð ÓÑÔÙØ Ø ÓÒ Ð ÓÑ Ò Grd transformatons Prpose: to provde a smple treatment of crvlnear bondares È Ý The orgnal PDE mst be rewrtten n terms of (ξ, η) nstead of (x, y) and dscretzed n the comptatonal doman rather than the physcal one. Ô Ý Ð ÓÑ Ò Ü Dervatve transformatons Ó Ý¹ ØØ Ö,,... } {{ } dffclt to compte ÖØ Ò Ö,,... } {{ } easy to compte ÒÚ Ö Ñ ÔÔ Ò È
PDE transformatons for a drect mappng Drect mappng ξ = ξ(x, y), η = η(x, y) Chan rle = = = +, ξ + η + ξ + η + Example: D Posson eqaton = f trns nto [ ( ) + ( ) ] [ ] ξ + ξ [ ( ) + [ ] η + η = + ( ) ( + + ( ) ( + + ( ) ] = f ) ) [ + transformed eqatons contan many more terms The metrcs need to be determned (approxmated by fnte dfferences) ]
PDE transformatons for an nverse mappng Inverse mappng x = x(ξ, η) y = y(ξ, η) Metrcs transformatons Chan rle where J = (x,y) (ξ,η) = + = +,,, } {{ } nknown =,,, } {{ } known } {{ } J s the Jacoban whch can be nverted sng Cramer s rle Dervatve transformatons = 1 [ detj ], = 1 det J [ ]
Drect verss nverse mappng Total dfferentals for both coordnate systems ξ = ξ(x, y) η = η(x, y) x = x(ξ, η) y = y(ξ, η) dξ = dx + dy dη = dx + dy dx = dξ + dη dy = dξ + dη = 1 dξ dη dx dy = = 1 detj = dx dy dξ dη Relatonshp between the drect and nverse metrcs = 1 det J, = 1 detj, = 1 detj, = 1 det J