Showing posts with label Finite Difference. Show all posts
Showing posts with label Finite Difference. Show all posts

Monday, February 16, 2015

Taylor’s series expansion and the Finite Difference Method


Perhaps the easiest interpretation for a Finite Difference formulation of numerical integration comes from the Taylor’s series expansion. Given a continuous function f(x), the discretized locations on the curve of f(x) that are separated by a distance ‘h’ can be expanded as a Taylor’s series. If the  are  and  , the function at i+1 can be represented in terms of the value at i. Mathematically
 


Stated in simpler terms, the first order Taylor’s series expansion is a literal translation of the definition of the first derivative of a continuous function f(x). Having stated thusly, the expansion can be pursued on both the forward and backward directions. That is, the expansion at a location can also be defined. Such an expansion thus becomes




Rearranging the above two equations in an ODE format, one arrives at the Forward and Backward Finite Difference formulations. By eliminating from the above equations (by simply subtracting one from the other), the Central Difference formulation can be derived.

But what if the higher order terms are put to practical use with the Taylor’s expansion series? Inclusion of higher order terms results in

 
and
 
                 
By ignoring the triple-differential term and adding the above equations, a formulation can be derived for the 2nd derivative, which turns out to be


To state the obvious, a Finite Difference formulation for a 2nd order differential has been derived starting from the Taylor’s expansion series.

Saturday, July 26, 2014

MOL vs Finite Difference



During a recent hallway conversation with my esteemed colleague Dr. Grigoriev, we were discussing the Method of Lines and he had posed the question of why it was referred to as the MOL and not the Finite Difference method.

Numerical solution of any differential equation (ordinary or partial) requires marching one step at a time, given the initial conditions at time t=0. The basic principle behind this marching goes back to the fundamental principle of the limit of a function. Given a function f(x), the derivative of the function can be represented as
 



The smaller the value of h, the more accurate is the derivative function. This principle of the limit, represented typically as the Taylor’s series expansion, is the “discretized” version of the ODE. Of course, “discretization” is a misnomer for an ODE since there is only one independent variable.

In the case of PDE’s, there exists the spatial dependence in addition to a time variable. The discretization thus has to be performed in both the spatial and the time domains. Once discretized separately as time and spatial domains, the independent variable becomes just one. The PDE has thus been converted into an ODE. This process of “replacement of the spatial derivatives with ODE’s” is referred to as the Method of Lines (ref: Hamdi et al).

So, how does one achieve this conversion from PDE to ODE? That is where the finite difference method comes in handy. The finite difference is thus the tool that discretizes the spatial domain, while the process of performing this change is the MOL.

Stated yet another way, the finite difference method is used to convert the 2nd order partial equation by using the following equality,  
 
followed by the Method of Lines, which uses this knowledge to replace the spatial derivatives with the ODE’s, i.e.,