What's the Difference Between Crank-Nicolson and Heun's Method?

  • Context: Graduate 
  • Thread starter Thread starter Smed
  • Start date Start date
  • Tags Tags
    Method
Click For Summary
SUMMARY

The Crank-Nicolson method and Heun's method are both numerical techniques used for solving differential equations, but they differ fundamentally in their approach. Heun's method is an explicit method, improving upon the forward Euler's method, while Crank-Nicolson is an implicit method, often employed for partial differential equations (PDEs). Both methods average the current state and the next timestep, but Heun's uses a predictor step, whereas Crank-Nicolson operates implicitly. Despite similar results under certain conditions, their formulations yield different equations when applied to specific problems.

PREREQUISITES
  • Understanding of ordinary differential equations (ODEs)
  • Familiarity with partial differential equations (PDEs)
  • Knowledge of numerical methods for solving differential equations
  • Basic calculus and differential equation notation
NEXT STEPS
  • Study the derivation of the Crank-Nicolson method for PDEs
  • Explore the implementation of Heun's method in numerical simulations
  • Learn about stability and convergence of numerical methods
  • Investigate the differences between explicit and implicit methods in numerical analysis
USEFUL FOR

Mathematicians, engineers, and computer scientists involved in numerical analysis, particularly those working with differential equations and seeking to understand the distinctions between various numerical methods.

Smed
Messages
36
Reaction score
1
Hi, can someone tell me the difference between the Crank-Nicolson and Heun numerical methods? For Heun's method I'm looking here http://en.wikipedia.org/wiki/Heun's_method and for the Crank-Nicolson method I'm looking here http://en.wikipedia.org/wiki/Crank–Nicolson_method . When I actually carry out a calculation with equal timesteps for both methods and f(t,u)=-.5*u, I get the exact same solution.

The equation I have for both is:

u^{n+1} = u^{n} - \frac{1}{2}u^{n}dt - \frac{1}{8}u^{n}dt^{2}
 
Last edited by a moderator:
Physics news on Phys.org
I'm no expert, but from what I can gather Heun's method is for ODE's while Crank-Nicolson is for PDE's?
 
Heun's method is an improvement of the forward Euler's method which is an explicit method.
While Crank-Nicolson method is an implicit method. Probably the improvement for the backward Euler method. This is the Crank-Nicolson method for ODE.

But of course the Crank-Nicolson method is verypopular in PDE.
 
Ah, in all cases I've come across Crank-Nicolson, it has been to solve PDEs.

So, if I read my notes correctly, while both methods take an average of the current state and the state at the next timestep, the main difference between Heun's method and Crank-Nicolson is that for Heun's method you use a predictor for the next timestep, keeping it explicit, while for Crank-Nicolson it is used implicitly instead. At least that's my understanding.

Using this I get some different results from yours, both with Crank-Nicolson and Heun's method, are you sure you do Heun's method correctly?
 
Smed said:
The equation I have for both is:

u^{n+1} = u^{n} - \frac{1}{2}u^{n}dt - \frac{1}{8}u^{n}dt^{2}
If we make that a +⅛ instead, I agree that Heun's method gives that equation. But I get something different for Crank-Nicolson.

For Crank-Nicolson, ignore the x-dependence of u and we have
(un+1 - un) / Δt = ½ ( -½ un+1 - ½ un)​
Solve that for un+1 and we get something different than the Heun's method equation. (Though they do agree up to order Δt2.)
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 12 ·
Replies
12
Views
9K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 0 ·
Replies
0
Views
7K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 7 ·
Replies
7
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K