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.
- numpy, torch, tqdm, matplotlib
-
Initial condition: a star shape
-
Boundary condition: zero Neumann
-
crank_nicolson.py: iteration
-
disc.py: discretization matrices
-
utils.py: initial condition, result plot
python crank_nicolson.py