Using Crank-Nicolson Method to solve Heat Equation

Click For Summary
SUMMARY

The discussion focuses on solving the heat equation using the Crank-Nicolson (C-N) method, specifically with initial conditions defined by U=[sin(pi)*x] at τ = 0 and U = 0 at x = 0, x = 1 for τ ≥ 0. The user initially implemented an explicit method derived from Taylor's theorem and later transitioned to the C-N method, expressing concerns about the complexity and accuracy of the results. After applying Gaussian elimination to the matrix form of the C-N method, the user observed redundancy in the results, prompting a consideration to skip certain rows in the matrix. Ultimately, the user clarified that the task only required the first time step, which had already been computed.

PREREQUISITES
  • Understanding of the Crank-Nicolson method for numerical solutions
  • Familiarity with the heat equation and its boundary conditions
  • Knowledge of matrix operations and Gaussian elimination
  • Basic principles of numerical analysis and stability considerations
NEXT STEPS
  • Study the derivation and application of the Crank-Nicolson method in detail
  • Explore numerical stability and convergence analysis for the heat equation
  • Learn about matrix representation of finite difference methods
  • Investigate alternative numerical methods for solving partial differential equations
USEFUL FOR

Mathematicians, physicists, and engineers involved in numerical analysis, particularly those working on heat transfer problems and finite difference methods.

robot1000
Messages
5
Reaction score
0
I'm a bit stuck with using the C-N method

The question I'm trying to solve is the standard heat equation with:

U=[sin(pi)*x] at \tau = 0

& U = 0 at x = 0

& x = 1 for \tau \geq 0

The intervals are 0.2 in x AND 0.02 in \tau up to \tau = 0.06

I've been asked to solve using an Explicit which I've done using formula derived from the taylor theorem, but the second part is asking to use the C-N Method.

I started using this formula:
5e27aff609471f9ebbbce7b7dae13ee5.png
in matrix form, where I'm letting r = 0.5 using
b9735da76916e0f2514a600f1acd3dcd.png


The only thing that's concerning me is that it seems a bit long winded and the answers for U(i,j) that have arisen don't seem at all close to the explicit method.

I put it all in matrix form and then using Gaussian elimination, is the correct method?
 
Physics news on Phys.org
Update 1

I've managed to work through the first matrix for u(n,1) and seem to have gotten a good set of results. What I've noticed is that the u(1,1) = u(4,1) & u(2,1) = u(3,1).

Is it worth just skipping out the 3rd and 4th row in the matrix as I can just input the results from u(1,n) and u(2,n) into u(3,n) and u(4,n)?

Update 2

I misread the question, which actually just asked for the first time step which I had already calculated.
 
Last edited:

Similar threads

  • · Replies 23 ·
Replies
23
Views
4K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 23 ·
Replies
23
Views
6K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
550
  • · Replies 12 ·
Replies
12
Views
9K
  • · Replies 2 ·
Replies
2
Views
3K