HOME
PDF

Finite difference approximation formulas

Nasser M. Abbasi

July 2, 2015 page compiled on July 2, 2015 at 1:06am

Contents

1 Approximation to first derivative
2 Approximation to second derivative

1 Approximation to first derivative

These formulas below approximate u′ at x = xj  where j  is the grid point number.

|--|-------------------------------------|-----------------------|------------|--------------------------------|
|  | formula                              |truncation             |Truncation  |common   name  and              |
|--|-------------------------------------|-----------------------|------------|--------------------------------|
|--|-------------------------------------|error------------------|error order-|common---notation---------------|
|  |  ′   1                              |   ′′h    (3)h2         |            |                                |
|1-|-uj ≈-h (uj+1-−-uj)------------------|−-uj2-−-uj-23! −-⋅⋅⋅---|O-(h)-------|one-point-forward-D+------------|
|2 | u′j ≈ 1h (uj − uj− 1)                  |u′j′ h2 − u(j3)h3! + ⋅⋅⋅     |O (h)       |one point backward  D_          |
|--|--′---1------------------------------|---(3)h2----(6)h5-------|----2-------|-------------------------D++D_--|
|3-|-uj ≈-2h (uj+1-−-uj−1)---------------|−-uj--6-−-uj--6! −-⋅⋅⋅-|O-(h-)------|centered-difference, D0-=----2---|
|4 | u′≈  1(3-uj − 2uj+1 + 1uj+2)        |to do                  |O (h2)      |3 points forward difference      |
|--|--j---h--2-------------2-------------|-----------------------|------------|--------------------------------|
-5---u′j ≈-16 (2uj+1-+-3uj-−-6uj−-1 +-uj−-2)-to-do------------------O-(h3)----------------------------------------

For example, to obtain the third formula above, we start from Taylor series and write

uj+1 = uj + hu ′j + h2-u′j′+ h3u ′′j′+ ⋅⋅⋅
                   2!     3!

then we write it again for the previous point

                    2       3
uj−1 = uj − hu ′j + h-u′j′− h--u′′j′⋅⋅⋅
                   2!     3!

Notice the sign change in the expressions. We now subtract the second formula above from the above resulting in

                        3
                 ′    h-- ′′′
uj+1 − uj−1 = 2huj + 2 3!uj + ⋅⋅⋅

or

pict

2 Approximation to second derivative

These formulas below approximate u′′ at x = x
      j  where j  is the grid point number. For approximation to   ′′
u the accuracy of the approximation formula must be no less than 2  .

|--|-----------------------------|------------------------|------------|----------------------------|
|--|-formula----------------------|truncation--------------|Truncation--|common---name---------------|
|  |                             |error                   |error order |                            |
|--|-------1---------------------|------h2-------h4-------|------------|----------------------------|
-1---u′′j ≈-h2 (Uj-−1 −-2Uj-+-Uj+1)-−-u(4)12 −-u(6)360 −-⋅⋅⋅--O-(h2)-------3-points-centered-difference--

To obtain the third formula above, we start from Taylor series and write

                  h2      h3      h4
uj+1 = uj + hu′j + ---u′′j + --u ′′j′+ --u ′′j′′⋅⋅⋅
                   2!     3!      4!

Then we write it again for the previous point

                    2      3       4
uj−1 = uj − hu′j + h--u′′j − h-u ′′j′+ h--u′′j′′⋅⋅⋅
                   2!     3!      4!

Notice the sign change in the expressions. We now add the second formula above from the above resulting in

pict