Skip to content

j-gavran/2D_anharmonic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

2D anharmonic oscillator

Solvers:

  1. Euler, Crank-Nicolson - cn.py
  2. Finite difference methods - iter_diff.py & matrix_diff.py
  3. Alternating-direction implicit method - adi_sparse.py & adi_tridiag.py
  4. Split-step Fourier method - ssfm.py & torch_ssfm.py
from methods import Method # wrapper za razlicne solverje

L, T, N, Nt = 5, 10, 128, 10000 # parametri mreze
n, a_x, a_y, lam = 0, 1, 0, 0   # parametri potenciala

M = Method(N=N, Nt=Nt, method_name="tridiag_adi")
M.init_grid(L=L, T=T)
M.init_pot(n=n, a_x=a_x, a_y=a_y, lam=lam)

res = M.start_method(check_overflow=False, save_every=Nt // 100)

See animations directory for results of time propagation.