ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Finite difference method - Wikipedia, the free encyclopedia

Finite difference method

From Wikipedia, the free encyclopedia

In mathematics, more precisely in numerical analysis, finite differences play an important role: they are one of the simplest ways of approximating a differential operator, and are extensively used in solving differential equations.

The finite difference method relies on discretizing a function on a grid.
The finite difference method relies on discretizing a function on a grid.

For example, consider the ordinary differential equation

 u'(x) = 3u(x) + 2. \,

The Euler method for solving this equation uses the finite difference quotient

\frac{u(x+h) - u(x)}{h} \approx u'(x)

to approximate the differential equation by

 u(x+h) = u(x) + h(3u(x)+2). \,

The last equation is called a finite-difference equation. Solving this equation gives an approximate solution to the differential equation.

The error between the approximate solution and the true solution is determined by the error that is made by going from a differential operator to a difference operator. This error is called the discretization error or truncation error (the term truncation error reflects the fact that a difference operator can be viewed as a finite part of the infinite Taylor series of the differential operator).

Contents

[edit] Example: the heat equation

Consider the normalized heat equation in one dimension, with homogeneous Dirichlet boundary conditions

 U_t=U_{xx} \,
 U(0,t)=U(1,t)=0 \, (boundary condition)
 U(x,0) =U_0(x) \, (initial condition)

One way to numerically solve this equation is to approximate all the derivatives by finite differences. We partition the domain in space using a mesh x0,...,xJ and in time using a mesh t0,....,tN. We assume a uniform partition both in space and in time, so the difference between two consecutive space points will be h and between two consecutive time points will be k. The points

 u(x_j,t_n) = u_j^n

will represent the numerical approximation of U(xj,tn).

[edit] Explicit method

Using a forward difference at time tn and a second-order central difference for the space derivative at position xj ("FTCS") we get the recurrence equation:

 \frac{u_j^{n+1} - u_j^{n}}{k} =\frac{u_{j+1}^n - 2u_j^n + u_{j-1}^n}{h^2}. \,

This is an explicit method for solving the one-dimensional heat equation.

We can obtain  u_j^{n+1} from the other values this way:

 u_{j}^{n+1} = (1-2r)u_{j}^{n} + ru_{j-1}^{n} + ru_{j+1}^{n}

where r = k / h2.

So, knowing the values at time n you can obtain the corresponding ones at time n+1 using this recurrence relation.  u_0^n and  u_J^n must be replaced by the boundary conditions, in this example they are both 0.

This explicit method is known to be numerically stable and convergent whenever  r\le 1/2 . The numerical errors are proportional to the time step and the square of the space step:

 \Delta u = O(k)+O(h^2)  \,

[edit] Implicit method

If we use the backward difference at time tn + 1 and a second-order central difference for the space derivative at position xj ("BTCS") we get the recurrence equation:

 \frac{u_{j}^{n+1} - u_{j}^{n}}{k} =\frac{u_{j+1}^{n+1} - 2u_{j}^{n+1} + u_{j-1}^{n+1}}{h^2}. \,

This is an implicit method for solving the one-dimensional heat equation.

We can obtain  u_j^{n+1} from solving a system of linear equations:

 (1+2r)u_j^{n+1} - ru_{j-1}^{n+1} - ru_{j+1}^{n+1}= u_{j}^{n}

The scheme is always numerically stable and convergent but usually more numerically intensive than the explicit method as it requires solving a system of numerical equations on each time step. The errors are linear over the time step and quadratic over the space step.

[edit] Crank-Nicolson method

Finally if we use the central difference at time tn + 1 / 2 and a second-order central difference for the space derivative at position xj ("CTCS") we get the recurrence equation:

 \frac{u_j^{n+1} - u_j^{n}}{k} = \frac{1}{2} \left(\frac{u_{j+1}^{n+1} - 2u_j^{n+1} + u_{j-1}^{n+1}}{h^2}+\frac{u_{j+1}^{n} - 2u_j^{n} + u_{j-1}^{n}}{h^2}\right).\,

This formula is known as the Crank-Nicolson method.

The Crank-Nicolson stencil.
The Crank-Nicolson stencil.

We can obtain  u_j^{n+1} from solving a system of linear equations:

 (2+2r)u_j^{n+1} - ru_{j-1}^{n+1} - ru_{j+1}^{n+1}= (2-2r)u_j^n + ru_{j-1}^n + ru_{j+1}^n

The scheme is always numerically stable and convergent but usually more numerically intensive as it requires solving a system of numerical equations on each time step. The errors are quadratic over the time step and formally are of the fourth degree regarding the space step:

 \Delta u = O(k^2)+O(h^4).  \,

However, near the boundaries, the error is often O(h2) instead of O(h4).

Usually the Crank-Nicolson scheme is the most accurate scheme for small time steps. The explicit scheme is the least accurate and can be unstable, but is also the easiest to implement and the least numerically intensive. The implicit scheme works the best for large time steps.

[edit] See also

[edit] References

[edit] External links


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -