Is there more than one Crank-Nicolson scheme?

  • Thread starter gjfelix2001
  • Start date
In summary: This is why they look different but will give the same results.Both schemes are named Crank-Nicolson, they just use different notation. This can be confusing, but it is important to understand that they are essentially the same method.
  • #1
gjfelix2001
19
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
  • #2
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.
 

1. What is the Crank-Nicolson scheme and how does it differ from other numerical schemes?

The Crank-Nicolson scheme is a numerical method used to solve partial differential equations (PDEs). It is a combination of the explicit and implicit schemes, making it a second-order accurate scheme. Unlike other numerical schemes, the Crank-Nicolson scheme is unconditionally stable, meaning that it can be used for a wide range of time steps without causing instability.

2. How does the Crank-Nicolson scheme handle non-linear PDEs?

The Crank-Nicolson scheme is also known as the trapezoidal rule because it takes the average of the explicit and implicit schemes. This averaging process also applies to the non-linear terms in the PDEs, making it a suitable method for solving non-linear PDEs. However, special care must be taken when implementing the scheme to ensure accuracy and stability.

3. Can the Crank-Nicolson scheme be applied to PDEs with variable coefficients?

Yes, the Crank-Nicolson scheme can be applied to PDEs with variable coefficients. In fact, it is particularly well-suited for solving PDEs with variable coefficients because it is a second-order accurate scheme. This means that it can capture changes in the coefficients more accurately than first-order schemes.

4. What are the advantages of using the Crank-Nicolson scheme?

One of the main advantages of the Crank-Nicolson scheme is its unconditional stability, which allows for a wider range of time steps to be used without causing instability. It is also a second-order accurate scheme, meaning that it can provide more accurate solutions compared to first-order schemes. Additionally, it can handle both linear and non-linear PDEs, making it a versatile method for solving a variety of problems.

5. Are there any limitations to using the Crank-Nicolson scheme?

While the Crank-Nicolson scheme has many advantages, it also has some limitations. One limitation is that it can be computationally expensive, especially for large systems of equations. Additionally, it may not be suitable for all types of PDEs, such as stiff or highly non-linear PDEs. In these cases, other numerical schemes may be more efficient or accurate.

Similar threads

  • Differential Equations
Replies
3
Views
1K
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
28
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
692
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
10
Views
1K
  • Differential Equations
Replies
8
Views
3K
  • Differential Equations
Replies
4
Views
2K
Replies
7
Views
240
  • Differential Equations
Replies
6
Views
2K
Back
Top