Is there more than one Crank-Nicolson scheme?

  • Thread starter Thread starter gjfelix2001
  • Start date Start date
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:\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

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

\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

i represents the space steps, j the time steps, k is \Delta t, h is \Delta x

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

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

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

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.
 
There is the following linear Volterra equation of the second kind $$ y(x)+\int_{0}^{x} K(x-s) y(s)\,{\rm d}s = 1 $$ with kernel $$ K(x-s) = 1 - 4 \sum_{n=1}^{\infty} \dfrac{1}{\lambda_n^2} e^{-\beta \lambda_n^2 (x-s)} $$ where $y(0)=1$, $\beta>0$ and $\lambda_n$ is the $n$-th positive root of the equation $J_0(x)=0$ (here $n$ is a natural number that numbers these positive roots in the order of increasing their values), $J_0(x)$ is the Bessel function of the first kind of zero order. I...
Are there any good visualization tutorials, written or video, that show graphically how separation of variables works? I particularly have the time-independent Schrodinger Equation in mind. There are hundreds of demonstrations out there which essentially distill to copies of one another. However I am trying to visualize in my mind how this process looks graphically - for example plotting t on one axis and x on the other for f(x,t). I have seen other good visual representations of...
Back
Top