Numerical Methods. Marisa Villano, Tom Fagan, Dave Fairburn, Chris Savino, David Goldberg, Daniel Rave. An Overview. The Method of Finite Differences Error Approximations and Dangers Approxmations to Diffusions Crank Nicholson Scheme Stability Criterion. Finite Differences.
Marisa Villano, Tom Fagan,
Dave Fairburn, Chris Savino,
David Goldberg, Daniel Rave
Best known numerical method of approximation
+ 1/6 u˝΄(x)(Δx) + O(Δx)
- 1/6 u˝΄(x)(Δx) + O(Δx)
u΄(x) = u(x) – u(x – Δx) + O(Δx)
u΄(x) = u(x + Δx) – u(x) + O(Δx)
u΄(x) = u(x + Δx) – u(x – Δx) + O(Δx)
u˝(x) = u(x + Δx) – 2u(x) + u(x – Δx) + O(Δx)
u(jΔx, nΔt) ~ uj
(jΔx, nΔt)~ (uj– uj ) / Δt
(jΔx, nΔt)~ (uj– uj ) / Δx
(jΔx, nΔt)~ (uj – uj ) / Δt
(jΔx, nΔt)~ (uj – uj ) / Δx
(jΔx, nΔt)~ (uj – uj ) / (2Δt)
(jΔx, nΔt)~ (uj – uj ) / (2Δx)
Evidence from an example in 8.1
Error: The local truncation error is O(
from the left hand side and is O(
the right hand side.
ujn+1 = unj+1 - unj + unj-1
h(x) = 0 for all j except for j = 5, so
hj = 0 0 0 0 1 0 0 0 0 0 0 ….
Neumann Boundary Conditions and the Crank-Nicolson Scheme
can solve scheme
is always true
Approximations of the diffusion equation, ut=uxx
The method of finite differences gives an answer, but it does not guarantee that this answer is meaningful.
Values must be chosen appropriately, to ensure that the results make sense and are applicable to real world scenarios.
This condition, that values must satisfy in order to be worthwhile, is called the “stability criterion.”
As per the book, take, for instance, the diffusion problem:
As can be easily shown, the graph of φ(x) looks like this.
In attempting to use the method of finite differences, we are using a forward difference for utand a centered difference for uxx.
This means that
It is important to note here that the superscript n denotes a counter on the t variable, and the subscript j denotes a counter on the x variable.
In order to make the calculations a bit cleaner, we are introducing a variable, s, which is defined by
Rearranging, we have
It would be nice if we could just plug in values and get a valid result…
However, putting in different values can lead to the results being close to, or far from, that actual answer.
For instance, letting ∆x=π/20, and letting s=5/11, we get a relatively nice result. Letting s=5/9 does not get such a nice result.
So what, of significance, changes?
As it turns out, changing the value of s can significantly change the validity of the solution. To see why, we return to our equation.
Since the left hand side is a function of T and the right hand side is a function of X, they must be equal to a constant.
This is a discrete version of an ODE, which when solved gives
Thus, to achieve stability, . This is why setting s=5/9 didn’t give a valid result.
It is to be noted that usually the necessary criterion is that , but that in this case it was irrelevant.
So the stability criterion must be worked out before one can effectively use the method of finite differences.
Example from 8.2