Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 717 Bytes

README.md

File metadata and controls

23 lines (18 loc) · 717 Bytes

Crank-Nicolson method in 2D

This repository provides the Crank-Nicolson method to solve the heat equation in 2D. Basically, the numerical method is processed by CPUs, but it can be implemented on GPUs if the CUDA is installed.

1. Requirements

  • numpy, torch, tqdm, matplotlib

2. Default setting

  • Initial condition: a star shape

  • Boundary condition: zero Neumann

  • crank_nicolson.py: iteration

  • disc.py: discretization matrices

  • utils.py: initial condition, result plot

3. Execution

python crank_nicolson.py

4. Result

r1