One dimensional finite difference method