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

Discussion Overview

The discussion focuses on the differences between the Crank-Nicolson and Heun numerical methods, particularly in the context of solving ordinary differential equations (ODEs) and partial differential equations (PDEs). Participants explore the characteristics, applications, and results of both methods without reaching a consensus.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant notes that both methods yield the same solution for a specific function, f(t,u)=-.5*u, when calculated with equal timesteps.
  • Another participant suggests that Heun's method is primarily for ODEs, while Crank-Nicolson is used for PDEs.
  • A participant explains that Heun's method is an improvement over the forward Euler method, which is explicit, whereas Crank-Nicolson is an implicit method, likely an improvement of the backward Euler method.
  • It is mentioned that Crank-Nicolson is commonly used for solving PDEs, and that both methods involve averaging the current state and the next timestep, but differ in their explicit and implicit nature.
  • One participant questions the correctness of another's implementation of Heun's method based on differing results.
  • A participant provides a specific equation for both methods and notes a discrepancy in the results for Crank-Nicolson compared to Heun's method, suggesting they agree only up to a certain order.

Areas of Agreement / Disagreement

Participants express differing views on the applications and results of the two methods, with no consensus reached on their equivalence or differences in specific cases.

Contextual Notes

Participants reference specific equations and methods without resolving the mathematical steps or assumptions involved in their calculations.

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