Radial Basis Finite Difference

Hello People
I was trying to simulate heat equation using Julia by the method of finite difference.
I would like to simulate for Radial Basis Finite Difference method also.
Please help me to find the code for it
my code for finite difference is

using Plots
#gr()
L=20
N=100
k=50
x=range(0, stop=100, length=100);
dx=x[2]-x[1];
dt=0.5*dx^2/(2*k);
t=0:dt:10
# print("the vlues of t",t)
#T=zeros(length(t),length(x))
T=zeros(length(x),length(t)) # t <--> x
s=size(T)
print("size of matrix",s)
#T[1,2]=T[1,1]=100 #complete 1st row
#T[end,end]=150  #last row of a matrix
@. T[:, 1] = 100 # initial values
@.T[:,end]=150
#for i in 2:1960
for j in 1:1960 # i -> j
#    for j=1:99
    for i=2:99 # j -> i, 1:99 -> 2:99
        T[i,j+1]=T[i,j]+k*dt/(dx^2)*(T[i+1,j]-2*T[i,j] + T[i-1,j])
    end
end
#surface(x,t,T)
surface(t,x,T) # x <--> t

This might be useful:

https://ferrite-fem.github.io/Ferrite.jl/dev/examples/heat_equation/

I also found the following in the DifferentialEquations.jl ecosystem:

https://github.com/SciML/SciMLBenchmarks.jl/blob/df8170422996722331b6cc619f9687f53aa1d3c2/benchmarks/StiffSDE/StochasticHeat.jmd

1 Like

Check out this EquivariantOperators.jl diffusion FDTD tutorial and package website