We will use the example provided in the official implementation of the KAN paper. Install the library with
pip install pykan
2D Poisson PDE
We will take Example-6 provided in the PyKAN repo.
We aim to solve a 2D poisson equation \(\nabla^2 f(x,y) = -2\pi^2{\rm sin}(\pi x){\rm sin}(\pi y)\), with boundary condition \(f(-1,y)=f(1,y)=f(x,-1)=f(x,1)=0\). The ground truth solution is \(f(x,y)={\rm sin}(\pi x){\rm sin}(\pi y)\).
fixing (0,0,0) with x, r2=0.9569580554962158, c=1
fixing (0,0,1) with sin, r2=0.9994773268699646, c=2
fixing (0,1,0) with x, r2=0.9826741814613342, c=1
fixing (0,1,1) with x, r2=0.9958211779594421, c=1
fixing (1,0,0) with x, r2=0.8470919728279114, c=1
fixing (1,0,1) with x, r2=0.9101454019546509, c=1
fixing (1,1,0) with x, r2=0.8957751989364624, c=1
fixing (1,1,1) with x, r2=0.924821674823761, c=1
fixing (2,0,0) with x, r2=0.9645843505859375, c=1
fixing (2,1,0) with x, r2=0.9815171360969543, c=1
fixing (3,0,0) with x, r2=0.06022500991821289, c=1
saving model version 0.1