Is there more than one Crank-Nicolson scheme?

  • Context: Graduate 
  • Thread starter Thread starter gjfelix2001
  • Start date Start date
Click For Summary
SUMMARY

The discussion centers on the Crank-Nicolson scheme for solving the 1D diffusion equation, highlighting differences in the formulation presented in two texts: "Numerical Analysis" by Burden and Faires and "Numerical and Analytical Methods for Scientists and Engineers Using Mathematica." The first book uses the equation format \(\frac{w_{i,j+1}-w_{i,j}}{k}\) while the second employs \(\frac{w_{i,j}-w_{i,j-1}}{k}\). Both formulations are valid representations of the Crank-Nicolson method, differing only in the time-stepping approach, where one predicts future values while the other relies on past values.

PREREQUISITES
  • Understanding of the Crank-Nicolson method for numerical solutions
  • Familiarity with the diffusion equation in one dimension
  • Knowledge of finite difference methods
  • Basic proficiency in mathematical notation and manipulation
NEXT STEPS
  • Study the derivation of the Crank-Nicolson scheme in detail
  • Explore finite difference methods for solving partial differential equations
  • Investigate stability and convergence criteria for numerical methods
  • Learn how to implement the Crank-Nicolson scheme using software like Mathematica or MATLAB
USEFUL FOR

Mathematicians, numerical analysts, and engineers interested in solving diffusion equations and understanding numerical methods for partial differential equations.

gjfelix2001
Messages
17
Reaction score
0
Hi everybody...

I want to solve the diffusion equation in 1D using the Crank-Nicolson scheme. I have two books about numerical methods, and the problem is that in "Numerical Analysis" from Burden and Faires, the differences equation for the diffusion equations is:[itex]\frac{w_{i,j+1}-w_{i,j}}{k}-\frac{\alpha^2}{2h^2}\Big[w_{i+1,j}-2w_{i,j}+w_{i-1,j}+w_{i+1,j+1}-2w_{i,j+1}+w_{i-1,j+1}\Big]=0[/itex]

On the other hand, in "Numerical and analytical methods for scientists and engineers using mathematica", the same equation is expressed as:

[itex]\frac{w_{i,j}-w_{i,j-1}}{k}-\frac{\alpha^2}{2h^2}\Big[w_{i+1,j}-2w_{i,j}+w_{i-1,j}+w_{i+1,j-1}-2w_{i,j-1}+w_{i-1,j-1}\Big]=0[/itex]

[itex]i[/itex] represents the space steps, [itex]j[/itex] the time steps, [itex]k[/itex] is [itex]\Delta t[/itex], [itex]h[/itex] is [itex]\Delta x[/itex]

Should this schemes yield the same results? Why the differences?

I mean, in the first term of the first scheme, the numerator is [itex]w_{i,j+1}-w_{i,j}[/itex], but in the second scheme is [itex]w_{i,j}-w_{i,j-1}[/itex].

In addition to this, the last 3 terms of the equations (inside the brackets) are [itex]w_{i+1,j+1}-2w_{i,j+1}+w_{i-1,j+1}[/itex] and [itex]w_{i+1,j-1}-2w_{i,j-1}+w_{i-1,j-1}[/itex].

Are both schemes named Crank-Nicolson?

Can somebody help me with this?? Thanks!
 
Last edited:
Physics news on Phys.org
It is just a difference in notation.

If you replace j+1 by j and j by j-1 in the first equation, you get the second equation (but with the terms in the [ ] written in a different order).

The method described in the first book is going to solve for the j+1 terms using the j terms. The second book is going to solve for the j terms using the j-1 terms.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 28 ·
Replies
28
Views
3K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K